/* =========================================================================
   Reference-API Live Demo · Barmenia Gothaer corporate
   --------------------------------------------------------------------------
   Layout: fixed 3-column grid. Geometry never shifts between scenarios.
   ======================================================================= */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Source+Sans+3:wght@400;500;600;700&display=swap');

:root {
  /* Brand */
  --bg-navy:        #0d2340;   /* primary */
  --bg-navy-deep:   #061629;
  --bg-navy-soft:   #1a3357;
  --bg-gold:        #c98f3a;   /* accent (warm, not the cartoon orange) */
  --bg-gold-soft:   #e8c98a;

  /* Surfaces */
  --paper:          #f5f1ea;   /* warm off-white */
  --paper-2:        #ece6db;
  --ink:            #0d2340;
  --ink-soft:       #4a5c75;
  --ink-mute:       #7a8aa1;
  --hairline:       #d9d2c4;
  --hairline-soft:  #e5e0d3;

  /* Code panel — slightly different cool navy so it reads as a console */
  --code-bg:        #0f1d36;
  --code-bg-2:      #142745;
  --code-fg:        #e6ecf5;
  --code-mute:      #8aa1c2;

  /* Syntax */
  --tok-key:    #f5b964;
  --tok-str:    #9bd9a3;
  --tok-num:    #f0a3c1;
  --tok-bool:   #c5a0ff;
  --tok-null:   #c5a0ff;
  --tok-punct:  #8aa1c2;

  /* HTTP */
  --c-post:   #2f7a4f;
  --c-get:    #2660a8;
  --c-put:    #a35e1a;
  --c-delete: #a83232;

  /* Status */
  --c-success: #2f7a4f;
  --c-pending: #a35e1a;
  --c-error:   #a83232;

  /* Sizing */
  --topbar-h:    66px;
  --bottombar-h: 64px;
  --col-side:    480px;
  --gap:         18px;
  --pad:         22px;
  --radius:      10px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body, #root {
  margin: 0; padding: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Source Sans 3', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overflow: hidden; }

/* =========================================================================
   App shell
   ======================================================================= */

.app {
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr var(--bottombar-h);
  height: 100vh;
  width: 100vw;
  background:
    radial-gradient(1200px 600px at 50% -300px, rgba(13, 35, 64, 0.06), transparent 70%),
    var(--paper);
}

/* =========================================================================
   Top bar
   ======================================================================= */

.topbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto minmax(280px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--hairline);
  box-shadow: 0 1px 0 rgba(13, 35, 64, 0.04);
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand-logo { height: 36px; width: auto; display: block; }
.brand-divider { width: 1px; height: 28px; background: var(--hairline); }
.brand-title-main {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.brand-title-sub {
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Server selector */
.server-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  padding: 4px 4px 4px 14px;
  border-radius: 999px;
}
.ss-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.ss-options { display: flex; gap: 2px; }
.ss-opt {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 7px 14px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  border-radius: 999px;
  cursor: pointer;
  transition: background 120ms, color 120ms;
  white-space: nowrap;
}
.ss-opt:hover { color: var(--ink); }
.ss-opt.is-active {
  background: var(--bg-navy);
  color: #fff;
  box-shadow: 0 1px 2px rgba(13, 35, 64, 0.2);
}
.ss-url-input {
  appearance: none;
  border: 0;
  background: #fff;
  border: 1px solid var(--hairline);
  padding: 6px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 12.5px;
  width: 280px;
  color: var(--ink);
  outline: none;
}
.ss-url-input:focus { border-color: var(--bg-navy); }

.topbar-right { display: flex; align-items: center; gap: 18px; justify-content: flex-end; }

.slide-counter {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.sc-num { font-size: 22px; color: var(--bg-navy); }
.sc-sep { color: var(--ink-mute); }
.sc-total { color: var(--ink-mute); }

/* =========================================================================
   Stage — the fixed three-column area
   ======================================================================= */

.stage {
  display: grid;
  grid-template-columns: var(--col-side) 1fr var(--col-side);
  gap: var(--gap);
  padding: var(--gap);
  min-height: 0; /* allow children to scroll */
  overflow: hidden;
}

.panel {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(13, 35, 64, 0.04);
  position: relative;
}

/* Header strip on each panel */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--hairline-soft);
  background: linear-gradient(180deg, #fbf9f4 0%, #fff 100%);
  flex-shrink: 0;
  min-height: 46px;
}

.panel-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.panel-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline-soft);
  flex-shrink: 0;
}
.panel-section:last-child { border-bottom: 0; }
.panel-section-grow {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.section-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* =========================================================================
   Request panel
   ======================================================================= */

.panel-request {
  background:
    linear-gradient(180deg, #fff 0%, #fbf9f4 100%);
}

.send-btn {
  appearance: none;
  border: 0;
  background: var(--bg-navy);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 80ms, background 120ms, box-shadow 120ms;
  box-shadow: 0 1px 2px rgba(13, 35, 64, 0.18);
}
.send-btn:hover { background: var(--bg-navy-soft); }
.send-btn:active { transform: translateY(1px); }
.send-btn:disabled { opacity: 0.7; cursor: progress; }
.send-btn.is-sending { background: var(--bg-navy-soft); }

.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 999px;
  animation: spin 700ms linear infinite;
}
.spinner-sm { width: 10px; height: 10px; border-width: 1.5px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* method + path line */
.req-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #fbf9f4;
  border-bottom: 1px solid var(--hairline-soft);
  flex-shrink: 0;
}

.method-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 4px;
  color: #fff;
  min-width: 50px;
}
.method-post   { background: var(--c-post); }
.method-get    { background: var(--c-get); }
.method-put    { background: var(--c-put); }
.method-delete { background: var(--c-delete); }

