/*
 * The demo shell: the stage a screen plays on, the phone frame, the bar at the foot with the honest line and the
 * guide, the date card when a chapter begins, and a short note. It uses friendly.css's tokens (each shell element
 * carries the .fr class and the current theme) and adds no colors of its own.
 */
html { background: #0a0a0a; }
html[data-theme="light"] { background: #ffffff; }
body { margin: 0; min-height: 100svh; padding-bottom: 48px; box-sizing: border-box; }

.stage.desk #screen > .fr { min-height: calc(100svh - 48px) !important; }
.stage.phone { display: flex; justify-content: center; align-items: flex-start; padding: 16px; }
.stage.phone #screen { width: 390px; height: 844px; flex: none; overflow: hidden; border-radius: 28px; outline: 1px solid #3a3a3a; }
html[data-theme="light"] .stage.phone #screen { outline-color: #d4d4d4; }
@media (max-width: 700px) {
  /* A desktop screen on a phone: its timelines keep room for their labels and slide sideways. */
  .stage.desk .fr .pic .tl { min-width: 1000px; }
  /* Its places sit in a row under the brand, as on a phone, instead of stacking. */
  .stage.desk .fr .bar .tabs { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px; }
  .stage.desk .fr .bar .brand { flex: 1; }
  .stage.phone { padding: 0; }
  .stage.phone #screen { border-radius: 0; outline: 0; }
}
.shell-error { padding: 48px 24px; text-align: center; font-family: Geist, ui-sans-serif, system-ui, sans-serif; color: #a1a1a1; }

/* The bar at the foot of every screen. */
.honest {
  position: fixed; left: 0; bottom: 0; z-index: 40; margin: 0; display: flex; align-items: center;
  width: 100%; min-height: 48px; padding: 6px 220px 6px 16px; box-sizing: border-box;
  border-top: 1px solid var(--line); background: var(--bg); color: var(--soft); font-size: 12px; line-height: 16px;
}
.guide { position: fixed; right: 12px; bottom: 6px; z-index: 41; background: transparent; }
.g-bar { display: flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); }
.g-bar button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 32px; height: 30px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; font-size: 13px; line-height: 18px; cursor: pointer; }
.g-bar button:hover:not(:disabled) { background: var(--tint); }
.g-bar button:disabled { color: var(--soft); opacity: 0.5; cursor: default; }
.g-bar svg, .g-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.g-name { font-weight: 500; }
.g-where { color: var(--soft); font-variant-numeric: tabular-nums; }

.g-panel {
  position: absolute; right: 0; bottom: 44px; width: min(360px, calc(100vw - 24px)); max-height: min(70svh, 640px);
  display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: var(--card); box-shadow: var(--lift-menu);
}
.g-panel[hidden] { display: none; }
.g-panel:focus { outline: none; }
.g-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 8px 10px 16px; border-bottom: 1px solid var(--line); }
.g-heading { font-weight: 600; }
.g-close { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--soft); cursor: pointer; }
.g-close:hover { background: var(--tint); color: var(--ink); }
.guide .g-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; }
.guide .g-chapter { padding: 8px 0 4px; }
.g-chapter + .g-chapter { border-top: 1px solid var(--line); margin-top: 4px; }
.guide .g-title { padding: 0 8px; font-weight: 600; }
.guide .g-date { padding: 0 8px; color: var(--soft); font-size: 12px; line-height: 16px; }
.guide .g-chapter ol { margin-top: 4px; }
.g-chapter li a { display: flex; align-items: center; min-height: 30px; padding: 4px 8px; border-radius: 6px; color: var(--soft); }
.g-chapter li a:hover { background: var(--tint); color: var(--ink); }
.g-chapter li a[aria-current] { background: var(--sel); color: var(--ink); font-weight: 500; }
.g-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 16px; border-top: 1px solid var(--line); }
.g-link { color: var(--soft) !important; font-size: 13px; text-decoration: underline !important; text-underline-offset: 4px; }
.g-link:hover { color: var(--ink) !important; }

@media (max-width: 520px) {
  .honest { padding-right: 176px; }
  .g-name { display: none; }
}

/* The date when a chapter begins. */
.chapter { position: fixed; inset: 0 0 48px 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); cursor: pointer; }
.chapter[hidden] { display: none; }
.c-card { display: flex; flex-direction: column; gap: 8px; max-width: 440px; padding: 32px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-align: left; }
.c-date { font-size: 32px; line-height: 36px; letter-spacing: -0.045em; }
.c-title { font-weight: 500; }
.c-title:empty { display: none; }
.c-line { color: var(--soft); }
@media (prefers-reduced-motion: no-preference) {
  .chapter:not([hidden]) { animation: chapter-in 160ms ease-out; }
  @keyframes chapter-in { from { opacity: 0; } to { opacity: 1; } }
}

/* A short note, such as for a button the prototype only draws. */
.toast { position: fixed; left: 50%; bottom: 60px; z-index: 42; transform: translateX(-50%); max-width: calc(100vw - 32px); margin: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); box-shadow: var(--lift-menu); font-size: 13px; line-height: 18px; }
.toast[hidden] { display: none; }

/* The start page and the list of every screen. */
.intro-page { min-height: calc(100svh - 48px); display: flex; flex-direction: column; }
.intro-page main { display: flex; flex-direction: column; gap: 24px; width: 100%; max-width: 640px; margin: 0 auto; padding: 96px 24px 64px; }
.intro-page .acts { display: flex; flex-wrap: wrap; gap: 12px; }
.intro-page .all { display: flex; flex-direction: column; gap: 32px; }
.intro-page .all section { display: flex; flex-direction: column; gap: 8px; }
.intro-page .all ol { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.intro-page .all li { border-bottom: 1px solid var(--line); }
.intro-page .all li a { display: flex; justify-content: space-between; gap: 16px; min-height: 40px; align-items: center; padding: 6px 0; }
.intro-page .all li a:hover { color: var(--soft); }
.intro-page .all .file { color: var(--soft); font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
