/* =========================================================
   ARC Response: Landfall — warm "storybook field-ops" skin
   Full-bleed map stage with floating instruments.
   ARC red stays reserved for emergencies + the brand cross.
   ========================================================= */
:root {
  --paper: #f2e6c9;
  --paper-deep: #e6d6b2;
  --panel: #fdf6e4;
  --panel-warm: #f8eed6;
  --ink: #46351f;
  --ink-soft: #6f5a3c;
  --ink-faint: #9b8462;
  --line: #d9c69d;
  --line-soft: #e9dcbc;
  --wood: #8a6844;
  --wood-deep: #64492c;
  --red: #d5192c;
  --red-deep: #a90f1f;
  --red-wash: #f9e3de;
  --amber: #b4720f;
  --amber-wash: #f7ecd0;
  --green: #4c7d36;
  --green-wash: #e8efd6;
  --water: #43809a;
  --water-wash: #ddebe4;
  --gold: #eda832;
  --gold-deep: #c8871a;
  --focus: #8a5a1e;

  --font-display: "Fredoka", "Trebuchet MS", sans-serif;
  --font-body: "Nunito Sans", "Avenir Next", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;
  /* CJK glyphs fall through to these; Latin text keeps the display/body faces above */
  --font-cjk: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 4px rgba(70,53,31,.14), 0 8px 22px rgba(70,53,31,.14);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
html.lang-zh {
  --font-display: "Fredoka", "Trebuchet MS", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-body: "Nunito Sans", "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Menlo, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", monospace;
}
html.lang-zh body { letter-spacing: 0; }
html.lang-zh h1, html.lang-zh h2, html.lang-zh h3 { letter-spacing: 0; }
body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
}
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; letter-spacing: .01em; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- brand cross ---------- */
.cross-mark {
  display: inline-block; width: 34px; height: 34px; position: relative; flex: none;
  background: #fff; border: 2px solid var(--wood); border-radius: 8px;
}
.cross-mark::before, .cross-mark::after {
  content: ""; position: absolute; background: var(--red); left: 50%; top: 50%;
  transform: translate(-50%, -50%); border-radius: 1px;
}
.cross-mark::before { width: 9px; height: 22px; }
.cross-mark::after  { width: 22px; height: 9px; }
.cross-mark.small { width: 30px; height: 30px; }
.cross-mark.small::before { width: 8px; height: 19px; }
.cross-mark.small::after  { width: 19px; height: 8px; }

/* ---------- buttons ---------- */
.btn {
  border: 2px solid var(--wood); background: var(--panel); color: var(--ink);
  border-radius: 10px; padding: 7px 14px; font-weight: 700; font-size: 13px;
  box-shadow: 0 2px 0 rgba(70,53,31,.18);
}
.btn:hover { background: var(--panel-warm); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--gold); border-color: var(--gold-deep); color: #4a3005; }
.btn-primary:hover { background: #f5b544; }
.btn-danger { background: var(--red); border-color: var(--red-deep); color: #fff; }
.btn-danger:hover { background: var(--red-deep); }
.btn-ghost { border-color: var(--line); color: var(--ink-soft); font-weight: 600; box-shadow: none; }
.btn-ghost:hover { border-color: var(--wood); background: var(--panel); }
.btn-big { font-size: 16px; padding: 12px 26px; font-family: var(--font-display); }
.btn-sm { padding: 3px 9px; font-size: 12px; border-radius: 8px; }

/* =========================================================
   START SCREEN
   ========================================================= */
.start-screen {
  position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 24px;
  overflow: hidden; background: var(--paper);
}
/* a light warm wash so the card stays crisp on the footage */
.start-screen::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(253,246,228,0) 40%, rgba(60,48,30,.12) 100%); pointer-events: none; }
/* welcome step: glassier, bigger, lets the footage through */
.start-welcome h1 { font-size: 84px; }
.start-welcome .start-blurb { font-size: 18px; max-width: 520px; }
.start-hero {
  position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 36px; align-items: center; width: 100%; max-width: 1180px;
}
/* minimal two-step landing: welcome first, then the setup card in the same spot */
.start-hero.minimal { display: flex; justify-content: flex-start; align-items: center; max-width: none; width: 100%; min-height: calc(100vh - 64px); }
/* welcome: no box — copy sits on the footage over a soft warm scrim on the left */
.start-welcome { position: relative; width: min(600px, 100%); padding: 0 0 0 6vw; text-align: left; }
.start-screen.welcoming::after {
  background: linear-gradient(90deg, rgba(253,246,228,.9) 0%, rgba(253,246,228,.72) 24%, rgba(253,246,228,.2) 42%, rgba(253,246,228,0) 52%);
}
.start-welcome .lang-toggle { position: fixed; top: 18px; right: 22px; z-index: 2; }
.start-welcome .start-kicker { color: var(--ink-soft); }
.start-welcome .start-blurb { color: var(--ink); text-shadow: 0 1px 0 rgba(253,246,228,.9); }
.start-welcome h1 { text-shadow: 0 2px 0 rgba(253,246,228,.9), 0 8px 24px rgba(50,35,15,.15); }
.start-welcome .resume-card { background: rgba(253,246,228,.9); }
.start-welcome .start-brand { margin: 6px 0 12px; }
.start-welcome h1 { font-size: 64px; line-height: .95; }
.cross-mark.big { width: 56px; height: 56px; border-radius: 12px; }
.cross-mark.big::before { width: 30%; height: 66%; } .cross-mark.big::after { width: 66%; height: 30%; }
.start-welcome .start-blurb { font-size: 16px; line-height: 1.55; margin: 6px 0 22px; max-width: 520px; }
.start-cta { display: flex; align-items: center; gap: 12px; }
.start-cta .btn-big { padding: 15px 36px; font-size: 18px; box-shadow: 0 6px 0 rgba(120,80,10,.25), 0 12px 30px rgba(50,35,15,.25); }
.start-back { position: absolute; top: 14px; left: 16px; }
.start-hero.minimal .start-card { justify-self: auto; max-width: 600px; padding-top: 44px; margin-left: 6vw; }
.start-hero.minimal .start-card .lang-toggle { display: none; }
.start-intro { color: var(--ink); padding: 18px 22px; border-radius: 16px; background: rgba(253,246,228,.78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1.5px solid rgba(138,104,68,.35); box-shadow: 0 10px 30px rgba(50,35,15,.18); }
.start-intro .start-brand { margin-bottom: 10px; }
.start-intro h1 { font-size: 64px; line-height: .95; letter-spacing: -.01em; }
.start-intro .start-blurb { font-size: 15.5px; line-height: 1.55; max-width: 560px; }
.start-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 14px; max-width: 600px; }
.st-tile {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px;
  background: rgba(255,253,244,.85); border: 1.5px solid rgba(138,104,68,.45);
  box-shadow: 0 2px 8px rgba(70,53,31,.12);
}
.st-tile .st-ico { font-size: 22px; line-height: 1.1; flex: none; }
.st-tile > div { display: flex; flex-direction: column; gap: 2px; }
.st-tile b { font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.st-tile span { font-size: 12px; color: var(--ink-soft); }
.start-strip { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.start-strip span { background: rgba(253,246,228,.6); padding: 3px 9px; border-radius: 999px; border: 1px solid rgba(138,104,68,.3); }
.start-card {
  background: rgba(253,246,228,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 2.5px solid var(--wood); border-radius: 18px; box-shadow: 0 18px 50px rgba(50,35,15,.28), var(--shadow);
  max-width: 560px; width: 100%; padding: 30px 32px 26px; justify-self: end;
  border-top: 8px solid var(--red);
}
.start-card-head { margin: 4px 0 16px; display: flex; flex-direction: column; gap: 3px; }
.start-card-head b { font-family: var(--font-display); font-weight: 600; font-size: 20px; }
.start-card-head span { font-size: 12px; color: var(--ink-faint); }
@media (max-width: 980px) {
  .start-hero { grid-template-columns: 1fr; gap: 22px; max-width: 640px; }
  .start-card { justify-self: stretch; max-width: none; }
  .start-intro h1 { font-size: 52px; }
}
.start-brand { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.start-kicker { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); font-weight: 800; }
.start-card h1 { font-size: 48px; line-height: 1; }
.start-brand h1 { font-size: 48px; line-height: 1; }
.start-sub { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.start-blurb { color: var(--ink-soft); margin: 12px 0 20px; }
.start-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 18px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 800; color: var(--ink-soft); min-width: 0; }
.field select, .field input { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; text-overflow: ellipsis; }
.field select, .field input {
  font-family: inherit; font-size: 14px; padding: 8px 10px; border: 2px solid var(--line);
  border-radius: 10px; background: #fffdf6; color: var(--ink);
}
.resume-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 10px 14px; border: 2px dashed var(--gold-deep); border-radius: 12px; background: var(--amber-wash); }
.resume-card > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.resume-card b { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.resume-card span { font-size: 12px; color: var(--ink-soft); }
.resume-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.start-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; gap: 12px; }
.check { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-soft); }
.start-foot { margin-top: 18px; font-size: 11px; color: var(--ink-faint); border-top: 1.5px dashed var(--line); padding-top: 12px; }

/* =========================================================
   LANDING — editorial hero over a live isometric county (ported from the portfolio page)
   Namespaced under .landing so the game skin is untouched.
   ========================================================= */
.landing {
  --lp-off-black: #1a1510; --lp-pure-black: #0c0905; --lp-off-white: #f8f3e9; --lp-pure-white: #fffdf8;
  --lp-steel: #6b6257; --lp-ash: #9a9082; --lp-blue: #b0660a; --lp-amber: #f2a324; --lp-amber-deep: #e2921a;
  --lp-hair: 0.5px solid rgba(60,40,10,0.08);
  --lp-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --lp-gutter: clamp(20px, 4vw, 56px);
  display: block; padding: 0; min-height: 0; overflow: visible; background: var(--lp-off-white); color: var(--lp-off-black);
  font-family: var(--lp-font); font-weight: 350; font-size: 16px; line-height: 1.2; letter-spacing: -0.02em;
  font-feature-settings: "ss01", "ss02", "cv01", "cv11"; -webkit-font-smoothing: antialiased;
}
html.lang-zh .landing { font-family: "Inter", "PingFang SC", "Noto Sans SC", system-ui, sans-serif; letter-spacing: 0; }
.landing::after { content: none; }
.landing h1, .landing h2, .landing h3 { font-family: inherit; }
.landing a { color: inherit; text-decoration: none; }
.landing ::selection { background: rgba(242,163,36,0.28); }
.lp-shell { max-width: 1400px; margin: 0 auto; padding-left: var(--lp-gutter); padding-right: var(--lp-gutter); }
body.setup-open { overflow: hidden; }

/* floating pill nav: brand + language */
.lp-nav {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 20;
  display: flex; align-items: center; gap: 22px; white-space: nowrap;
  background: var(--lp-pure-white); border: var(--lp-hair); border-radius: 12px; padding: 9px 12px 9px 16px;
  box-shadow: 0 6px 24px rgba(60,40,10,.06);
}
.lp-nav-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 450; }
.lp-nav-brand .cross-mark { width: 18px; height: 18px; border-radius: 4px; }
.landing .lang-toggle { position: static; display: inline-flex; border: 0.5px solid rgba(60,40,10,.2); border-radius: 8px; overflow: hidden; background: transparent; }
.landing .lang-toggle button { font-family: var(--lp-font); font-weight: 450; font-size: 13px; padding: 4px 10px; color: var(--lp-steel); }
.landing .lang-toggle button.active { background: var(--lp-off-black); color: var(--lp-off-white); }
.landing .lang-toggle button + button { border-left: 0.5px solid rgba(60,40,10,.2); }