.req-path {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  word-break: break-all;
}

/* Headers list */
.header-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
}
.header-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  padding: 3px 0;
  border-bottom: 1px dotted var(--hairline-soft);
}
.header-row:last-child { border-bottom: 0; }
.header-key {
  color: var(--ink-soft);
  font-weight: 500;
}
.header-val {
  color: var(--ink);
  word-break: break-all;
}
.header-row-empty {
  color: var(--ink-mute);
  font-style: italic;
}

/* =========================================================================
   Variant picker — shown between req-line and Headers when ≥ 2 variants
   ======================================================================= */

.variant-picker {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--hairline-soft);
  background: var(--paper);
  flex-shrink: 0;
}

.variant-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  text-align: left;
  width: 100%;
  color: var(--ink-soft);
  transition: background 120ms, border-color 120ms, color 120ms;
}
.variant-chip:hover {
  background: rgba(13, 35, 64, 0.05);
  color: var(--ink);
}
.variant-chip.is-active {
  background: rgba(13, 35, 64, 0.08);
  border-color: rgba(13, 35, 64, 0.18);
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--bg-navy);
}

.chip-label {
  flex: 1 1 auto;
  line-height: 1.3;
}

/* Status badges for variant chips */
.chip-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
  min-width: 34px;
  letter-spacing: 0.02em;
}
.cb-success     { background: rgba(47, 122, 79, 0.12);  color: #2a6e47; border: 1px solid rgba(47, 122, 79, 0.28); }
.cb-pending     { background: rgba(38, 96, 168, 0.12);  color: #2660a8; border: 1px solid rgba(38, 96, 168, 0.28); }
.cb-teal        { background: rgba(16, 128, 116, 0.12); color: #107074; border: 1px solid rgba(16, 128, 116, 0.28); }
.cb-amber       { background: rgba(163, 94, 26, 0.12);  color: #a35e1a; border: 1px solid rgba(163, 94, 26, 0.28); }
.cb-orange      { background: rgba(180, 90, 0, 0.12);   color: #b45a00; border: 1px solid rgba(180, 90, 0, 0.28); }
.cb-unprocessable { background: rgba(168, 50, 50, 0.10); color: #943030; border: 1px solid rgba(168, 50, 50, 0.25); }
.cb-error       { background: rgba(168, 50, 50, 0.12);  color: #a83232; border: 1px solid rgba(168, 50, 50, 0.28); }
.cb-neutral     { background: var(--paper-2); color: var(--ink-soft); border: 1px solid var(--hairline); }

/* Code block (JSON) */
.code-block {
  margin: 0;
  background: var(--code-bg);
  color: var(--code-fg);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  line-height: 1.55;
  padding: 14px 16px;
  border-radius: 6px;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  white-space: pre;
}
.json-line { white-space: pre; }

.tok-key   { color: var(--tok-key); }
.tok-str   { color: var(--tok-str); }
.tok-num   { color: var(--tok-num); }
.tok-bool  { color: var(--tok-bool); }
.tok-null  { color: var(--tok-null); font-style: italic; }
.tok-punct { color: var(--tok-punct); }

/* =========================================================================
   Response panel
   ======================================================================= */

.resp-meta { display: flex; align-items: center; gap: 10px; }
.resp-meta-pending, .resp-meta-idle {
  font-size: 12px;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  gap: 8px;
}
.resp-meta-pending .spinner {
  border-color: rgba(13,35,64,0.2); border-top-color: var(--bg-navy);
}
.idle-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--hairline);
  border: 1px solid var(--ink-mute);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 8px 4px 6px;
  border-radius: 4px;
  background: var(--paper);
}
.status-badge .sb-num {
  font-weight: 700;
  font-size: 12px;
}
.status-success { background: rgba(47, 122, 79, 0.10); color: var(--c-success); border: 1px solid rgba(47, 122, 79, 0.25); }
.status-pending { background: rgba(163, 94, 26, 0.10); color: var(--c-pending); border: 1px solid rgba(163, 94, 26, 0.30); }
.status-error   { background: rgba(168, 50, 50, 0.10); color: var(--c-error);   border: 1px solid rgba(168, 50, 50, 0.25); }
.status-neutral { background: var(--paper); color: var(--ink-soft); border: 1px solid var(--hairline); }

.resp-time {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--ink-mute);
}

/* Empty / loading states inside response panel */
.panel-empty-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--ink-mute);
  text-align: center;
  gap: 16px;
}
.panel-empty-body p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}
.panel-empty-body em {
  font-style: normal;
  font-weight: 600;
  color: var(--ink-soft);
}
.empty-icon { color: var(--hairline); }

.panel-loading {
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--ink-mute);
  font-size: 13px;
}
.loading-track {
  width: 80%;
  height: 3px;
  background: var(--paper-2);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.loading-bar {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--bg-navy), transparent);
  width: 40%;
  animation: load-slide 1.4s ease-in-out infinite;
}
@keyframes load-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* Polling log */
.poll-log {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.poll-step {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--paper);
  border: 1px solid var(--hairline-soft);
  border-radius: 6px;
  animation: poll-in 280ms ease-out;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, box-shadow 120ms;
}
.poll-step:hover { background: var(--paper-2); }
.poll-step.is-active {
  background: rgba(13, 35, 64, 0.07);
  border-color: rgba(13, 35, 64, 0.2);
  box-shadow: inset 3px 0 0 var(--bg-navy);
}
.poll-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-mute);
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 2px 6px;
}
.poll-call {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--ink);
  word-break: break-all;
}
.poll-time {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--ink-mute);
}
.poll-step-source {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--bg-navy);
  background: rgba(13, 35, 64, 0.08);
  border: 1px solid rgba(13, 35, 64, 0.15);
  padding: 2px 7px;
  border-radius: 4px;
}

