@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/fonts/SpaceGrotesk-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --canvas: #0b1220;
  --surface: #121d31;
  --surface-raised: #192741;
  --surface-field: #0d1729;
  --ink: #f2f5fb;
  --muted: #acb9cd;
  --muted-soft: #8091ac;
  --line: #2b3b57;
  --accent: #d2f27b;
  --accent-ink: #14200b;
  --accent-soft: #293a26;
  --signal: #ffac87;
  --signal-ink: #401f1a;
  --radius-panel: 16px;
  --radius-control: 10px;
  --content-width: 1460px;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  background: var(--canvas);
  color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  min-width: 320px;
  scrollbar-color: #52617b var(--canvas);
  scrollbar-width: thin;
  scroll-behavior: smooth;
}
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 5% 4%, rgb(45 69 112 / 22%), transparent 36rem),
    var(--canvas);
  color: var(--ink);
}
button, input, textarea, select { font: inherit; }
button, .file-button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: inherit; text-decoration-color: var(--muted-soft); text-underline-offset: .2em; }
button:disabled { cursor: not-allowed; opacity: .58; }

.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: #0d1525;
}
.topbar-content {
  display: flex;
  width: min(var(--content-width), calc(100% - 3.5rem));
  min-height: 82px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: .7rem; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; color: var(--accent); }