/* hero */
.lp-hero { position: relative; min-height: 100svh; overflow: hidden; }
.landing #sim {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair;
  -webkit-mask-image: radial-gradient(ellipse 74% 80% at 60% 50%, #000 42%, rgba(0,0,0,0.65) 70%, transparent 100%);
          mask-image: radial-gradient(ellipse 74% 80% at 60% 50%, #000 42%, rgba(0,0,0,0.65) 70%, transparent 100%);
}
.lp-hero::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(248,243,233,0.85) 0%, rgba(248,243,233,0.35) 90px, rgba(248,243,233,0) 170px),
    linear-gradient(0deg, var(--lp-off-white) 0%, rgba(248,243,233,0.88) 26%, rgba(248,243,233,0) 56%),
    linear-gradient(90deg, rgba(248,243,233,0.55) 0%, rgba(248,243,233,0) 40%);
}
.lp-grain {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0.07; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.landing #tip {
  position: absolute; z-index: 4; pointer-events: none; padding: 8px 12px; border-radius: 10px;
  background: var(--lp-pure-white); border: var(--lp-hair); color: var(--lp-off-black);
  font-size: 12px; line-height: 1.3; white-space: nowrap; transform: translate(14px, 14px); opacity: 0; transition: opacity .12s;
}
.landing #tip.on { opacity: 1; }
.landing #tip small { display: block; color: var(--lp-steel); font-size: 11px; margin-top: 2px; }
.lp-hero-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; pointer-events: none; }
.lp-hero-body .lp-shell { padding-bottom: clamp(44px, 7vh, 80px); text-align: center; display: flex; flex-direction: column; align-items: center; }
.lp-hero-body .lp-shell > * { pointer-events: auto; }
.lp-kicker { font-size: 12px; color: var(--lp-ash); margin-bottom: 14px; letter-spacing: 0; }
.lp-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.lp-strip span { display: inline-flex; align-items: center; border-radius: 9999px; border: 0.5px solid var(--lp-blue); color: var(--lp-blue); padding: 3px 11px; font-size: 12px; line-height: 1.2; }
.lp-hero h1 { font-weight: 350; font-size: clamp(34px, 4.2vw, 58px); line-height: 1.04; letter-spacing: -0.03em; max-width: 22ch; text-wrap: balance; text-shadow: none; }
.lp-lead { margin-top: 18px; max-width: 58ch; font-size: 17px; line-height: 1.35; color: var(--lp-steel); }
.lp-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.lp-cta {
  display: inline-flex; align-items: center; gap: 12px; height: 56px; padding: 0 26px 0 22px; border: 0; cursor: pointer;
  border-radius: 9999px; background: var(--lp-amber); color: var(--lp-pure-black);
  font-family: var(--lp-font); font-size: 17px; font-weight: 500; letter-spacing: -0.02em;
  transition: background-color .18s ease, transform .18s ease;
}
.lp-cta:hover { background: var(--lp-amber-deep); transform: translateY(-1px); }
.lp-cta .dot { width: 30px; height: 30px; border-radius: 50%; background: var(--lp-pure-black); display: grid; place-items: center; flex: none; }
.lp-cta svg { width: 12px; height: 12px; fill: var(--lp-amber); stroke: none; margin-left: 1px; }
.lp-link {
  display: inline-flex; align-items: center; gap: 12px; height: 56px; padding: 0 26px; border-radius: 9999px; cursor: pointer;
  color: var(--lp-blue); background: transparent; font-family: var(--lp-font); font-size: 17px; font-weight: 500; letter-spacing: -0.02em;
  border: 1px solid var(--lp-blue); transition: background-color .18s ease, transform .18s ease;
}
.lp-link:hover { background: rgba(176,102,10,0.08); transform: translateY(-1px); }
.lp-link svg { width: 14px; height: 14px; stroke: var(--lp-blue); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lp-hint { margin-top: 22px; font-size: 12px; color: var(--lp-ash); }
.landing .resume-card { margin-top: 22px; max-width: 560px; background: var(--lp-pure-white); border: var(--lp-hair); border-radius: 16px; padding: 12px 16px; }
.landing .resume-card b { font-family: var(--lp-font); font-weight: 500; font-size: 15px; }
.landing .resume-card span { color: var(--lp-steel); }
.landing .resume-card .btn { font-family: var(--lp-font); border-radius: 9999px; font-weight: 500; box-shadow: none; }
.landing .resume-card .btn-primary { background: var(--lp-off-black); border-color: var(--lp-off-black); color: var(--lp-off-white); }
.landing .resume-card .btn-ghost { background: transparent; border-color: rgba(60,40,10,.2); color: var(--lp-steel); }

/* sections */
.lp-section { padding-top: 94px; }
.lp-label small { display: block; font-size: 12px; color: var(--lp-ash); margin-bottom: 10px; }
.lp-label h2 { font-size: 27px; font-weight: 350; line-height: 1.2; letter-spacing: -0.02em; }
.lp-what { display: grid; grid-template-columns: 220px 1fr 260px; gap: 50px; align-items: start; }
.lp-body p { font-size: 18px; line-height: 1.3; max-width: 58ch; }
.lp-body p + p { margin-top: 22px; }
.lp-facts { display: grid; gap: 22px; padding-top: 4px; }
.lp-facts small { display: block; font-size: 12px; color: var(--lp-ash); margin-bottom: 6px; }
.lp-facts > div { font-size: 14px; line-height: 1.3; }
.lp-partners { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px; margin-top: 4px; }
.lp-partners .logo { display: inline-flex; align-items: center; height: 56px; }
.lp-partners .logo img { height: 46px; width: auto; display: block; mix-blend-mode: multiply; }
.lp-partners .logo img[alt="American Red Cross"] { height: 56px; margin-left: -6px; }
.lp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lp-tag { display: inline-flex; align-items: center; border-radius: 9999px; border: 0.5px solid var(--lp-blue); color: var(--lp-blue); padding: 2px 10px; font-size: 10px; letter-spacing: -0.02em; line-height: 1.2; }
.lp-card {
  margin-top: 94px; background: var(--lp-pure-white); border: var(--lp-hair); border-radius: 54px; padding: 69px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 50px;
}
.lp-card h3 { font-size: 18px; font-weight: 350; line-height: 1.2; margin-bottom: 10px; }
.lp-card p { font-size: 16px; line-height: 1.3; color: var(--lp-steel); max-width: 34ch; }
.lp-card .lp-tag { margin-bottom: 22px; }
.lp-end { padding-top: 94px; padding-bottom: 113px; }
.lp-end h2 { font-size: 27px; font-weight: 350; max-width: 24ch; text-wrap: balance; }
.lp-end .lp-actions { margin-top: 30px; }

/* setup overlay: the same editorial card language, form controls restyled */
.lp-setup { position: fixed; inset: 0; z-index: 30; background: rgba(248,243,233,.96); overflow: auto; display: grid; place-items: center; padding: 24px; }
.lp-setup.hidden { display: none; }
.lp-setup-card { position: relative; width: min(720px, 100%); background: var(--lp-pure-white); border: var(--lp-hair); border-radius: 30px; padding: 40px 44px 36px; box-shadow: 0 30px 80px rgba(60,40,10,.10); }
.lp-back { position: absolute; top: 18px; right: 18px; height: 38px; padding: 0 16px; font-size: 14px; gap: 8px; }
.lp-setup-sub { margin-top: 10px; font-size: 14px; color: var(--lp-steel); }
.lp-setup .start-grid { margin-top: 28px; gap: 18px 22px; }
.lp-setup .field { font-family: var(--lp-font); font-weight: 450; font-size: 12px; color: var(--lp-steel); gap: 6px; }
.lp-setup .field select, .lp-setup .field input { font-family: var(--lp-font); font-size: 15px; font-weight: 350; color: var(--lp-off-black); padding: 10px 12px; border: 0.5px solid rgba(60,40,10,.25); border-radius: 12px; background: var(--lp-off-white); }
.lp-setup .field select:focus, .lp-setup .field input:focus { outline: 1px solid var(--lp-blue); outline-offset: 2px; }
.lp-setup .start-actions { margin-top: 30px; }
.lp-setup .check { font-family: var(--lp-font); font-size: 14px; color: var(--lp-steel); }
.lp-setup .lp-cta { height: 52px; font-size: 16px; }

@media (max-width: 960px) { .lp-what { grid-template-columns: 1fr; gap: 30px; } .lp-card { grid-template-columns: 1fr; padding: 50px 34px; border-radius: 34px; } }
@media (max-width: 640px) {
  .lp-hero::after {
    background:
      linear-gradient(180deg, rgba(248,243,233,0.85) 0%, rgba(248,243,233,0.3) 90px, rgba(248,243,233,0) 160px),
      linear-gradient(0deg, var(--lp-off-white) 0%, rgba(248,243,233,0.94) 40%, rgba(248,243,233,0.6) 62%, rgba(248,243,233,0) 82%);
  }
  .lp-nav { top: 16px; gap: 12px; padding: 8px 10px 8px 12px; }
  .lp-nav-brand { font-size: 13px; }
  .lp-hero-body .lp-shell { padding-bottom: 76px; }
  .lp-section { padding-top: 69px; }
  .lp-setup-card { padding: 28px 22px 24px; border-radius: 22px; }
  .lp-setup .start-grid { grid-template-columns: 1fr; }
  .lp-setup .start-actions { flex-direction: column; align-items: flex-start; }
}
@media (hover: none) { .lp-hint, .landing #tip { display: none; } }
@media (prefers-reduced-motion: reduce) { .lp-cta, .lp-link, .landing #tip { transition: none; } }

/* =========================================================
   GAME STAGE — full-bleed map
   ========================================================= */
.game { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.stage {
  flex: 1; position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.18), transparent 60%),
    linear-gradient(160deg, #a9cf8b, #8dbb86 55%, #7fb2a0);
}
#map { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#map:active { cursor: grabbing; }
#map.build-cursor { cursor: crosshair; }

.zoom-controls {
  position: absolute; left: 14px; bottom: 90px; z-index: 30;
  display: flex; flex-direction: column; gap: 8px;
}
.zoom-controls button {
  width: 44px; height: 44px; border-radius: 50%; font-size: 19px; font-weight: 800;
  background: var(--panel); border: 2.5px solid var(--wood); color: var(--ink);
  box-shadow: var(--shadow);
}
.zoom-controls button:hover { background: var(--gold); }

/* ---------- floating chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  background: var(--panel); border: 2px solid var(--wood); border-radius: 12px;
  padding: 6px 12px; box-shadow: var(--shadow); font-size: 13.5px; font-weight: 700;
}
.chip-sub { font-size: 11px; color: var(--ink-faint); font-weight: 500; }
.chip-day b { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.chip-wx { font-weight: 600; }
.chip-wx .wx-icon { font-size: 19px; }
.chip-coins b { font-size: 15px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

.hud-topleft { position: absolute; top: 12px; left: 14px; z-index: 31; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* ---------- unified instrument clusters: one container, segmented inside ---------- */
.chip-row, .hud-topright {
  background: var(--panel); border: 2px solid var(--wood); border-radius: 14px;
  box-shadow: var(--shadow); padding: 3px 4px; gap: 0; align-items: stretch;
  flex-wrap: nowrap; min-height: 50px;
}
.chip-row .chip, .hud-topright .chip { align-items: center; }
.chip-row .chip, .hud-topright .chip {
  border: 0; box-shadow: none; background: transparent; border-radius: 10px; margin: 0;
  padding: 5px 12px;
}
.chip-row .chip + .chip, .hud-topright .chip + .chip { border-left: 1.5px dashed var(--line-soft); border-radius: 0; }
.hud-topright .chip:last-child { border-radius: 0 10px 10px 0; }
.help-chip:hover { background: var(--gold) !important; }

/* live supply-vs-demand overview: segmented strip, same row as the meters */
.ops-overview {
  display: flex; gap: 0; min-height: 50px;
  background: var(--panel); border: 2px solid var(--wood); border-radius: 14px;
  box-shadow: var(--shadow); padding: 3px 4px;
}
.ops-overview .ops-tile { display: flex; flex-direction: column; justify-content: center; }
.ops-tile {
  background: transparent; border: 0; border-radius: 10px;
  padding: 3px 8px 4px; text-align: center; cursor: pointer;
  min-width: 56px; transition: background .12s ease;
}
.ops-tile + .ops-tile { border-left: 1.5px dashed var(--line-soft); border-radius: 0; }
.ops-tile:hover { background: var(--paper-deep); }
.ops-tile b { display: block; font-family: var(--font-mono); font-size: 14px; font-weight: 600; line-height: 1.15; white-space: nowrap; }
.ops-tile span { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); font-weight: 800; white-space: nowrap; }
.ops-tile.ops-ok b { color: var(--green); }
.ops-tile.ops-warn b { color: var(--amber); box-shadow: inset 0 -2px 0 var(--amber); }
.ops-tile.ops-bad b { color: var(--red); box-shadow: inset 0 -2px 0 var(--red); }

.hud-topbar {
  position: absolute; top: 12px; right: 14px; z-index: 30; /* flush right — the agent rail starts lower */
  display: flex; gap: 8px; align-items: flex-start; justify-content: flex-end;
  flex-wrap: wrap-reverse; /* too tight? the ops strip drops to a second row; money + scores stay on top */
  max-width: calc(100% - 320px); /* the day/weather chips keep their lane on the left */
}
.hud-topright { display: flex; flex: none; }
.ops-overview { flex: none; }


.meter-chip { gap: 6px; }
.meter { width: 104px; height: 11px; background: var(--paper-deep); border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.meter-chip.pulse { animation: chip-pulse .55s ease; }
@keyframes chip-pulse {
  0% { box-shadow: var(--shadow); }
  40% { box-shadow: 0 0 0 4px rgba(237,168,50,.55); transform: scale(1.04); }
  100% { box-shadow: var(--shadow); transform: none; }
}
.meter > div { height: 100%; border-radius: 6px; transition: width .4s ease; }
#bar-sat { background: linear-gradient(90deg, #e0755f, #dd4f5c); }
#bar-eff { background: linear-gradient(90deg, #7aa74e, #4c7d36); }
.meter > div.bad { background: var(--red) !important; }
.score-delta { font-size: 10.5px; font-weight: 600; }
.score-delta.up { color: var(--green); }
.score-delta.down { color: var(--red); }

/* ---------- disaster info card ---------- */
.disaster-card {
  background: var(--panel); border: 2px solid var(--wood); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden; width: 300px;
}
.dc-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 13px 6px; }
.dc-head h2 { font-size: 16px; }
.dc-btn {
  border: 1.5px solid var(--line); background: var(--panel-warm); border-radius: 8px;
  width: 24px; height: 24px; font-weight: 800; color: var(--ink-soft); line-height: 1;
}
.dc-body { padding: 2px 13px 8px; }
.dc-row { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; padding: 3px 0; }
.dc-row .dc-ico { width: 18px; text-align: center; }
.dc-row .dc-label { flex: 1; color: var(--ink-soft); }
.dc-row b { font-weight: 800; }
.dc-level-high { color: var(--red); }
.dc-level-mod { color: var(--amber); }
.dc-level-low { color: var(--green); }
.dc-trend { font-size: 11px; font-weight: 700; margin-left: 4px; }
.dc-forecast { margin: 6px 0 2px; }
.dc-forecast .btn { width: 100%; }
.dc-forecast.on { font-size: 11.5px; color: var(--green); background: var(--green-wash); border-radius: 8px; padding: 5px 8px; }
.fx-day.fx-click { cursor: pointer; position: relative; box-shadow: inset 0 0 0 2px var(--gold); border-radius: 8px; }
.fx-day.fx-click:hover { background: var(--amber-wash); }
.fx-day .fx-pin { position: absolute; top: -6px; right: -4px; font-size: 10px; }
.fc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 8px; }
.fc-table th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); padding: 4px 6px; border-bottom: 1.5px solid var(--line-soft); }
.fc-table td { padding: 6px; border-bottom: 1px dashed var(--line-soft); vertical-align: top; }
.dc-flood { margin: 2px 0 6px 26px; display: flex; flex-direction: column; gap: 3px; }
.dc-fl-row { display: flex; align-items: center; gap: 7px; font-size: 11.5px; }
.dc-fl-name { width: 62px; color: var(--ink-soft); font-weight: 600; }
.dc-fl-bar { flex: 1; position: relative; height: 8px; background: var(--water-wash); border-radius: 4px; overflow: hidden; border: 1px solid var(--line-soft); }
.dc-fl-bar i { display: block; height: 100%; border-radius: 4px; transition: width .5s ease; }
.dc-fl-bar i.low { background: var(--water); }
.dc-fl-bar i.mod { background: #3f7ba2; }
.dc-fl-bar i.high { background: var(--red); }
.dc-fl-bar u { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); opacity: .55; }
.dc-fl-row b { width: 42px; text-align: right; font-size: 11px; }
.dc-fl-legend { font-size: 10px; color: var(--ink-faint); margin-top: 1px; }