.poll-step-reset {
  appearance: none;
  border: 1px solid var(--hairline);
  background: var(--paper);
  color: var(--ink-mute);
  font-size: 11px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 120ms;
}
.poll-step-reset:hover { background: var(--paper-2); color: var(--ink); }

.poll-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--c-pending);
  text-transform: none;
  letter-spacing: 0;
}
.poll-pill .spinner {
  border-color: rgba(163, 94, 26, 0.25);
  border-top-color: var(--c-pending);
}

@keyframes poll-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Subtle motion when a request goes out / response arrives */
.panel-request.is-flying::after,
.panel-response.is-arrived::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--bg-gold), transparent);
  animation: flash-bar 700ms ease-out;
  pointer-events: none;
}
@keyframes flash-bar {
  from { opacity: 0; transform: scaleX(0.2); }
  to   { opacity: 0; transform: scaleX(1); }
}
.panel-response.is-arrived {
  animation: response-pulse 600ms ease-out;
}
@keyframes response-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(201, 143, 58, 0.0); }
  30%  { box-shadow: 0 0 0 3px rgba(201, 143, 58, 0.25); }
  100% { box-shadow: 0 1px 2px rgba(13, 35, 64, 0.04); }
}

/* =========================================================================
   Story (centre) panel
   ======================================================================= */

.panel-story {
  background: linear-gradient(180deg, #fff 0%, #fbf9f4 100%);
  display: flex;
  flex-direction: column;
}

.story-imagewrap {
  flex: 0 0 auto;
  position: relative;
  height: 46%;
  min-height: 280px;
  overflow: hidden;
  background: var(--bg-navy-deep);
}
.story-image {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.story-image-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 -60px 80px -30px rgba(13, 35, 64, 0.45);
  border-bottom: 3px solid var(--bg-gold);
}

.story-text {
  flex: 1 1 auto;
  padding: 28px 36px 24px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.story-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bg-gold);
  margin-bottom: 10px;
}

