/* The browser frame belongs to the page; the popup itself uses the extension's CSS. */
.demo-browser { position: relative; }
.demo-browser [hidden], .demo-walkthrough [hidden] { display: none !important; }
.demo-extension-button {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 5px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}
.demo-extension-button:hover,
.demo-extension-button[aria-expanded="true"] {
  border-color: #9dbec2;
  background: #e2eff0;
}
.demo-extension-button img { width: 24px; height: 24px; }
.demo-popup {
  position: absolute;
  top: 53px;
  right: 12px;
  z-index: 3;
  width: 340px;
  max-width: calc(100% - 24px);
  border: 1px solid #d2dbde;
  border-radius: 10px;
  background: #f6f7f9;
  box-shadow: 0 12px 35px #112d3030, 0 2px 8px #112d3014;
  max-height: calc(100% - 66px);
  overflow: auto;
}
.demo-popup-chrome {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 11px;
  border-bottom: 1px solid #e0e7e9;
  background: #fff;
  color: #70868a;
}
.demo-popup-chrome > span { font-size: 9px; letter-spacing: 1.1px; }
.demo-popup-chrome button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 3px;
  border: none;
  color: #526d71;
  background: transparent;
  font-size: 11px;
  line-height: 1;
}
.demo-popup-chrome button span { font-size: 21px; }
.demo-popup-note { margin: 0; padding: 10px 12px; border-top: 1px solid #dce5e6; background: #fff; color: #4d6569; font-size: 12px; line-height: 1.6; }
.demo-browser .journal-page { min-height: 570px; }
.demo-browser .journal-article { min-height: 435px; }
.demo-browser .journal-copy h2 { min-height: 104px; }
.demo-browser .journal-photo > img { max-height: 350px; }
.demo-walkthrough {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 2px 0;
  font-size: 14px;
  color: #44696c;
}
.demo-reset {
  flex-shrink: 0;
  padding: 5px 0;
  border: none;
  background: transparent;
  color: #657e81;
  font-size: 12px;
}
.demo-reset:hover { color: var(--accent); }
.demo-caption { margin-top: 10px; }
/* Mirrors the real extension's bilingual sibling treatment. */
.demo-browser .nt-sibling.nt-bilingual {
  display: block;
  margin-top: .25em;
  opacity: .92;
  border-left: 2px solid rgba(20,120,200,.45);
  padding-left: .5em;
}
@media(max-width:760px) {
  .demo-popup { top: 41px; }
  .demo-browser .browser-bar { height: 40px; }
  .demo-browser .journal-article { min-height: 455px; }
  .demo-browser .journal-copy h2 { min-height: 100px; }
  .demo-walkthrough { font-size: 12px; padding-top: 14px; }
}
@media(max-width:600px) {
  /* Reflow the preview, preserving the popup's actual text size on a small screen. */
  .demo-popup { max-height: none; position: relative; top: auto; right: auto; max-width: 100%; width: 100%; margin: 0; border: none; border-bottom: 1px solid #d2dbde; border-radius: 0; box-shadow: none; }
  #demo-popup-view { display: block; width: 100%; max-width: 340px; margin-inline: auto; }
  .demo-browser .journal-page { min-height: 0; }
  .demo-browser .journal-article { min-height: 0; }
  .demo-browser .journal-copy h2 { min-height: 0; }
  .demo-heading { align-items: start; gap: 15px; }
  .demo-hint { text-align: right; max-width: 150px; line-height: 1.5; }
  .demo-hint span { display: none; }
  .demo-walkthrough { align-items: start; }
  .demo-caption { max-width: 400px; line-height: 1.7; }
}
