/* The play page's own styles (app/static/index.html), beside app.css and ui.css. */
  .turn { display: flex; flex-direction: column; gap: 10px; }
  .no-times .t-time { display: none; }
  .no-changes .chip:not(.party-chip) { display: none; }
  .chip.party-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .chip.party-chip svg { width: 13px; height: 13px; }
  .sans-story .narration { font-family: var(--ui-font); }
  .role { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .role:last-child { border-bottom: 0; }
  .role-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
  .role-head b { font-weight: 500; } .role-head small { color: var(--subtle); font-size: 12px; text-align: right; }
  .role-row { display: grid; grid-template-columns: 1fr 104px; gap: 8px; margin-top: 6px; }
  .choice-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
  .choice-opt:last-child { border-bottom: 0; }
  .choice-opt input { margin-top: 3px; accent-color: var(--accent); width: 18px; height: 18px; flex: 0 0 auto; }
  .choice-opt b { font-weight: 500; display: block; } .choice-opt small { color: var(--subtle); font-size: 12px; }
  .range-row { display: flex; align-items: center; gap: 10px; } .range-row input { flex: 1; accent-color: var(--accent); }
  .new-story { margin: 8px 0 16px; }
  .login-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--chip); padding: 4px; border-radius: 10px; margin: 14px 0 4px; }
  .login-tabs button { border: 0; background: none; border-radius: 8px; padding: 8px; cursor: pointer; color: var(--muted); font-weight: 500; }
  .login-tabs button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
  .login .ok { color: var(--ok); font-size: 13px; min-height: 18px; margin-top: 10px; }
  .credits { border: 1px solid var(--line); background: var(--raised); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 600;
             cursor: pointer; white-space: nowrap; color: var(--ink); font-variant-numeric: tabular-nums; }
  .credits.low { color: var(--bad); border-color: var(--bad); }
  .cost { color: var(--subtle); font-weight: 400; font-size: 12px; margin-left: 6px; }
  /* ---- accessibility (Settings) ---- */
  body.a11y-font { --story-font: "Atkinson Hyperlegible", var(--ui-font); --ui-font: "Atkinson Hyperlegible", system-ui, sans-serif;
                   --display-font: "Atkinson Hyperlegible", system-ui, sans-serif; }
  body.a11y-spacing .narration, body.a11y-spacing .you, body.a11y-spacing .help-page p { line-height: 1.95; letter-spacing: .02em; word-spacing: .08em; }
  body.a11y-spacing .narration p { margin-bottom: 1.3em; }
  body.a11y-motion *, body.a11y-motion *::before, body.a11y-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
                                                                             transition-duration: .001ms !important; scroll-behavior: auto !important; }
  body.a11y-contrast { --muted: color-mix(in srgb, var(--ink) 86%, var(--bg)); --subtle: color-mix(in srgb, var(--ink) 80%, var(--bg)); --faint: color-mix(in srgb, var(--ink) 72%, var(--bg));
                       --line: color-mix(in srgb, var(--ink) 38%, var(--bg)); }
  body.a11y-links a { text-decoration: underline; text-underline-offset: 2px; }
  .invite-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; }
  .version-history { margin-top: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--raised); padding: 0 16px; }
  .version-history > summary { cursor: pointer; padding: 14px 0; font-weight: 600; }
  .version-list { display: flex; flex-direction: column; gap: 8px; padding-bottom: 14px; }
  .version-row { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
  .version-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; } .version-head b { font: 650 15px/1.2 var(--display-font); }
  .version-tags { display: flex; gap: 6px; flex-wrap: wrap; } .version-changes { margin: 0; }
  .version-tags .pill-tag { padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; }
  .pill-tag.ok-tag { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
  /* ---- players' pages ---- */
  html.visiting body, html.visiting .home-main { background: color-mix(in srgb, var(--visit-tint) 7%, var(--bg)); }
  /* a visited profile's theme (visitTheme): fills take its exact accent; text, links and icons a tone that reads on this page */
  :root { --accent-fill: var(--accent); }
  .ui-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); min-height: 100vh; font-family: var(--ui-font); }
  .ui-board-panel { background: var(--bg); color: var(--ink); padding: 28px clamp(16px, 3vw, 36px); display: grid; gap: 14px; align-content: start; }
  .ui-board-title { margin: 0 0 4px; font: 700 20px/1.2 var(--display-font); }
  .ui-board-row { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; }
  .ui-board-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
  .ui-board-items { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .ui-board-text { margin: 0; color: var(--ink); }
  .ui-board-field { min-height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--field-line); background: var(--surface); color: var(--ink);
                    outline: 2px solid var(--focus); outline-offset: 1px; width: min(100%, 260px); }
  .ui-board-card { display: flex; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
  .ui-board-face { width: 52px; height: 52px; font-size: 22px; }
  .ui-board .side-link { width: auto; } .ui-board .meter { width: min(100%, 260px); }
  :root.visiting { --accent: var(--visit-on-light); --accent-fill: var(--visit-fill); --accent-ink: var(--visit-ink);
                   --accent-soft: color-mix(in srgb, var(--visit-fill) 24%, var(--bg)); }
  @media (prefers-color-scheme: dark) { :root.visiting:not([data-theme="light"]) { --accent: var(--visit-on-dark); } }
  :root.visiting[data-theme="dark"] { --accent: var(--visit-on-dark); }
  .author-page { max-width: 1100px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 36px) 60px; --author-tint: var(--accent-fill); }
  .author-banner { height: clamp(140px, 22vw, 240px); margin: 0 calc(-1 * clamp(16px, 3vw, 36px)); overflow: hidden;
                   background: linear-gradient(135deg, color-mix(in srgb, var(--author-tint) 55%, var(--bg)), color-mix(in srgb, var(--accent) 35%, var(--bg))); }
  .author-banner img { width: 100%; height: 100%; object-fit: cover; display: block; transform-origin: 50% 50%; }
  .author-banner { position: relative; }
  .banner-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
  .page-fx { position: fixed; pointer-events: none; z-index: 6; }  /* (over the profile column, under trays and dialogs) */
  .effect-mark svg { width: 26px; height: 26px; color: var(--subtle); }
  .banner-sweep { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; background-size: 250% 100%; background-position: 120% 0; opacity: 0; }
  .author-head { display: flex; align-items: flex-end; gap: 16px; position: relative; flex-wrap: wrap; margin-top: 12px; }
  .author-head .face.author-face { width: 112px; height: 112px; font-size: 44px; margin-top: -68px; border: 4px solid var(--bg);
                                   box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .5); background: var(--accent-fill); color: var(--accent-ink); }
  .face { display: inline-grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--accent-fill); color: var(--accent-ink); font-weight: 700; flex: none; }
  .face img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .author-who { flex: 1 1 160px; min-width: 0; padding-bottom: 6px; } .author-who h1 { margin: 0; font: 700 clamp(26px, 4vw, 38px)/1.1 var(--display-font); }
  .author-who p { margin: 4px 0 0; }
  .author-bio { max-width: 70ch; font-size: 16px; line-height: 1.6; margin: 16px 0 0; white-space: pre-line; }
  .author-stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 8px; }
  .author-stats > div { padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--raised); min-width: 110px; }
  .author-stats b { display: block; font: 700 22px/1.1 var(--display-font); color: var(--accent); } .author-stats span { font-size: 13px; color: var(--muted); }
  .byline { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 2px 0; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; margin: 2px 0 6px; }
  .byline .face { width: 26px; height: 26px; font-size: 12px; } .byline:hover span { text-decoration: underline; }
  .profile-pic { display: flex; align-items: center; gap: 14px; margin: 6px 0 4px; } .profile-pic .face.big { width: 64px; height: 64px; font-size: 26px; }
  .profile-pic-actions { display: flex; gap: 6px; flex-wrap: wrap; }
  .set-sub { margin: 14px 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
  .cosmetic-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .cosmetic { border: 1px solid var(--line); background: var(--raised); color: var(--ink); border-radius: 12px; padding: 6px; cursor: pointer; font: inherit; font-size: 12px;
              display: flex; flex-direction: column; gap: 4px; align-items: stretch; text-align: left; }
  .cosmetic img { width: 100%; aspect-ratio: 3 / 1; object-fit: cover; border-radius: 8px; display: block; }
  .cosmetic.theme i { display: block; height: 22px; border-radius: 8px; background: linear-gradient(90deg, var(--swatch-tint, var(--chip)), var(--swatch, var(--chip))); }
  .cosmetic[aria-checked="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
  .cosmetic:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .profile-edit .btn { margin-top: 8px; }
  /* ---- the store ---- */
  .store-page { max-width: 1100px; margin: 0 auto; padding: clamp(18px, 3vw, 32px) clamp(16px, 3vw, 36px) 60px; }
  .store-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  .store-head h1 { margin: 0; font: 700 clamp(28px, 4vw, 40px)/1.1 var(--display-font); }
  .store-purse { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); }
  .store-purse b { font: 700 18px/1 var(--display-font); } .pip-mark { color: var(--gold, #dea44e); display: inline-flex; } .pip-mark svg { width: 18px; height: 18px; }
  .store-how { max-width: 70ch; margin: 10px 0 12px; line-height: 1.5; }
  .store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 12px; }
  .store-item { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--raised); display: flex; flex-direction: column; }
  .store-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; }
  /* the store's cards (showStore): a small page wearing the look, what it is, and what you can do with it */
  .store-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 6px; }
  .store-tools .fbar-search { flex: 1 1 200px; max-width: 320px; } .store-tools .fbar-pick { width: auto; max-width: 220px; }
  .store-tools .fbar-count { margin-left: auto; font-size: 13px; color: var(--subtle); }
  .store-grid { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px; }
  .store-item { border: 0; box-shadow: var(--e1); background: var(--surface); }
  .store-item:hover { box-shadow: var(--e2); }
  .store-item.wearing { box-shadow: 0 0 0 2px var(--accent), var(--e1); }
  .store-look-wrap { position: relative; padding: 10px 10px 0; }
  .store-look-wrap .cthumb { border-radius: 12px; }
  .store-flags { position: absolute; top: 18px; left: 18px; display: flex; gap: 6px; z-index: 3; }
  .store-flag { font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 88%, transparent);
                backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: var(--e1); }
  .store-flag.on { background: var(--accent-fill); color: var(--accent-ink); }
  .store-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
  .store-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .store-short { font-size: 12px; color: var(--subtle); }
  .store-actions { display: flex; gap: 6px; flex: none; }
  .store-buy svg { width: 15px; height: 15px; } .store-buy { font-variant-numeric: tabular-nums; }
  .store-none { padding: 40px 0; text-align: center; }
  .try-on { width: min(1040px, calc(100vw - 32px)); }
  .try-on-stage { position: relative; overflow: hidden; height: min(68vh, 680px); background: var(--bg); }
  .try-on-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--bg); transform-origin: 0 0; }
  .try-on .module-dialog-foot { gap: 8px; }
  .shelf-head .muted.small { margin-left: 10px; }
  .keep-character { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); margin: 10px 0 0; cursor: pointer; }
  .keep-character input { accent-color: var(--accent); width: 16px; height: 16px; }
  .char-list .set-row { padding: 9px 0; } .char-actions { display: flex; gap: 4px; flex: none; }
  .char-list .btn { margin-top: 10px; }
  .character-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .ideas-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 4px; font-family: var(--ui-font); }
  .ideas-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-right: 2px; }
  .idea { border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--raised));
          color: var(--ink); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
  .idea:hover { border-color: var(--accent); } .idea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .branch-btn { opacity: .55; margin-left: auto; } .branch-btn:hover, .branch-btn:focus-visible { opacity: 1; }
  .tips-card { background: var(--raised); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 16px; padding: 14px 16px; margin: 6px 0 18px; font-family: var(--ui-font); }
  .tips-head b { font: 650 15px/1.3 var(--display-font); }
  .tips-list { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; }
  .tip { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 14px; line-height: 1.45; }
  .tip b { display: block; font-weight: 600; } .tip span:not(.tip-icon) { color: var(--muted); }
  .tip-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
  .tip-icon svg { width: 17px; height: 17px; }
  .tips-actions { display: flex; justify-content: flex-end; gap: 8px; }
  .help-page { max-width: 720px; margin: 0 auto; padding: 20px 16px 60px; }
  .help-title { font: 700 clamp(28px, 5vw, 40px)/1.1 var(--display-font); margin: 18px 0 8px; }
  .help-lede { font-size: 17px; color: var(--muted); margin: 0 0 18px; line-height: 1.5; }
  .help-sec { margin-top: 26px; } .help-sec h2 { font: 650 19px/1.3 var(--display-font); margin: 0 0 8px; }
  .help-sec p { margin: 0 0 10px; line-height: 1.55; }
  .feedback-card { background: var(--raised); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-family: var(--ui-font); }
  .feedback-card b { display: block; margin-bottom: 2px; }
  .stars { display: flex; gap: 4px; margin: 8px 0; }
  .stars button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 18px; cursor: pointer; color: var(--faint); }
  .stars button.on { color: var(--warn); border-color: var(--warn); }
  .feedback-card textarea { min-height: 70px; resize: vertical; }
  /* ---- the Studio's story list (2026-10-17) ---- */
  .studio-home { max-width: 1200px; padding: clamp(24px, 4vw, 44px) clamp(16px, 4vw, 48px) 0; }
  .studio-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
  .studio-head h1 { margin: 0 0 6px; font: 700 clamp(30px, 4vw, 44px)/1.05 var(--display-font); letter-spacing: -.025em; }
  .studio-head p { margin: 0; color: var(--muted); max-width: 60ch; }
  .studio-head .btn { min-height: 44px; padding: 0 18px; font-size: 15px; } .studio-head .btn svg { width: 18px; height: 18px; }
  .studio-allowance { display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 0; padding: 7px 14px; border-radius: 999px; font-size: 13px;
                      border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
  .studio-allowance svg { width: 16px; height: 16px; color: var(--gold); }
  .studio-allowance.used svg { color: var(--faint); }
  .studio-grid { display: grid; gap: 22px 18px; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); margin-top: 28px; }
  .studio-new { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; min-height: 240px; padding: 22px;
                border-radius: 16px; border: 1px dashed var(--faint); background: transparent; color: var(--ink); cursor: pointer; text-align: left; }
  .studio-new svg { width: 26px; height: 26px; color: var(--accent); margin-bottom: 6px; }
  .studio-new b { font: 650 18px/1.2 var(--display-font); } .studio-new span { color: var(--muted); font-size: 13px; line-height: 1.45; }
  .studio-new:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
  .studio-card { cursor: pointer; min-width: 0; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; display: flex; flex-direction: column; }
  .studio-card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
  .studio-card:focus-visible, .studio-new:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
  .studio-card-art { position: relative; aspect-ratio: 16 / 9; background: var(--chip); }
  .studio-card-art img, .studio-card-art .ph { width: 100%; height: 100%; object-fit: cover; display: block; }
  .studio-card-blank { width: 100%; height: 100%; display: grid; place-items: center;
                       background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 60%), linear-gradient(135deg, var(--accent-soft), var(--chip)); }
  .studio-card-blank span { font: 700 54px/1 var(--display-font); color: color-mix(in srgb, var(--accent) 70%, var(--ink)); opacity: .55; text-transform: uppercase; }
  .studio-state { position: absolute; top: 10px; left: 10px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
                  background: rgba(24, 21, 15, .74); color: #fdfcfb; }
  .studio-state.brief { background: var(--accent-fill); color: var(--accent-ink); }
  .studio-state.review { background: var(--gold); color: #18150f; }
  .studio-state.live { background: var(--ok); color: #fdfcfb; }
  .studio-state.removed { background: var(--bad); color: #fdfcfb; }
  .studio-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
  .studio-card-body h3 { margin: 0; font: 650 17px/1.25 var(--display-font); color: var(--ink); text-transform: none; letter-spacing: 0; overflow-wrap: anywhere; }
  .studio-pitch { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .studio-pitch.no-hook { color: var(--subtle); font-style: italic; }
  .studio-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: auto; padding-top: 6px; font-size: 12px; color: var(--subtle); }
  .studio-facts span { display: inline-flex; align-items: center; gap: 5px; } .studio-facts svg { width: 13px; height: 13px; }

  /* ---- the chat header, the story tray and settings (2026-10-17) ---- */
  .title-art { width: 36px; height: 36px; border-radius: 10px; overflow: hidden; flex: none; background: var(--chip); margin: 0 4px 0 2px; }
  .title-art img, .title-art .ph { width: 100%; height: 100%; object-fit: cover; display: block; }
  .at-home .title-art, .at-home .hud { display: none; }
  .hud { display: flex; align-items: center; gap: 14px; margin-right: 8px; }
  .hud-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
  .hud-chip svg { width: 16px; height: 16px; color: var(--gold); }
  .hud .meter { width: 116px; }
  @media (max-width: 900px) { .hud .meter { display: none; } }
  @media (max-width: 600px) { .hud { display: none; } }
  .meter-top { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
  .meter-top svg { width: 14px; height: 14px; } .meter-top b { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }
  .meter.hp .meter-top svg { color: var(--bad); } .meter.mp .meter-top svg { color: var(--accent); }
  .meter-track { height: 6px; border-radius: 999px; background: var(--chip); overflow: hidden; }
  .meter-track i { display: block; height: 100%; border-radius: inherit; background: var(--ok); transition: width .4s ease; }
  .meter.mp .meter-track i { background: var(--accent-fill); } .meter-track.xp i { background: var(--gold); }
  .pill-btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px 0 11px; border-radius: 999px; border: 1px solid var(--line);
              background: var(--surface); color: var(--ink); cursor: pointer; font-size: 14px; flex: none; }
  .pill-btn svg { width: 17px; height: 17px; } .pill-btn:hover { background: var(--chip); }
  .at-home .pill-btn { display: none; }
  @media (max-width: 480px) { .pill-btn span { display: none; } .pill-btn { padding: 0 10px; } }

  .sheet-head h2 { font-family: var(--display-font); font-weight: 650; letter-spacing: -.01em; }
  .tray-hero { margin: 12px 0 14px; padding: 16px; border-radius: 18px; background: linear-gradient(160deg, var(--accent-soft), var(--raised) 70%); border: 1px solid var(--line); }
  .tray-place { display: flex; align-items: center; gap: 8px; } .tray-place svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
  .tray-place b { font: 650 20px/1.2 var(--display-font); letter-spacing: -.01em; }
  .tray-time { display: flex; align-items: center; gap: 6px; margin: 6px 0 0 26px; font-size: 13px; color: var(--muted); }
  .tray-time svg { width: 15px; height: 15px; color: var(--gold); }
  .tray-meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 14px; }
  .rank-chip { display: inline-block; margin-top: 12px; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
  .gift-head .rank-chip { margin: 0; }
  .tray-tabs { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; padding: 4px; margin-bottom: 14px;
               background: var(--chip); border-radius: 14px; }
  .tray-tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 6px; border: 0; border-radius: 10px; background: none;
                      color: var(--muted); cursor: pointer; font-size: 12px; }
  .tray-tabs button svg { width: 17px; height: 17px; }
  .tray-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
  .tray-card { margin-bottom: 18px; }
  .tray-h { display: flex; align-items: center; gap: 7px; font: 600 14px/1.3 var(--display-font); margin: 0 0 8px; color: var(--ink); text-transform: none; letter-spacing: 0; }
  .tray-h svg { width: 15px; height: 15px; color: var(--muted); }
  .tray-count { margin-left: auto; font: 500 12px var(--ui-font); color: var(--subtle); }
  .tray-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--raised); overflow: hidden; }
  .tray-list li { padding: 10px 12px; font-size: 14px; line-height: 1.45; } .tray-list li + li { border-top: 1px solid var(--line); }
  .tray-empty { color: var(--subtle); }
  .person { display: flex; align-items: center; gap: 10px; }
  .face { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; }
  .face.big { width: 44px; height: 44px; font-size: 18px; }
  .person-text { min-width: 0; flex: 1; } .person-text b { display: flex; align-items: center; gap: 4px; font-weight: 600; }
  .person-text small { display: block; color: var(--muted); font-size: 12px; }
  .person-card > summary { list-style: none; cursor: pointer; } .person-card > summary::-webkit-details-marker { display: none; }
  .person-card[open] > summary .person-text b { color: var(--accent); }
  .person-more { padding: 8px 0 2px 42px; font-size: 13px; line-height: 1.5; } .person-more p { margin: 0 0 6px; }
  .person-more .seen { color: var(--muted); font-style: italic; }
  .person-more h4 { margin: 8px 0 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .known { margin: 0; padding-left: 16px; } .known li { margin: 0 0 3px; }
  .gift h4 { margin: 10px 0 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .place-card .face svg { width: 16px; height: 16px; }
  .star svg { width: 13px; height: 13px; color: var(--gold); fill: var(--gold); }
  .party-member { display: grid; gap: 6px; } .party-member + .party-member { margin-top: 12px; }
  .party-member .meter-track { margin-left: 46px; }
  .party-ride { margin-top: 12px; font-size: 13px; color: var(--muted); }
  .mood { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--chip); color: var(--muted); flex: none; }
  .mood.good { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
  .mood.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
  .cost-chip.good { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
  .cost-chip.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
  .tray-chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .tray-chip { font-size: 13px; padding: 5px 11px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); }
  .tray-exits { display: flex; flex-direction: column; gap: 6px; }
  .exit { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
          background: var(--raised); color: var(--ink); cursor: pointer; font-size: 14px; text-align: left; }
  .exit svg { width: 16px; height: 16px; color: var(--muted); flex: none; } .exit:hover { border-color: var(--accent); } .exit:hover svg { color: var(--accent); }
  .gift { border: 1px solid var(--line); border-radius: 14px; background: var(--raised); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
  .gift-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; } .gift-head b { font-family: var(--display-font); font-size: 16px; }
  .ability { padding-top: 8px; border-top: 1px solid var(--line); font-size: 14px; }
  .ability b { display: inline; text-transform: capitalize; margin-right: 6px; } .ability .cost-chip { vertical-align: 1px; } .ability p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
  .ability.locked { color: var(--subtle); font-size: 13px; }
  .cost-chip { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
  .skills { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--raised); }
  .skill-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; } .skill-top span { text-transform: capitalize; }
  .kv-row, .clock-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .status-chip { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--chip); color: var(--muted); flex: none; }
  .segs { display: flex; gap: 3px; flex: none; } .segs i { width: 14px; height: 8px; border-radius: 3px; background: var(--chip); } .segs i.on { background: var(--gold); }
  .event { display: flex; gap: 10px; } .turn-no { flex: none; font-size: 12px; color: var(--subtle); min-width: 52px; padding-top: 1px; }
  .tray-spoil { border: 1px dashed var(--line); border-radius: 14px; padding: 10px 12px; } .tray-spoil summary { cursor: pointer; color: var(--muted); font-size: 13px; }
  .tray-spoil .tray-list { margin-top: 10px; }

  .set-profile { display: flex; align-items: center; gap: 12px; margin: 14px 0 10px; }
  .set-profile .set-text { flex: 1; }
  .set-text { min-width: 0; } .set-text b { display: block; font-weight: 600; font-size: 14px; } .set-text small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
  .set-icon { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--raised); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
  .set-icon svg { width: 18px; height: 18px; } .set-icon:hover { color: var(--ink); }
  .set-credits { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; width: 100%; text-align: left; cursor: pointer;
                 padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 18%, var(--raised)), var(--raised)); color: var(--ink); }
  .set-credits svg { grid-row: span 2; width: 22px; height: 22px; color: var(--gold); }
  .set-credits span { font-weight: 650; font-size: 15px; } .set-credits small { color: var(--muted); font-size: 12px; }
  .set-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 10px; }
  .set-link { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--raised);
              color: var(--ink); text-decoration: none; font-size: 13px; }
  .set-link svg { width: 16px; height: 16px; color: var(--accent); flex: none; } .set-link:hover { border-color: var(--accent); }
  .set-group { margin-top: 24px; }
  .set-h { font: 650 15px/1.3 var(--display-font); margin: 0 0 4px; color: var(--ink); text-transform: none; letter-spacing: 0; }
  .set-note { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
  .set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); cursor: default; }
  .set-row:last-child { border-bottom: 0; } label.set-row { cursor: pointer; }
  .style-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 8px; margin-top: 8px; }
  .style-card { text-align: left; padding: 11px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); cursor: pointer; }
  .style-card small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; margin-top: 3px; }
  .style-card[aria-checked="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--raised)); box-shadow: inset 0 0 0 1px var(--accent); }
  .style-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; } .style-top b { font-weight: 600; font-size: 14px; }
  .seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--chip); flex: none; }
  .seg button { border: 0; background: none; color: var(--muted); padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; }
  .seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
  .set-size { display: flex; align-items: center; gap: 10px; flex: none; }
  .set-size input { width: 120px; accent-color: var(--accent); }
  .builder-cheating { margin: 4px 0 18px; padding: 14px 16px 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--raised); }
  .builder-cheating .hint { margin: 4px 0 0; } .builder-cheating input[type=range] { width: 100%; margin: 12px 0 2px; accent-color: var(--accent); }
  .builder-cheating .set-row { border-bottom: 0; margin-top: 4px; }
  .set-stops { padding: 12px 0 10px; border-bottom: 1px solid var(--line); }
  .set-stops-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
  .set-stops-head b { font-weight: 600; font-size: 14px; } .set-stops-now { font-size: 13px; color: var(--accent); font-weight: 600; }
  .set-stops input { width: 100%; margin: 10px 0 2px; accent-color: var(--accent); }
  .set-stops input:disabled { opacity: .5; cursor: not-allowed; }
  .set-stops-marks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
  .set-stops-marks span.on { color: var(--ink); font-weight: 600; }
  .set-stops-note { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.4; min-height: 2.8em; }
  .size-sample { width: 30px; text-align: center; font-family: var(--story-font); color: var(--ink); }
  .tog { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; flex: none;
         transition: background .2s; margin: 0; }
  .tog::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fdfcfb; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
  .tog:checked { background: var(--accent); } .tog:checked::after { transform: translateX(18px); }
  .tog:focus-visible, .seg button:focus-visible, .style-card:focus-visible, .tray-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  @media (prefers-reduced-motion: reduce) { .tog, .tog::after, .meter-track i { transition: none; } }
  .set-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; } .set-actions svg { width: 15px; height: 15px; }
  .set-advanced { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 14px; }
  .set-fold { border-top: 1px solid var(--line); margin-top: 6px; } .set-fold > summary { cursor: pointer; padding: 13px 0; font-weight: 600; }
  .set-advanced > summary { cursor: pointer; font: 650 15px var(--display-font); color: var(--muted); }
  .set-advanced .set-group { margin-top: 16px; }
  .set-about { margin: 6px 0 12px; }
  .set-about > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
  .set-about p { margin: 6px 0; line-height: 1.5; }

  /* ---- in-world windows: status, skills, system notices (2026-10-18) ---- */
  :is(.narration, .command-card) .window { margin: 0 0 .9em; max-width: 420px; border-radius: 14px; overflow: hidden; font-family: var(--ui-font); font-size: .9em;
                       border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
                       background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface));
                       box-shadow: 0 8px 24px -14px color-mix(in srgb, var(--accent) 60%, transparent); }
  :is(.narration, .command-card) .window-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 9px 14px;
                             border-bottom: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); }
  :is(.narration, .command-card) .window-title b { font: 650 1em/1.3 var(--display-font); letter-spacing: .01em; }
  :is(.narration, .command-card) .window-title span { font-size: .88em; color: var(--accent); font-weight: 600; white-space: nowrap; }
  :is(.narration, .command-card) .window-body { padding: 8px 14px 10px; display: flex; flex-direction: column; gap: 5px; line-height: 1.45; }
  :is(.narration, .command-card) .window-body p { margin: 0; }
  :is(.narration, .command-card) .window-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline; }
  :is(.narration, .command-card) .window-row span { color: var(--muted); } :is(.narration, .command-card) .window-row b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
  :is(.narration, .command-card) .window-bar { grid-column: 1 / -1; height: 4px; border-radius: 999px; background: var(--chip); overflow: hidden; display: block; }
  :is(.narration, .command-card) .window-bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
  :is(.narration, .command-card) .window-list { margin: 0; padding-left: 1.1em; } :is(.narration, .command-card) .window-list li { margin: 1px 0; }
  .narration blockquote { font-style: italic; }

  /* ---- the chat (2026-10-17) ---- */
  .topbar { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(1.2) blur(14px); }
  .topbar .title b { font-family: var(--display-font); font-weight: 650; font-size: 16px; letter-spacing: -.01em; }
  .story-inner { max-width: 740px; gap: 26px; padding-top: 22px; padding-bottom: 36px; }
  .story-head { position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 16 / 6; background: var(--chip); margin-bottom: 4px; }
  .story-head-art img, .story-head-art .ph { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0; }
  .story-head::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(24, 21, 15, .82)); }
  .story-head-text { position: absolute; left: 20px; right: 20px; bottom: 16px; z-index: 1; color: #faf7f2; }
  .story-head h1 { margin: 0; font: 700 clamp(24px, 4vw, 34px)/1.05 var(--display-font); letter-spacing: -.02em; text-wrap: balance; }
  .story-head p { margin: 4px 0 0; font-size: 13px; opacity: .8; }
  @media (max-width: 560px) { .story-head { aspect-ratio: 16 / 8; } }
  .turn { gap: 12px; }
  .you { border-radius: 18px 18px 6px 18px; padding: 10px 15px; font-size: 15px; line-height: 1.45; color: var(--ink); }
  .you.continued { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; font-size: 13px; color: var(--muted);
                   background: transparent; border: 1px dashed var(--line); border-radius: 999px; }
  .you.continued svg { width: 13px; height: 13px; }
  .narration { line-height: 1.72; }
  .narration.error { background: color-mix(in srgb, var(--bad) 9%, transparent); border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent);
                     border-radius: 14px; padding: 10px 14px; }
  .meta { margin-top: -2px; gap: 8px; }
  .turn-actions { display: flex; gap: 2px; margin: 0 6px 0 -8px; }
  .turn-actions .icon-btn { width: 32px; height: 32px; border-radius: 9px; color: var(--muted); }
  @media (max-width: 899px) { .turn-actions .icon-btn { width: 44px; height: 44px; border-radius: 12px; } }  /* (44 px: Apple's touch size) */
  .turn-actions .icon-btn svg { width: 17px; height: 17px; }
  .turn-actions .icon-btn:hover { color: var(--ink); background: var(--chip); }
  .turn-actions .icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .turn-actions .icon-btn:first-child { color: var(--accent); }
  .composer { background: linear-gradient(180deg, transparent, var(--bg) 40%); border-top: 0; padding-top: 12px; }
  .composer-inner { max-width: 740px; }
  .compose-row { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 6px 6px 6px 4px; box-shadow: 0 8px 28px -12px rgba(0, 0, 0, .35); }
  .compose-row:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
  .compose-row textarea { border: 0; background: transparent; box-shadow: none; outline: none; padding: 10px 12px; }
  .compose-row .send { width: 40px; height: 40px; }
  .command-menu { right: 0; }

  /* ---- home (2026-10-17) ---- */
  .home-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100%; }
  @media (max-width: 899px) { .home-shell { grid-template-columns: minmax(0, 1fr); } .side { display: none !important; } }
  @media (min-width: 900px) { .app.at-home:has(.home-shell) .topbar { display: none; } }  /* (only while the home layout is showing: it stays in the page when a story opens) */
  .side { position: sticky; top: 0; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
          padding: 22px 12px 16px; border-right: 1px solid var(--line); background: var(--surface); }
  .side-brand { border: 0; background: none; padding: 0 10px 22px; cursor: pointer; text-align: left; }
  .side-brand .brand-logo img { height: 34px; }
  .topbar .title .brand-logo img { height: 24px; }
  .side-link { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none;
               color: var(--muted); cursor: pointer; text-align: left; font-size: 14px; }
  .side-link svg { width: 18px; height: 18px; flex: none; }
  .side-link:hover, .side-link.active { color: var(--ink); background: var(--chip); }
  .side-link.active { font-weight: 600; }
  .side-h { font-size: 13px; font-weight: 600; color: var(--subtle); margin: 24px 10px 6px; }
  .side-story { display: flex; gap: 10px; align-items: center; width: 100%; padding: 6px 8px; border: 0; background: none; border-radius: 10px;
                cursor: pointer; text-align: left; color: var(--ink); }
  .side-story:hover { background: var(--chip); }
  .side-story img, .side-story .ph { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; background: var(--chip); }
  .side-story span { min-width: 0; }
  .side-story b { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-story small { color: var(--subtle); font-size: 12px; }
  .side-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
  .side-credits { border: 0; background: none; padding: 0; color: var(--muted); text-align: left; cursor: pointer; font-size: 12px; }
  .side-credits:hover { color: var(--ink); }
  .home-main { min-width: 0; padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
  .hero { position: relative; overflow: hidden; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
          gap: clamp(20px, 4vw, 48px); align-items: center; padding: clamp(28px, 5vw, 56px) clamp(16px, 4vw, 48px) 36px; }
  .hero-glow { position: absolute; inset: -60px; z-index: -2; opacity: .38; filter: blur(56px) saturate(1.25); }
  .hero-glow img, .hero-glow .ph { width: 100%; height: 100%; object-fit: cover; }
  .hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 35%, var(--bg) 100%); }
  .hero-flag { display: inline-block; color: var(--gold-text); font-size: 14px; font-weight: 600; margin-bottom: 10px; }  /* (design plan 40: 5.6:1 in light mode) */
  .hero-title { font: 700 clamp(36px, 5.2vw, 60px)/1 var(--display-font); letter-spacing: -.03em; margin: 0 0 16px; text-wrap: balance; }
  .hero-pitch { font-size: 17px; line-height: 1.55; margin: 0 0 16px; max-width: 54ch; }
  .hero-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
  .hero-tags button { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; min-height: 30px; font: inherit; font-size: 13px; color: var(--muted);
                      background: color-mix(in srgb, var(--bg) 55%, transparent); cursor: pointer; }
  .hero-tags button:hover { color: var(--ink); border-color: var(--faint); }
  .hero-tags button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .hero-facts { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
  .hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
  .hero-actions .btn { min-height: 44px; padding: 0 18px; font-size: 15px; }
  .hero-art { aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; border: 0; padding: 0; cursor: pointer; background: var(--chip);
              transform: rotate(1.5deg); box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .6);
              will-change: transform; backface-visibility: hidden; }  /* (its own layer: resampled once, design plan 41) */
  .hero-art img, .hero-art .ph { width: 100%; height: 100%; object-fit: cover; display: block; }
  @media (max-width: 760px) {
    .hero { grid-template-columns: minmax(0, 1fr); padding-top: 16px; } .hero-art { order: -1; transform: none; }
    .hero-text { display: flex; flex-direction: column; } .hero-title { font-size: clamp(28px, 8vw, 36px); margin-bottom: 10px; }
    .hero-pitch { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 14px; }
    .hero-actions { order: 1; margin-bottom: 14px; } .hero-tags { order: 2; } .hero-facts { order: 3; margin-bottom: 0; }
  }
  .btn.roll svg { width: 18px; height: 18px; color: var(--gold); }  /* (the die is the brand's flourish: it stays gold) */
  .btn.roll.rolling svg { animation: die-roll .45s cubic-bezier(.3, 1.4, .6, 1); }
  @keyframes die-roll { from { transform: rotate(0) scale(1); } 50% { transform: rotate(200deg) scale(1.25); } to { transform: rotate(360deg) scale(1); } }
  @media (prefers-reduced-motion: reduce) { .btn.roll.rolling svg { animation: none; } .tile-art img { transition: none; } }
  .home-body { padding: 0 clamp(16px, 4vw, 48px); }
  .genres { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 6px; margin-top: 8px; scrollbar-width: none; }
  .genres button { flex: none; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 7px 15px; cursor: pointer; font-size: 14px; }
  .genres button:hover { color: var(--ink); border-color: var(--faint); }
  .genres button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
  @media (max-width: 760px) { .genres button { min-height: 44px; } }
  /* rows that show there's more (scrollRow, design plan 42) */
  .scroll-row { position: relative; }
  .scroll-row > .genres, .scroll-row > .rail { mask-image: none; }
  .scroll-row.more-right > :first-child { mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent); }
  .scroll-row.more-left > :first-child { mask-image: linear-gradient(90deg, transparent, #000 56px); }
  .scroll-row.more-left.more-right > :first-child { mask-image: linear-gradient(90deg, transparent, #000 56px, #000 calc(100% - 56px), transparent); }
  .scroll-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
                background: var(--surface); color: var(--ink); display: none; place-items: center; cursor: pointer; box-shadow: var(--shadow); z-index: 2; }
  .scroll-btn svg { width: 16px; height: 16px; } .scroll-btn.back svg { transform: rotate(180deg); }
  .scroll-btn.back { left: -6px; } .scroll-btn.on { right: -6px; }
  .scroll-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  @media (hover: hover) and (pointer: fine) { .scroll-row.more-left > .scroll-btn.back, .scroll-row.more-right > .scroll-btn.on { display: grid; } }
  .scroll-row:has(> .rail) > .scroll-btn { top: calc(50% - 30px); }
  .shelf { margin-top: 34px; }
  .shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
  .shelf-title { font: 650 23px/1.2 var(--display-font); letter-spacing: -.015em; margin: 0; }
  .rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 270px); gap: 18px; overflow-x: auto; scroll-snap-type: x proximity;
          padding: 4px 4px 10px; margin: -4px -4px 0; scrollbar-width: thin; }
  .rail > * { scroll-snap-align: start; }
  .tile-grid { display: grid; gap: 26px 18px; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
  .tile { cursor: pointer; min-width: 0; border-radius: 14px; }
  .tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
  .tile-art { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--chip); }
  .tile-art img, .tile-art .ph { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
  .tile:hover .tile-art img { transform: scale(1.04); }
  .tile-name { font: 600 16px/1.3 var(--display-font); margin: 10px 2px 3px; overflow-wrap: anywhere; text-transform: none; letter-spacing: 0; color: var(--ink); }
  .tile-meta { margin: 0 2px; font-size: 13px; color: var(--muted); }
  .tile-desc { margin: 5px 2px 0; font-size: 13px; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .tile-flag.mature { left: auto; right: 10px; }
  .tile-flag { position: absolute; top: 10px; left: 10px; background: rgba(24, 21, 15, .74); color: #fdfcfb; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
  .die { display: inline-grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); width: 36px; height: 36px; padding: 6px; gap: 2px; border-radius: 9px;
         background: var(--gold); box-shadow: inset 0 -3px 0 rgba(85, 58, 27, .35), 0 6px 14px rgba(0, 0, 0, .35); }
  .die i { border-radius: 50%; }
  .die i.pip { background: #18150f; }
  .tile-rank { position: absolute; top: 10px; left: 10px; transform: rotate(-8deg); }
  .tile:nth-child(even) .tile-rank { transform: rotate(6deg); }
  .saves { margin-top: 14px; }
  .write-cta { margin-top: 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 24px 26px;
               border-radius: 18px; border: 1px dashed var(--faint); }
  .write-cta h2 { font: 650 21px/1.2 var(--display-font); margin: 0 0 4px; }
  .write-cta p { margin: 0; color: var(--muted); max-width: 60ch; }
  .login .brand { margin: 0 0 10px; } .login .brand .brand-logo img { height: 44px; }
  /* The wordmark: ink letters on light backgrounds, paper on dark (the die is gold on both). */
  .brand-logo { display: inline-flex; } .brand-logo img { display: block; width: auto; }
  .brand-logo .on-dark { display: none; }
  :root[data-theme="dark"] .brand-logo .on-light { display: none; } :root[data-theme="dark"] .brand-logo .on-dark { display: block; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-logo .on-light { display: none; }
                                        :root:not([data-theme="light"]) .brand-logo .on-dark { display: block; } }
  .feedback-card .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
  .home { flex: 1; overflow-y: auto; display: none; }
  .at-home .home { display: block; }
  .at-home .story, .at-home .composer, .at-home #openWorld, .at-root #goHome { display: none; }
  .tabbar { display: none; }
  .audience { display: grid; gap: 4px; margin: 10px 0 4px; max-width: 360px; } .audience .seg { display: flex; } .audience .seg button { flex: 1; }
  .mature-note { max-width: 560px; margin: 40px auto; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
  .mature-note h1 { margin: 0 0 8px; font: 700 26px/1.2 var(--display-font); } .mature-note p { color: var(--muted); margin: 0 0 16px; } .mature-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .store-name { display: grid; min-width: 0; } .store-name small { font-size: 12px; color: var(--subtle); }
  .studio-drafts { display: grid; gap: 8px; } .draft-row { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .draft-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; min-height: 56px; }
  .draft-open svg { width: 20px; height: 20px; color: var(--muted); flex: none; } .draft-open div { min-width: 0; display: grid; }
  .draft-open b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .draft-open span { font-size: 13px; color: var(--muted); }
  .draft-row .icon-btn { margin-right: 6px; color: var(--muted); } .draft-row .icon-btn:hover { color: var(--bad); }
  .ph-page { display: grid; gap: 14px; padding: 8px 0; } .ph-row { display: flex; gap: 12px; align-items: center; }
  .ph { background: var(--ph, var(--chip)); border-radius: 12px; animation: ph-pulse 1.4s ease-in-out infinite; }
  .ph-banner { aspect-ratio: 3 / 1; max-height: 240px; } .ph-cover { aspect-ratio: 16 / 9; max-height: 320px; border-radius: 18px; }
  .ph-round { width: 88px; height: 88px; border-radius: 50%; flex: none; } .ph-line { height: 14px; border-radius: 7px; }
  .ph-stat { flex: 1; height: 64px; max-width: 120px; } .ph-card { height: 180px; border-radius: 16px; }
  .ph-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  @keyframes ph-pulse { 50% { opacity: .55; } }
  .ph-hero { aspect-ratio: 21 / 8; max-height: 340px; border-radius: 20px; }
  .ph-pill { width: 96px; height: 34px; border-radius: 999px; flex: none; }
  .ph-col { display: grid; gap: 10px; align-content: start; }
  .ph-split { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) 320px; }
  .ph-field { height: 44px; border-radius: 10px; } .ph-tall { height: 120px; }
  .ph-post, .ph-turn { padding: 16px 0; border-bottom: 1px solid var(--line); }
  .ph-square-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } .ph-square { aspect-ratio: 1; border-radius: 16px; }
  .ph-story-cover { max-height: 200px; }
  .ph-canvas { height: max(360px, calc(100vh - 320px)); border-radius: 14px; }
  .ph-row { flex-wrap: wrap; }
  @media (max-width: 760px) { .ph-split { grid-template-columns: 1fr; } .ph-side { display: none; } .ph-canvas { height: 240px; } }
  .empty-action { margin-top: 14px; }
  @media (prefers-reduced-motion: reduce) { .ph { animation: none; } }
  @media (max-width: 899px) {  /* the phone's tab bar (docs/design-plan.md item 2): it replaces the sidebar and the top bar's Home */
    .at-home .tabbar { display: grid; grid-template-columns: repeat(var(--tabs, 4), minmax(0, 1fr)); gap: 4px; flex: none;
                       padding: 4px 8px calc(4px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
    .at-home #goHome, .at-home .write-cta { display: none; }
  }
  .tab { min-width: 0; min-height: 49px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0;
         background: none; color: var(--muted); cursor: pointer; font: 500 11px/1.2 var(--ui-font); border-radius: 12px; }
  .tab-icon { display: grid; place-items: center; width: min(52px, 100%); height: 28px; border-radius: 14px; }
  .tab-label { max-width: 100%; white-space: nowrap; }
  .tab { container-type: inline-size; }
  @container (max-width: 56px) { .tab-label { display: none; } }  /* (very large text: the icon alone, never a clipped "Ho…"; the name stays for screen readers) */ .tab-icon svg { width: 22px; height: 22px; }
  .tab.active { color: var(--accent); font-weight: 700; } .tab.active .tab-icon { background: var(--accent-soft); }
  .tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  /* News and notifications (2026-10-20): a count on the bell, the News tab and its sidebar link */
  .badge { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 5px; box-sizing: border-box; border-radius: 999px;
           background: var(--bad); color: #fff; font: 700 11px/17px var(--ui-font); text-align: center; pointer-events: none; }
  .news-page { max-width: 720px; margin: 0 auto; padding: 8px 16px 40px; box-sizing: border-box; }
  .news-head h1 { margin: 0 0 4px; font-family: var(--display-font); } .news-head p { margin: 0 0 18px; }
  .news-item { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 16px 18px; }
  .news-item + .news-item { margin-top: 14px; } .news-item.pinned { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
  .news-item h2 { margin: 6px 0 8px; font-size: 19px; line-height: 1.25; }
  .news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
  .news-kind { font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--chip); color: var(--ink); }
  .news-kind.patch { background: var(--accent-soft); color: var(--accent); }
  .news-new { font-weight: 700; color: var(--bad); }
  .news-body { font-size: 15px; line-height: 1.55; } .news-body p.h { font-weight: 700; margin: 14px 0 6px; } .news-body p { margin: 0 0 10px; } .news-body ul { margin: 0 0 10px; padding-left: 20px; }
  .notes { list-style: none; margin: 0; padding: 0; }
  .note { padding: 12px 4px; border-bottom: 1px solid var(--line); } .note:last-child { border-bottom: 0; }
  .note.unread { padding-left: 12px; box-shadow: inset 3px 0 0 var(--accent); }
  .note.linked { cursor: pointer; } .note.linked:hover { background: var(--chip); }
  .note-top { display: flex; justify-content: space-between; gap: 10px; } .note-top time { color: var(--muted); font-size: 12px; flex: none; }
  .note p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
  .notes-news { width: 100%; margin-bottom: 12px; }
  .notes-allow { margin-top: 16px; font-size: 13px; color: var(--muted); }
  .pending-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 12px 0 4px; background: var(--raised); font-size: 14px; }
  .pending-card b { display: block; margin-bottom: 2px; } .pending-card p { margin: 0; color: var(--muted); }
  .pending-card .row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
  .pending-card.approved { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--raised)); }
  @media (max-width: 899px) { .topbar .icon-btn { width: 44px; height: 44px; } }  /* (the phone's touch size: 44 pt) */
  .home-inner { max-width: 1100px; margin: 0 auto; padding: 8px 16px calc(32px + env(safe-area-inset-bottom)); }
  .home-h { font-size: 20px; margin: 22px 0 12px; font-family: var(--display-font); font-weight: 600; }
  .continue { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
  .cont-card { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
  .cont-card button.open { flex: 1; display: flex; gap: 12px; align-items: center; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; min-width: 0; color: var(--ink); }
  .cont-card img, .cont-card .ph { width: 112px; height: 72px; object-fit: cover; flex: 0 0 auto; background: var(--chip); }
  .cont-card b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cont-card span { display: block; font-size: 12px; color: var(--muted); }
  .cont-card .icon-btn { margin-right: 6px; color: var(--faint); }
  .worlds { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
  .world-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
  .world-card .art { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--accent-soft), var(--chip)); }
  .world-card .art img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .world-card .art .tag { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.55); color: #fff; }
  .world-card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
  .world-card h3 { margin: 0; font-size: 18px; text-transform: none; letter-spacing: 0; color: var(--ink); font-family: var(--display-font); }
  .genre { display: flex; flex-wrap: wrap; gap: 4px; }
  .genre span { font-size: 11px; color: var(--muted); background: var(--chip); border-radius: 999px; padding: 1px 8px; }
  .world-card p { margin: 0; font-size: 14px; color: var(--muted); flex: 1; }
  .world-card .usage { font-size: 12px; color: var(--subtle); }
  .world-card.clickable { cursor: pointer; transition: border-color .15s, transform .15s; }
  .world-card.clickable:hover { border-color: var(--accent); transform: translateY(-1px); }
  .world-card .badge { position: absolute; top: 10px; right: 10px; background: var(--accent-fill); color: var(--accent-ink);
    border-radius: 999px; font-size: 11px; padding: 2px 8px; font-weight: 600; }
  /* a story's page, between the home page and the story itself */
  .world-page { max-width: 980px; margin: 0 auto; padding: 8px 16px calc(40px + env(safe-area-inset-bottom)); }
  .world-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  @media (max-width: 760px) { .world-hero { grid-template-columns: minmax(0, 1fr); } }  /* (minmax: long words can't widen the page) */
  .world-hero .art { aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: linear-gradient(135deg, var(--accent-soft), var(--chip)); }
  .world-hero .art img { width: 100%; height: 100%; object-fit: cover; display: block; }
  /* Titles use the display font; the serif is for story text only (design plan rule 6). */
  .world-hero h1 { margin: 0 0 6px; font-family: var(--display-font); font-size: 30px; line-height: 1.15; }
  .world-meta { font-size: 13px; color: var(--muted); margin: 6px 0 10px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
  .world-meta .pill-tag { background: var(--chip); border-radius: 999px; padding: 1px 9px; font-size: 12px; }
  .world-meta .warn-tag { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
  .world-desc { font-size: 16px; line-height: 1.55; margin: 0 0 14px; }
  .world-go { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .world-go .btn.primary { min-width: 140px; } .world-go .btn svg { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; }
  .home-top { padding: clamp(16px, 3vw, 28px) clamp(16px, 4vw, 48px) 0; } .home-top + .hero { padding-top: clamp(16px, 3vw, 32px); }
  .home-top + .hero .hero-glow { -webkit-mask-image: linear-gradient(to bottom, transparent 60px, #000 260px); mask-image: linear-gradient(to bottom, transparent 60px, #000 260px); } .home-foot { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; padding: 28px 16px 36px; margin-top: 12px;
                                                  border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
  .home-foot a { color: var(--muted); } .home-foot a:hover { color: var(--ink); }
  .home-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0 0 4px; }
  .home-tools .icon-btn { width: 44px; height: 44px; flex: none; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); position: relative; }
  .home-tools .home-search { flex: 1; margin: 0; }
  .home-tools a.icon-btn { display: grid; place-items: center; color: var(--ink); }
  .discord-mark { width: 20px; height: 20px; fill: currentColor; }
  .login-discord { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; padding: 10px; border-radius: 10px;
                   border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 14px; }
  .login-discord:hover { background: var(--chip); } .login-discord:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .notes-seg { display: flex; margin-bottom: 14px; } .notes-seg button { flex: 1; }
  .news-briefs { list-style: none; margin: 0; padding: 0; }
  .news-brief { display: block; width: 100%; text-align: left; padding: 12px 6px; border: 0; border-bottom: 1px solid var(--line); background: none;
                color: inherit; font: inherit; cursor: pointer; border-radius: 0; }
  .news-brief:hover { background: var(--chip); } .news-brief:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .news-brief b { display: block; margin: 4px 0 2px; font-size: 15px; line-height: 1.3; }
  .news-brief p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .news-all { margin-top: 14px; width: 100%; }
  .btn.danger { color: var(--bad); } .btn.danger:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); }
  .news-admin { display: flex; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
  .news-edit { display: grid; gap: 10px; } .news-edit .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .news-edit input[type=text], .news-edit textarea, .news-edit select, .news-edit input[type=datetime-local] {
    box-sizing: border-box; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); font: inherit; }
  .news-edit input[type=text] { flex: 1; min-width: 160px; } .news-edit textarea { width: 100%; min-height: 260px; resize: vertical; font-size: 14px; line-height: 1.5; }
  .news-edit label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
  .news-edit .error { color: var(--bad); font-size: 13px; min-height: 1em; }
  .news-item.picked { animation: news-picked 2.4s ease-out; }
  @keyframes news-picked { from { box-shadow: 0 0 0 3px var(--accent); } to { box-shadow: 0 0 0 3px transparent; } }
  @media (prefers-reduced-motion: reduce) { .news-item.picked { animation: none; box-shadow: 0 0 0 2px var(--accent); } }
  .notes-body .news-item { padding: 14px 16px; } .notes-body .news-item h2 { font-size: 17px; }
  .home-search { width: 100%; max-width: 420px; box-sizing: border-box; margin: 0 0 4px; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line);
                 background: var(--raised); color: var(--ink); font: inherit; font-size: 15px; }
  .home-search:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .rate-box { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
  .rate-stars { display: flex; gap: 2px; } .rate-stars button { border: 0; background: none; font-size: 24px; line-height: 1; padding: 2px; cursor: pointer; color: var(--line); }
  .rate-stars button.on { color: var(--gold, #dea44e); } .rate-stars button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
  .world-report { margin: 28px 0 8px; font-size: 13px; color: var(--muted); }
  .world-report summary { cursor: pointer; width: max-content; } .world-report summary:hover { color: var(--ink); }
  .report-form { display: flex; flex-direction: column; gap: 10px; max-width: 460px; margin-top: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--raised); }
  .report-reasons { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; } .report-reasons legend { font-weight: 600; color: var(--ink); margin-bottom: 6px; }
  .report-reason { display: flex; gap: 8px; align-items: center; color: var(--ink); cursor: pointer; } .report-reason input { accent-color: var(--accent); }
  .report-form textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
  .report-form .btn { align-self: flex-start; }
  .world-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; margin-top: 22px; }
  .world-page, .studio-page { overflow-wrap: anywhere; }
  .world-sec { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
  .world-sec h3 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  .world-sec p { margin: 0 0 6px; font-size: 14px; line-height: 1.5; }
  .world-sec .people { display: flex; flex-wrap: wrap; gap: 6px; }
  .world-sec .people span { background: var(--chip); border-radius: 10px; padding: 4px 9px; font-size: 13px; }
  .world-sec .people small { color: var(--muted); }
  .world-admin { margin-top: 18px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; display: flex;
    gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; }
  .world-admin b { margin-right: 6px; color: var(--muted); font-weight: 600; }
  /* the Story Studio: write a brief, let the AI build the world around it */
  .studio-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 0 4px;
    padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
  .studio-cta p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
  .studio-page { max-width: 860px; margin: 0 auto; padding: 8px 16px calc(48px + env(safe-area-inset-bottom)); }
  .studio-page h1 { font-family: var(--display-font); font-size: 26px; margin: 6px 0 4px; }
  .studio-note { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
  .studio-step { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
  .studio-step h2 { margin: 0 0 2px; font-size: 16px; }
  .studio-step .hint { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
  .studio-step .field { margin-top: 8px; }
  .studio-step textarea { min-height: 64px; resize: vertical; }
  .studio-row { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: start;
    padding: 8px 0; border-top: 1px dashed var(--line); }
  .studio-row:first-of-type { border-top: 0; }
  .builder-picks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
  .builder-pick { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
  .builder-pick input { margin: 0; }
  .studio-row .remove { justify-self: end; }
  .counter { font-size: 11px; color: var(--subtle); text-align: right; }
  .counter.over { color: var(--bad); }
  .studio-actions { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 0;
    background: linear-gradient(transparent, var(--bg) 30%); }
  .studio-problems { color: var(--bad); font-size: 13px; margin: 6px 0; }
  .studio-problems li { margin: 2px 0; }
  .studio-list .row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .studio-list .row b { display: block; } .studio-list .row span { font-size: 12px; color: var(--muted); }
  .studio-result { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .studio-result .box { background: var(--raised); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
  .studio-result .box b { display: block; margin-bottom: 4px; }
  .studio-result ul { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
  .studio-result .yours { font-size: 11px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 0 6px; margin-left: 4px; }
  .gen-progress { display: flex; flex-direction: column; gap: 8px; max-width: 560px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--raised); }
  .gen-progress b { font-weight: 600; font-size: 15px; }
  .gen-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .gen-bar i { height: 8px; border-radius: 999px; background: var(--chip); overflow: hidden; position: relative; }
  .gen-bar i.done { background: var(--accent); }
  .gen-bar i.now::after { content: ""; position: absolute; inset: 0; width: 40%; border-radius: inherit; background: var(--accent); animation: gen-slide 1.4s ease-in-out infinite; }
  @keyframes gen-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
  @media (prefers-reduced-motion: reduce) { .gen-bar i.now::after { animation: none; width: 50%; } }
  .gen-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; font-size: 12px; color: var(--muted); }
  .gen-steps .done, .gen-steps .now { color: var(--ink); } .gen-steps .now { font-weight: 600; }
  .working { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; }
  /* the builder: steps across the top, one step at a time, a live preview beside it */
  .studio-page.builder-page { max-width: 1240px; }
  .builder-head { display: flex; align-items: center; gap: 10px; margin: 8px 0 10px; flex-wrap: wrap; }
  .builder-name { font-family: var(--display-font); font-size: 20px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 18px; align-items: start; }
  @media (max-width: 1000px) { .builder { grid-template-columns: minmax(0, 1fr); } .builder-preview { order: 2; } }
  .builder-steps { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
  .builder-step { white-space: nowrap; border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; padding: 10px 12px;
    border-bottom: 2px solid transparent; cursor: pointer; }
  .builder-step:hover { color: var(--ink); }
  .builder-step.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
  .builder-step .req { color: var(--accent); font-weight: 600; }
  .builder-step.done .req { color: var(--ok); }
  .builder-title { margin: 0; font-size: 20px; }
  .builder-sub { margin: 18px 0 2px; font-size: 16px; }
  .builder-module { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; background: var(--surface); }
  .builder-module .builder-toggle { border: 0; margin: 0; background: none; }
  .builder-module.on { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
  .builder-module-fields { padding: 0 14px 12px; }
  .builder-module .needs { display: block; margin-top: 4px; font-size: 12px; color: var(--accent); }
  .suggest-wrap { margin: 6px 0 10px; } .suggest-wrap .tiny { margin-left: 8px; }
  .btn.suggest { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
  .suggestion { margin-top: 8px; padding: 10px 12px; border: 1px dashed color-mix(in srgb, var(--accent) 60%, var(--line));
    border-radius: 12px; background: var(--accent-soft); font-size: 14px; }
  .suggestion ul { margin: 6px 0; padding-left: 18px; } .suggestion li { margin: 3px 0; }
  .ideas-log { max-height: min(56vh, 560px); overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin: 6px 0; }  /* (design plan 38) */
  .ideas-head { display: flex; align-items: center; gap: 10px; } .ideas-head > div { flex: 1; }
  .ideas-close, .builder-ideas-btn { display: none; } .builder-ideas-btn svg { width: 16px; height: 16px; }
  .world-edits { display: grid; gap: 6px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
  .world-edits ul { margin: 0; padding-left: 18px; } .world-edits p { margin: 0; }
  .world-edit-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; } .world-edit-actions .btn { margin: 0; }
  .sw-card .sw-form-actions { background: var(--raised); margin: 0 -14px -14px; padding: 10px 14px; border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; }
  /* the assistant as a sheet on a narrow screen (design plan 34) */
  @media (max-width: 1000px) {
    .builder-ideas-btn { display: inline-flex; }
    .builder-preview .ideas-chat:not(.sheet-open) { display: none; }
    .ideas-chat.sheet-open { position: fixed; left: 0; right: 0; bottom: 0; top: max(10vh, env(safe-area-inset-top)); z-index: 40; border-radius: 18px 18px 0 0;
                             display: flex; flex-direction: column; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); box-shadow: var(--shadow); }
    .ideas-chat.sheet-open .ideas-log { max-height: none; flex: 1; }
      .ideas-chat.sheet-open .ideas-text { font-size: 16px; }
    .ideas-chat.sheet-open .ideas-close { display: inline-grid; }
    body.ideas-sheet-open::after { content: ""; position: fixed; inset: 0; background: var(--scrim); z-index: 39; }
  }
  .ideas-form { display: flex; flex-direction: column; gap: 6px; }
  .ideas-form-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
  .ideas-file { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 4px 4px 10px; border-radius: 10px;
                background: var(--accent-soft); font-size: 13px; } .ideas-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ideas-file .icon-btn { width: 28px; height: 28px; }
  .builder-body .hint { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
  .builder-body textarea { min-height: 80px; resize: vertical; }
  .builder-cards { display: flex; flex-direction: column; gap: 10px; }
  .builder-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
  .builder-card-top { display: flex; justify-content: space-between; align-items: center; }
  .builder-subhead { margin: 22px 0 8px; font-size: 15px; }
  .builder-size .seg { display: flex; width: 100%; max-width: 420px; margin: 6px 0 4px; } .builder-size .seg button { flex: 1; }
  .builder-more { margin-top: 10px; } .builder-more > summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 4px 0; }
  .builder-more[open] > summary { margin-bottom: 8px; }
  .builder-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 0 10px; }
  .builder-add { width: 100%; border-style: dashed; }
  .builder-toggle { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px;
    border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; }
  .builder-toggle b { display: block; } .builder-toggle span { font-size: 13px; color: var(--muted); }
  .builder-toggle input { width: 20px; height: 20px; accent-color: var(--accent); flex: 0 0 auto; }
  .builder-foot { position: sticky; bottom: 0; display: flex; justify-content: space-between; padding: 12px 0;
    background: linear-gradient(transparent, var(--bg) 35%); margin-top: 8px; }
  .builder-check { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 4px; }
  .builder-check .ok button { color: var(--ok); } .builder-check li:not(.ok):not(.todo) button { color: var(--muted); }
  .linkish { background: none; border: 0; padding: 4px 0; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
  .builder-preview { position: sticky; top: 8px; display: flex; flex-direction: column; gap: 10px; }
  .builder-preview-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
  .builder-preview-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
  .builder-preview-card .art { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--accent-soft), var(--chip)); }
  .builder-preview-card .art img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .builder-cover .studio-actions { position: static; background: none; padding: 4px 0 0; }
  .builder-preview-card h3 { margin: 10px 12px 4px; font-family: var(--display-font); font-size: 18px; text-transform: none; letter-spacing: 0; color: var(--ink); }
  .builder-preview-card p { margin: 0 12px 12px; color: var(--muted); font-size: 14px; }
  .builder-preview .world-sec { padding: 10px 12px; }
  .builder-preview .world-sec p { font-size: 13px; }

  /* ---- the Studio, in the app's design (2026-10-18) ---- */
  .studio-page.builder-page { max-width: 1280px; padding: clamp(14px, 3vw, 28px) clamp(16px, 3vw, 36px) calc(48px + env(safe-area-inset-bottom)); }
  .builder-head { gap: 12px; margin: 0 0 18px; flex-wrap: nowrap; }
  .builder-back svg { width: 16px; height: 16px; transform: rotate(180deg); margin-right: 4px; vertical-align: -3px; }
  .builder-titlebox { flex: 1; min-width: 0; }
  .builder-eyebrow { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
  .studio-page .builder-name { margin: 2px 0 0; font: 700 clamp(22px, 3vw, 30px)/1.15 var(--display-font); letter-spacing: -.02em;
                  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .save-chip { font-size: 12px; color: var(--muted); padding: 4px 10px; border-radius: 999px; background: var(--chip); white-space: nowrap; }
  .save-chip:empty { display: none; }
  .builder { grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: clamp(16px, 2.5vw, 28px); }
  .builder-progress { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; font-size: 13px; color: var(--muted); }
  .builder-progress > span { white-space: nowrap; }
  .builder-meter { flex: 1; height: 6px; border-radius: 999px; background: var(--chip); overflow: hidden; }
  .builder-meter i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .3s ease; }
  .builder-steps { gap: 6px; border: 0; margin: 0 0 22px; padding: 2px 2px 8px; scrollbar-width: none; }
  .builder-steps::-webkit-scrollbar { display: none; }
  .builder-step { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 999px;
                  background: var(--raised); color: var(--muted); font-size: 13px; border-bottom-width: 1px; }
  .builder-step:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--ink); }
  .builder-step .step-num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700;
                            background: var(--chip); color: var(--muted); flex: none; }
  .builder-step .step-num svg { width: 13px; height: 13px; }
  .builder-step.done .step-num { background: color-mix(in srgb, var(--ok) 22%, transparent); color: var(--ok); }
  .builder-step.optional .step-label::after { content: " · optional"; color: var(--subtle); font-weight: 400; }
  .builder-step.on { border-color: var(--accent); color: var(--ink); font-weight: 600; background: color-mix(in srgb, var(--accent) 10%, var(--raised)); }
  .builder-step.on .step-num { background: var(--accent); color: #fff; }
  .builder-step:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .builder-stephead { margin-bottom: 16px; }
  .builder-title { margin: 4px 0 6px; font: 700 clamp(24px, 3vw, 32px)/1.15 var(--display-font); letter-spacing: -.02em; }
  .builder-stephead .hint { font-size: 15px; line-height: 1.5; max-width: 62ch; margin: 0 0 10px; }
  .builder-panel.card { background: var(--raised); border: 1px solid var(--line); border-radius: 18px; padding: 6px 18px 18px; }
  .builder-body .field > span { font-weight: 600; color: var(--ink); font-size: 14px; }
  .builder-body .field input, .builder-body .field textarea, .builder-body .field select { border-radius: 12px; }
  .builder-card { border-radius: 16px; padding: 12px 14px; background: var(--raised); }
  .builder-add { border-radius: 14px; padding: 12px; }
  .builder-sub { margin: 22px 0 8px; font: 650 13px/1.3 var(--ui-font); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
  .builder-module { border-radius: 16px; background: var(--raised); transition: border-color .2s; }
  .builder-module .builder-toggle { padding: 14px 16px; cursor: pointer; }
  .builder-module .builder-toggle b { font-size: 15px; margin-bottom: 2px; }
  .builder-module .builder-toggle input { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--line);
                                          position: relative; cursor: pointer; transition: background .2s; margin: 0; }
  .builder-module .builder-toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
                                                 background: #fdfcfb; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
  .builder-module .builder-toggle input:checked { background: var(--accent); }
  .builder-module .builder-toggle input:checked::after { transform: translateX(18px); }
  .builder-module .builder-toggle input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .builder-module-fields { padding: 4px 16px 14px; border-top: 1px solid var(--line); }
  .builder-cheating { border-radius: 16px; padding: 0 16px; }
  .builder-cheating > summary { list-style: none; cursor: pointer; padding: 14px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .builder-cheating > summary::-webkit-details-marker { display: none; }
  .builder-cheating > summary b { display: block; font-size: 15px; } .builder-cheating-lock { color: var(--muted); font-size: 12px; }
  .builder-cheating > summary .set-stops-now::after { content: "›"; display: inline-block; margin-left: 8px; color: var(--muted); transition: transform .2s; }
  .builder-cheating[open] > summary .set-stops-now::after { transform: rotate(90deg); }
  .builder-cheating[open] { padding-bottom: 8px; }
  .builder-module-filter { margin: 2px 0 4px; }
  .builder-option { padding: 4px 16px; margin-top: 10px; } .builder-option .set-row { border: 0; }
  .builder-module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 10px; align-items: start; }
  .builder-module-grid .builder-module { margin: 0; }
  .builder-module .builder-toggle span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .builder-module .builder-toggle { cursor: default; }
  .builder-module-more { border: 0; background: none; padding: 0 16px 12px; font: inherit; font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer; }
  .builder-module-more::after { content: "›"; display: inline-block; margin-left: 5px; }
  .builder-module-more:hover { text-decoration: underline; } .builder-module-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
  .module-dialog { width: min(640px, calc(100vw - 32px)); max-height: min(86vh, 900px); padding: 0; border: 1px solid var(--line); border-radius: 20px;
                   background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7); overflow: hidden; }
  .module-dialog[open] { display: flex; flex-direction: column; }
  .module-dialog::backdrop { background: rgba(10, 8, 5, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
  .module-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
  .module-dialog-head b { display: block; font: 700 20px/1.2 var(--display-font); } .module-dialog-head small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
  .module-dialog .builder-module-fields { overflow-y: auto; padding: 4px 20px 16px; border: 0; }
  .module-dialog .builder-module-fields textarea { min-height: 70px; }
  .module-dialog-foot { display: flex; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid var(--line); }
  .module-dialog-head .icon-btn { flex: none; width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--chip); color: var(--muted); font-size: 18px; cursor: pointer; }
  .module-dialog-head .icon-btn:hover { color: var(--ink); } .module-dialog :focus:not(:focus-visible) { outline: none; }
  .module-dialog :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; } .module-dialog:focus { outline: none; }
  .profile-links { display: flex; flex-wrap: wrap; gap: 8px; }
  .profile-dialog .profile-edit { display: grid; gap: 10px; align-content: start; } .profile-dialog .profile-edit > .btn { justify-self: start; }
  .module-dialog .hint { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 12px 0 0; }
  .builder-check { gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); margin-bottom: 18px; }
  .builder-check li button { width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--raised);
                             font-size: 14px; text-decoration: none; }
  .builder-check li.ok button { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
  .builder-check li.todo button { border-style: dashed; border-color: var(--subtle); }  /* (to do: a dashed outline and the words, not the warning colour: item 19) */
  .builder-foot { align-items: center; gap: 10px; margin-top: 24px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px;
                  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); bottom: 12px; }
  .builder-where { font-size: 13px; color: var(--muted); }
  .builder-preview { top: 16px; gap: 12px; }
  .builder-preview-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--muted); margin-top: 4px; }
  .builder-preview-card { border-radius: 18px; background: var(--raised); box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .5); }
  .builder-preview-card h3 { font: 700 20px/1.2 var(--display-font); }
  .builder-preview .world-sec { border-radius: 14px; }
  .ideas-chat { border-radius: 18px; padding: 14px; background: var(--raised); }
  .ideas-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
  .ideas-head b { display: block; font: 650 15px/1.2 var(--display-font); } .ideas-head small { color: var(--muted); font-size: 12px; }
  .ideas-form textarea { border-radius: 12px; }
  @media (max-width: 900px) { .builder { grid-template-columns: minmax(0, 1fr); } .builder-preview { position: static; } }
  @media (min-width: 901px) { .builder-steps { flex-wrap: wrap; overflow: visible; } }
  @media (max-width: 560px) {
    .builder-step .step-label { display: none; } .builder-step.on .step-label { display: inline; }
    .builder-step { padding: 4px; } .builder-step.on { padding-right: 12px; }
    .builder-head .builder-back { font-size: 0; padding: 0 10px; } .builder-head .builder-back svg { margin: 0; }
    .builder-foot { bottom: calc(8px + env(safe-area-inset-bottom)); }
  }
  @media (max-width: 899px) {  /* the builder's own header is the phone's only one (docs/design-plan.md item 18): ← Your stories, the title, Save */
    .at-home.in-builder .topbar { display: none; }
    .builder-head .builder-eyebrow { display: none; }
    .builder-head .builder-back { min-width: 44px; min-height: 44px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .builder-meter i, .builder-module .builder-toggle input, .builder-module .builder-toggle input::after { transition: none; }
  }
  .world-card .go { display: flex; gap: 8px; margin-top: 6px; }
  .world-card .go select { flex: 1; min-height: 38px; }
  .world-card .go .btn { flex: 0 0 auto; }
  .welcome { color: var(--muted); font-size: 14px; margin-top: 14px; }
  .credit-big { font-size: 34px; font-weight: 700; margin: 14px 0 2px; font-variant-numeric: tabular-nums; }
  .bars { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }
  .bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 13px; }
  .bar-row .track { grid-column: 1 / -1; height: 6px; background: var(--chip); border-radius: 3px; overflow: hidden; }
  .bar-row .track i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
  .bar-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .activity { list-style: none; margin: 0; padding: 0; font-size: 13px; }
  .activity li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 7px 0; border-top: 1px solid var(--line); }
  .activity li:first-child { border-top: 0; }
  .activity small { color: var(--subtle); grid-column: 1 / -1; }
  .plus { color: var(--ok); font-weight: 600; } .minus { font-weight: 600; }
  .you-edit { align-self: stretch; display: flex; flex-direction: column; gap: 6px; }
  .you-edit textarea { min-height: 60px; resize: vertical; border-radius: 14px; }
  .you-edit .row { display: flex; gap: 6px; justify-content: flex-end; }
  /* Rich narration: paragraphs, emphasis, dialogue, and in-world text (signs, letters, status windows). */
  .narration:not(.error):not(.thinking) { white-space: normal; }
  .narration p { margin: 0 0 .85em; } .narration > :last-child { margin-bottom: 0; }
  .narration strong { font-weight: 700; } .narration em { font-style: italic; }
  .narration .say { color: var(--say); }
  .no-say .narration .say { color: inherit; }
  .narration blockquote { margin: 0 0 .85em; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--raised);
    border-radius: 0 10px 10px 0; font-family: var(--ui-font); font-size: .9em; line-height: 1.5; }
  .narration ul { margin: 0 0 .85em; padding-left: 1.3em; } .narration li { margin: .2em 0; }
  .narration hr { border: 0; border-top: 1px solid var(--line); margin: 1em 25%; }
  .narration code { font-family: ui-monospace, Consolas, monospace; font-size: .85em; background: var(--chip); padding: 1px 5px; border-radius: 5px; }
  .narration .h { font-weight: 700; }
  .narration.streaming::after { content: none; }
  .narration.streaming > :last-child::after { content: "▍"; color: var(--accent); animation: blink 1s steps(2) infinite; }
  :root { --say: #795326; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --say: #eac98c; } }
  :root[data-theme="dark"] { --say: #eac98c; }
  /* The goddess's gifts: picked in the story, before play begins. */
  .gifts { display: grid; gap: 8px; }
  .gift { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px 14px; cursor: pointer; font-family: var(--ui-font); }
  .gift:hover { border-color: var(--accent); }
  .gift[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
  .gift b { display: block; font-size: 16px; } .gift .gift-tag { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; }
  .gift .what { font-size: 13px; margin-top: 8px; color: var(--ink); } .gift .later { font-size: 12px; color: var(--subtle); margin-top: 4px; }
  .gift-confirm { position: sticky; bottom: 0; padding: 10px 0 2px; background: linear-gradient(transparent, var(--bg) 30%); }
  .gift-confirm .btn { width: 100%; }
  .identity-form { font-family: var(--ui-font); border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 14px 16px; }
  .identity-form h3 { margin: 0; font-size: 16px; } .identity-form .lede { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
  .identity-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
  .identity-form .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
  .identity-form .err { color: var(--bad); font-size: 13px; margin-top: 8px; }
  .identity-form textarea { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; }
  @media (max-width: 480px) { .identity-form .row { grid-template-columns: 1fr; } }
/* (the Studio's assistant at work: what it's doing, three dots, and for how long) */
.ideas-working { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.ideas-working .dots { display: inline-flex; gap: 3px; }
.ideas-working .dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .35; animation: ideas-dot 1.2s ease-in-out infinite; }
.ideas-working .dots i:nth-child(2) { animation-delay: .15s; } .ideas-working .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ideas-dot { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .ideas-working .dots i { animation: none; opacity: .7; } }
/* (links and pictures in rich text: narration, news, authors' command windows) */
.rich-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.rich-link:hover { text-decoration-thickness: 2px; }
.rich-figure { margin: 14px 0; }
.rich-figure .rich-img { display: block; max-width: 100%; height: auto; border-radius: 12px; }
.rich-figure figcaption { margin-top: 6px; font-size: 13px; color: var(--muted); }
/* (inside a sentence a picture is the size of a word: a picture to see in full goes on its own line, as a figure) */
p .rich-img, li .rich-img, blockquote .rich-img { display: inline-block; height: 1.6em; width: auto; max-width: 100%; vertical-align: -0.35em; border-radius: 4px; }
.rich-img-off { color: var(--muted); }


/* ---- the Story Studio's world view (studio-world.js) ---- */
.sheet.right.full { width: 100vw; }
#sheet-studioworld .sheet-body { padding-bottom: 16px; }
.sw-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.sw-tab-bad:not(.primary) { border-color: var(--bad); color: var(--bad); }
.sw-opening { margin-bottom: 10px; }
.sw-clock { display: flex; align-items: center; gap: 12px; margin: 4px 0 8px; flex-wrap: wrap; }
.sw-track { position: relative; flex: 1; min-width: 240px; display: flex; align-items: center; }
.sw-track input { width: 100%; margin: 0; }
.sw-mark { position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; background: var(--accent); border-radius: 1px; pointer-events: none; }
.sw-time { font-weight: 650; font-variant-numeric: tabular-nums; min-width: 3.2em; }
.sw-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.sw-line { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line);
           background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.sw-line svg { width: 28px; height: 8px; overflow: visible; }
.sw-line.on { color: var(--ink); background: var(--raised); border-color: color-mix(in srgb, var(--ink) 45%, var(--line)); }
.sw-line:not(.on) svg { opacity: .45; }
.sw-line:focus-visible, .sw-link:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
.sw-stage { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; height: max(460px, calc(100vh - 250px)); }
.sw-canvas { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); overflow: hidden; }
.sw-svg { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; font-family: var(--ui-font); }
.sw-svg:active { cursor: grabbing; }
.sw-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; }
.sw-tools .btn { min-width: 32px; min-height: 32px; background: var(--surface); }
.sw-side { overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px 14px; background: var(--surface); }
.sw-side h3 { font: 650 16px/1.25 var(--display-font); margin: 12px 0 2px; text-transform: none; letter-spacing: normal; color: var(--ink); }
.sw-link { border: 0; background: none; padding: 2px 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.sw-warning { border-left: 3px solid var(--warn); padding-left: 8px; }
/* lines: each kind its own stroke pattern, so none depends on colour */
.sw-e { fill: none; stroke: var(--subtle, var(--muted)); stroke-width: 1.5; stroke-linecap: round; }
.sw-e-exits { stroke: var(--line); stroke-width: 4; }
.sw-e-bonds { stroke: var(--accent); stroke-width: 2; }
.sw-e-attitude { stroke: var(--ok); stroke-width: 2; }
.sw-e-attitude.bad { stroke: var(--bad); stroke-dasharray: 7 4; }
.sw-e-knows { stroke: var(--ink); stroke-dasharray: 1 5; stroke-width: 2.5; }
.sw-e-groups { stroke-dasharray: 10 5; }
.sw-e-items { stroke-dasharray: 3 3; }
.sw-e-events { stroke: var(--warn); stroke-dasharray: 8 3 2 3; }
.sw-e.hot { stroke-width: 3; opacity: 1; }
.sw-e.dim { opacity: .15; }
.sw-e-label { font-size: 12px; font-weight: 700; text-anchor: middle; fill: var(--ok); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; }
.sw-e-label.bad { fill: var(--bad); }
/* nodes */
.sw-place rect { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.sw-place.start rect { stroke: var(--accent); stroke-width: 3; }
.sw-place.nowhere rect { stroke-dasharray: 6 4; }
.sw-place-name { font-size: 13px; font-weight: 650; fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
.sw-start-tag { font-size: 12px; font-weight: 650; fill: var(--accent); }
.sw-place, .sw-person, .sw-thing { cursor: pointer; outline: none; }
.sw-person circle { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.sw-person.player circle { fill: var(--surface); stroke: var(--ink); stroke-width: 2.5; stroke-dasharray: 4 2.5; }
.sw-initials.you { font-size: 9.5px; }
.sw-initials { font-size: 11px; font-weight: 700; text-anchor: middle; fill: var(--ink); pointer-events: none; }
.sw-name { font-size: 12px; font-weight: 600; text-anchor: middle; fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; opacity: 0; pointer-events: none; }
.sw-person:hover .sw-name, .sw-person:focus .sw-name, .sw-person.picked .sw-name { opacity: 1; }
.sw-person:hover, .sw-person:focus, .sw-thing:hover, .sw-thing:focus { isolation: isolate; }
.sw-thing > rect, .sw-thing > polygon { stroke-width: 1.5; }
.sw-event > rect { fill: color-mix(in srgb, var(--warn) 25%, var(--surface)); stroke: var(--warn); }
.sw-item > rect { fill: var(--raised); stroke: var(--muted); }
.sw-group > polygon { fill: var(--surface); stroke: var(--ink); }
.sw-thing-name { font-size: 12px; text-anchor: middle; fill: var(--muted); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; }
.sw-place.flagged rect, .sw-person.flagged circle, .sw-thing.flagged > rect, .sw-thing.flagged > polygon { stroke: var(--bad); stroke-width: 3; }
.sw-badge { fill: var(--bad); stroke: var(--surface); stroke-width: 2; }
.sw-badge-text { font-size: 11px; font-weight: 800; text-anchor: middle; fill: #fff; pointer-events: none; }
.sw-place.picked rect, .sw-place:focus-visible rect { stroke: var(--ink); stroke-width: 3; }
.sw-person.picked circle, .sw-person:focus-visible circle, .sw-thing.picked > *:first-child, .sw-thing:focus-visible > *:first-child { stroke: var(--ink); stroke-width: 3; }
.sw-place.dim, .sw-person.dim, .sw-thing.dim { opacity: .25; }
.sw-place, .sw-person, .sw-thing, .sw-e { transition: opacity .15s ease; }
@media (prefers-reduced-motion: reduce) { .sw-place, .sw-person, .sw-thing, .sw-e { transition: none; } }
@media (max-width: 1000px) { .sw-stage { grid-template-columns: 1fr; height: auto; } .sw-canvas { height: 60vh; } .sw-side { max-height: none; } }
.sw-list { display: grid; gap: 10px; }
/* the tabs beside the canvas: cards, a day strip, a timeline, a ladder */
.sw-gallery { display: grid; gap: 10px; }
.sw-filterbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sw-search { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
             font: inherit; font-size: 14px; width: min(100%, 260px); }
.sw-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: start; }
.sw-card { display: grid; gap: 8px; padding: 14px; border-radius: 14px; margin: 0; background: var(--raised); border: 1px solid var(--line); }
.sw-ability { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.sw-card { gap: 12px; }
.sw-sec { display: grid; gap: 7px; }
.sw-sec + .sw-sec, .sw-card-head + .sw-sec + .sw-sec { border-top: 1px solid var(--line); padding-top: 12px; }
.sw-sec-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sw-note { font-size: 11.5px; color: var(--muted); }
.sw-bond { line-height: 1.8; }
.sw-ability:first-of-type { border-top: 0; padding-top: 0; }
.sw-card.start { border-color: var(--accent); }
.sw-card-head { display: flex; align-items: center; gap: 10px; }
.sw-card-words { display: grid; gap: 1px; flex: 1; min-width: 0; }
.sw-card-title { font: 650 16px/1.25 var(--display-font); color: var(--ink); }
.sw-card-sub { font-size: 13px; color: var(--muted); }
.sw-card-go { flex: 0 0 auto; }
.sw-card-about { margin: 0; color: var(--ink); }
.sw-card p { margin: 0; }
.sw-chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.sw-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line);
           font-size: 12px; font-weight: 600; color: var(--muted); background: none; font-family: inherit; }
.sw-chip.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.sw-chip.good { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); }
.sw-chip.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); }
.sw-chip.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); }
.sw-chip.quiet { border-style: dashed; }
.sw-chip-link { cursor: pointer; color: var(--ink); }
.sw-chip-link:hover { border-color: var(--accent); color: var(--accent); }
.sw-label { font-size: 12px; font-weight: 650; color: var(--muted); margin-right: 2px; }
.sw-avatar { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700;
             background: var(--accent-soft); border: 1.5px solid var(--accent); color: var(--ink); }
.sw-avatar.player { background: var(--surface); border: 2px dashed var(--ink); font-size: 11px; }
.sw-avatar.flagged { border: 3px solid var(--bad); }
.sw-who { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sw-person-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 2px; border-radius: 999px; border: 1px solid var(--line);
                  background: none; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.sw-person-chip:hover { border-color: var(--accent); }
.sw-person-chip .sw-avatar { width: 26px; height: 26px; font-size: 10px; }
.sw-day-wrap { display: grid; gap: 3px; }
.sw-day { position: relative; display: flex; height: 26px; border-radius: 8px; overflow: hidden; background: var(--bg); }
.sw-band { display: flex; align-items: center; min-width: 2px; padding: 0 6px; overflow: hidden; background: var(--accent-soft); border-right: 2px solid var(--surface); }
.sw-band.alt { background: color-mix(in srgb, var(--accent) 38%, var(--surface)); }
.sw-band.none { background: repeating-linear-gradient(45deg, var(--bg) 0 5px, var(--raised) 5px 10px); }
.sw-band span { font-size: 11.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-day-mark { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1.5px; background: var(--ink); border-radius: 2px; }
.sw-day-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sw-busy { display: flex; align-items: flex-end; gap: 2px; height: 40px; padding: 2px; border-radius: 8px; background: var(--bg); }
.sw-busy-bar { flex: 1; background: color-mix(in srgb, var(--accent) 55%, var(--surface)); border-radius: 3px 3px 0 0; }
.sw-busy-bar.now { background: var(--ink); }
.sw-bonds { line-height: 1.9; }
.sw-more summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.sw-more[open] summary { margin-bottom: 6px; }
.sw-section { font: 650 13px/1.2 var(--ui-font); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 8px 0 0; }
.sw-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; position: relative; }
.sw-steps::before { content: ""; position: absolute; left: 47px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.sw-step { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 16px; position: relative; }
.sw-step-when, .sw-step-time { grid-column: 1; text-align: center; font-variant-numeric: tabular-nums; background: var(--surface); position: relative; z-index: 1; }
.sw-step-when { font-weight: 700; font-size: 14px; padding-top: 10px; }
.sw-step-time { font-size: 12px; color: var(--muted); align-self: start; }
.sw-step > .sw-card { grid-column: 2; grid-row: 1 / span 3; max-width: 760px; }
.sw-rungs::before { left: 21px; }
.sw-rungs .sw-step { grid-template-columns: 44px minmax(0, 1fr); }
.sw-rung { grid-column: 1; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font: 700 18px/1 var(--display-font);
           background: var(--accent-fill, var(--accent)); color: var(--accent-ink); position: relative; z-index: 1; }
.sw-rungs .sw-step > .sw-card { grid-row: 1; }
.sw-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.sw-stat { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.sw-stat b { font: 700 26px/1 var(--display-font); color: var(--ink); font-variant-numeric: tabular-nums; }
.sw-stat span { font-size: 13px; color: var(--muted); }
.sw-stat.bad { border-color: var(--bad); } .sw-stat.bad b { color: var(--bad); }
.sw-stat.warn b { color: var(--warn); } .sw-stat.good b { color: var(--ok); }
.sw-check { grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; }
.sw-check-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; border: 2px solid currentColor; flex: 0 0 auto; }
.sw-check-icon.ok, .sw-check-icon.good { color: var(--ok); } .sw-check-icon.bad { color: var(--bad); } .sw-check-icon.warn { color: var(--warn); }
.sw-check.ok { opacity: .8; }
.sw-change { display: flex; align-items: center; gap: 10px; }
.sw-change .sw-check-icon { width: 22px; height: 22px; font-size: 13px; }
.sw-side .sw-ladder .sw-steps::before, .sw-side .sw-rung { display: none; }
.sw-side .sw-rungs .sw-step { grid-template-columns: minmax(0, 1fr); }
.sw-side .sw-rungs .sw-step > .sw-card { grid-column: 1; }
.sw-card.sw-flash { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 699px) { .sw-card-go { display: none; } }
@media (max-width: 700px) { .sw-step { grid-template-columns: 64px minmax(0, 1fr); } .sw-steps::before { left: 31px; } .sw-card-head { flex-wrap: wrap; } }
.box.flagged { border-color: var(--bad); }
/* direct edits in the inspector (studio-world.js swEdit*) */
.sw-inspect-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.sw-inspect-head h3 { margin-bottom: 2px; }
.sw-form { display: grid; gap: 12px; margin-top: 8px; }
.sw-field { display: grid; gap: 5px; }
.sw-input { min-height: 32px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--field-line, var(--line)); background: var(--surface); color: var(--ink);
            font: inherit; font-size: 13px; min-width: 0; }
textarea.sw-input { resize: vertical; }
.sw-rows { display: grid; gap: 6px; }
.sw-row { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.sw-hours { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) 28px; gap: 4px 6px; align-items: center;
            padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.sw-hours > select.sw-input { grid-column: 1 / 4; }
.sw-hours > .sw-x { grid-column: 4; grid-row: 1 / 3; }
.sw-hours .sw-input[type=time] { width: 100%; }
.sw-row select.sw-input { flex: 1 1 120px; }
.sw-grow { flex: 1 1 140px; }
.sw-x { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.sw-x:hover { color: var(--bad); border-color: var(--bad); }
.sw-check-row { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.sw-check-chip { gap: 4px; cursor: pointer; }
.sw-form-actions { display: flex; gap: 8px; flex-wrap: wrap; position: sticky; bottom: 0; padding: 8px 0 2px; background: var(--surface); }
.sw-rung-edit { grid-template-columns: auto 72px auto minmax(0, 1fr); }
.sw-rung-edit > select.sw-input, .sw-rung-edit > input.sw-input:last-child { grid-column: 1 / -1; }
.sw-rewrite { border: 1px dashed var(--line); border-radius: 12px; padding: 8px 12px; display: grid; gap: 8px; }
.sw-rewrite[open] { border-style: solid; }
.sw-rewrite summary { cursor: pointer; font-size: 13px; font-weight: 650; color: var(--accent); }
.sw-rewrite .btn { justify-self: start; }
.sw-rules { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
/* ---- the Ideas assistant (2026-11-02 redesign): a writer's notebook beside the brief, not a chat app ----
   The co-writer's words are set in the story's own serif, like narration in play; the author's question is a quiet
   quoted line; ideas are index cards that go into a step; the brand's gold die marks it and tumbles while it thinks. */
.ideas-chat { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px 12px; }
.ideas-head { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.ideas-head b { font: 650 17px/1.2 var(--display-font); display: block; }
.ideas-head small { color: var(--muted); font-size: 12.5px; }
.ideas-mark { width: 30px; height: 30px; padding: 5px; gap: 1.5px; border-radius: 8px; flex: none; transform: rotate(-6deg); box-shadow: inset 0 -2px 0 rgba(85, 58, 27, .35), 0 3px 8px rgba(0, 0, 0, .25); }
.ideas-log { gap: 14px; padding: 12px 2px 4px; }
.ideas-intro p { margin: 0 0 10px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.ideas-starters { display: grid; gap: 6px; }
.ideas-starter { text-align: left; border: 1px dashed var(--line); background: none; color: var(--ink); border-radius: 12px; padding: 9px 12px;
                 font: inherit; font-size: 14px; cursor: pointer; min-height: 40px; }
.ideas-starter:hover { border-style: solid; border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
.ideas-starter:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ideas-msg { padding: 0; background: none; }
.ideas-msg.user { align-self: stretch; padding-left: 12px; border-left: 2px solid var(--line); }
.ideas-who { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.ideas-msg.user .ideas-text { font-size: 14px; color: var(--muted); }
.ideas-msg.assistant .ideas-text { font-size: 15px; line-height: 1.55; color: var(--ink); }
.ideas-working { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.ideas-die { width: 22px; height: 22px; padding: 4px; gap: 1px; border-radius: 6px; box-shadow: inset 0 -2px 0 rgba(85, 58, 27, .35); animation: ideas-tumble 1.1s ease-in-out infinite; }
@keyframes ideas-tumble { 0% { transform: rotate(0); } 50% { transform: rotate(180deg) scale(.9); } 100% { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ideas-die { animation: none; } }
body.a11y-motion .ideas-die { animation: none; }
.idea-card, .world-edits { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line);
                           box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 6%, transparent); }
.idea-where { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--gold-text); }
.idea-line { margin: 0; font-size: 14px; line-height: 1.5; }
.idea-more { margin: 0; font-size: 12.5px; color: var(--muted); }
.idea-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
.idea-card.added { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.idea-card.added .idea-where::after { content: " · added"; color: var(--ok); }
.world-edits { border-style: dashed; border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: color-mix(in srgb, var(--accent) 5%, var(--raised)); }
.world-edits .idea-where { color: var(--accent); }
.ideas-form textarea { border-radius: 14px; resize: none; min-height: 44px; max-height: 180px; overflow-y: auto; line-height: 1.45; }
.sw-case { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 28px; gap: 6px; align-items: center; }
@media (max-width: 700px) { .sw-case { grid-template-columns: minmax(0, 1fr) 28px; } .sw-case > :nth-child(2) { grid-column: 1; } .sw-case > .sw-x { grid-row: 1 / 3; grid-column: 2; } }
.sw-case-results { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.sw-case-result { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
/* the co-writer's icon buttons: send (paper airplane), attach (paperclip), clear (bin), stop (square) */
.ideas-icon { width: 36px; height: 36px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid var(--line);
              background: none; color: var(--muted); cursor: pointer; padding: 0; }
.ideas-icon svg { width: 18px; height: 18px; }
.ideas-icon:hover:not(:disabled) { color: var(--ink); border-color: var(--faint); }
.ideas-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ideas-icon:disabled { opacity: .45; cursor: default; }
.ideas-send { background: var(--accent-fill, var(--accent)); border-color: var(--accent-fill, var(--accent)); color: var(--accent-ink); }
.ideas-send:hover:not(:disabled) { color: var(--accent-ink); filter: brightness(1.08); }
.ideas-send.stopping { background: none; border-color: var(--line); color: var(--ink); }
.ideas-send svg { transform: translateX(-1px); }
.ideas-clear { width: 32px; height: 32px; border-color: transparent; }
.ideas-form-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
@media (pointer: coarse) { .ideas-icon { width: 44px; height: 44px; } .ideas-clear { width: 40px; height: 40px; } }
.ideas-icon[hidden] { display: none; }
