/* WaveOps Agent — single stylesheet, no build step. */
:root {
  --navy: #0b2545;
  --navy-2: #123b5d;
  --teal: #0f8b8d;
  --teal-2: #57b8b0;
  --teal-soft: #e3f4f1;
  --sand: #e9c46a;
  --coral: #e76f51;
  --paper: #f4f1ea;
  --paper-2: #faf8f2;
  --card: #ffffff;
  --ink: #172a3a;
  --muted: #6b7a8a;
  --line: #e3e0d7;
  --ok: #1e7a63;
  --warn: #b7791f;
  --stop: #c24c3a;
  --shadow: 0 18px 50px rgba(11, 37, 69, 0.08);
  --shadow-sm: 0 6px 18px rgba(11, 37, 69, 0.06);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 2%, rgba(87, 184, 176, 0.08), transparent 26rem),
    radial-gradient(circle at 92% 18%, rgba(233, 196, 106, 0.10), transparent 24rem),
    var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration: none; }
a:hover { color: #0a6c6e; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
code {
  font-family: "Cascadia Code", "Consolas", "SFMono-Regular", monospace;
  font-size: 0.88em;
  background: #efede5;
  border-radius: 6px;
  padding: 2px 6px;
}
h1, h2, h3 { margin: 0; line-height: 1.22; letter-spacing: -0.02em; color: var(--navy); }
p { margin: 0 0 10px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.inline-form { display: inline; margin: 0; }
.eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.18em;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--teal-2);
}
.eyebrow.dark { color: var(--teal); }
.eyebrow.light { color: #9fd8d3; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: 70px;
  display: flex; align-items: center; gap: 22px;
  padding: 0 clamp(18px, 4vw, 46px);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(11, 37, 69, 0.08);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--navy); flex: 0 0 auto;
}
.brand:hover { color: var(--navy); }
.brand-mark { color: var(--teal); display: inline-flex; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font-size: 18px; letter-spacing: -0.04em; }
.brand-text small { font-size: 10px; letter-spacing: 0.16em; color: var(--muted); margin-top: 4px; }
.topnav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.topnav a {
  color: #536477; font-size: 13.5px; font-weight: 600;
  padding: 9px 12px; border-radius: 9px;
}
.topnav a:hover, .topnav a.active { color: var(--navy); background: #f0eee7; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-name { font-size: 13px; color: #4b5d70; }
.role-pill {
  display: inline-flex; align-items: center;
  border-radius: 999px; padding: 3px 9px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; white-space: nowrap;
}
.role-pill.admin { color: #7d5a0b; background: #fbf0ce; }
.role-pill.guest { color: #1f5f5b; background: #e1f2ef; }

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 11px;
  padding: 10px 16px; font-size: 13.5px; font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--teal); color: white; box-shadow: 0 8px 18px rgba(15, 139, 141, 0.22); }
.btn-primary:hover { background: #0b7577; color: white; }
.btn-light { background: #fff; color: var(--navy); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12); }
.btn-dark { background: rgba(255, 255, 255, 0.12); color: white; border-color: rgba(255, 255, 255, 0.25); }
.btn-dark:hover { background: rgba(255, 255, 255, 0.2); color: white; }
.btn-ghost { background: transparent; border-color: var(--line); color: #4b5d70; }
.btn-ghost:hover { background: #f6f4ee; color: var(--navy); }
.btn-small { padding: 7px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; padding: 12px 16px; }
.btn:disabled { opacity: 0.55; cursor: wait; transform: none; }
.text-link { font-size: 12.5px; font-weight: 700; }

/* ------------------------------------------------------------------ flash */
.flash-stack { position: fixed; top: 82px; right: 24px; z-index: 60; display: grid; gap: 8px; max-width: min(380px, 90vw); }
.flash { padding: 11px 14px; border-radius: 11px; font-size: 13px; box-shadow: var(--shadow-sm); border: 1px solid; }
.flash-error { background: #fdf0eb; color: #8a3522; border-color: #f2c7ba; }
.flash-success { background: #e9f5ef; color: #1c624f; border-color: #b9ddce; }
.flash-info { background: #eef4fa; color: #315b7c; border-color: #c8dced; }

/* ------------------------------------------------------------------ shell */
.shell {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 26px 0 10px;
}
.shell.narrow { width: min(1040px, calc(100% - 48px)); }
.page-head { margin: 20px 0 24px; }
.page-head h1 { font-size: 34px; margin: 8px 0 8px; }
.banner {
  border-radius: 14px; padding: 12px 16px; margin: 0 0 16px;
  font-size: 13.5px; border: 1px solid;
}
.banner-warn { background: #fdf4df; border-color: #ecd7a3; color: #6c531a; }
.banner a { color: #8a6415; font-weight: 700; text-decoration: underline; }
.compact-banner { margin: 18px 0 0; }

/* ------------------------------------------------------------------- hero */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.7fr) auto;
  gap: 28px;
  align-items: center;
  padding: 34px 38px;
  border-radius: 26px;
  color: white;
  background:
    radial-gradient(circle at 80% 12%, rgba(87, 184, 176, 0.34), transparent 24rem),
    radial-gradient(circle at 12% 105%, rgba(233, 196, 106, 0.20), transparent 22rem),
    linear-gradient(135deg, #081d36 0%, #0b2545 54%, #123b5d 100%);
  box-shadow: 0 24px 60px rgba(8, 29, 54, 0.18);
}
.hero::after {
  content: "";
  position: absolute; right: -80px; bottom: -110px; width: 440px; height: 300px;
  border: 1px solid rgba(159, 216, 211, 0.18);
  border-radius: 50%;
  transform: rotate(-12deg);
  pointer-events: none;
}
.hero-copy, .hero-reading, .hero-actions { position: relative; z-index: 2; }
.hero h1 { color: white; font-size: clamp(36px, 4.4vw, 58px); margin: 10px 0 12px; line-height: 1.02; }
.hero h1 em { font-style: normal; color: var(--sand); }
.hero-lead { max-width: 530px; color: #d4e2ec; font-size: 14.5px; margin: 0; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; color: #c2d5e2; font-size: 12px; }
.hero-meta .sep { color: rgba(255, 255, 255, 0.28); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #75e0c8; box-shadow: 0 0 0 4px rgba(117, 224, 200, 0.2); }
.hero-reading {
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  padding: 17px 20px 15px;
  backdrop-filter: blur(8px);
}
.reading-label { color: #b9d3df; font-size: 11.5px; letter-spacing: 0.08em; }
.reading-value { display: flex; align-items: baseline; gap: 7px; margin: 1px 0 2px; }
.reading-value span { font-size: clamp(44px, 5vw, 66px); line-height: 1; font-weight: 800; letter-spacing: -0.06em; color: #fff; }
.reading-value small { font-size: 17px; color: #a9c6d4; }
.reading-trend { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: 12.5px; color: #d8e6ee; }
.trend-arrow { color: var(--sand); font-weight: 800; }
.reading-trend #trend-delta { color: #9fb9c8; }
.reading-risk { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: #b9d3df; font-size: 11.5px; }
.hero-actions { display: flex; flex-direction: column; gap: 9px; align-items: stretch; min-width: 138px; }
.readonly-pill { border: 1px solid rgba(255,255,255,.22); color: #d6e5ed; border-radius: 999px; padding: 8px 11px; font-size: 11.5px; text-align: center; }
.refresh-icon { font-size: 17px; line-height: 0.7; }

/* --------------------------------------------------------------------- kpi */
.kpi-grid {
  position: relative; z-index: 3;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
  margin: -14px 18px 0;
}
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: 15px;
  padding: 15px 16px 13px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 1px;
}
.kpi-label { font-size: 11.5px; color: var(--muted); font-weight: 650; letter-spacing: 0.02em; }
.kpi-value { font-size: 27px; line-height: 1.2; color: var(--navy); letter-spacing: -0.04em; }
.kpi-value small { font-size: 12px; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.kpi-note { font-size: 10.8px; color: #8a97a4; }

/* --------------------------------------------------------------- period strip */
.period-strip {
  position: relative; z-index: 3;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  margin: 14px 18px 0; padding: 1px;
  background: var(--line); border-radius: 15px; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.period-item {
  display: flex; flex-direction: column; gap: 1px;
  padding: 13px 16px 12px; background: #fbfaf6;
}
.period-label { font-size: 10.8px; color: var(--muted); font-weight: 650; letter-spacing: .02em; }
.period-value { font-size: 23px; line-height: 1.15; color: var(--teal); letter-spacing: -.04em; }
.period-value small { font-size: 11px; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.period-note { font-size: 10.2px; color: #8a97a4; }

/* --------------------------------------------------------------- workspace */
.workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.85fr); gap: 18px; margin-top: 20px; align-items: start; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm);
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.panel-head h2 { font-size: 21px; margin-top: 6px; }
.panel-head h3 { font-size: 17px; margin-top: 5px; }
.panel-head.compact { align-items: center; margin-bottom: 12px; }
.chart-head-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.mode-chip {
  display: inline-flex; align-items: center; gap: 5px;
  color: #315d63; background: #e7f3f0; border: 1px solid #cfe8e3;
  border-radius: 999px; padding: 3px 9px; font-size: 10.5px; font-weight: 700;
  white-space: nowrap;
}
.chart-wrap { position: relative; height: 385px; width: 100%; }
.chart-wrap canvas { display: block; width: 100% !important; height: 100% !important; }
.chart-skeleton {
  position: absolute; inset: 12% 4% 8%; display: grid; place-items: center;
  border-radius: 12px; color: #8c9aa4; font-size: 12px;
  background: linear-gradient(100deg, #f7f5ef 20%, #fbfaf6 38%, #f7f5ef 56%);
  background-size: 220% 100%; animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -120% 0; } }
.empty-chart { display: grid; place-items: center; height: 100%; color: #8c9aa4; font-size: 12px; }
.chart-foot { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding-top: 12px; border-top: 1px solid #f0eee7; margin-top: 12px; }
.legend-hint { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11.5px; color: #5f7080; }
.legend-hint span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 15px; height: 3px; border-radius: 99px; display: inline-block; }
.swatch.observed { background: #0b2545; }
.swatch.forecast { background: var(--teal); }
.swatch.period { background: var(--sand); }
.swatch.band { background: #b9e3dd; height: 9px; border-radius: 3px; }
.chart-note { font-size: 11px; color: #98a3ae; white-space: nowrap; }
.panel-note { margin: 12px 0 0; font-size: 11.8px; line-height: 1.65; color: #7c8a97; }
.text-link { color: var(--teal); }

/* ------------------------------------------------------------------- agent */
.agent-panel { display: flex; flex-direction: column; min-height: 580px; padding: 18px 18px 15px; }
.agent-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px 12px; }
.agent-ident { display: flex; align-items: center; gap: 10px; }
.agent-avatar {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  color: white; font-weight: 800; font-size: 17px;
  background: linear-gradient(145deg, var(--teal), #0a6c6e);
  box-shadow: 0 7px 16px rgba(15, 139, 141, 0.25);
}
.agent-head h2 { font-size: 17px; }
.agent-status { display: flex; align-items: center; gap: 5px; color: #7b8b99; font-size: 10.8px; }
.agent-status i { width: 6px; height: 6px; background: #2eae8f; border-radius: 50%; box-shadow: 0 0 0 3px rgba(46, 174, 143, 0.14); }
.agent-badge { color: #5f737e; border: 1px solid #dde7e5; background: #f4faf8; border-radius: 999px; padding: 3px 8px; font-size: 10px; font-weight: 700; }
.chat-log {
  position: relative;
  flex: 1; min-height: 290px; max-height: 435px; overflow-y: auto;
  background: #f8f7f2; border: 1px solid #ece9df; border-radius: 14px;
  padding: 13px 12px; display: flex; flex-direction: column; gap: 13px;
  scrollbar-width: thin;
}
.msg { display: flex; flex-direction: column; gap: 4px; max-width: 95%; }
.msg-user { align-self: flex-end; align-items: flex-end; }
.msg-agent { align-self: flex-start; align-items: flex-start; }
.msg-meta { font-size: 10.5px; color: #8b98a4; padding: 0 3px; }
.msg-meta span { color: #abb4bd; margin-left: 5px; }
.bubble {
  border-radius: 12px; padding: 10px 12px; font-size: 12.8px; line-height: 1.72;
  white-space: pre-line; word-break: break-word;
}
.msg-agent .bubble { background: white; border: 1px solid #e7e4da; color: #33495b; border-top-left-radius: 4px; }
.msg-user .bubble { background: var(--navy); color: white; border-top-right-radius: 4px; }
.msg-tools { display: flex; gap: 6px; align-items: center; padding: 1px 3px 0; }
.tool-pill { font-family: "Cascadia Code", "Consolas", monospace; font-size: 9.8px; color: #2d7874; background: #e5f4f1; border: 1px solid #cfe9e4; padding: 1px 6px; border-radius: 5px; }
.tool-time { color: #a1abb4; font-size: 9.8px; }
.facts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 4px; width: 100%; }
.fact { background: #fbfaf6; border: 1px solid #ece8dd; border-radius: 8px; padding: 6px 8px; }
.fact span { display: block; color: #8a96a1; font-size: 9.5px; }
.fact b { color: #1e3c51; font-size: 13px; }
.agent-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 10.5px; background: white; border: 1px solid #e9e5db; border-radius: 8px; overflow: hidden; }
.agent-table th { background: #f1efe7; text-align: left; padding: 5px 6px; color: #6d7a84; font-weight: 700; white-space: nowrap; }
.agent-table td { padding: 5px 6px; border-top: 1px solid #f0ede5; white-space: normal; word-break: break-word; color: #425769; line-height: 1.5; }
.typing .bubble { display: flex; gap: 4px; align-items: center; min-height: 32px; }
.typing i { width: 5px; height: 5px; background: #9fb1b9; border-radius: 50%; animation: blink 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .14s; }
.typing i:nth-child(3) { animation-delay: .28s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.suggestions { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 0 8px; }
.suggestion {
  border: 1px solid #e2ded2; background: #fff; color: #556a78;
  border-radius: 999px; padding: 5px 9px; font-size: 10.5px; line-height: 1.2;
  text-align: left; transition: all .15s ease;
}
.suggestion:hover { border-color: #a8d6d1; background: #f1faf8; color: #1f6664; }
.chat-form {
  display: flex; align-items: flex-end; gap: 7px;
  border: 1px solid #ddd9cd; background: #fff; border-radius: 12px; padding: 6px 6px 6px 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.chat-form:focus-within { border-color: #8ccdc7; box-shadow: 0 0 0 3px rgba(15,139,141,.09); }
.chat-form textarea {
  flex: 1; border: none; outline: none; resize: none; min-height: 34px; max-height: 92px;
  padding: 5px 0; background: transparent; color: var(--ink); font-size: 12.5px; line-height: 1.5;
}
.send-btn {
  width: 32px; height: 32px; border: none; border-radius: 9px; background: var(--teal); color: #fff;
  font-size: 18px; line-height: 1; font-weight: 700; display: grid; place-items: center;
}
.send-btn:disabled { background: #b5c9c8; cursor: wait; }
.agent-foot { margin: 7px 2px 0; color: #9aa5ad; font-size: 9.8px; line-height: 1.45; }

/* ------------------------------------------------------------------- lower */
.lower-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; }
.small-panel { padding: 19px 20px; }
.metric-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 14px; }
.metric-list > div { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid #f2efe7; font-size: 12px; }
.metric-list span { color: #7d8a95; }
.metric-list b { color: #223f54; }
.window-lead { margin: 2px 0 10px; font-size: 12.5px; color: #526777; }
.window-lead b { color: var(--teal); }
.window-list { display: grid; gap: 5px; }
.window-row { display: grid; grid-template-columns: 1.35fr .42fr .5fr .52fr; gap: 5px; align-items: center; padding: 6px 0; border-bottom: 1px solid #f2efe7; font-size: 10.7px; }
.window-time { color: #435869; font-variant-numeric: tabular-nums; }
.window-hours, .window-max { color: #85929c; }
.window-max { text-align: right; }
.station-list { display: grid; gap: 2px; }
.station-row { display: grid; grid-template-columns: 58px 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid #f2efe7; font-size: 12px; }
.station-id { font-family: "Cascadia Code", "Consolas", monospace; color: var(--teal); font-weight: 700; }
.station-name { color: #415666; }
.station-role { color: #8b98a3; font-size: 10.5px; }
.source-links { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; font-size: 11.5px; }
.source-links a { color: #397f7d; }

/* --------------------------------------------------------------- risk chips */
.risk-badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 2px 8px; font-size: 10.5px; font-weight: 800; white-space: nowrap; }
.risk-ok { background: #e3f3ec; color: #196852; }
.risk-warn { background: #fbf0d4; color: #8b6218; }
.risk-stop { background: #fbe6e0; color: #a23d2c; }
.hero .risk-ok, .hero .risk-warn, .hero .risk-stop { box-shadow: 0 0 0 1px rgba(255,255,255,.10); }

/* ----------------------------------------------------------------- account */
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 28px; }
.profile-row { display: flex; align-items: center; gap: 13px; padding-bottom: 16px; border-bottom: 1px solid #f0ede5; }
.profile-avatar { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 20px; background: linear-gradient(145deg, var(--navy), #1d5274); }
.profile-row h2 { font-size: 20px; }
.profile-row p { margin: 0; font-size: 12px; }
.profile-row .role-pill { margin-left: auto; }
.permission-list { display: grid; gap: 0; margin-top: 13px; }
.permission-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #f2efe7; font-size: 12.5px; color: #5b6d7a; }
.ok-text { color: var(--ok); }
.callout { margin-top: 16px; padding: 12px 14px; background: #f4f9f7; border-left: 3px solid var(--teal); border-radius: 0 9px 9px 0; font-size: 12px; color: #43615e; }
.callout p { margin: 5px 0; }
.auth-form { display: grid; gap: 13px; margin-top: 17px; }
.auth-form.compact { margin-top: 12px; }
.field { display: grid; gap: 5px; font-size: 12px; color: #566a78; font-weight: 650; }
.field input {
  width: 100%; border: 1px solid #dcd8cc; border-radius: 9px;
  padding: 11px 12px; font-size: 14px; color: var(--ink); background: #fff;
  outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus { border-color: #8dcec8; box-shadow: 0 0 0 3px rgba(15,139,141,.09); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 54px; }
.password-toggle { position: absolute; right: 3px; top: 3px; bottom: 3px; border: none; background: transparent; color: #6e8290; font-size: 11px; padding: 0 8px; border-radius: 6px; }
.password-toggle:hover { background: #f3f1ea; }

/* ------------------------------------------------------------------- error */
.error-card { margin: 40px auto 60px; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 40px; box-shadow: var(--shadow); max-width: 620px; }
.error-card h1 { font-size: 33px; margin: 10px 0 8px; }
.error-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ------------------------------------------------------------------ footer */
.site-footer { margin-top: 34px; padding: 18px 0 26px; border-top: 1px solid rgba(11,37,69,.08); }
.footer-inner { width: min(1440px, calc(100% - 48px)); margin: 0 auto; display: flex; justify-content: space-between; gap: 24px; font-size: 10.8px; color: #98a3aa; line-height: 1.6; }
.footer-inner span:last-child { text-align: right; max-width: 720px; }

/* ------------------------------------------------------------------- login */
.login-body { background: #081d36; }
.login-shell { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(420px, .82fr); min-height: 100vh; }
.login-story {
  position: relative; overflow: hidden; color: #fff;
  padding: clamp(30px, 5vw, 70px) clamp(28px, 6vw, 90px) 100px;
  background:
    radial-gradient(circle at 78% 18%, rgba(87,184,176,.30), transparent 28rem),
    radial-gradient(circle at 10% 90%, rgba(233,196,106,.16), transparent 26rem),
    linear-gradient(145deg, #071a30, #0b2545 58%, #123b5d);
  display: flex; flex-direction: column; justify-content: center;
}
.login-story::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
  pointer-events: none;
}
.login-story > * { position: relative; z-index: 2; }
.login-brand { color: white; margin-bottom: 52px; }
.login-brand:hover { color: white; }
.login-brand .brand-text small { color: #9bb7c8; }
.login-story h1 { color: white; font-size: clamp(38px, 4.5vw, 64px); line-height: 1.07; margin: 12px 0 18px; font-weight: 800; }
.login-story h1 em { font-style: normal; color: var(--sand); }
.login-lead { color: #cbdde7; max-width: 620px; font-size: 15px; line-height: 1.85; }
.story-points { display: grid; gap: 17px; margin-top: 32px; max-width: 600px; }
.story-point { display: flex; gap: 13px; align-items: flex-start; }
.point-icon { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid rgba(159,216,211,.35); border-radius: 9px; color: #9fd8d3; font-family: "Cascadia Code", monospace; font-size: 10px; flex: 0 0 auto; }
.story-point b { display: block; color: #e8f2f6; font-size: 13.5px; margin-bottom: 1px; }
.story-point span { color: #9db7c6; font-size: 12.5px; line-height: 1.65; }
.story-wave { position: absolute; left: 0; right: 0; bottom: 0; height: 160px; opacity: .85; z-index: 1; }
.story-wave svg { width: 100%; height: 100%; }
.login-panel { background: var(--paper); display: flex; flex-direction: column; justify-content: center; padding: 42px clamp(22px, 4vw, 64px); }
.login-card { width: min(420px, 100%); margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 36px 34px 28px; box-shadow: 0 28px 70px rgba(11,37,69,.12); }
.login-card h2 { font-size: 29px; margin: 8px 0 4px; }
.login-card .muted { font-size: 13px; margin-bottom: 20px; }
.login-card .btn { margin-top: 6px; }
.demo-card { margin-top: 20px; padding: 11px 13px; background: #f7f4e9; border: 1px dashed #d8cba3; border-radius: 10px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 11px; }
.demo-card b { display: block; color: #695927; font-size: 11.5px; }
.demo-card span { color: #9a8a62; font-size: 10.3px; }
.demo-card code { background: #fff; color: #67521c; font-size: 11px; }
.login-meta { display: flex; align-items: center; gap: 7px; margin-top: 22px; color: #95a1aa; font-size: 10.3px; }
.login-meta .dot { width: 6px; height: 6px; border-radius: 50%; background: #2eae8f; }
.login-copyright { max-width: 420px; margin: 18px auto 0; color: #9aa5aa; font-size: 10px; line-height: 1.6; text-align: center; }

/* ------------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px);
  background: var(--navy); color: #fff; border-radius: 10px; padding: 10px 16px;
  font-size: 12.5px; opacity: 0; pointer-events: none; transition: all .22s ease; z-index: 90;
  box-shadow: 0 12px 30px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #8a3522; }

/* --------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .hero { grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); }
  .hero-actions { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
  .workspace { grid-template-columns: 1fr; }
  .agent-panel { min-height: auto; }
  .chat-log { max-height: 360px; }
  .lower-grid { grid-template-columns: 1fr 1fr; }
  .lower-grid .small-panel:last-child { grid-column: 1 / -1; }
}
@media (max-width: 880px) {
  .topnav { display: none; }
  .shell, .shell.narrow, .footer-inner { width: calc(100% - 30px); }
  .hero { grid-template-columns: 1fr; padding: 27px 24px; gap: 20px; }
  .hero-actions { justify-content: flex-start; }
  .hero-reading { max-width: 340px; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); margin: -10px 8px 0; }
  .period-strip { grid-template-columns: repeat(2, 1fr); margin: 12px 8px 0; }
  .kpi:nth-child(4), .kpi:nth-child(5) { grid-column: span 1; }
  .lower-grid { grid-template-columns: 1fr; }
  .lower-grid .small-panel:last-child { grid-column: auto; }
  .login-shell { grid-template-columns: 1fr; }
  .login-story { min-height: 54vh; padding-bottom: 84px; }
  .login-panel { padding: 34px 18px 46px; }
  .account-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 5px; }
  .footer-inner span:last-child { text-align: left; }
}
@media (max-width: 620px) {
  .topbar { height: 62px; gap: 8px; padding: 0 14px; }
  .topbar-right .role-pill, .topbar-right .user-name { display: none; }
  .hero h1 { font-size: 38px; }
  .hero-reading { max-width: none; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .kpi-grid { grid-template-columns: 1fr 1fr; margin: 12px 0 0; }
  .period-strip { grid-template-columns: 1fr 1fr; margin: 12px 0 0; }
  .kpi-value { font-size: 24px; }
  .panel { padding: 16px; border-radius: 16px; }
  .chart-wrap { height: 300px; }
  .chart-foot { flex-direction: column; align-items: flex-start; gap: 8px; }
  .chart-note { white-space: normal; }
  .panel-head { flex-direction: column; gap: 7px; }
  .chart-head-meta { align-items: flex-start; }
  .msg { max-width: 100%; }
  .facts-grid { grid-template-columns: 1fr 1fr; }
  .login-story h1 { font-size: 35px; }
  .login-story { padding: 28px 22px 76px; }
  .login-brand { margin-bottom: 34px; }
  .login-lead { font-size: 13.5px; }
  .story-points { margin-top: 24px; }
  .login-card { padding: 28px 22px 24px; }
  .flash-stack { top: 70px; right: 10px; left: 10px; max-width: none; }
}