.brand-copy { display: grid; gap: .1rem; }
.brand-copy strong { font-size: 1.2rem; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.brand-copy small { color: var(--muted); font-size: .72rem; font-weight: 650; letter-spacing: .19em; }
.top-actions { display: flex; min-width: 0; align-items: center; gap: 1.25rem; }
.world-meta { display: flex; min-width: 0; align-items: center; gap: .65rem; color: var(--ink); font-size: .78rem; line-height: 1.4; }
.world-meta svg, .location-pin {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
}
.world-meta span { display: grid; gap: .05rem; }
.world-meta strong { max-width: 25ch; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.world-meta time { color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
.status-text { color: var(--muted); font-size: .74rem; }
#save-status { max-width: 205px; }
#save-status.is-error { color: var(--signal); }
.save-button, .primary-button {
  display: inline-flex;
  min-height: 42px;
  padding: .62rem .95rem;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .8rem;
  font-weight: 700;
  transition: filter .18s ease, transform .18s ease;
}
.save-button:hover, .primary-button:hover { filter: brightness(1.07); transform: translateY(-1px); }
.save-button:active, .primary-button:active { transform: translateY(0); }
.primary-button { min-width: 185px; white-space: nowrap; }
.primary-button::after {
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
}
.primary-button:disabled::after { display: none; }

.layout {
  display: grid;
  width: min(var(--content-width), calc(100% - 3.5rem));
  margin: 0 auto;
  padding: 2rem 0 3.5rem;
  align-items: start;
  gap: 1.7rem 1.35rem;
  grid-template-columns: minmax(0, 1.75fr) minmax(300px, .8fr);
  grid-template-areas:
    "story world"
    "timeline world";
}
.story-column { display: grid; min-width: 0; gap: 1.35rem; grid-area: story; }
.world-column { display: grid; min-width: 0; gap: 1rem; grid-area: world; }
.scene-card, .state-panel, .reference-panel, .support-panel, .timeline-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
}
.scene-card { overflow: hidden; animation: scene-arrive 620ms cubic-bezier(.18, .8, .24, 1) both; }
@keyframes scene-arrive {
  from { filter: blur(1.5px); transform: translateY(7px); }
  to { filter: blur(0); transform: translateY(0); }
}
.scene-image { position: relative; margin: 0; overflow: hidden; background: #1a2940; }
.scene-image::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgb(8 14 25 / 54%), transparent 68%), linear-gradient(0deg, rgb(8 14 25 / 78%), transparent 48%);
  content: "";
  pointer-events: none;
}
.scene-image img {
  display: block;
  width: 100%;
  aspect-ratio: 2.55 / 1;
  object-fit: cover;
  object-position: center 57%;
}
.scene-image figcaption {
  position: absolute;
  z-index: 1;
  right: 1.2rem;
  bottom: 1rem;
  left: 1.4rem;
  color: #e0e9f6;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.scene-heading-row { display: flex; margin: 1.5rem 1.65rem 0; align-items: flex-start; gap: .85rem; }
.location-pin { margin-top: .25rem; }
.location-copy { min-width: 0; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); }
h1 { margin-bottom: .25rem; font-size: clamp(2rem, 4vw, 3.45rem); font-weight: 650; letter-spacing: -.04em; line-height: 1.02; }
h2 { margin-bottom: .65rem; font-size: clamp(1.32rem, 2vw, 1.7rem); font-weight: 650; letter-spacing: -.04em; line-height: 1.15; }
h3 { margin-bottom: .45rem; font-size: .97rem; font-weight: 650; letter-spacing: -.02em; }
.scene-detail { margin: 0; color: var(--muted); font-size: .91rem; line-height: 1.5; }
.opening { max-width: 72ch; margin: 1.25rem 1.65rem 1.5rem; color: #d7e0ee; font-size: clamp(1rem, 1.35vw, 1.13rem); line-height: 1.7; }
.narration-wrap { margin: 0 1.65rem 1.3rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.narration { max-width: 72ch; margin: 0; color: #cbd7e8; font-size: .95rem; line-height: 1.65; }
.scene-divider { height: 1px; margin: 0 1.65rem; background: var(--line); }
.outcome-block { margin: 0; }
.outcome-content { margin: 1.15rem 1.65rem 1.45rem; }
.canonical-outcome { max-width: 72ch; margin: 0; color: #e2e9f3; font-size: 1.03rem; line-height: 1.68; }
.ending-wrap { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.ending { margin: 0; color: var(--signal); font-size: .98rem; line-height: 1.6; }

.decision-area { min-width: 0; padding: 1.35rem 0 0; border-top: 1px solid var(--line); }
.decision-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.decision-heading h2 { margin-bottom: .45rem; }
.suggestion-intro { max-width: 65ch; margin-bottom: .9rem; color: var(--muted); font-size: .85rem; line-height: 1.55; }
.refresh-button, .quiet-button {
  min-height: 39px;
  flex: 0 0 auto;
  padding: .55rem .75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--ink);
  font-size: .75rem;
  font-weight: 600;
  transition: border-color .16s ease, background .16s ease;
}
.refresh-button:hover, .quiet-button:hover { border-color: var(--accent); background: var(--accent-soft); }
.refresh-button:disabled { cursor: wait; opacity: .55; }
.suggestion-list { display: grid; }
.suggestion-option {
  display: grid;
  width: 100%;
  min-height: 62px;
  padding: .75rem .8rem;
  align-items: center;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  gap: .8rem;
  grid-template-columns: 25px minmax(0, 1fr) 12px;
  text-align: left;
  transition: background .16s ease;
}
.suggestion-option:last-child { border-bottom: 1px solid var(--line); }
.suggestion-option:hover, .suggestion-option:focus-visible { background: #19253b; }
.suggestion-icon { display: grid; width: 24px; height: 24px; place-items: center; color: var(--accent); }
.suggestion-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.suggestion-copy { display: grid; gap: .18rem; }
.suggestion-copy strong { font-size: .87rem; font-weight: 650; }
.suggestion-copy small { color: var(--muted); font-size: .76rem; line-height: 1.4; }
.suggestion-chevron { width: 8px; height: 8px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); transform: rotate(45deg); }
.suggestion-option:disabled { cursor: wait; opacity: .58; }
.suggestion-status { min-height: 1.25em; margin: .65rem 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }

.composer { margin-top: 1.1rem; }
.composer > label { display: block; margin-bottom: .5rem; color: var(--ink); font-size: .88rem; font-weight: 650; }
textarea {
  display: block;
  width: 100%;
  min-height: 118px;
  resize: vertical;
  padding: .95rem 1rem;
  border: 1px solid #3b4d6c;
  border-radius: 12px;
  background: var(--surface-field);
  color: var(--ink);
  caret-color: var(--accent);
  font-size: .95rem;
  line-height: 1.55;
  transition: border-color .16s ease, background .16s ease;
}
textarea:hover { border-color: #657695; }
textarea:focus { border-color: var(--accent); background: #101b2e; }
textarea::placeholder { color: #a3b0c5; opacity: 1; }
.composer.is-ended textarea { background: #151e2d; color: var(--muted); }
.composer-footer { display: flex; margin-top: .75rem; align-items: center; justify-content: space-between; gap: .75rem; }
.hint { color: var(--muted-soft); font-size: .72rem; line-height: 1.4; }
.stop-button {
  min-height: 40px;
  padding: .55rem .8rem;
  border: 1px solid #8b5048;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--signal);
  font-size: .8rem;
  font-weight: 600;
}
.stop-button:hover { background: #34212b; }
.error-message { margin: .7rem 0 0; padding: .7rem .8rem; border: 1px solid #815148; border-radius: var(--radius-control); background: #2d1c26; color: #ffc0a5; font-size: .8rem; line-height: 1.5; }
.time-skip-panel { margin-top: 1.15rem; border-top: 1px solid var(--line); }
.time-skip-panel summary { min-height: 53px; }
.time-skip-hint { margin-left: .35rem; color: var(--muted); font-size: .74rem; font-weight: 400; }
.time-skip-copy { max-width: 68ch; margin: 0 0 .85rem; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.time-skip-group { display: grid; grid-template-columns: 4rem minmax(0, 1fr); align-items: start; gap: .55rem; margin: 0 0 .65rem; }
.time-skip-group-label { padding-top: .5rem; color: var(--muted); font-size: .73rem; font-weight: 650; }
.time-skip-options { display: flex; flex-wrap: wrap; gap: .4rem; }
.time-skip-options button {
  min-height: 36px;
  padding: .45rem .62rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17243a;
  color: #dfe7f2;
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
  transition: border-color .16s ease, color .16s ease;
}
.time-skip-options button:hover { border-color: var(--accent); color: var(--accent); }
.time-skip-options button:disabled { cursor: wait; opacity: .55; }

.timeline-section { padding: 1.35rem 1.55rem 1.5rem; grid-area: timeline; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.section-heading h2 { margin: 0; }
.muted { color: var(--muted); font-size: .73rem; }
.timeline { margin: 1.2rem 0 0; padding: 0 0 0 1.05rem; border-left: 1px solid #52627c; list-style: none; }
.timeline li { position: relative; padding: 0 0 1.1rem 1rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { position: absolute; top: .19rem; left: -1.36rem; width: 8px; height: 8px; border: 2px solid var(--surface); border-radius: 50%; background: var(--accent); content: ""; }
.timeline time { color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
.timeline p { max-width: 70ch; margin: .28rem 0 0; color: #d8e1ee; font-size: .88rem; line-height: 1.55; }

.state-panel { padding: 1.25rem 1.3rem 1.35rem; }
.state-panel h2 { margin-bottom: .75rem; }
.stat-line { display: flex; min-height: 43px; padding: .58rem 0; align-items: baseline; justify-content: space-between; gap: .8rem; border-bottom: 1px solid #293a54; color: var(--muted); font-size: .82rem; }
.stat-line strong { max-width: 64%; color: var(--ink); font-size: .83rem; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.next-event { margin-top: 1rem; padding-top: .95rem; border-top: 1px solid var(--line); }
.next-event h3 { margin-bottom: .3rem; color: var(--accent); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; }
.next-event p { margin: 0; color: #dce5f1; font-size: .88rem; line-height: 1.5; }
.reference-panel { padding: .25rem 1.1rem; }
.reference-panel details, .support-panel details { border-bottom: 1px solid #293a54; }
.reference-panel details:last-child, .support-panel details:last-child { border-bottom: 0; }
summary { display: flex; min-height: 51px; align-items: center; gap: .7rem; color: var(--ink); cursor: pointer; font-size: .81rem; font-weight: 600; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { width: 8px; height: 8px; margin-left: auto; flex: 0 0 auto; border-top: 1.7px solid var(--muted); border-right: 1.7px solid var(--muted); content: ""; transform: rotate(45deg); transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
details[open] > summary::after { transform: rotate(135deg); }
.accordion-icon { width: 21px; height: 21px; flex: 0 0 auto; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.summary-count { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }
summary .summary-count { margin-left: auto; }
.plain-list { display: grid; gap: .48rem; margin: 0; padding: 0 0 .9rem 1.8rem; color: #d0d9e7; font-size: .76rem; line-height: 1.45; list-style: none; }
.plain-list li { display: flex; justify-content: space-between; gap: .6rem; }
.plain-list li span:first-child { overflow-wrap: anywhere; }
.plain-list li span:last-child { color: var(--muted); text-align: right; }
.empty-row { color: var(--muted); font-style: italic; }
.panel-copy { margin: 0 0 .7rem; padding-left: 1.8rem; color: var(--muted); font-size: .74rem; line-height: 1.55; }
.support-panel { padding: .15rem 1.1rem; }
.support-panel details[open] > :not(summary) { max-width: 100%; }
.saves-panel, .model-panel { padding-bottom: .9rem; }
.field-label { display: block; margin: .7rem 0 .35rem; color: #d9e2ef; font-size: .74rem; font-weight: 600; }
select, input {
  width: 100%;
  min-height: 41px;
  padding: .55rem .65rem;
  border: 1px solid #435471;
  border-radius: 9px;
  background: var(--surface-field);
  color: var(--ink);
}
select option { background: var(--surface); color: var(--ink); }
input { caret-color: var(--accent); }
.button-row { display: flex; flex-wrap: wrap; gap: .42rem; margin-top: .55rem; }
.small-button {
  min-height: 36px;
  padding: .48rem .62rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17243a;
  color: #e1e8f2;
  font-size: .73rem;
  font-weight: 600;
  transition: border-color .16s ease, background .16s ease;
}
.small-button:hover { border-color: var(--accent); background: #1b2d3e; }
.danger-button { color: #ffb39d; }
.file-button { display: inline-flex; align-items: center; }
.privacy-note, .trust-note { margin: .7rem 0 0; color: var(--muted); font-size: .72rem; line-height: 1.55; }
.model-panel h2 { margin: .2rem 0 .5rem; font-size: 1.12rem; }
.model-copy { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.key-entry { display: flex; gap: .45rem; }
.key-entry input { min-width: 0; font-size: .78rem; }
.key-entry button { flex: 0 0 auto; }
.text-button { margin-top: .6rem; padding: 0; border: 0; background: none; color: var(--accent); font-size: .75rem; text-decoration: underline; text-underline-offset: 3px; }
.model-panel > .status-text { display: block; margin: .7rem 0 0; color: var(--muted); line-height: 1.5; }
.demo-banner { padding: .8rem 1rem; border: 1px solid #8b6f45; border-radius: var(--radius-control); background: #332919; color: #ffe0a1; font-size: .8rem; line-height: 1.5; }
footer { display: flex; padding: 1.05rem max(1.75rem, calc((100% - var(--content-width)) / 2)); justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .72rem; }

.account-name { color: var(--muted); font-size: .74rem; white-space: nowrap; }
a.quiet-button { display: inline-flex; align-items: center; text-decoration: none; }
.eyebrow { margin: .2rem 0 .3rem; color: var(--accent); font-size: .66rem; font-weight: 700; letter-spacing: .14em; }
.copy-local { margin-top: .6rem; }
.dialog { width: min(420px, calc(100% - 2rem)); padding: 1.4rem; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); color: var(--ink); }
.dialog::backdrop { background: rgb(5 9 17 / 70%); }
.dialog h2 { margin: 0 0 .4rem; font-size: 1.35rem; }
.dialog-copy { margin: 0 0 .6rem; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.dialog-actions { justify-content: flex-end; margin-top: 1.1rem; }
.dialog-submit { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.dialog-submit:hover { background: var(--accent); filter: brightness(1.07); }
.account-layout { width: min(1080px, calc(100% - 2rem)); margin: 0 auto; padding: 2.5rem 0 4rem; display: grid; gap: 1.25rem; }
.account-layout > * { min-width: 0; }
.account-panel { padding: 1.4rem; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); }
.account-panel h2 { margin: 0 0 .4rem; }
.account-panel h3 { margin: 1.6rem 0 .2rem; font-size: 1rem; }
.account-panel .panel-copy { padding-left: 0; }
#password-form { max-width: 360px; }
.table-wrap { position: relative; overflow-x: auto; margin-top: .8rem; }
.user-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: .78rem; }
.user-table th { padding: .5rem .6rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.user-table td { padding: .55rem .6rem; border-bottom: 1px solid #293a54; vertical-align: middle; }
.user-table select { width: auto; min-width: 5.5rem; min-height: 32px; padding: .3rem .4rem; font-size: .75rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.create-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 700px) { .create-grid { grid-template-columns: 1fr; } .account-name { display: none; } .top-actions { flex-wrap: wrap; justify-content: flex-end; } }

@media (max-width: 1080px) {
  .topbar-content, .layout { width: min(920px, calc(100% - 2.5rem)); }
  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "story" "world" "timeline";
    gap: 1.25rem;
    padding-top: 1.4rem;
  }
  .world-column { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .state-panel { grid-column: 1 / -1; }
  .reference-panel, .support-panel { min-width: 0; }
}
@media (max-width: 690px) {
  .topbar-content { min-height: 76px; width: calc(100% - 1.25rem); flex-wrap: wrap; padding: .55rem 0; gap: .4rem .6rem; }
  .brand { gap: .45rem; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-copy strong { font-size: 1rem; }
  .brand-copy small { font-size: .7rem; letter-spacing: .13em; }
  .top-actions { flex: 1 1 auto; flex-wrap: wrap; justify-content: flex-end; gap: .3rem .6rem; }
  .world-meta { order: 1; }
  .save-button { order: 2; }
  .world-meta { gap: .42rem; font-size: .7rem; }
  .world-meta svg { width: 18px; height: 18px; }
  .world-meta strong { max-width: 18ch; }
  .world-meta time { font-size: .7rem; }
  #save-status { display: block; flex-basis: 100%; order: 3; max-width: none; font-size: .72rem; text-align: right; }
  .save-button { min-height: 37px; padding: .5rem .62rem; font-size: .71rem; }
  .layout { width: calc(100% - 1.25rem); padding: .85rem 0 2.25rem; gap: 1rem; }
  .story-column, .world-column { gap: 1rem; }
  .scene-card, .state-panel, .reference-panel, .support-panel, .timeline-section { border-radius: 13px; }
  .scene-image img { aspect-ratio: 1.8 / 1; }
  .scene-image figcaption { right: .8rem; bottom: .65rem; left: .9rem; font-size: .7rem; }
  .scene-heading-row { margin: 1.1rem 1rem 0; gap: .6rem; }
  h1 { font-size: clamp(1.8rem, 9vw, 2.55rem); }
  h2 { font-size: 1.32rem; }
  .scene-detail { font-size: .82rem; }
  .opening { margin: .95rem 1rem 1.1rem; font-size: .96rem; line-height: 1.62; }
  .narration-wrap { margin: 0 1rem 1rem; }
  .scene-divider { margin: 0 1rem; }
  .outcome-content { margin: .95rem 1rem 1.1rem; }
  .canonical-outcome { font-size: .97rem; }
  .decision-area { padding-top: 1rem; }
  .decision-heading { flex-wrap: wrap; gap: .2rem .7rem; }
  .decision-heading > div { flex: 1 1 220px; }
  .suggestion-intro { margin-bottom: .65rem; font-size: .79rem; }
  .refresh-button { min-height: 35px; padding: .42rem .58rem; font-size: .7rem; }
  .suggestion-option { min-height: 58px; padding: .65rem .55rem; gap: .55rem; grid-template-columns: 22px minmax(0, 1fr) 10px; }
  .suggestion-copy strong { font-size: .81rem; }
  .suggestion-copy small { font-size: .72rem; }
  textarea { min-height: 112px; padding: .8rem; font-size: .9rem; }
  .composer-footer { align-items: stretch; flex-direction: column; }
  .primary-button, .stop-button { width: 100%; }
  .hint { order: 2; text-align: center; }
  .time-skip-hint { display: block; margin: .1rem 0 0; }
  .time-skip-group { grid-template-columns: 1fr; gap: .25rem; }
  .time-skip-group-label { padding-top: 0; }
  .world-column { grid-template-columns: minmax(0, 1fr); }
  .state-panel { grid-column: auto; }
  .timeline-section { padding: 1rem; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: .25rem; }
  footer { padding: .9rem 1rem; flex-direction: column; gap: .4rem; }
}
@media (max-width: 390px) {
  .topbar-content { min-height: 72px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-copy strong { font-size: .91rem; }
  .brand-copy small { display: none; }
  .world-meta { font-size: .7rem; }
  .world-meta strong { max-width: 12ch; }
  .world-meta time { font-size: .7rem; }
  .save-button { min-height: 36px; padding: .4rem .5rem; font-size: .7rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
