:root {
  --ink: #17252a;
  --ink-soft: #56646a;
  --muted: #8b9697;
  --line: #dfe5e3;
  --line-strong: #cbd5d2;
  --paper: #f6f7f4;
  --panel: #ffffff;
  --sidebar: #14282d;
  --sidebar-2: #1b3539;
  --sidebar-text: #eaf2ef;
  --sidebar-muted: #91aaa5;
  --teal: #159e92;
  --teal-dark: #087b73;
  --teal-soft: #e1f3ef;
  --orange: #cf7d32;
  --orange-soft: #fff0df;
  --blue: #3f6f9f;
  --blue-soft: #e8f0f8;
  --rose: #bd5b5d;
  --rose-soft: #f9e8e6;
  --lime: #5e8d4a;
  --lime-soft: #e9f1e4;
  --shadow: 0 8px 24px rgba(25, 46, 47, 0.06);
  --shadow-lg: 0 18px 42px rgba(25, 46, 47, 0.14);
  --radius: 8px;
  --radius-sm: 5px;
  --sidebar-width: 252px;
  font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 0; background: var(--paper); }
body { min-width: 0; margin: 0; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(21, 158, 146, 0.35); outline-offset: 2px; }
a { color: inherit; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; transform: translateY(-160%); background: var(--teal-dark); color: #fff; padding: 9px 13px; border-radius: 4px; text-decoration: none; }
.skip-link:focus { transform: translateY(0); }

.app-shell { width: 100%; min-width: 0; min-height: 100vh; display: flex; }
.sidebar { width: var(--sidebar-width); flex: 0 0 var(--sidebar-width); min-height: 100vh; max-height: 100vh; overflow-y: auto; padding: 23px 15px 16px; display: flex; flex-direction: column; background: var(--sidebar); color: var(--sidebar-text); position: sticky; top: 0; z-index: 30; }
.brand-lockup { display: flex; align-items: center; gap: 11px; padding: 0 9px 26px; }
.brand-mark { width: 33px; height: 33px; display: grid; place-items: center; border: 1px solid rgba(157, 222, 213, .5); color: #a9e2d8; font-weight: 750; letter-spacing: 0; border-radius: 7px; background: rgba(48, 123, 115, .3); }
.brand-name { font-size: 14px; font-weight: 700; letter-spacing: 0; }
.brand-caption { color: var(--sidebar-muted); font-size: 10px; margin-top: 3px; letter-spacing: 0; text-transform: uppercase; }
.workspace-switch { width: 100%; min-height: 58px; display: flex; align-items: center; gap: 10px; padding: 9px 10px; color: var(--sidebar-text); text-align: left; border: 1px solid rgba(166, 204, 198, .16); border-radius: var(--radius); background: rgba(255, 255, 255, .06); }
.workspace-switch:hover { background: rgba(255, 255, 255, .1); }
.workspace-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #d9ece5; color: #28615e; font-size: 12px; font-weight: 750; flex: 0 0 auto; }
.workspace-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 3px; }
.workspace-copy strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-copy small { color: var(--sidebar-muted); font-size: 10px; }
.symbol { color: var(--sidebar-muted); font-size: 16px; line-height: 1; }
.primary-nav { margin-top: 27px; }
.nav-label { padding: 0 11px 9px; color: #71918d; font-size: 10px; letter-spacing: 0; text-transform: uppercase; }
.nav-label-spaced { margin-top: 25px; }
.nav-item { width: 100%; min-height: 39px; display: flex; align-items: center; gap: 11px; padding: 8px 11px; border-radius: 6px; color: #b6c9c5; background: transparent; text-align: left; font-size: 12px; position: relative; }
.nav-item:hover { color: #f2fbf8; background: rgba(255, 255, 255, .08); }
.nav-item.is-active { color: #fff; background: var(--sidebar-2); box-shadow: inset 3px 0 0 #45c8b9; }
.nav-symbol { width: 17px; color: #8cbab2; text-align: center; font-size: 16px; line-height: 1; }
.nav-item.is-active .nav-symbol { color: #75d6c9; }
.nav-count { margin-left: auto; color: #789792; font-size: 10px; font-variant-numeric: tabular-nums; }
.nav-count-warn { color: #f2bc7d; }
.nav-count-hot { color: #ed9590; }
.sidebar-footer { margin-top: auto; padding: 18px 8px 0; border-top: 1px solid rgba(179, 207, 202, .12); }
.live-indicator { display: flex; align-items: center; gap: 7px; color: #9bb5b0; font-size: 10px; margin-bottom: 12px; }
.live-indicator span { width: 6px; height: 6px; border-radius: 50%; background: #56c6a0; box-shadow: 0 0 0 3px rgba(86, 198, 160, .12); }
.sidebar-help { width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px 3px; color: #adc1bd; background: transparent; text-align: left; font-size: 11px; }
.sidebar-help:hover { color: #fff; }
.sidebar-version { color: #66817d; font-size: 10px; margin-top: 14px; }

.main-area { flex: 1; min-width: 0; background: var(--paper); }
.topbar { height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 33px; background: rgba(246, 247, 244, .94); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px); }
.topbar-left, .topbar-actions { display: flex; align-items: center; min-width: 0; }
.topbar-left { flex: 1 1 auto; gap: 16px; overflow: hidden; }
.topbar-actions { flex: 0 0 auto; }
.breadcrumb { display: flex; min-width: 0; align-items: center; gap: 10px; overflow: hidden; font-size: 12px; color: var(--muted); white-space: nowrap; }
.breadcrumb strong { min-width: 0; overflow: hidden; color: var(--ink); font-weight: 650; text-overflow: ellipsis; }
.breadcrumb-separator { color: var(--line-strong); }
.topbar-actions { gap: 10px; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; color: #59686b; border: 1px solid transparent; border-radius: 6px; background: transparent; font-size: 17px; position: relative; }
.icon-button:hover { color: var(--teal-dark); border-color: var(--line); background: #fff; }
.menu-button { display: none; }
.notification-dot { position: absolute; top: 7px; right: 7px; width: 5px; height: 5px; border: 1px solid var(--paper); border-radius: 50%; background: var(--orange); }
.search-box { width: 244px; height: 35px; display: flex; align-items: center; gap: 8px; padding: 0 9px; color: #81908f; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.search-box:focus-within { border-color: #92c8c1; box-shadow: 0 0 0 3px rgba(21, 158, 146, .08); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); font-size: 11px; background: transparent; }
.search-box input::placeholder { color: #a0aaaa; }
.search-box kbd { padding: 2px 5px; color: #94a09f; border: 1px solid var(--line); border-radius: 3px; font-size: 10px; line-height: 1; background: #f7f9f7; }
.primary-button { min-height: 35px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; color: #fff; border-radius: 5px; background: var(--teal-dark); font-size: 11px; font-weight: 650; white-space: nowrap; }
.primary-button:hover { background: #05665f; }
.primary-button.compact { min-height: 34px; }
.secondary-button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; color: #36565a; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; font-size: 11px; font-weight: 600; white-space: nowrap; }
.secondary-button:hover { border-color: #9bbab5; background: #f6fbf9; }
.user-button { display: flex; align-items: center; gap: 7px; min-height: 35px; color: var(--ink-soft); padding: 0 0 0 4px; border-radius: 5px; background: transparent; font-size: 11px; }
.user-button:hover { color: var(--teal-dark); }
.user-avatar { width: 26px; height: 26px; display: grid; place-items: center; color: #fff; border-radius: 50%; background: #31585a; font-size: 11px; font-weight: 700; }
.user-button > span:last-child { color: #9ba7a6; font-size: 15px; }

.page-wrap { max-width: 1480px; margin: 0 auto; padding: 31px 33px 54px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading > div:first-child { min-width: 0; }
.eyebrow { margin: 0 0 8px; color: var(--teal-dark); font-size: 10px; font-weight: 750; letter-spacing: 0; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; color: var(--ink); font-size: 28px; line-height: 1.18; letter-spacing: 0; }
h2 { margin-bottom: 5px; color: var(--ink); font-size: 16px; letter-spacing: 0; }
h3 { margin-bottom: 4px; color: var(--ink); font-size: 13px; }
.page-subtitle { margin: 0; overflow-wrap: anywhere; color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.heading-actions { min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.heading-actions > * { max-width: 100%; }
.route-select { max-width: 100%; min-height: 35px; padding: 0 29px 0 10px; color: var(--ink); border: 1px solid var(--line); border-radius: 5px; background: #fff; font-size: 11px; }

.grid { display: grid; gap: 14px; }
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.stat-card, .panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.stat-card { min-height: 132px; padding: 17px 18px; position: relative; overflow: hidden; }
.stat-card::after { content: ""; width: 90px; height: 90px; position: absolute; right: -42px; bottom: -42px; border: 1px solid rgba(21, 158, 146, .12); border-radius: 50%; }
.stat-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--ink-soft); font-size: 11px; }
.stat-label .metric-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.stat-card.orange .metric-dot { background: var(--orange); }
.stat-card.blue .metric-dot { background: var(--blue); }
.stat-card.rose .metric-dot { background: var(--rose); }
.stat-value { margin-top: 15px; color: var(--ink); font-size: 28px; font-weight: 720; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.stat-value small { margin-left: 4px; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.stat-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 9px; font-size: 10px; }
.trend-up { color: var(--teal-dark); }
.trend-flat { color: var(--muted); }
.trend-warn { color: var(--orange); }
.trend-down { color: var(--rose); }

.panel { min-width: 0; overflow: hidden; }
.view-grid > *, .side-stack > * { min-width: 0; }
.panel-header { min-height: 57px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.panel-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.panel-title > div { min-width: 0; }
.panel-title h2 { margin: 0; overflow-wrap: anywhere; }
.panel-title p { margin: 3px 0 0; overflow-wrap: anywhere; color: var(--muted); font-size: 10px; }
.panel-tools { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.panel-body { padding: 17px; }
.dashboard-main { grid-template-columns: minmax(0, 1.4fr) minmax(300px, .86fr); margin-bottom: 14px; }
.dashboard-lower { grid-template-columns: minmax(0, 1fr) minmax(300px, .86fr); }
.route-overview { padding: 20px 20px 18px; }
.route-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.route-kicker { color: var(--muted); font-size: 10px; }
.route-name { margin-top: 5px; overflow-wrap: anywhere; color: var(--ink); font-size: 20px; font-weight: 700; letter-spacing: 0; }
.status-chip, .tag, .priority-chip { display: inline-flex; align-items: center; justify-content: center; min-height: 22px; padding: 0 8px; border-radius: 4px; font-size: 10px; font-weight: 650; white-space: nowrap; }
.status-chip::before { content: ""; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: currentColor; }
.status-chip.active, .tag.active { color: #277a6c; background: var(--teal-soft); }
.status-chip.review, .tag.review { color: #a66b25; background: var(--orange-soft); }
.status-chip.draft, .tag.draft { color: #617275; background: #edf1f0; }
.status-chip.blocked, .tag.blocked { color: #a84d4e; background: var(--rose-soft); }
.status-chip.done, .tag.done { color: #4f7c44; background: var(--lime-soft); }
.route-track { display: flex; align-items: center; gap: 0; margin: 0 4px 20px; }
.route-node { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; color: var(--ink); font-size: 11px; font-weight: 650; }
.route-node .node-dot { width: 11px; height: 11px; border: 3px solid #8ed4c8; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--teal-soft); }
.route-node.end .node-dot { border-color: #dfae73; box-shadow: 0 0 0 3px var(--orange-soft); }
.route-line { height: 1px; flex: 1; margin: 0 11px; background: linear-gradient(90deg, #8ed4c8, #dfae73); position: relative; }
.route-line::after { content: ""; position: absolute; top: -3px; right: 0; width: 7px; height: 7px; border-top: 1px solid #dfae73; border-right: 1px solid #dfae73; transform: rotate(45deg); }
.route-meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.route-meta { padding: 13px 13px 2px 0; }
.route-meta + .route-meta { padding-left: 13px; border-left: 1px solid var(--line); }
.route-meta span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 6px; }
.route-meta strong { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.route-meta em { color: var(--teal-dark); font-size: 10px; font-style: normal; margin-left: 3px; }
.health-panel .panel-body { padding: 18px 18px 14px; }
.health-list { display: grid; gap: 15px; }
.health-row { display: grid; grid-template-columns: 100px 1fr 39px; align-items: center; gap: 11px; }
.health-row label { color: var(--ink-soft); font-size: 10px; }
.meter { height: 7px; border-radius: 4px; background: #edf1ef; overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.meter.orange > span { background: var(--orange); }
.meter.blue > span { background: var(--blue); }
.meter.rose > span { background: var(--rose); }
.health-row strong { color: var(--ink); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.health-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 19px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.health-foot button { color: var(--teal-dark); background: transparent; font-size: 10px; font-weight: 650; }

.action-list { display: grid; }
.action-item { display: grid; grid-template-columns: 27px minmax(0, 1fr) auto; align-items: center; gap: 11px; min-height: 61px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.action-item:last-child { border-bottom: 0; }
.action-index { width: 25px; height: 25px; display: grid; place-items: center; color: var(--teal-dark); border: 1px solid #b8ded8; border-radius: 50%; background: var(--teal-soft); font-size: 10px; font-weight: 700; }
.action-copy { min-width: 0; overflow-wrap: anywhere; }
.action-copy strong { display: block; color: var(--ink); font-size: 11px; font-weight: 650; }
.action-copy small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.action-item > time { color: var(--muted); font-size: 10px; white-space: nowrap; }
.timeline { display: grid; gap: 0; }
.timeline-item { display: grid; grid-template-columns: 93px 17px minmax(0, 1fr); min-height: 68px; position: relative; }
.timeline-item::before { content: ""; position: absolute; left: 101px; top: 17px; bottom: -2px; width: 1px; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-time { padding-top: 2px; color: var(--muted); font-size: 10px; }
.timeline-dot { width: 9px; height: 9px; margin-top: 2px; border: 2px solid #8ed4c8; border-radius: 50%; background: #fff; z-index: 1; }
.timeline-dot.orange { border-color: #dfae73; }
.timeline-dot.blue { border-color: #8caed2; }
.timeline-copy { min-width: 0; padding-left: 12px; overflow-wrap: anywhere; }
.timeline-copy strong { display: block; color: var(--ink); font-size: 11px; font-weight: 650; }
.timeline-copy small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }

.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-color: #b7c7c3 #edf1ef; scrollbar-width: thin; }
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-track { background: #edf1ef; }
.table-wrap::-webkit-scrollbar-thumb { border: 2px solid #edf1ef; border-radius: 8px; background: #9eb3ae; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th { padding: 10px 13px; color: #859392; border-bottom: 1px solid var(--line); text-align: left; font-size: 10px; font-weight: 650; letter-spacing: 0; white-space: nowrap; }
td { max-width: 320px; padding: 12px 13px; overflow-wrap: anywhere; color: var(--ink-soft); border-bottom: 1px solid #edf1ef; font-size: 11px; vertical-align: middle; }
tbody tr:hover { background: #f8fbf9; }
tbody tr:last-child td { border-bottom: 0; }
td strong { color: var(--ink); font-weight: 650; }
.muted { color: var(--muted); font-size: 10px; line-height: 1.5; }
.id-code { color: var(--teal-dark); font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; }
.table-empty { padding: 34px 16px; color: var(--muted); text-align: center; font-size: 11px; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.table-toolbar > .muted { min-width: 0; overflow-wrap: anywhere; text-align: right; }
.filter-group { min-width: 0; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.filter-button { min-height: 27px; padding: 0 9px; color: var(--ink-soft); border: 1px solid transparent; border-radius: 4px; background: transparent; font-size: 10px; }
.filter-button:hover { color: var(--teal-dark); background: var(--teal-soft); }
.filter-button.is-active { color: var(--teal-dark); border-color: #b9ded7; background: var(--teal-soft); font-weight: 650; }
.inline-select { max-width: 100%; min-height: 29px; padding: 0 23px 0 8px; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 4px; background: #fff; font-size: 10px; }

.view-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .33fr); gap: 14px; align-items: start; }
.side-stack { display: grid; gap: 14px; }
.mini-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mini-stat { padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: #fbfcfa; }
.mini-stat span { display: block; color: var(--muted); font-size: 10px; }
.mini-stat strong { display: block; margin-top: 7px; color: var(--ink); font-size: 20px; font-variant-numeric: tabular-nums; }
.mini-stat em { display: block; margin-top: 3px; color: var(--teal-dark); font-size: 10px; font-style: normal; }
.callout { padding: 13px 14px; border-left: 3px solid var(--orange); background: var(--orange-soft); }
.callout strong { display: block; color: #8d5e27; font-size: 11px; }
.callout p { margin: 6px 0 0; color: #8f7458; font-size: 10px; line-height: 1.6; }
.definition-list { display: grid; gap: 0; }
.definition-row { display: grid; grid-template-columns: 95px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.definition-row:last-child { border-bottom: 0; }
.definition-row dt { color: var(--muted); font-size: 10px; }
.definition-row dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--ink-soft); font-size: 10px; line-height: 1.55; }

.entity-avatar { width: 28px; height: 28px; display: inline-grid; place-items: center; margin-right: 8px; color: #2d6762; border-radius: 50%; background: var(--teal-soft); font-size: 10px; font-weight: 700; vertical-align: middle; }
.entity-avatar.person { color: #945e34; background: var(--orange-soft); }
.name-cell { max-width: 100%; display: inline-flex; align-items: center; }
.name-cell .entity-name { min-width: 0; display: inline-flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; white-space: normal; }
.name-cell .entity-name small { color: var(--muted); font-size: 10px; }
.route-cell { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 650; }
.route-cell span { color: var(--orange); font-size: 13px; }

.evidence-expiry { display: inline-flex; align-items: center; gap: 5px; color: var(--orange); }
.evidence-expiry::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.evidence-expiry.ok { color: var(--teal-dark); }
.evidence-expiry.overdue { color: var(--rose); }
.risk-label { color: var(--rose); font-size: 10px; }
.risk-label.low { color: var(--teal-dark); }
.risk-label.mid { color: var(--orange); }

.prompt-card { padding: 15px 16px; border-bottom: 1px solid var(--line); }
.prompt-card:last-child { border-bottom: 0; }
.prompt-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.prompt-title { min-width: 0; flex: 1 1 220px; overflow-wrap: anywhere; color: var(--ink); font-size: 12px; font-weight: 650; line-height: 1.5; }
.prompt-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 9px; color: var(--muted); font-size: 10px; }
.prompt-meta > span { min-width: 0; overflow-wrap: anywhere; }
.prompt-metrics { min-width: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.prompt-metric { color: var(--ink-soft); font-size: 10px; }
.prompt-metric strong { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.prompt-action { min-width: 54px; min-height: 27px; padding: 0 8px; color: var(--teal-dark); border: 1px solid #b9ded7; border-radius: 4px; background: var(--teal-soft); font-size: 10px; font-weight: 650; }
.prompt-action:hover { background: #d2eee8; }
.prompt-runner { padding: 16px; background: #f5faf8; border-bottom: 1px solid var(--line); }
.prompt-runner textarea { width: 100%; min-height: 66px; padding: 10px; resize: vertical; color: var(--ink); border: 1px solid #cde0db; border-radius: 5px; outline: 0; background: #fff; font-size: 11px; line-height: 1.55; }
.prompt-runner textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(21, 158, 146, .08); }
.runner-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 9px; }
.runner-footer small { min-width: 0; flex: 1 1 220px; overflow-wrap: anywhere; color: var(--muted); font-size: 10px; }
.runner-result { margin-top: 12px; padding: 11px 12px; color: var(--ink-soft); border: 1px solid #d7e9e4; border-radius: 4px; background: #fff; font-size: 10px; line-height: 1.6; }
.runner-result strong { color: var(--teal-dark); }

.kanban-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 15px; background: #f2f5f3; }
.kanban-column { min-width: 0; }
.kanban-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 2px 9px; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.kanban-heading span { display: inline-flex; align-items: center; justify-content: center; min-width: 19px; min-height: 18px; padding: 0 4px; color: var(--muted); border-radius: 4px; background: #e4eae7; font-size: 10px; }
.kanban-cards { display: grid; gap: 8px; }
.kanban-card { min-height: 126px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 3px 9px rgba(25, 46, 47, .04); }
.kanban-card:hover { border-color: #a8ccc5; }
.kanban-card .card-type { color: var(--teal-dark); font-size: 9px; font-weight: 700; letter-spacing: 0; text-transform: uppercase; }
.kanban-card h3 { margin: 7px 0 11px; line-height: 1.45; }
.kanban-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 7px; flex-wrap: wrap; color: var(--muted); font-size: 10px; }
.kanban-card-footer > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.person-dot { width: 20px; height: 20px; display: grid; place-items: center; color: #fff; border-radius: 50%; background: #527275; font-size: 9px; font-weight: 700; }

.phase-list { display: grid; gap: 10px; }
.phase { padding: 14px; border: 1px solid var(--line); border-radius: 5px; background: #fbfcfa; }
.phase-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.phase-head strong { color: var(--ink); font-size: 11px; }
.phase-head span { color: var(--muted); font-size: 10px; }
.phase .meter { height: 5px; margin: 11px 0 8px; }
.phase-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: 10px; }
.task-list { display: grid; }
.task-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 48px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-check { width: 17px; height: 17px; display: grid; place-items: center; color: #fff; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; font-size: 11px; }
.task-check.is-done { border-color: var(--teal); background: var(--teal); }
.task-copy { min-width: 0; overflow-wrap: anywhere; }
.task-copy strong { display: block; color: var(--ink); font-size: 11px; font-weight: 600; }
.task-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.task-row time { color: var(--muted); font-size: 10px; white-space: nowrap; }

.funnel { display: grid; gap: 9px; padding: 2px 0 5px; }
.funnel-row { display: grid; grid-template-columns: 95px 1fr 35px; align-items: center; gap: 10px; }
.funnel-row label { color: var(--ink-soft); font-size: 10px; }
.funnel-bar { height: 17px; overflow: hidden; border-radius: 3px; background: #edf1ef; }
.funnel-bar span { display: block; height: 100%; background: var(--teal); }
.funnel-row:nth-child(2) .funnel-bar span { background: #44b4a6; }
.funnel-row:nth-child(3) .funnel-bar span { background: #72c7ab; }
.funnel-row:nth-child(4) .funnel-bar span { background: #dfae73; }
.funnel-row strong { color: var(--ink); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.sparkline { height: 55px; display: flex; align-items: end; gap: 6px; margin-top: 12px; padding: 0 3px; border-bottom: 1px solid var(--line); }
.sparkline i { display: block; flex: 1; min-width: 4px; max-width: 17px; border-radius: 2px 2px 0 0; background: #9bd8ce; }
.sparkline i:nth-last-child(-n+3) { background: var(--teal); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 9px; color: var(--muted); font-size: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.legend i.orange { background: var(--orange); }

.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi-card { min-height: 139px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.kpi-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.kpi-card-top span { min-width: 0; overflow-wrap: anywhere; color: var(--muted); font-size: 10px; }
.kpi-icon { width: 24px; height: 24px; display: grid; place-items: center; color: var(--teal-dark); border-radius: 5px; background: var(--teal-soft); font-size: 13px; }
.kpi-card strong { display: block; margin-top: 16px; color: var(--ink); font-size: 24px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.kpi-card small { display: block; margin-top: 7px; color: var(--ink-soft); font-size: 10px; }
.kpi-card small b { color: var(--teal-dark); font-weight: 650; }

.intake-progress { display: flex; align-items: center; gap: 16px; padding: 17px; border-bottom: 1px solid var(--line); background: #f7fbf9; }
.progress-ring { width: 63px; height: 63px; display: grid; place-items: center; flex: 0 0 auto; border: 6px solid #dbece7; border-top-color: var(--teal); border-right-color: var(--teal); border-radius: 50%; color: var(--teal-dark); font-size: 14px; font-weight: 700; transform: rotate(-16deg); }
.progress-ring span { transform: rotate(16deg); }
.intake-progress-copy { min-width: 0; overflow-wrap: anywhere; }
.intake-progress-copy strong { display: block; color: var(--ink); font-size: 12px; }
.intake-progress-copy p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.checklist { display: grid; }
.check-item { display: grid; grid-template-columns: 21px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 51px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.check-item:last-child { border-bottom: 0; }
.check-box { width: 17px; height: 17px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; color: #fff; font-size: 10px; }
.check-box.checked { color: #fff; border-color: var(--teal); background: var(--teal); }
.check-copy { min-width: 0; overflow-wrap: anywhere; }
.check-copy strong { display: block; color: var(--ink); font-size: 11px; font-weight: 600; }
.check-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.check-item time { color: var(--muted); font-size: 10px; white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--ink-soft); font-size: 10px; font-weight: 650; }
.field input, .field select, .field textarea { width: 100%; min-height: 34px; padding: 7px 9px; color: var(--ink); border: 1px solid var(--line); border-radius: 4px; outline: 0; background: #fff; font-size: 11px; }
.field textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(21, 158, 146, .08); }
.form-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(15, 31, 33, .5); z-index: 90; }
.modal { width: min(520px, 100%); max-height: min(700px, calc(100vh - 40px)); overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 18px 19px 15px; border-bottom: 1px solid var(--line); }
.modal-header > div { min-width: 0; }
.modal-header h2 { margin: 0; overflow-wrap: anywhere; }
.modal-header p { margin: 5px 0 0; overflow-wrap: anywhere; color: var(--muted); font-size: 10px; }
.modal-body { padding: 17px 19px 19px; }
.modal-close { width: 28px; height: 28px; display: grid; place-items: center; color: var(--muted); border-radius: 4px; background: transparent; font-size: 17px; }
.modal-close:hover { color: var(--ink); background: #f1f4f2; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 120; max-width: min(360px, calc(100vw - 44px)); padding: 11px 14px; color: #fff; border-radius: 5px; background: #234348; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; font-size: 11px; line-height: 1.45; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.sidebar-scrim { display: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.loading { display: grid; min-height: 280px; place-items: center; color: var(--muted); font-size: 11px; }
[hidden] { display: none !important; }
button:disabled { cursor: not-allowed; opacity: .55; }
.workspace-switch.is-static { cursor: default; }
.workspace-switch.is-static:hover { background: rgba(255, 255, 255, .06); }
.user-role { min-height: 20px; display: inline-flex; align-items: center; padding: 0 7px; color: #526365; border: 1px solid var(--line); border-radius: 4px; background: #fff; font-size: 9px; white-space: nowrap; }
.text-button { min-height: 32px; padding: 0 6px; color: var(--teal-dark); background: transparent; font-size: 10px; font-weight: 650; }
.text-button:hover { color: #055f59; text-decoration: underline; }
.readonly-badge { min-height: 28px; display: inline-flex; align-items: center; padding: 0 9px; color: #526365; border: 1px solid var(--line); border-radius: 4px; background: #fff; font-size: 10px; font-weight: 650; }

.auth-screen .sidebar, .auth-screen .sidebar-scrim, .auth-screen .topbar { display: none; }
.auth-screen .main-area { min-height: 100vh; }
.auth-screen .page-wrap { max-width: 1180px; min-height: 100vh; display: grid; align-items: center; padding-top: 44px; padding-bottom: 44px; }
.auth-layout { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 390px; align-items: center; gap: 72px; }
.auth-copy { max-width: 520px; }
.auth-copy h1 { margin-top: 14px; font-size: 34px; }
.auth-copy > p:last-child { max-width: 470px; margin: 16px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.8; }
.auth-mark { width: 42px; height: 42px; display: grid; place-items: center; color: #fff; border-radius: 7px; background: var(--sidebar); font-size: 16px; font-weight: 750; }
.auth-panel { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.auth-panel > p { margin: 7px 0 22px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.auth-form { display: grid; gap: 14px; }
.auth-form .primary-button { width: 100%; margin-top: 2px; }
.auth-state, .empty-state-page { width: min(520px, 100%); justify-self: center; text-align: center; }
.auth-state .auth-mark { margin: 0 auto 22px; }
.auth-state p, .empty-state-page p { margin: 10px auto 22px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.empty-state-page .status-chip { margin-bottom: 18px; }
.auth-progress { width: 180px; height: 3px; margin: 22px auto 0; overflow: hidden; border-radius: 3px; background: #e4e9e7; }
.auth-progress span { width: 45%; height: 100%; display: block; border-radius: inherit; background: var(--teal); animation: auth-loading 1.2s ease-in-out infinite alternate; }
@keyframes auth-loading { from { transform: translateX(0); } to { transform: translateX(123%); } }

.service-summary { padding: 20px; }
.service-summary-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.service-summary-head span { display: block; color: var(--muted); font-size: 10px; }
.service-summary-head strong { display: block; margin-top: 5px; color: var(--ink); font-size: 23px; font-variant-numeric: tabular-nums; }
.service-summary > .meter { height: 8px; }
.service-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 19px 0 0; border-top: 1px solid var(--line); }
.service-meta > div { min-width: 0; padding: 13px 12px 0 0; }
.service-meta > div:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--line); }
.service-meta dt { color: var(--muted); font-size: 10px; }
.service-meta dd { margin: 6px 0 0; overflow-wrap: anywhere; color: var(--ink); font-size: 11px; line-height: 1.45; }
.service-updates { display: grid; padding: 4px 17px; }
.service-update { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.service-update:last-child { border-bottom: 0; }
.service-update time { color: var(--muted); font-size: 10px; }
.service-update > div { min-width: 0; overflow-wrap: anywhere; }
.service-update strong { display: block; color: var(--ink); font-size: 11px; }
.service-update p { margin: 5px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.55; }
.empty-inline { padding: 28px 16px; color: var(--muted); text-align: center; font-size: 10px; }
.cell-subtitle { margin-top: 4px; color: var(--muted); font-size: 9px; }
.table-link { color: var(--teal-dark); font-size: 10px; font-weight: 650; text-decoration: none; }
.table-link:hover { text-decoration: underline; }
.compact-table { min-width: 0; table-layout: fixed; }
.compact-table th, .compact-table td { padding-right: 9px; padding-left: 9px; white-space: normal; overflow-wrap: anywhere; }
.compact-table th:first-child { width: 38%; }
.compact-table th:nth-child(2) { width: 21%; }
.compact-table th:nth-child(3) { width: 27%; }
.compact-table th:last-child { width: 14%; }

.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 14px 0; align-items: start; }
.workspace-mini-avatar { width: 28px; height: 28px; display: inline-grid; place-items: center; margin-right: 8px; flex: 0 0 auto; color: #2d6762; border-radius: 50%; background: var(--teal-soft); font-size: 9px; font-weight: 750; }
tbody tr.is-current { background: #f3f9f7; }
.table-progress { min-width: 112px; display: flex; align-items: center; gap: 8px; }
.table-progress > span { width: 68px; height: 5px; display: block; overflow: hidden; border-radius: 4px; background: #e7ecea; }
.table-progress i { height: 100%; display: block; border-radius: inherit; background: var(--teal); }
.table-progress strong { min-width: 30px; font-size: 10px; font-variant-numeric: tabular-nums; }
.workspace-choice-list { display: grid; gap: 6px; }
.workspace-choice { width: 100%; min-height: 58px; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; background: #fff; text-align: left; }
.workspace-choice:hover { border-color: #a5c7c0; background: #f7fbfa; }
.workspace-choice.is-current { border-color: #a9d3cc; background: var(--teal-soft); }
.workspace-choice strong, .workspace-choice small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-choice strong { font-size: 11px; }
.workspace-choice small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.workspace-choice i { color: var(--teal-dark); font-size: 9px; font-style: normal; font-weight: 650; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.field input:disabled, .field select:disabled, .field textarea:disabled { color: #667474; background: #f4f6f4; cursor: default; opacity: 1; }

@media (max-width: 1320px) {
  .view-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side-stack > .panel:last-child { grid-column: 1 / -1; }
}

@media (max-width: 1180px) {
  :root { --sidebar-width: 224px; }
  .topbar { padding: 0 24px; }
  .page-wrap { padding-right: 24px; padding-left: 24px; }
  .search-box { width: 190px; }
  .user-name { display: none; }
  .dashboard-main, .dashboard-lower { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 25; background: rgba(15, 31, 33, .45); }
  .sidebar.is-open + .sidebar-scrim { display: block; }
  .menu-button { display: grid; }
  .topbar { padding: 0 18px; }
  .page-wrap { padding: 25px 18px 46px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .view-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side-stack > .panel:last-child { grid-column: 1 / -1; }
  .auth-layout { gap: 38px; grid-template-columns: minmax(0, 1fr) 360px; }
}

@media (max-width: 680px) {
  .topbar { height: 62px; gap: 10px; }
  .breadcrumb span:not(.breadcrumb-separator) { display: none; }
  .topbar-actions { gap: 3px; }
  .search-box { width: 35px; padding: 0; justify-content: center; border-color: transparent; background: transparent; }
  .search-box input, .search-box kbd { display: none; }
  .search-box span { font-size: 19px; }
  .topbar-actions .primary-button { width: 34px; min-width: 34px; padding: 0; font-size: 0; }
  .topbar-actions .primary-button span { font-size: 18px; }
  .user-button { padding-left: 2px; }
  .user-button > span:last-child { display: none; }
  .user-role { display: none; }
  .page-heading { display: block; margin-bottom: 21px; }
  .heading-actions { margin-top: 14px; }
  h1 { font-size: 24px; }
  .stats-grid { gap: 9px; }
  .stat-card { min-height: 119px; padding: 14px; }
  .stat-value { margin-top: 12px; font-size: 23px; }
  .route-overview { padding: 16px; }
  .route-name { font-size: 17px; }
  .route-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .route-meta:nth-child(3) { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .route-meta:nth-child(4) { border-top: 1px solid var(--line); }
  .side-stack { grid-template-columns: 1fr; }
  .side-stack > .panel:last-child { grid-column: auto; }
  .panel-header { padding: 12px 14px; }
  .panel-tools { width: 100%; justify-content: flex-start; }
  .panel-tools > * { max-width: 100%; }
  .panel-body { padding: 14px; }
  .panel-title h2 { white-space: normal; }
  .health-row { grid-template-columns: 86px 1fr 33px; }
  .kanban-board { grid-template-columns: 1fr; padding: 12px; }
  .kanban-column + .kanban-column { margin-top: 4px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .kpi-card { min-height: 128px; padding: 13px; }
  .kpi-card strong { font-size: 21px; }
  .intake-progress { align-items: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .table-toolbar { align-items: flex-start; flex-direction: column; }
  .table-toolbar > .muted { width: 100%; text-align: left; }
  .table-wrap table:not(.compact-table) th:first-child,
  .table-wrap table:not(.compact-table) td:first-child { position: sticky; left: 0; }
  .table-wrap table:not(.compact-table) th:first-child { z-index: 2; background: #fff; box-shadow: 7px 0 9px -9px rgba(23, 37, 42, .55); }
  .table-wrap table:not(.compact-table) td:first-child { z-index: 1; background: #fff; box-shadow: 7px 0 9px -9px rgba(23, 37, 42, .45); }
  .table-wrap table:not(.compact-table) tbody tr:hover td:first-child { background: #f8fbf9; }
  .table-wrap table:not(.compact-table) tbody tr.is-current td:first-child { background: #f3f9f7; }
  .page-wrap { padding-right: 13px; padding-left: 13px; }
  .timeline-item { grid-template-columns: 78px 17px 1fr; }
  .timeline-item::before { left: 86px; }
  .funnel-row { grid-template-columns: 75px 1fr 27px; }
  .admin-grid { grid-template-columns: 1fr; }
  .auth-screen .page-wrap { padding: 28px 18px; }
  .auth-layout { grid-template-columns: 1fr; gap: 30px; }
  .auth-copy { padding: 4px 2px 0; }
  .auth-copy h1 { font-size: 28px; }
  .auth-copy > p:last-child { font-size: 12px; }
  .auth-panel { padding: 21px 18px; }
  .service-update { grid-template-columns: 72px minmax(0, 1fr); }
  .service-update > .tag { grid-column: 2; justify-self: start; }
  .client-overview { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .prompt-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 10px; }
  .prompt-metrics { grid-column: 1 / -1; justify-content: space-between; margin-left: 0; }
  .modal-backdrop { padding: 10px; }
  .modal { max-height: calc(100vh - 20px); }
  .modal-header { padding: 15px 14px 12px; }
  .modal-body { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