.story-title {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 700;
  font-size: 32px;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.story-subtitle {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 500;
  font-size: 17px;
  line-height: 1.3;
  color: var(--ink-soft);
  margin: 0 0 18px;
}

.story-body {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 12px;
  text-wrap: pretty;
  max-width: 64ch;
}

.story-bullets {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.story-bullets li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 14px;
  align-items: start;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}
.bullet-mark {
  display: block;
  width: 10px; height: 10px;
  background: var(--bg-gold);
  margin-top: 7px;
  transform: rotate(45deg);
}
.story-subbullets {
  margin-top: 8px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.story-subbullets li {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ink-soft);
}
.subbullet-mark {
  display: block;
  width: 6px; height: 6px;
  border: 1.5px solid var(--bg-gold);
  margin-top: 5px;
  transform: rotate(45deg);
  flex-shrink: 0;
}

.story-links {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.story-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-left: 4px solid var(--bg-gold);
  border-radius: 6px;
  text-decoration: none;
  transition: transform 100ms, box-shadow 120ms;
}
.story-link:hover {
  box-shadow: 0 4px 12px rgba(13, 35, 64, 0.08);
  transform: translateY(-1px);
}
.story-link-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.story-link-url {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--ink-soft);
  word-break: break-all;
}

.story-contact {
  margin-top: 18px;
  padding: 18px 20px;
  background: var(--bg-navy);
  color: #fff;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}
.story-contact-person { min-width: 0; }
.story-contact-person--right { text-align: right; }
.contact-name { font-weight: 700; font-size: 18px; }
.contact-role { font-size: 13px; color: var(--bg-gold-soft); margin: 2px 0 10px; }
.contact-email {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255,255,255,0.4);
}

.story-hints {
  margin-top: 18px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-navy) 4%, transparent);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hint-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.45;
}
.hint-label {
  flex-shrink: 0;
  width: 62px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--bg-navy);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hint-text {
  color: var(--ink-soft);
}

.story-meta {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}

/* =========================================================================
   Bottom bar
   ======================================================================= */

.bottombar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: #fff;
  border-top: 1px solid var(--hairline);
  z-index: 5;
}

.nav-btn {
  appearance: none;
  width: 40px; height: 40px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  border-radius: 999px;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 120ms;
}
.nav-btn:hover:not(:disabled) {
  background: var(--bg-navy);
  color: #fff;
  border-color: var(--bg-navy);
}
.nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.scenario-rail {
  display: flex;
  gap: 6px;
  justify-content: center;
  overflow: auto;
  padding: 4px 0;
}
.rail-pill {
  appearance: none;
  border: 1px solid var(--hairline);
  background: var(--paper);
  font: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all 120ms;
  white-space: nowrap;
}
.rail-pill:hover { color: var(--ink); border-color: var(--ink-mute); }
.rail-pill.is-active {
  background: var(--bg-navy);
  color: #fff;
  border-color: var(--bg-navy);
}
.rail-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(255,255,255,0.18);
  padding: 2px 6px;
  border-radius: 4px;
}
.rail-pill:not(.is-active) .rail-num {
  background: #fff;
  border: 1px solid var(--hairline);
  color: var(--ink-mute);
}
.rail-label { font-size: 12.5px; font-weight: 500; }

/* =========================================================================
   Scrollbars (subtle, brand-neutral)
   ======================================================================= */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--hairline);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover { background: var(--ink-mute); }

.code-block::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }
.code-block::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

/* =========================================================================
   Smaller viewport guard — keep the 3-col layout but shrink side cols a bit
   ======================================================================= */
@media (max-width: 1500px) {
  :root { --col-side: 420px; }
  .story-text { padding: 22px 28px 18px; }
  .story-title { font-size: 28px; }
}
@media (max-width: 1300px) {
  :root { --col-side: 360px; --gap: 14px; }
  .story-title { font-size: 24px; }
  .ss-options .ss-opt { padding: 6px 10px; font-size: 11.5px; }
  .ss-url-input { width: 200px; }
}

.story-text--qr {
  flex-direction: row;
  gap: 20px;
  overflow: hidden;
}

.story-text-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: auto;
}

.story-qrcode-aside {
  flex: 0 0 clamp(180px, 36%, 280px);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}