/* forecast strip lives inside the disaster card */
.forecast-strip { display: flex; padding: 4px 8px 8px; border-top: 1.5px dashed var(--line-soft); }
.fx-day { flex: 1; min-width: 0; text-align: center; padding: 4px 2px; border-right: 1px dashed var(--line-soft); }
.fx-day:last-child { border-right: 0; }
.fx-day.today { background: var(--amber-wash); border-radius: 8px; }
.fx-label { font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); font-weight: 800; white-space: nowrap; }
.fx-icon { font-size: 17px; margin: 1px 0; }
.fx-sev { font-size: 10.5px; }
.fx-meter { height: 4px; background: var(--paper-deep); border-radius: 3px; margin-top: 3px; overflow: hidden; }
.fx-meter > div { height: 100%; background: var(--water); }
.fx-meter > div.high { background: var(--red); }
.fx-meter > div.mid { background: var(--amber); }
.fx-unknown { color: var(--ink-faint); font-style: italic; font-size: 10px; }

/* ---------- agent rail ---------- */
.agent-rail {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%); z-index: 30;
  display: flex; flex-direction: column; gap: 10px;
  background: rgba(100,73,44,.86); border-radius: 40px; padding: 12px 8px;
  box-shadow: var(--shadow);
}
.agent-slot { background: none; border: 0; padding: 0; text-align: center; position: relative; width: 70px; }
.agent-portrait {
  width: 52px; height: 52px; border-radius: 50%; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 18px; color: #fff;
  border: 2.5px solid #f2e6c9; box-shadow: 0 2px 6px rgba(0,0,0,.3);
  transition: transform .15s ease;
}
.agent-slot:hover .agent-portrait { transform: scale(1.1); }
.agent-slot-name { font-size: 9.5px; color: #f6ecd6; font-weight: 700; line-height: 1.15; margin-top: 4px; }
.agent-badge {
  position: absolute; top: -3px; right: 6px; min-width: 19px; height: 19px; border-radius: 10px;
  background: var(--gold); color: #4a3005; border: 2px solid #fff;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.agent-badge.urgent { background: var(--red); color: #fff; }

/* ---------- build palette ---------- */
/* task hub: round buttons above the bar, one per kind of task */
.task-hub {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 30;
  display: flex; gap: 14px;
}
.hub-btn {
  position: relative; width: 54px; height: 54px; border-radius: 50%; font-size: 23px;
  background: var(--panel); border: 3px solid var(--wood);
  box-shadow: 0 3px 0 rgba(70,53,31,.3), var(--shadow);
  transition: transform .12s ease, background .12s ease;
}
.hub-btn:hover { transform: translateY(-3px); }
.hub-btn.active { background: var(--gold); border-color: var(--gold-deep); transform: translateY(-3px); }
.hub-btn .tab-badge { position: absolute; top: -7px; right: -8px; box-shadow: 0 0 0 2px var(--panel); }
.hub-btn .tab-badge:empty { display: none; }
.hub-btn .hub-label {
  position: absolute; left: 50%; bottom: -19px; transform: translateX(-50%);
  font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fdf6e4;
  text-shadow: 0 1px 2px rgba(0,0,0,.5); white-space: nowrap;
}
/* quick-build shortcuts in the bar */
.bar-build { display: inline-flex; gap: 5px; margin: 0 6px 0 -1px; }
.build-btn {
  border-radius: 50%; background: var(--panel); border: 2px solid var(--wood);
  transition: transform .12s ease;
}
.build-btn.mini { width: 34px; height: 34px; font-size: 17px; padding: 0; }
.build-btn.mini { position: relative; overflow: visible; }
.plus-badge {
  position: absolute; top: -5px; right: -5px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--gold); border: 1.5px solid var(--gold-deep); color: #4a3005;
  font-style: normal; font-family: var(--font-display); font-weight: 800; font-size: 11px; line-height: 11px;
  display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.build-btn.active .plus-badge { background: #fff; }
.build-btn:hover { transform: translateY(-2px); }
.build-btn.active { background: var(--gold); border-color: var(--gold-deep); transform: translateY(-2px); }
/* alert + ledger chips in the top-right cluster */
.icon-chip { position: relative; width: 42px; font-size: 17px; }
.icon-chip .tab-badge { position: absolute; top: 1px; right: 1px; font-size: 10px; line-height: 15px; min-width: 16px; padding: 0 4px; }
.icon-chip .tab-badge:empty { display: none; }
.build-banner {
  position: absolute; bottom: 84px; left: 50%; transform: translateX(-50%); z-index: 30;
  background: var(--wood-deep); color: #f6ecd6; padding: 7px 16px; border-radius: 20px;
  font-size: 13px; font-weight: 700; box-shadow: var(--shadow); white-space: nowrap;
}

/* ---------- floating side panel ---------- */
.side-panel {
  position: absolute; left: 14px; top: 178px; bottom: 16px; width: 396px; z-index: 35;
  background: var(--panel); border: 2.5px solid var(--wood); border-radius: 16px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden;
}
.side-panel-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 2px solid var(--line-soft); background: var(--panel-warm);
}
.side-panel-head h2 { font-size: 18px; }
.tab-body { padding: 10px 12px; overflow-y: auto; flex: 1; }

/* ---------- bottom bar ---------- */
.bottom-bar {
  display: flex; align-items: center; gap: 7px; padding: 8px 12px;
  background: linear-gradient(180deg, #8a6844, #6b4f2f);
  border-top: 3px solid #4e3820; z-index: 40; flex-wrap: wrap;
}
.bar-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--panel); border: 2px solid #4e3820; border-radius: 11px;
  padding: 8px 11px; font-weight: 800; font-size: 13px; color: var(--ink);
  box-shadow: 0 2px 0 rgba(0,0,0,.25); white-space: nowrap;
}
.bar-btn:hover { background: var(--panel-warm); }
.bar-btn.active { background: var(--gold); }
.btn-execute {
  margin-left: auto; background: var(--gold); border: 2.5px solid var(--gold-deep);
  border-radius: 12px; padding: 9px 16px; font-family: var(--font-display);
  font-size: 15px; font-weight: 600; color: #4a3005;
  box-shadow: 0 3px 0 rgba(0,0,0,.28); white-space: nowrap;
}
.btn-execute:hover { background: #f5b544; }
.btn-execute:active { transform: translateY(1px); box-shadow: none; }
.btn-execute:disabled { opacity: .45; cursor: not-allowed; }
.btn-execute:disabled:hover { background: var(--panel); }
.tab-badge {
  display: inline-block; min-width: 19px; padding: 0 5px; border-radius: 10px; background: var(--red);
  color: #fff; font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; line-height: 18px;
}
.tab-badge.dim { background: var(--paper-deep); color: var(--ink-soft); border: 1px solid var(--line); }
.tab-badge:empty { display: none; }

/* timeline in the bottom bar */
.bar-spacer { flex: 1; }
.timeline { flex: none; padding: 0 4px; margin-right: 6px; }
/* day clock: ring of round segments */
.day-clock { display: flex; align-items: center; gap: 9px; }
.day-clock svg { flex: none; overflow: visible; }
.dk-face { fill: rgba(0,0,0,.28); }
.dk-seg { fill: none; stroke: rgba(0,0,0,.42); stroke-width: 6; stroke-linecap: butt; }
.dk-fill { fill: none; stroke: var(--gold); stroke-width: 6; stroke-linecap: butt; filter: drop-shadow(0 0 2px rgba(240,200,105,.6)); }
.dk-hand { stroke: #fdf6e4; stroke-width: 2.2; stroke-linecap: round; }
.dk-pin { fill: #fdf6e4; }
.dk-label { display: flex; flex-direction: column; gap: 1px; line-height: 1.15; color: #fdf6e4; white-space: nowrap; }
.dk-label b { font-family: var(--font-display); font-weight: 600; font-size: 13px; }
.dk-label b i { font-style: normal; font-weight: 500; font-size: 11px; color: #e8d9b6; margin-left: 4px; text-transform: uppercase; letter-spacing: .05em; }
.dk-label span { font-size: 10.5px; color: #e8d9b6; }
.tl-track { position: relative; height: 12px; background: rgba(0,0,0,.3); border-radius: 7px; overflow: hidden; border: 1.5px solid rgba(0,0,0,.35); }
.tl-fill { height: 100%; background: linear-gradient(90deg, #f0c869, var(--gold)); border-radius: 7px; transition: width .4s ease; }
.tl-notch { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(0,0,0,.4); }
.tl-labels { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 9.5px; color: #e8d9b6; margin-top: 2px; }
.btn-round { background: var(--panel); color: var(--ink); border-color: var(--wood-deep); font-size: 14px; padding: 9px 12px; margin-left: auto; }
.btn-round:hover { background: var(--panel-warm); }
.btn-round + .btn-execute, .btn-round ~ #btn-endday { margin-left: 0; }

/* alert ribbon (emergency) */
.alert-ribbon {
  position: fixed; top: 0; left: 0; right: 0;
  background: var(--red); color: #fff; padding: 8px 18px; font-weight: 800; font-size: 13px;
  display: flex; gap: 10px; align-items: center; z-index: 55; justify-content: center;
}

/* =========================================================
   MAP FLOATING PIECES
   ========================================================= */
.map-tip {
  position: absolute; pointer-events: none; background: rgba(70,53,31,.95); color: #fdf6e4; font-size: 11.5px;
  padding: 7px 11px; border-radius: 8px; z-index: 32; max-width: 290px; line-height: 1.4;
  border: 1.5px solid rgba(253,246,228,.35);
}
.map-tip b { color: #ffd9a8; }

.detail-overlay {
  position: absolute; top: 64px; right: 104px; width: 306px; max-height: 72%;
  overflow-y: auto; background: var(--panel); border: 2.5px solid var(--wood);
  border-radius: 14px; box-shadow: 0 8px 28px rgba(70,53,31,.35); z-index: 34;
}
.detail-overlay-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 12px; border-bottom: 1.5px solid var(--line-soft);
  position: sticky; top: 0; background: var(--panel-warm); z-index: 2;
}
.detail-overlay-head h2 { font-size: 15px; }
.detail-body { padding: 12px 14px; font-size: 13px; }
.detail-body.empty { color: var(--ink-faint); font-style: italic; }
.detail-sub { color: var(--ink-soft); font-size: 12.5px; font-weight: 600; margin: 2px 0 6px; }
.stat-row { display: flex; gap: 6px; margin: 4px 0 10px; }
.stat {
  flex: 1; background: var(--panel-warm); border: 1.5px solid var(--line-soft);
  border-radius: 10px; padding: 6px 4px 4px; text-align: center; min-width: 0;
}
.stat b { display: block; font-family: var(--font-mono); font-size: 15px; font-weight: 600; line-height: 1.1; }
.stat span { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); font-weight: 800; margin-top: 2px; white-space: nowrap; }
.stat.stat-warn b { color: var(--amber); }
.stat.stat-bad b { color: var(--red); }
.site-card { padding: 4px 0 10px; }
.site-card h3 { font-size: 16px; font-weight: 600; }
.site-card > .wf-sub { margin-bottom: 4px; }
.site-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.site-flash { animation: site-flash 1.2s ease 2; }
@keyframes site-flash {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 3px var(--red); }
}
.fac-status { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 6px; background: var(--paper-deep); color: var(--ink-soft); }
.fac-status.active { background: var(--green-wash); color: var(--green); }
.fac-status.damaged { background: var(--red-wash); color: var(--red-deep); }
.fac-status.understaffed { background: var(--amber-wash); color: var(--amber); }
.staff-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 12.5px; }
.staff-row select { padding: 4px; border-radius: 8px; border: 1.5px solid var(--line); background: #fffdf6; font-family: inherit; }
.staff-row input[type=number] { border-radius: 8px; border: 1.5px solid var(--line); padding: 3px 6px; font-family: var(--font-mono); }

/* =========================================================
   PANEL CONTENT — tasks, workforce, ledger, resources
   ========================================================= */
.task-group-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; font-weight: 800;
  color: var(--ink-faint); margin: 10px 2px 5px; }
.task-card {
  border: 2px solid var(--line); border-left-width: 6px; border-radius: 12px;
  padding: 9px 11px; margin-bottom: 8px; background: #fffdf4; cursor: pointer; transition: box-shadow .15s, transform .12s;
}
.task-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.task-card.demand { border-left-color: var(--water); }
.task-card.emergency { border-left-color: var(--red); background: var(--red-wash); }
.task-card.advisory { border-left-color: var(--amber); }
.task-card.done { opacity: .55; cursor: default; }
.task-card.done:hover { transform: none; box-shadow: none; }
.task-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.task-name { font-weight: 800; font-size: 13.5px; }
.task-tag { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); white-space: nowrap; }
.task-tag.urgent { color: var(--red); }
.task-desc { font-size: 12px; color: var(--ink-soft); margin-top: 3px; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; font-size: 11px; color: var(--ink-faint); margin-top: 6px; min-height: 20px; }
.task-meta .tm-agent, .task-meta .tm-due { white-space: nowrap; }
.task-meta .tm-due { font-family: var(--font-mono); }
.task-meta .tm-right { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.task-edit, .task-recall { height: 24px; padding: 0 9px; font-size: 11.5px; line-height: 1; border-radius: 7px; white-space: nowrap; }
.task-status-pill { font-size: 10px; font-weight: 800; text-transform: uppercase; padding: 1px 7px; border-radius: 6px; }
.task-status-pill.resolved { background: var(--green-wash); color: var(--green); }
.task-status-pill.failed { background: var(--red-wash); color: var(--red-deep); }
.task-status-pill.executing { background: var(--water-wash); color: var(--water); }
.task-status-pill.planned { background: var(--amber-wash); color: var(--gold-deep); }
.task-card.planned { border: 2px dashed var(--gold-deep); border-left-width: 4px; background: linear-gradient(90deg, var(--amber-wash), var(--panel) 55%); cursor: pointer; }
.task-status-pill.planned { white-space: nowrap; }
.task-status-pill.dismissed { background: var(--paper-deep); color: var(--ink-faint); }
.empty-note { color: var(--ink-faint); font-style: italic; font-size: 12.5px; padding: 8px 2px; }

/* workforce */
.wf-summary { display: flex; gap: 14px; font-size: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.wf-summary b { font-family: var(--font-mono); }
.wf-row { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 9px; border: 1.5px solid var(--line-soft); border-radius: 10px; margin-bottom: 5px; font-size: 12.5px; background: #fffdf4; }
.wf-name { font-weight: 700; }
.wf-sub { font-size: 11px; color: var(--ink-faint); }
.wf-state { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 1px 7px; border-radius: 6px; background: var(--paper-deep); color: var(--ink-soft); }
.wf-state.assigned { background: var(--water-wash); color: var(--water); }
.wf-state.training { background: var(--amber-wash); color: var(--amber); }
.wf-state.available { background: var(--green-wash); color: var(--green); }

/* ledger */
.ledger-row { display: flex; gap: 8px; align-items: baseline; padding: 5px 4px; border-bottom: 1px dashed var(--line-soft); font-size: 12px; }
.ledger-delta { font-family: var(--font-mono); font-weight: 700; min-width: 42px; text-align: right; }
.ledger-delta.pos { color: var(--green); }
.ledger-delta.neg { color: var(--red); }
.ledger-reason { flex: 1; color: var(--ink-soft); }
.ledger-tag { font-size: 10px; color: var(--ink-faint); white-space: nowrap; }

/* resources grid (inside Facilities panel) */
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.res-item { border-bottom: 1px dashed var(--line-soft); padding: 3px 0; }
.res-k { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); font-weight: 800; }
.res-v { font-family: var(--font-mono); font-size: 14.5px; }
.res-v small { font-size: 11px; color: var(--ink-faint); }

/* alert feed (inside Tasks panel) */
.feed-item { display: flex; gap: 8px; padding: 5px 2px; border-bottom: 1px dashed var(--line-soft); font-size: 12px; }
.feed-time { font-family: var(--font-mono); color: var(--ink-faint); font-size: 11px; white-space: nowrap; }
.feed-item.warn .feed-text::before { content: "▲ "; color: var(--amber); }
.feed-item.danger .feed-text::before { content: "● "; color: var(--red); }
.feed-item.info .feed-text::before { content: "○ "; color: var(--water); }
.feed-item.good .feed-text::before { content: "✓ "; color: var(--green); }

/* =========================================================
   MODALS (unchanged structure, warm skin)
   ========================================================= */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(70,53,31,.55); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--panel); border: 3px solid var(--wood); border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  max-width: 860px; width: 100%; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal.wide { max-width: 1020px; }
.modal-head {
  padding: 14px 20px; border-bottom: 2px solid var(--line); display: flex; justify-content: space-between;
  align-items: center; gap: 12px; background: var(--panel-warm);
}
.modal-head h2 { font-size: 20px; }
.modal-head .sub { font-size: 12px; color: var(--ink-faint); }
.modal-head.emergency { background: var(--red); color: #fff; border-bottom-color: var(--red-deep); }
.modal-head.emergency .sub { color: rgba(255,255,255,.85); }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot {
  padding: 12px 20px; border-top: 2px solid var(--line); display: flex; justify-content: flex-end;
  gap: 10px; background: var(--panel-warm); align-items: center; flex-wrap: wrap;
}
.modal-foot .foot-note { margin-right: auto; font-size: 12px; color: var(--ink-soft); }

/* --- dialogue template --- */
.dlg-grid { display: grid; grid-template-columns: 300px 1fr; gap: 18px; }
@media (max-width: 760px) { .dlg-grid { grid-template-columns: 1fr; } }
.dlg-context {
  background: var(--panel-warm); border: 1.5px solid var(--line-soft); border-radius: 12px; padding: 12px 14px;
  align-self: start;
}
.dlg-context h3 { font-size: 13px; color: var(--ink-faint); margin-bottom: 8px; }
.ctx-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12.5px; }
.ctx-kv dt { color: var(--ink-faint); }
.ctx-kv dd { margin: 0; font-weight: 700; text-align: right; }
.ctx-proj { margin-top: 12px; border-top: 1.5px dashed var(--line-soft); padding-top: 10px; }
.ctx-proj .warn, .warn { color: var(--amber); font-weight: 700; }
.ctx-proj .bad, .bad { color: var(--red); font-weight: 700; }
.ctx-proj .good, .good { color: var(--green); font-weight: 700; }

.agent-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.agent-avatar {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px; color: #fff; flex: none;
  border: 2px solid rgba(255,255,255,.7); box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.agent-avatar { position: relative; overflow: hidden; }
.agent-avatar img, .agent-portrait img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
}
.agent-avatar.small { width: 28px; height: 28px; font-size: 12px; }
.agent-portrait { position: relative; overflow: hidden; }
.agent-name { font-weight: 800; font-size: 14px; }
.agent-domain { font-size: 11px; color: var(--ink-faint); }
.agent-suggest {
  display: flex; align-items: center; gap: 10px; margin: 0 0 8px; padding: 8px 10px;
  border: 2px solid var(--gold-deep); border-radius: 10px; background: linear-gradient(180deg, #fff6d8, var(--amber-wash));
}
.agent-suggest .sg-ico { font-size: 18px; flex: none; }
.agent-suggest > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.agent-suggest b { font-family: var(--font-display); font-weight: 600; font-size: 12.5px; letter-spacing: .02em; text-transform: uppercase; color: var(--gold-deep); }
.agent-suggest span { font-size: 12.5px; color: var(--ink); }
.agent-suggest .btn { flex: none; }
.rec-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--gold); color: #4a3005; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; vertical-align: middle; }
.agent-msg {
  background: var(--water-wash); border-radius: 4px 14px 14px 14px; padding: 10px 13px; font-size: 13px;
  margin-bottom: 8px; max-width: 94%; border: 1px solid rgba(67,128,154,.2);
}
.agent-msg.alt { background: var(--paper-deep); border-color: var(--line); }
.quick-prompts { display: flex; gap: 7px; flex-wrap: wrap; margin: 10px 0; }
.quick-prompts .btn { font-size: 12px; padding: 4px 11px; border-color: var(--line); font-weight: 600; border-radius: 14px; box-shadow: none; }

.plan-editor { border: 2px solid var(--line); border-radius: 12px; margin-top: 10px; overflow: hidden; }
.plan-editor-head { padding: 8px 12px; background: var(--panel-warm); border-bottom: 1.5px solid var(--line-soft);
  font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--ink-faint); }
.plan-rows { padding: 8px 12px; }
.peh-sub { float: right; font-weight: 600; font-size: 10px; letter-spacing: .02em; text-transform: none; color: var(--ink-faint); }
/* site picker: selectable cards with color-coded route times */
.site-opts { display: flex; flex-direction: column; gap: 7px; }
.site-opt {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px 9px 10px; cursor: pointer;
  border: 2px solid var(--line-soft); border-radius: 11px; background: var(--panel); transition: border-color .12s, background .12s;
}
.site-opt:hover { border-color: var(--gold-deep); }
.site-opt.selected { border-color: var(--gold-deep); background: var(--amber-wash); box-shadow: inset 0 0 0 1px rgba(200,135,26,.25); }
.site-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.so-tile { width: 36px; height: 36px; border-radius: 9px; background: var(--paper); border: 1.5px solid var(--line-soft); display: inline-flex; align-items: center; justify-content: center; font-size: 19px; flex: none; }
.site-opt.selected .so-tile { background: #fff; border-color: var(--gold-deep); }
.so-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.so-name { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; line-height: 1.15; }
.so-meta { font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.so-com { font-weight: 700; color: var(--ink); }
.so-vuln { font-weight: 800; padding: 0 6px; border-radius: 999px; }
.so-vuln.v-low { background: var(--green-wash); color: var(--green); }
.so-vuln.v-mid { background: var(--amber-wash); color: var(--amber); }
.so-vuln.v-high { background: var(--red-wash); color: var(--red-deep); }
.so-routes { display: flex; gap: 5px; flex: none; }
.so-eta { display: inline-flex; flex-direction: column; align-items: center; min-width: 58px; padding: 3px 6px; border-radius: 8px; font-family: var(--font-mono); font-size: 12px; font-weight: 600; line-height: 1.15; }
.so-eta i { font-style: normal; font-family: var(--font-body); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; opacity: .75; }
.so-eta.e-good { background: var(--green-wash); color: var(--green); }
.so-eta.e-mid { background: var(--amber-wash); color: var(--amber); }
.so-eta.e-bad { background: var(--red-wash); color: var(--red-deep); }
.so-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; position: relative; background: #fff; }
.site-opt.selected .so-check { background: var(--gold); border-color: var(--gold-deep); }
.site-opt.selected .so-check::after { content: '\2713'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 900; color: #4a3005; }
.plan-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 13px; }
.plan-row label { flex: 1; }
.plan-row .row-sub { font-size: 11px; color: var(--ink-faint); display: block; }
/* stepper: [−] value [+] / max */
.stepper { display: inline-flex; align-items: center; gap: 0; flex: none; }
.stepper .step-btn {
  width: 30px; height: 32px; border: 2px solid var(--wood); background: var(--panel); color: var(--ink);
  font-family: var(--font-display); font-size: 17px; font-weight: 700; line-height: 1; padding: 0; cursor: pointer;
}
.stepper .step-btn:first-child { border-radius: 9px 0 0 9px; }
.stepper .step-btn:nth-child(3) { border-radius: 0 9px 9px 0; border-left: 0; }
.stepper .step-btn:hover:not(:disabled) { background: var(--gold); }
.stepper .step-btn:disabled { color: var(--ink-faint); background: var(--paper-deep); cursor: default; }
.stepper input[type=number] {
  width: 52px; height: 32px; margin: 0; padding: 0 4px; border: 2px solid var(--wood); border-left: 0; border-radius: 0;
  font-family: var(--font-mono); font-size: 14px; font-weight: 600; text-align: center; background: #fffdf6; color: var(--ink);
  -moz-appearance: textfield; appearance: textfield;
}
.stepper input[type=number]::-webkit-inner-spin-button, .stepper input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; background: #fff; box-shadow: inset 0 0 0 2px var(--gold); }
.stepper .step-max { margin-left: 7px; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; }
.stepper.at-max .step-max { color: var(--green); font-weight: 700; }
.stepper.disabled .step-btn, .stepper.disabled input { background: var(--paper-deep); color: var(--ink-faint); border-color: var(--line); }
.plan-row { align-items: center; }
.plan-total { padding: 8px 12px; border-top: 1.5px solid var(--line-soft); font-size: 13px; display: flex; justify-content: space-between; }
.plan-total b { font-family: var(--font-mono); }
.plan-total.short b { color: var(--red); }

.option-card {
  border: 2px solid var(--line); border-radius: 12px; padding: 11px 13px; margin-bottom: 9px;
  display: flex; gap: 12px; cursor: pointer; background: #fffdf4;
}
.option-card:hover { border-color: var(--wood); }
.option-card.selected { border-color: var(--wood-deep); box-shadow: 0 0 0 2px var(--gold); }
.option-card input { margin-top: 3px; }
.option-title { font-weight: 800; font-size: 13.5px; }
.option-desc { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.option-stats { display: flex; gap: 14px; margin-top: 5px; font-size: 11.5px; font-family: var(--font-mono); color: var(--ink-soft); }
.option-impact { display: flex; flex-wrap: wrap; gap: 5px 6px; margin-top: 7px; }
.option-impact .imp {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: var(--panel-warm); border: 1px solid var(--line-soft); color: var(--ink);
}
.option-impact .imp.pos { color: var(--green); border-color: var(--green); background: #eaf5ec; }
.option-impact .imp.neg { color: var(--red); border-color: #f0b4ba; background: #fdecee; }
.option-impact .imp.soft { font-family: var(--font-body); font-weight: 600; color: var(--ink-soft); }
.option-affects { margin-top: 7px; font-size: 11.5px; color: var(--ink-soft); border-left: 3px solid var(--line); padding-left: 8px; }
.option-affects b { color: var(--ink); }
.option-risk { margin-top: 6px; font-size: 11.5px; color: #7a4d00; font-weight: 700; }
.em-touched { margin: 0; padding-left: 16px; font-size: 12px; }
.em-touched li { margin: 2px 0; }

/* --- briefing / report --- */
.brief-section { margin-bottom: 16px; }
.brief-section h3 { font-size: 16px; margin-bottom: 6px; border-bottom: 1.5px dashed var(--line); padding-bottom: 4px; }
.report-header { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.report-score { text-align: center; }
.report-score .big { font-family: var(--font-mono); font-size: 34px; font-weight: 600; line-height: 1; }
.report-score .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); font-weight: 800; }
.report-score .d { font-size: 12px; font-family: var(--font-mono); }
.report-score .d.up { color: var(--green); } .report-score .d.down { color: var(--red); }
.agent-report-card { border: 2px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.agent-report-head { display: flex; align-items: center; gap: 9px; padding: 8px 12px; background: var(--panel-warm);
  border-bottom: 1.5px solid var(--line-soft); }
.agent-report-head .net { margin-left: auto; font-family: var(--font-mono); font-weight: 700; }
.agent-report-head .net.pos { color: var(--green); } .agent-report-head .net.neg { color: var(--red); }
.agent-report-body { padding: 8px 12px; font-size: 12.5px; }
.insight { background: var(--amber-wash); border-left: 4px solid var(--amber); padding: 6px 10px;
  font-size: 12px; margin-top: 7px; border-radius: 0 8px 8px 0; }
.summary-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.summary-chip { background: var(--paper); border: 1.5px solid var(--line-soft); border-radius: 8px; padding: 5px 10px; font-size: 12px; }
.summary-chip b { font-family: var(--font-mono); }
.trend-canvas { width: 100%; height: 120px; border: 1.5px solid var(--line-soft); border-radius: 8px; background: #fffdf4; }

/* onboarding dots */
.ob-dots { display: flex; gap: 6px; }
.ob-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.ob-dots span.on { background: var(--red); }

/* toasts */
#toast-root { position: fixed; bottom: 76px; left: 50%; transform: translateX(-50%); z-index: 90;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--wood-deep); color: #f6ecd6; padding: 9px 17px; border-radius: 14px; font-size: 13px;
  box-shadow: var(--shadow); animation: toast-in .25s ease; max-width: 480px; font-weight: 600;
}
.toast.score-pos { background: var(--green); color: #fff; }
.toast.score-neg { background: var(--red-deep); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* misc */
.divider { border: 0; border-top: 1.5px dashed var(--line-soft); margin: 12px 0; }
table.mini { width: 100%; border-collapse: collapse; font-size: 12px; }
table.mini th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-faint); padding: 4px 6px; border-bottom: 1.5px solid var(--line); }
table.mini td { padding: 4px 6px; border-bottom: 1px dashed var(--line-soft); }
table.mini td.num { font-family: var(--font-mono); text-align: right; }

/* small screens: shrink floating chrome */
@media (max-width: 900px) {
  .hud-topbar { right: 12px; top: auto; bottom: 90px; }
  .agent-rail { display: none; }
  .side-panel { width: min(396px, 92vw); top: 120px; }
  .disaster-card { width: 260px; }
}

/* ---------- compact chip UX (Workers / Facilities / Fleet) ---------- */
/* status KPI row: quiet readings (big value, small caption) — no chrome, so filters read as the controls */
.chip-strip {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 6px;
  margin: 2px 0 12px; padding: 8px 12px 7px;
  background: linear-gradient(180deg, rgba(255,253,244,.9), var(--panel-warm)); border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(70,53,31,.08);
}
.mini-chip { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; line-height: 1; gap: 3px; }
.mini-chip i { display: none; }
.mini-chip b { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--ink); letter-spacing: .01em; white-space: nowrap; }
.mini-chip span { font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); font-weight: 800; white-space: nowrap; }
.mini-chip.warn b { color: var(--amber); }
.mini-chip.warn span::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); margin-right: 4px; vertical-align: 1px; }
.chip-wrap { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }

/* money panel: request funding */
.fund-request { display: flex; flex-direction: column; gap: 10px; }
.fund-block { border: 2px solid var(--line-soft); border-radius: 12px; padding: 10px 12px; background: var(--panel); }
.fund-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.fund-head .fund-ico { font-size: 20px; line-height: 1; flex: none; margin-top: 1px; }
.fund-head > div > b { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; display: block; }
.fund-head span { font-size: 12px; color: var(--ink-soft); }
.fund-head span b { display: inline; font-family: inherit; font-size: inherit; font-weight: 800; color: var(--ink); }
.fund-head span b.bad { color: var(--red); }
.fund-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 7px; }
.fund-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; text-align: left; line-height: 1.2; }
.fund-opt b { font-size: 13px; }
.fund-opt span { font-size: 11px; color: var(--ink-soft); font-weight: 600; }
.fund-opt em { font-style: normal; font-family: var(--font-mono); color: var(--green); font-weight: 700; }
.fund-opt.danger { border-color: var(--red); }
.fund-opt.danger em { color: var(--red-deep); }
.fund-opt.danger:hover { background: var(--red-wash); }
.fund-note { font-size: 12.5px; padding: 6px 10px; border-radius: 8px; background: var(--green-wash); color: var(--green); }
.w-chip {
  display: inline-flex; align-items: center; gap: 3px;
  background: #fffdf4; border: 1.5px solid var(--line); border-radius: 9px;
  padding: 2px 4px 2px 7px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.w-fat { font-size: 10px; color: var(--amber); font-weight: 800; }
.w-fat.bad { color: var(--red); }
.w-x {
  border: 0; background: var(--paper-deep); border-radius: 6px; width: 18px; height: 18px;
  font-size: 10px; line-height: 1; color: var(--ink-soft); padding: 0;
}
.w-x:hover { background: var(--red); color: #fff; }
.w-x.train:hover { background: var(--gold); color: var(--ink); }
.train-bar { display: flex; gap: 10px; align-items: center; margin: 4px 0 8px; flex-wrap: wrap; }
.crew-row { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; border-bottom: 1px dashed var(--line-soft); }
.crew-fac { font-size: 12px; font-weight: 800; min-width: 120px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-top: 3px; }
.fac-block { border-top: 1.5px dashed var(--line-soft); margin-top: 8px; padding-top: 7px; }
.fac-head { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.fac-head b { text-transform: capitalize; }
.fac-emoji { font-size: 16px; }
.fac-stat { margin-left: auto; font-size: 12px; color: var(--ink-soft); }
.fac-sub { font-size: 12px; color: var(--ink-soft); margin: 4px 0 0 2px; }
.tiny-input { width: 44px; padding: 2px 5px; border: 1.5px solid var(--line); border-radius: 6px; text-align: right; font-size: 12px; }
.staff-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 6px; }
.staff-dots { display: inline-flex; gap: 3px; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--paper-deep); border: 1.5px solid var(--line); display: inline-block; }
.dot.on { background: var(--green); border-color: var(--green); }
.skill-star { font-size: 13px; filter: grayscale(1) opacity(.45); }
.skill-star.ok { filter: none; }
.build-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1.5px dashed var(--line-soft); margin-top: 6px; }
.build-row .build-name { font-weight: 800; font-size: 13px; white-space: nowrap; }
.build-row .wf-sub { flex: 1; }
.fleet-row { display: flex; align-items: center; gap: 9px; padding: 7px 4px; border-bottom: 1px dashed var(--line-soft); font-size: 13px; }
.fleet-row .fleet-id { min-width: 86px; }
.fleet-row .wf-sub { flex: 1; }

/* freshly arrived alerts */
.feed-item.feed-new { background: var(--amber-wash); border-radius: 8px; padding-left: 6px; padding-right: 6px; }
.feed-newpill { font-size: 9px; font-weight: 800; color: var(--red); letter-spacing: .08em; align-self: center; }

/* ---------- worker tiles + two-CTA flow ---------- */
.cta-row { display: flex; gap: 8px; margin: 6px 0 10px; }
.cta-row .cta { flex: 1; padding: 10px 8px; font-size: 13.5px; }
.cta-row .cta-active { background: var(--gold); border-color: var(--gold-deep); }
.select-bar {
  background: var(--amber-wash); border: 1.5px solid var(--amber); border-radius: 10px;
  padding: 7px 10px; font-size: 12.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-bottom: 8px;
}
.worker-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.worker-tile {
  position: relative; background: #fffdf4; border: 2px solid var(--line); border-radius: 10px;
  padding: 7px 9px 8px;
}
.worker-tile.selectable { cursor: pointer; border-style: dashed; }
.worker-tile.selectable:hover { border-color: var(--gold-deep); background: var(--amber-wash); }
.worker-tile.sel { border-style: solid; border-color: var(--gold-deep); background: var(--amber-wash); }
.worker-tile.enroute { opacity: .75; border-style: dashed; }
.wt-check {
  position: absolute; top: -7px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--gold); color: #4a3005; font-weight: 800; font-size: 12px;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
}
.wt-name { font-weight: 800; font-size: 12.5px; line-height: 1.2; }
.wt-role { font-size: 10.5px; color: var(--ink-faint); margin: 1px 0 4px; }
.wt-meta { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; min-height: 20px; }
.wt-meta .w-x { margin-left: auto; }
.wt-energy { height: 5px; background: var(--paper-deep); border-radius: 3px; overflow: hidden; margin-top: 5px; }
.wt-energy > div { height: 100%; background: var(--green); border-radius: 3px; }
.wt-energy > div.warn { background: var(--amber); }
.wt-energy > div.bad { background: var(--red); }

/* ---------- ticking clock in the day chip ---------- */
.clock-face {
  position: relative; width: 22px; height: 22px; border-radius: 50%;
  background: #fffdf4; border: 2px solid var(--wood); flex: none; display: inline-block;
}
.clock-face::after { /* center pin */
  content: ""; position: absolute; left: 50%; top: 50%; width: 3px; height: 3px;
  background: var(--ink); border-radius: 50%; transform: translate(-50%, -50%);
}
.clock-hand {
  position: absolute; left: 50%; bottom: 50%; transform-origin: 50% 100%;
  background: var(--ink); border-radius: 2px;
}
.clock-hand.h { width: 2.5px; height: 5px; }
.clock-hand.m { width: 1.8px; height: 7.5px; background: var(--red); }
.clock-face.ticking { box-shadow: 0 0 0 3px rgba(237,168,50,.45); }

/* ---------- structured map tooltip ---------- */
.map-tip {
  min-width: 176px; max-width: 300px;
  background: rgba(52,39,22,.96) !important; border: 1.5px solid rgba(253,246,228,.4) !important;
  border-radius: 10px !important; padding: 9px 11px !important;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.tip-title { font-weight: 800; font-size: 13px; color: #fdf6e4; }
.tip-sub { font-size: 10.5px; color: #cdbb97; margin: 1px 0 5px; }
.tip-row { display: flex; align-items: center; gap: 6px; font-size: 11.5px; padding: 2px 0; color: #f2e6c9; }
.tip-row > span:first-child { font-weight: 700; text-transform: capitalize; }
.tip-val { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; }
.tip-val.dim, .tip-note.dim { color: #a8946f; }
.tip-pill { font-size: 8.5px; font-weight: 800; text-transform: uppercase; padding: 1px 5px; border-radius: 5px; background: #6b5a3d; color: #fdf6e4; }
.tip-pill.active { background: #4c7d36; }
.tip-pill.understaffed { background: #c8871a; }
.tip-pill.damaged { background: #a90f1f; }
.tip-pill.closing { background: #6b5a3d; }
.tip-note { font-size: 10.5px; color: #ffd9a8; margin-top: 3px; }
.tip-stats { display: flex; gap: 6px; margin-top: 6px; border-top: 1px solid rgba(253,246,228,.18); padding-top: 6px; }
.tip-stats span {
  flex: 1; text-align: center; font-family: var(--font-mono); font-size: 10.5px;
  background: rgba(253,246,228,.1); border-radius: 6px; padding: 2px 4px; color: #f2e6c9;
}
.tip-stats span.warn { color: #f5c064; }
.tip-stats span.bad { color: #ff9d9d; }
.fac-status.closing { background: var(--paper-deep); color: var(--ink-soft); }
.fac-status.building { background: var(--amber-wash); color: var(--gold-deep); }
.build-note { color: var(--gold-deep); font-weight: 700; }

/* panel filters + facility cards */
.filter-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 10px; }
.cta-sub { display: block; font-size: 10.5px; font-weight: 600; opacity: .8; letter-spacing: .02em; }
.filter-chip {
  border: 1.5px solid var(--line); background: var(--panel); border-radius: 999px; padding: 3px 10px;
  font-size: 11.5px; font-weight: 700; color: var(--ink-soft); cursor: pointer; white-space: nowrap;
}
.filter-chip:hover { border-color: var(--gold-deep); color: var(--ink); }
.filter-chip.active { background: var(--gold); border-color: var(--gold-deep); color: #4a3005; }
.fac-grid { display: grid; grid-template-columns: 1fr; gap: 9px; margin-bottom: 6px; }
.fac-card {
  border: 2px solid var(--wood); border-radius: var(--radius); background: #fffcf1; padding: 9px 11px 10px;
  box-shadow: 0 1px 2px rgba(70,53,31,.12); position: relative;
}
.fac-card.op { border-color: var(--green); }
.fac-card.st-building { border-style: dashed; border-color: var(--gold-deep); background: repeating-linear-gradient(135deg, #fffcf1 0 14px, var(--amber-wash) 14px 18px); }
.fac-card.st-damaged { border-color: var(--red); }
.fac-card.st-closing { opacity: .7; }
.fc-title { display: flex; align-items: center; gap: 9px; }
.fc-emoji { font-size: 22px; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; background: var(--paper); border-radius: 9px; border: 1.5px solid var(--line-soft); flex: none; }
.fc-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.fc-name b { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; line-height: 1.15; }
.fc-name .bad { color: var(--red); font-weight: 700; } .fc-name .warn { color: var(--amber); font-weight: 700; }
.fc-locate { flex: none; padding: 3px 7px; }
.site-card .fac-card { margin-top: 10px; }
.build-here { margin-top: 10px; border: 2px dashed var(--line); border-radius: var(--radius); padding: 8px 11px; background: var(--paper); }
.build-here.only { margin-top: 6px; border-style: solid; border-color: var(--wood); background: var(--panel); }
.build-here-title { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); margin-bottom: 4px; }
.fac-card .fac-block { border-top: 0; margin-top: 4px; padding-top: 0; }
.fac-card .fac-head { display: none; }
.com-card { margin-bottom: 9px; }
.com-card .staff-row { margin-top: 6px; }
/* facility block sections: Status / Resources / Staffing, divided */
.fs { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-top: 1.5px dashed var(--line-soft); }
.fac-block .fs:first-of-type { border-top: 0; }
.fs-label { flex: none; width: 62px; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); padding-top: 4px; }
.fs-body { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12.5px; overflow: hidden; }
.fs-spacer { flex: 1; }
.fs-stat { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--ink-soft); }
.fs-stat b { color: var(--ink); font-size: 13px; }
.fs-stat .tiny-input { margin: 0 2px; }
.fs-status .build-note { font-size: 11.5px; }
.occ-bar { display: inline-block; width: 64px; height: 8px; border-radius: 4px; background: var(--paper-deep); border: 1px solid var(--line-soft); overflow: hidden; }
.occ-bar i { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.fs-staff .staff-dots { display: inline-flex; gap: 3px; }
.fs .fatigue-line { flex-basis: 100%; }
.cohorts { flex-basis: 100%; display: flex; flex-direction: column; gap: 3px; margin-top: 2px; }
.cohort-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 11.5px; color: var(--ink-soft); padding: 4px 6px; border-radius: 7px; background: var(--paper); }
.cohort-sum b { color: var(--ink); }
.cohort-sum b.warn { color: var(--amber); } .cohort-sum b.bad, .cohort-sum .bad b { color: var(--red); }
.cohort-sum .co-toggle {
  margin-left: auto; width: 22px; height: 22px; padding: 0; border: 1.5px solid var(--line); border-radius: 6px; background: var(--panel);
  color: var(--ink-soft); font-size: 13px; line-height: 1; cursor: pointer; transition: transform .15s ease, background .12s ease;
}
.cohort-sum .co-toggle:hover { background: var(--gold); color: #4a3005; border-color: var(--gold-deep); }
.cohort-sum .co-toggle.open { transform: rotate(90deg); }
.cohort-head { display: flex; justify-content: space-between; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); margin-bottom: 1px; }
.cohort-head .wf-sub { text-transform: none; letter-spacing: 0; font-weight: 600; }
.cohort { display: grid; grid-template-columns: 22px minmax(0, 1fr) 36px 58px 34px; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-soft); padding: 3px 6px; border-radius: 7px; background: var(--paper); min-width: 0; }
.cohort.hot { background: var(--red-wash); color: var(--red-deep); }
.cohort b { font-size: 12px; color: var(--ink); }
.cohort .co-from { font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cohort .co-stay { text-align: right; }
.cohort .co-stay.bad { color: var(--red); font-weight: 700; }
.cohort .fat-bar { width: 58px; min-width: 0; }
.cohort .co-pct { text-align: right; }
.fs .return-block.warn { color: #7a4d00; background: var(--amber-wash); }
.fs .return-block { flex-basis: 100%; white-space: normal; font-size: 11.5px; color: var(--red-deep); background: var(--red-wash); border-radius: 7px; padding: 4px 8px; }

/* broke state */
.chip-coins.broke { border-color: var(--red); }
.chip-coins.broke b { color: var(--red); }
.option-card.locked { opacity: .55; cursor: not-allowed; }
.option-card.locked:hover { border-color: var(--line); }

/* route preview mini-map in task dialogues */
#dlg-map { width: 100%; height: auto; border: 2px solid var(--wood); border-radius: 10px; margin-top: 10px; background: #96c6bd; display: block; }
.dlg-map-btn { display: block; width: 100%; margin-top: 6px; font-weight: 700; }
.spotlight-hidden { display: none !important; }
.game.spotlight .hud-topleft, .game.spotlight .hud-topbar, .game.spotlight .agent-rail,
.game.spotlight .task-hub, .game.spotlight .bottom-bar { opacity: .18; pointer-events: none; filter: saturate(.4); }
#spotlight-bar {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 14px; max-width: calc(100% - 40px);
  background: var(--panel); border: 2.5px solid var(--wood); border-radius: 14px; box-shadow: var(--shadow); padding: 8px 12px 8px 14px;
}
#spotlight-bar .sp-title { font-family: var(--font-display); font-weight: 600; font-size: 15px; white-space: nowrap; }
#spotlight-bar .sp-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-family: var(--font-mono); font-size: 12px; }
#spotlight-bar .sp-leg { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
#spotlight-bar .sp-leg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
#spotlight-bar .sp-hint { font-size: 11px; color: var(--ink-faint); white-space: nowrap; }
#spotlight-bar .btn { white-space: nowrap; flex: none; }
.dlg-map-note { font-size: 10px; color: var(--ink-faint); text-align: center; margin-top: 3px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

/* ---------- interactive tutorial coach ---------- */
#coach-root { position: absolute; z-index: 45; width: min(440px, 92%); pointer-events: none; transition: left .3s ease, top .3s ease; }
.coach-card { position: relative; }
.coach-card.arrow-top::before, .coach-card.arrow-bottom::before {
  content: ""; position: absolute; left: var(--ax, 50%); margin-left: -9px;
  border-left: 9px solid transparent; border-right: 9px solid transparent;
}
.coach-card.arrow-top::before { top: -11px; border-bottom: 11px solid var(--gold-deep); }
.coach-card.arrow-bottom::before { bottom: -11px; border-top: 11px solid var(--gold-deep); }
.coach-card {
  display: flex; gap: 10px; align-items: flex-start; pointer-events: auto;
  background: var(--panel); border: 2.5px solid var(--gold-deep); border-radius: 16px;
  padding: 12px 14px; box-shadow: 0 10px 34px rgba(70,53,31,.35);
  animation: coach-in .35s ease;
}
@keyframes coach-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.coach-body { flex: 1; min-width: 0; }
.coach-title { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.coach-count { font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); margin-left: 4px; }
.coach-text { font-size: 12.5px; color: var(--ink-soft); margin: 3px 0 8px; }
.coach-actions { display: flex; gap: 8px; align-items: center; }
.coach-wait { font-size: 11px; color: var(--gold-deep); font-weight: 800; }
.coach-glow { animation: coach-glow 1.4s ease infinite; border-radius: 12px; }
@keyframes coach-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(237,168,50,.0); }
  50% { box-shadow: 0 0 0 5px rgba(237,168,50,.65); }
}
@media (prefers-reduced-motion: reduce) { .coach-glow { animation: none; box-shadow: 0 0 0 3px rgba(237,168,50,.6); } }

/* handbook help button */
.help-chip {
  width: 38px; justify-content: center; font-family: var(--font-display);
  font-size: 18px; font-weight: 700; color: var(--gold-deep); cursor: pointer; padding: 6px 0;
}
.help-chip:hover { background: var(--gold); color: #4a3005; }
.settings-chip { font-size: 19px; color: var(--ink-soft); }

/* language toggle (start screen) + settings modal */
.lang-toggle { position: absolute; top: 14px; right: 16px; display: inline-flex; border: 2px solid var(--wood); border-radius: 999px; overflow: hidden; background: var(--panel); }
.lang-toggle button { border: 0; background: transparent; padding: 4px 11px; font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--ink-soft); }
.lang-toggle button.active { background: var(--gold); color: #4a3005; }
.lang-toggle button + button { border-left: 1.5px dashed var(--line-soft); }
.start-card { position: relative; }
.settings-body { display: flex; flex-direction: column; gap: 14px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px; border: 2px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--panel); }
.settings-row .st-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.settings-row .st-label b { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.settings-row .st-label span { font-size: 12px; color: var(--ink-soft); }
.settings-row .lang-toggle { position: static; flex: none; }
.settings-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-soft); }
.settings-meta b { color: var(--ink); }

/* ---------- handbook visual system: lead → hero → points → foot ---------- */
.hb-lead {
  display: flex; gap: 10px; align-items: baseline;
  font-family: var(--font-display); font-size: 17px; line-height: 1.35; font-weight: 500;
  border-left: 4px solid var(--gold); padding: 3px 0 3px 13px; margin-bottom: 14px;
}
.hb-lead-ico { font-size: 17px; flex: none; }
.hb-hero {
  background: var(--panel-warm); border: 1.5px solid var(--line-soft); border-radius: 14px;
  padding: 14px; margin-bottom: 14px;
}
.hb-svg { width: 100%; height: auto; display: block; }
.hb-phases { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.hb-phase { text-align: center; font-size: 10px; color: var(--ink-faint); line-height: 1.3; }
.hb-phase b { display: block; font-size: 12px; color: var(--ink); }
.hb-phase .ph-ico { font-size: 17px; display: block; margin-bottom: 1px; }
.hb-coms { display: flex; gap: 8px; margin-top: 12px; }
.hb-com { flex: 1; text-align: center; background: #fffdf4; border: 1.5px solid var(--line); border-radius: 10px; padding: 6px 4px; font-size: 10.5px; color: var(--ink-soft); }
.hb-com b { display: block; font-size: 12px; color: var(--ink); }
.hb-flow { display: flex; gap: 20px; flex-wrap: wrap; }
.hb-step {
  flex: 1; min-width: 100px; background: #fffdf4; border: 1.5px solid var(--line);
  border-radius: 12px; padding: 9px 6px; text-align: center; font-size: 12px; position: relative;
}
.hb-step small { font-size: 10px; color: var(--ink-faint); line-height: 1.3; display: block; margin-top: 2px; }
.hb-step + .hb-step::before {
  content: "\2192"; position: absolute; left: -17px; top: 50%; transform: translateY(-50%);
  font-weight: 800; font-size: 15px; color: var(--wood);
}
.hb-points { display: flex; flex-direction: column; gap: 9px; }
.hb-point { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--ink-soft); line-height: 1.45; }
.hb-point .hb-pico { font-size: 17px; width: 26px; text-align: center; flex: none; }
.hb-point b { color: var(--ink); }
.hb-point .pt-warn { color: var(--amber); font-weight: 700; }
.hb-foot { margin-top: 14px; padding-top: 10px; border-top: 1.5px dashed var(--line-soft); font-size: 11.5px; color: var(--ink-faint); }
.hb-score-col { background: #fffdf4; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.hb-score-line { font-size: 11.5px; margin: 6px 0 0; color: var(--ink-soft); display: flex; gap: 7px; line-height: 1.4; }
.hb-earn { color: var(--green); font-weight: 800; }
.hb-lose { color: var(--red); font-weight: 800; }
.task-card.hb-demo { pointer-events: none; margin-bottom: 6px; padding: 7px 11px; }
.hb-demo-chip { pointer-events: none; margin-bottom: 8px; border: 1.5px solid var(--line) !important; background: var(--panel-warm) !important; }

/* shelter fatigue + send home */
.fatigue-line { display: flex; align-items: center; gap: 7px; margin-top: 7px; }
.fat-bar { flex: 1; height: 8px; background: var(--paper-deep); border-radius: 5px; overflow: hidden; border: 1px solid var(--line); }
.fat-bar > span { display: block; height: 100%; background: var(--green); border-radius: 5px; }
.fat-bar > span.warn { background: var(--amber); }
.fat-bar > span.bad { background: var(--red); }
.btn-close { border-color: var(--line); color: var(--ink-faint); box-shadow: none; margin-left: auto; }
.btn-close:hover { border-color: var(--red); color: var(--red); background: var(--red-wash); }
/* "all clear — run the round" nudge */
.btn-round.pulse-cta { animation: cta-pulse 1.6s ease infinite; }
@keyframes cta-pulse {
  0%, 100% { box-shadow: 0 3px 0 rgba(0,0,0,.28); }
  50% { box-shadow: 0 3px 0 rgba(0,0,0,.28), 0 0 0 6px rgba(237,168,50,.5); }
}
@media (prefers-reduced-motion: reduce) { .btn-round.pulse-cta { animation: none; box-shadow: 0 0 0 4px rgba(237,168,50,.5); } }

/* =========================================================
   LIVE LEAD CHAT (task + emergency dialogues)
   ========================================================= */
.lead-chat { margin: 10px 0 12px; border: 1.5px dashed var(--line); border-radius: 12px; padding: 10px 12px; background: rgba(253,246,228,.6); }
.lead-chat-log { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.lead-chat-log:empty { display: none; }
.lead-msg { font-size: 13px; line-height: 1.45; padding: 7px 11px; border-radius: 12px; max-width: 92%; }
.lead-msg.me { align-self: flex-end; background: var(--amber-wash); border: 1px solid var(--line); border-bottom-right-radius: 4px; }
.lead-msg.them { align-self: flex-start; background: #fffdf4; border: 1px solid var(--line-soft); border-bottom-left-radius: 4px; }
.lead-msg.err { color: var(--red); }
.lead-msg.thinking { display: inline-flex; gap: 4px; padding: 10px 14px; }
.lead-msg.thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-faint); animation: lead-dot 1s infinite ease-in-out; }
.lead-msg.thinking i:nth-child(2) { animation-delay: .15s; } .lead-msg.thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes lead-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.lead-apply { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-soft); font-size: 12px; color: var(--ink-soft); }
.lead-chat-row { display: flex; gap: 8px; margin-top: 8px; }
.lead-chat-log:not(:empty) + .lead-chat-row { margin-top: 10px; }
.lead-chat-row input { flex: 1; min-width: 0; font-family: inherit; font-size: 13.5px; padding: 8px 11px; border: 2px solid var(--line); border-radius: 10px; background: #fffdf6; color: var(--ink); }
.lead-chat-row input:focus { outline: none; border-color: var(--wood); }
.lead-chat-row input:disabled { opacity: .6; }
.lead-chat-note { margin-top: 6px; font-size: 11.5px; color: var(--ink-faint); }
.lead-live { color: var(--green); font-weight: 800; }
.lead-off { color: var(--ink-faint); font-weight: 800; }

/* ---- emergency dialogue: calmer hierarchy ---- */
.em-grid { grid-template-columns: 250px 1fr; }
.em-side .ctx-kv { font-size: 12px; }
.em-side #dlg-map { margin-top: 8px; }
.em-touched-line { margin-top: 10px; font-size: 11.5px; color: var(--ink-soft); display: flex; flex-direction: column; gap: 2px; }
.em-touched-line b { color: var(--ink); }
.em-options { margin-top: 10px; }
.em-card { padding: 10px 12px; margin-bottom: 8px; align-items: flex-start; }
.em-card:not(.selected) { background: rgba(255,253,244,.55); }
.em-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.em-stats { display: inline-flex; gap: 5px; flex: none; }
.em-stats .imp { font-family: var(--font-mono); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--panel-warm); border: 1px solid var(--line-soft); color: var(--ink); }
.em-stats .imp.pos { color: var(--green); border-color: var(--green); background: #eaf5ec; }
.em-stats .imp.neg { color: var(--red); border-color: #f0b4ba; background: #fdecee; }
.em-card .option-more { display: none; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-soft); }
.em-card.selected .option-more { display: block; }
.em-card .option-more .option-desc { margin-bottom: 4px; }
.em-card .option-affects { margin-top: 6px; }

/* impact list inside emergency option cards */
.impact-list { margin-top: 8px; border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; background: #fffdf4; }
.impact-head { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); padding: 6px 10px; background: var(--panel-warm); border-bottom: 1px solid var(--line-soft); }
.impact-head b { color: var(--ink); }
.impact-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; padding: 6px 10px; font-size: 12px; border-bottom: 1px dashed var(--line-soft); }
.impact-row:last-child { border-bottom: 0; }
.impact-row i { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); display: block; }
.impact-row.bad i { background: var(--red); } .impact-row.ok i { background: var(--green); }
.impact-row > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.impact-row b { font-weight: 800; color: var(--ink); }
.impact-row span { color: var(--ink-soft); }
.impact-row.bad span { color: #8a1d28; } .impact-row.ok span { color: var(--green); }
.impact-row em { font-style: normal; font-family: var(--font-mono); font-weight: 700; font-size: 11.5px; color: var(--red); white-space: nowrap; }
.impact-row.ok em, .impact-row.warn em { color: var(--ink-soft); }

.plan-total-why { flex-basis: 100%; margin-top: 6px; font-size: 12px; font-weight: 600; color: #8a1d28; font-family: var(--font-body); }
.plan-total { flex-wrap: wrap; }

/* ---- task / emergency dialogue: two clear zones (plan, then conversation) ---- */
.agent-brief { background: var(--water-wash); border: 1.5px solid #c9dcd3; border-radius: 12px; padding: 10px 14px; font-size: 13px; line-height: 1.5; color: var(--ink); margin-bottom: 4px; }
.agent-brief p { margin: 0; }
.agent-brief p + p { margin-top: 5px; color: var(--ink-soft); }
.agent-brief p.lead-line { font-weight: 600; }
.dlg-section { margin-top: 16px; padding-top: 10px; border-top: 2px solid var(--line-soft); }
.dlg-section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--ink); }
.dlg-section-head .sec-num { width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: var(--panel); font-size: 12px; display: grid; place-items: center; flex: none; }
.dlg-section-head .sec-sub { font-family: var(--font-body); font-weight: 600; font-size: 12px; color: var(--ink-faint); margin-left: auto; text-align: right; }
.plan-section .suggest-box, .plan-section .suggestion { margin-bottom: 8px; }
.talk-section .lead-chat { margin: 0; border: 0; padding: 0; background: transparent; }
.talk-section .lead-chat-log { max-height: 280px; padding: 2px; }
.talk-section .quick-prompts { margin: 8px 0 0; }
.talk-section .lead-chat-log:not(:empty) + .quick-prompts { margin-top: 10px; }
.talk-section .lead-msg.them { background: var(--water-wash); border-color: #c9dcd3; }

.agent-suggest.muted { background: var(--panel-warm); border-color: var(--line); }

/* ---- discussion side panel: docked to the task popup ---- */
.agent-head .agent-talk { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--wood); background: var(--panel); font-weight: 800; }
.agent-head .agent-talk b { background: var(--ink); color: var(--panel); border-radius: 999px; padding: 0 6px; font-size: 11px; }
.lead-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); display: inline-block; }
.lead-dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(76,125,54,.18); }
.modal-dock { display: flex; align-items: stretch; justify-content: center; width: 100%; max-height: 92vh; }
.modal-dock > .modal { max-height: 92vh; }
.modal-backdrop.has-side .modal-dock > .modal.wide { max-width: 900px; }
.lead-drawer {
  width: 0; max-width: 360px; overflow: hidden; flex: none; opacity: 0;
  background: var(--panel); border: 3px solid var(--wood); border-left: 0; border-radius: 0 18px 18px 0;
  box-shadow: 0 20px 60px rgba(0,0,0,.35); display: flex; flex-direction: column; min-height: 0;
}
.lead-drawer.open { width: 360px; opacity: 1; }
.modal-backdrop.has-side .modal-dock > .modal { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.lead-drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px; border-bottom: 2px solid var(--line); background: var(--panel-warm); flex: none; }
.lead-drawer-head > * { flex: none; }
.lead-drawer-head .agent-avatar { flex: 0 0 auto; width: 38px; height: 38px; }
.lead-drawer-head > div:not(.agent-avatar) { min-width: 0; flex: 1; }
.lead-drawer-head .agent-domain { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-drawer .lead-chat { margin: 0; border: 0; border-radius: 0; background: transparent; flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 12px 14px; width: 360px; }
.lead-drawer .lead-chat-log { flex: 1; max-height: none; min-height: 0; overflow-y: auto; }
.lead-drawer .lead-chat-log:empty { display: block; }
.lead-drawer .lead-chat-log:empty::before { content: 'Ask anything about this task. The lead answers only from what they can see.'; display: block; font-size: 12.5px; color: var(--ink-faint); padding: 8px 2px; }
.lead-drawer .quick-prompts { margin: 8px 0 0; }
.lead-drawer .lead-msg.them { background: var(--water-wash); border-color: #c9dcd3; }
@media (max-width: 1100px) { .modal-dock { flex-direction: column; } .lead-drawer { max-width: none; width: 100%; border-left: 3px solid var(--wood); border-top: 0; border-radius: 0 0 18px 18px; max-height: 40vh; } .lead-drawer.open { width: 100%; } .lead-drawer .lead-chat { width: auto; } .modal-backdrop.has-side .modal-dock > .modal { border-radius: 18px 18px 0 0; } }

/* ---- docked panel as a messaging thread ---- */
.modal-backdrop.has-side .modal-dock > .modal { border-right: 0; }
.lead-drawer { border-left: 1.5px solid var(--line-soft); background: #fbf6ea; }
.lead-drawer-head { background: #fffdf6; border-bottom: 1.5px solid var(--line-soft); }
.lead-drawer .lead-chat-log { gap: 8px; padding: 6px 2px; }
.lead-drawer .lead-msg { max-width: 84%; font-size: 13px; line-height: 1.45; padding: 8px 12px; border: 0; }
.lead-drawer .lead-msg.them { position: relative; margin-left: 32px; background: #fffdf6; color: var(--ink); border-radius: 16px 16px 16px 4px; box-shadow: 0 1px 2px rgba(70,53,31,.10); }
.lead-drawer .lead-msg.them::before {
  content: var(--lead-short, ""); position: absolute; left: -32px; bottom: 0; width: 24px; height: 24px; border-radius: 50%;
  background: var(--lead-color, var(--wood)); color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 9px; letter-spacing: .02em;
  display: grid; place-items: center; box-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.lead-drawer .lead-msg.them.thinking { padding: 10px 14px; }
.lead-drawer .lead-msg.me { background: var(--wood-deep); color: #fdf6e4; border-radius: 16px 16px 4px 16px; }
.lead-drawer .lead-msg.err { background: var(--red-wash); color: var(--red-deep); }
.lead-drawer .lead-apply { border-top-color: rgba(70,53,31,.15); }
.lead-drawer .quick-prompts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.lead-drawer .quick-prompts .btn { border-radius: 999px; font-size: 12px; padding: 5px 11px; background: transparent; border: 1.5px solid var(--wood); color: var(--wood-deep); }
.lead-drawer .quick-prompts .btn:disabled { opacity: .35; }
.lead-drawer .lead-chat-row { align-items: center; gap: 6px; margin-top: 10px; }
.lead-drawer .lead-chat-row input { border-radius: 999px; padding: 9px 14px; border: 1.5px solid var(--line); background: #fffdf6; }
.lead-drawer #lead-send { width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 16px; font-weight: 800; display: grid; place-items: center; flex: none; }
.lead-drawer .lead-chat-note { text-align: center; }

/* ---- the panel is the popup's right column: shared title bar, body, footer bands ---- */
.lead-drawer { background: var(--panel); border-left: 0; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.lead-drawer-head { background: var(--panel-warm); border-bottom: 2px solid var(--line); padding: 14px 16px; box-sizing: border-box; box-shadow: inset 1.5px 0 0 var(--line-soft); }
.lead-drawer .lead-chat { padding: 0; border-left: 1.5px solid var(--line-soft); }
.lead-drawer .lead-chat-log { padding: 14px 16px 6px; }
.lead-drawer .lead-chat-log:empty::before { padding: 14px 16px; }
.lead-drawer .quick-prompts { padding: 0 16px 10px; margin: 0; }
.lead-drawer .lead-chat-foot { margin-top: auto; background: var(--panel-warm); border-top: 2px solid var(--line); padding: 10px 16px; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.lead-drawer .lead-chat-row { margin: 0; }
.lead-drawer .lead-chat-note { margin: 0; text-align: left; }
.agent-head .agent-talk.active { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.agent-head .agent-talk.active b { background: var(--gold); color: #3a2a12; }
/* one shadow for the whole popup+panel unit, none on the parts or the bubbles */
.modal-backdrop.has-side .modal-dock { width: auto; border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.modal-backdrop.has-side .modal-dock > .modal, .lead-drawer { box-shadow: none; }
.lead-drawer .lead-msg.them { box-shadow: none; border: 1px solid var(--line-soft); }
.lead-drawer .lead-msg.them::before { box-shadow: none; }
.lead-drawer-head { box-shadow: none; }

.lead-drawer-head { padding: 0 14px 0 16px; overflow: hidden; align-items: center; }
.lead-drawer-head .agent-avatar { width: 34px; height: 34px; font-size: 12px; }
.lead-drawer-head .agent-name { font-size: 14px; line-height: 1.15; }
.lead-drawer-head .lead-chat-note { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 2px 0 0; }
.lead-drawer .lead-chat-foot { padding: 0 16px; overflow: hidden; justify-content: center; }

/* ---- SITREP: the lead's briefing as a report, not a chat bubble ---- */
.sitrep { border: 1.5px solid var(--line); border-radius: 12px; background: #fffdf6; margin-bottom: 4px; overflow: hidden; }
.sitrep-head { display: flex; align-items: center; gap: 10px; padding: 7px 12px; background: var(--panel-warm); border-bottom: 1.5px solid var(--line-soft); font-size: 11.5px; color: var(--ink-soft); font-weight: 700; }
.sitrep-tag { font-family: var(--font-display); font-weight: 600; font-size: 12px; padding: 1px 8px; border-radius: 4px; background: var(--ink); color: var(--panel); }
.sitrep-rows { display: flex; flex-direction: column; }
.sitrep-row { display: grid; grid-template-columns: 96px 1fr; }
.sitrep-row dt, .sitrep-row dd { padding: 7px 12px; border-bottom: 1px dashed var(--line-soft); font-size: 13px; line-height: 1.45; }
.sitrep-rows > :last-child dt, .sitrep-rows > :last-child dd, .sitrep-rows > :last-child { border-bottom: 0; }
.sitrep-row dt { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); padding-top: 9px; padding-right: 0; }
.sitrep-row dd { margin: 0; color: var(--ink); }
.sitrep-row.warn dt { color: var(--amber); } .sitrep-row.warn dt::before { content: '\26A0  '; }
.sitrep-row.warn dd { color: #7a4d00; }

/* ---- agent popover: open items + full conversation history ---- */
.agent-popover-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .agent-popover-cols { grid-template-columns: 1fr; } }
.count-pill { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: var(--panel); font-size: 11px; text-align: center; margin-left: 4px; }
.thread { border: 1.5px solid var(--line); border-radius: 12px; background: #fffdf6; margin-bottom: 8px; overflow: hidden; }
.thread summary { list-style: none; cursor: pointer; padding: 9px 12px; display: flex; flex-direction: column; gap: 2px; background: var(--panel-warm); }
.thread summary::-webkit-details-marker { display: none; }
.thread summary::before { content: '\25B8'; float: right; color: var(--ink-faint); }
.thread[open] summary::before { content: '\25BE'; }
.thread-title { font-weight: 800; font-size: 13px; }
.thread-meta { font-size: 11px; color: var(--ink-faint); }
.thread-status { font-style: normal; font-weight: 800; color: var(--ink-faint); }
.thread-status.open { color: var(--green); }
.thread-log { display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 10px; }
.thread-log .lead-msg { max-width: 88%; font-size: 12.5px; line-height: 1.45; padding: 7px 11px; border: 0; }
.thread-log .lead-msg.me { align-self: flex-end; background: var(--wood-deep); color: #fdf6e4; border-radius: 14px 14px 4px 14px; }
.thread-log .lead-msg.them { position: relative; align-self: flex-start; margin-left: 30px; background: var(--water-wash); color: var(--ink); border: 1px solid #c9dcd3; border-radius: 14px 14px 14px 4px; }
.thread-log .lead-msg.them::before { content: var(--lead-short, ""); position: absolute; left: -30px; bottom: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--lead-color, var(--wood)); color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 8.5px; display: grid; place-items: center; }
.thread-actions { padding: 0 12px 12px; display: flex; justify-content: flex-end; }

.sitrep-row.suggest dt { color: var(--gold-deep); }
.sitrep-row.suggest dd { background: var(--amber-wash); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; }
.sitrep-row.suggest dd > span { flex: 1; }
.sitrep-row.suggest dd .btn { flex: none; }
.sitrep-row.suggest.hold dt { color: var(--ink-faint); } .sitrep-row.suggest.hold dt::before { content: ''; }
.sitrep-row.suggest.hold dd { background: var(--panel-warm); font-weight: 500; }

/* ---- lead popover: history entry → full thread view ---- */
.history-entry { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin-top: 12px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fffdf6; cursor: pointer; font-family: inherit; color: var(--ink); }
.history-entry:hover:not(:disabled) { border-color: var(--wood); background: var(--panel-warm); }
.history-entry:disabled { opacity: .6; cursor: default; }
.history-ico { font-size: 20px; flex: none; }
.history-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.history-text b { font-size: 13.5px; }
.history-text span { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-arrow { font-size: 22px; color: var(--ink-faint); flex: none; }
.modal.history-modal { max-width: 720px; height: 92vh; }
.modal.history-modal .modal-body { background: #fbf6ea; }
.history-thread { display: flex; flex-direction: column; gap: 8px; padding: 4px 6px 8px; }
.history-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; font-size: 11px; color: var(--ink-faint); font-weight: 700; }
.history-divider::before, .history-divider::after { content: ''; flex: 1; border-top: 1.5px dashed var(--line); }
.history-divider span { white-space: nowrap; }
.history-divider em { font-style: normal; font-weight: 800; }
.history-divider .btn { padding: 2px 9px; font-size: 11px; }
.history-thread .lead-msg { max-width: 78%; font-size: 13px; line-height: 1.45; padding: 8px 12px; border: 0; }
.history-thread .lead-msg.me { align-self: flex-end; background: var(--wood-deep); color: #fdf6e4; border-radius: 16px 16px 4px 16px; }
.history-thread .lead-msg.them { position: relative; align-self: flex-start; margin-left: 32px; background: #fffdf6; color: var(--ink); border: 1px solid var(--line-soft); border-radius: 16px 16px 16px 4px; }
.history-thread .lead-msg.them::before { content: var(--lead-short, ""); position: absolute; left: -32px; bottom: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--lead-color, var(--wood)); color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 9px; display: grid; place-items: center; }
.sitrep-row.suggest dt { background: var(--amber-wash); }
.sitrep-row.suggest.hold dt { background: var(--panel-warm); }

/* direct line composer inside the history view */
.history-thread .lead-chat { margin: 0; border: 0; padding: 0; background: transparent; }
.history-thread .lead-chat-log { max-height: none; overflow: visible; gap: 8px; }
.history-thread .lead-chat-log:empty::before { content: 'Nothing on the direct line yet.'; font-size: 12px; color: var(--ink-faint); padding: 4px 2px; }
.history-thread .lead-chat-log .lead-msg { max-width: 78%; font-size: 13px; line-height: 1.45; padding: 8px 12px; border: 0; }
.history-thread .lead-chat-log .lead-msg.me { align-self: flex-end; background: var(--wood-deep); color: #fdf6e4; border-radius: 16px 16px 4px 16px; }
.history-thread .lead-chat-log .lead-msg.them { position: relative; align-self: flex-start; margin-left: 32px; background: #fffdf6; color: var(--ink); border: 1px solid var(--line-soft); border-radius: 16px 16px 16px 4px; }
.history-thread .lead-chat-log .lead-msg.them::before { content: var(--lead-short, ""); position: absolute; left: -32px; bottom: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--lead-color, var(--wood)); color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 9px; display: grid; place-items: center; }
.history-thread .lead-chat-foot { position: sticky; bottom: -16px; margin: 12px -6px -8px; padding: 10px 6px 12px; background: #fbf6ea; border-top: 1.5px solid var(--line-soft); }
.history-thread .lead-chat-row { margin: 0; align-items: center; gap: 6px; }
.history-thread .lead-chat-row input { border-radius: 999px; padding: 9px 14px; border: 1.5px solid var(--line); background: #fffdf6; }
.history-thread #lead-send { width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 16px; font-weight: 800; display: grid; place-items: center; flex: none; }

/* ---- lead view: banner (status + open items) pinned above the thread ---- */
.modal.history-modal { max-width: 760px; }
.history-banner { position: sticky; top: -16px; z-index: 2; margin: -16px -20px 8px; padding: 10px 20px; background: var(--panel-warm); border-bottom: 2px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.history-banner-row { display: flex; align-items: flex-start; gap: 12px; font-size: 12.5px; }
.history-banner-label { flex: none; width: 84px; padding-top: 3px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.history-status { color: var(--ink-soft); line-height: 1.4; }
.history-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.history-chip { font-family: inherit; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1.5px solid var(--wood); background: #fffdf6; color: var(--ink); cursor: pointer; }
.history-chip:hover { background: var(--amber-wash); }
.history-chip.emergency { border-color: var(--red); color: var(--red-deep); }
.history-chip.advisory { border-style: dashed; color: var(--ink-soft); }
.history-none { font-size: 12px; color: var(--ink-faint); padding-top: 3px; }
.modal.history-modal .modal-body { flex: 1 1 auto; min-height: 0; }

/* the thread grows from the top, the direct line stays pinned to the bottom of the view */
.modal.history-modal .modal-body { display: flex; flex-direction: column; }
.history-thread { flex: 1 1 auto; }
.history-thread .lead-chat { margin-top: auto; }
.history-thread .lead-chat-foot { position: static; margin: 12px 0 0; padding: 10px 0 0; }
.history-thread .direct-line { margin-top: auto; display: flex; flex-direction: column; }
.history-thread .direct-line .lead-chat { margin-top: 0; }
.modal.history-modal .modal-foot:empty { display: none; }
.modal-x { flex: none; width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 15px; display: grid; place-items: center; }
.history-modal .sitrep { margin: 4px 0 10px; }
.history-modal .sitrep-row { grid-template-columns: 120px 1fr; }

/* ---- structured report blocks (Disaster Officer) ---- */
.sr-callout { margin: 10px 12px 4px; padding: 10px 14px; border-radius: 10px; background: var(--amber-wash); border: 1.5px solid #ecd9a8; }
.sr-callout-title { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--ink); }
.sr-callout-text { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.sr-list { margin: 8px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.sr-list li { font-size: 12.5px; padding-left: 18px; position: relative; }
.sr-list li::before { content: '\2610'; position: absolute; left: 0; color: var(--gold-deep); }
.sr-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 12px; border-bottom: 1px dashed var(--line-soft); }
.sr-tile { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--panel-warm); border: 1.5px solid var(--line-soft); }
.sr-tile-label { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.sr-tile-main { font-family: var(--font-display); font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.sr-tile-ico { font-size: 18px; }
.sr-tile-sub { font-size: 11.5px; color: var(--ink-soft); }
.sr-tile.warn { border-color: #e6c98a; background: var(--amber-wash); } .sr-tile.bad { border-color: #f0b4ba; background: var(--red-wash); } .sr-tile.good { border-color: #b9d3a8; background: var(--green-wash); }
.sr-table { padding: 8px 12px 10px; border-bottom: 1px dashed var(--line-soft); }
.sr-table-label { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 4px; }
.sr-table table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sr-table th { text-align: left; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); padding: 3px 6px 3px 0; border-bottom: 1px solid var(--line-soft); }
.sr-table td { padding: 5px 6px 5px 0; border-bottom: 1px dashed var(--line-soft); vertical-align: middle; }
.sr-table tr:last-child td { border-bottom: 0; }
.sr-table .sr-name { font-weight: 800; }
.sr-table tr.bad .sr-name { color: var(--red-deep); }
.sr-barcell { min-width: 120px; }
.sr-bar { display: inline-block; width: 64px; height: 7px; border-radius: 4px; background: var(--line-soft); vertical-align: middle; margin-right: 6px; overflow: hidden; }
.sr-bar i { display: block; height: 100%; background: var(--water); border-radius: 4px; }
.sr-bar i.warn { background: var(--gold-deep); } .sr-bar i.bad { background: var(--red); }
.sr-num { font-family: var(--font-mono); font-size: 11.5px; }
.sr-flag { font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 1px 7px; border-radius: 999px; }
.sr-flag.bad { background: var(--red); color: #fff; } .sr-flag.warn { background: var(--amber-wash); color: #7a4d00; border: 1px solid #e6c98a; }
.sr-stats { display: flex; gap: 10px; }
.sr-stat { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--panel-warm); border: 1px solid var(--line-soft); }
.sr-stat b { font-family: var(--font-mono); font-size: 14px; } .sr-stat span { font-size: 11px; color: var(--ink-soft); }
.sr-note { padding: 8px 12px; font-size: 12px; color: var(--ink-faint); font-style: italic; }
