/* 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: 9px;
  background: transparent;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.demo-extension-button:hover,
.demo-extension-button[aria-expanded="true"] {
  border-color: #b9d4d6;
  background: #e4f1f1;
}
.demo-extension-button img { width: 24px; height: 24px; }
.demo-popup {
  position: absolute;
  top: 56px;
  right: 12px;
  z-index: 3;
  width: 340px;
  max-width: calc(100% - 24px);
  border: 1px solid #d3dfe0;
  border-radius: 14px;
  background: #f4f7f7;
  box-shadow: 0 24px 50px -16px rgb(17 45 48 / .35), 0 2px 8px rgb(17 45 48 / .08);
  max-height: calc(100% - 68px);
  overflow: auto;
  animation: demo-pop .18s ease-out;
}
@keyframes demo-pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.demo-popup-chrome {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #e0e8e8;
  background: rgb(255 255 255 / .92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #6a8184;
}
.demo-popup-chrome > span { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; }
.demo-popup-chrome button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 4px;
  border: none;
  border-radius: 6px;
  color: #526d71;
  background: transparent;
  font-size: 12px;
  line-height: 1;
}
.demo-popup-chrome button:hover { color: var(--accent); }
.demo-popup-chrome button span { font-size: 19px; }
.demo-popup-note { margin: 0; padding: 10px 12px; border-top: 1px solid #dce5e6; background: #fff; color: #4d6569; font-size: 13px; line-height: 1.6; }
.demo-browser .journal-page { min-height: 660px; }
.demo-browser .journal-article { min-height: 525px; }
.demo-browser .journal-copy h2 { min-height: 104px; }
.demo-browser .journal-photo > img { max-height: 420px; }
.demo-walkthrough {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 4px 0;
  font-size: 15px;
  font-weight: 500;
  color: #3e6467;
}
.demo-reset {
  flex-shrink: 0;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: #56696c;
  font-size: 13px;
  font-weight: 500;
  transition: color .15s, border-color .15s;
}
.demo-reset:hover { color: var(--accent); border-color: var(--border-strong); }
.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(15,123,138,.45);
  padding-left: .5em;
}
@media(max-width:760px) {
  .demo-popup { top: 46px; }
  .demo-browser .browser-bar { height: 40px; }
  .demo-browser .journal-article { min-height: 540px; }
  .demo-browser .journal-copy h2 { min-height: 100px; }
  .demo-walkthrough { font-size: 14px; 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; }
}
