/* RurTech GST Billing — brand colours from the RurTech mark (cyan → green). */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #142030;
  --text-2: #3d4a5c;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #0e7490;         /* cyan-700: buttons, links, the chart */
  --accent-hover: #155e75;
  --accent-soft: #e0f2f6;
  --accent-text: #ffffff;
  --brand-green: #10b981;
  --side-bg: #0b1c26;        /* sidebar stays dark in both themes, like the logo's ground */
  --side-text: #c7d6e0;
  --side-muted: #7f97a8;
  --side-active: #12313f;
  --good: #047857;   --good-soft: #d1fae5;
  --warn: #92400e;   --warn-soft: #fef3c7;
  --bad: #b91c1c;    --bad-soft: #fee2e2;
  --info: #1d4ed8;   --info-soft: #dbeafe;
  --neutral-soft: #eef2f6;
  --chart-grid: #e8edf2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .18);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d141b;
    --surface: #151e27;
    --surface-2: #111921;
    --text: #e5edf3;
    --text-2: #c2ceda;
    --muted: #8b9bab;
    --border: #253241;
    --border-strong: #33455a;
    --accent: #22d3ee;
    --accent-hover: #67e8f9;
    --accent-soft: #0f3340;
    --accent-text: #06232c;
    --side-bg: #081319;
    --side-active: #10303c;
    --good: #34d399;   --good-soft: #0d3328;
    --warn: #fbbf24;   --warn-soft: #3a2c0b;
    --bad: #f87171;    --bad-soft: #3d1717;
    --info: #93c5fd;   --info-soft: #172a4a;
    --neutral-soft: #1d2833;
    --chart-grid: #223040;
    --shadow: none;
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.error { color: var(--bad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
kbd {
  font: 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace; padding: 2px 5px; border-radius: 4px;
  border: 1px solid var(--border-strong); border-bottom-width: 2px; background: var(--surface); color: var(--text-2);
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: 600 13.5px/1.2 var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.wide { width: 100%; justify-content: center; padding: 11px 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.linkish { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.icon-btn { background: none; border: 0; font-size: 18px; color: var(--text-2); cursor: pointer; padding: 6px; border-radius: 6px; }
.icon-btn:hover { background: var(--neutral-soft); }

/* ------------------------------------------------------------ sign in */
.signin { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.signin-brand {
  background: radial-gradient(1200px 600px at 0% 0%, #12404f 0%, var(--side-bg) 55%); color: #e6f4f8;
  padding: 56px 64px; display: flex; flex-direction: column; gap: 28px; justify-content: center;
}
/* The RurTech logo is drawn for a white ground, so it sits on a white tile on dark panels. */
.logo-tile { display: inline-flex; background: #fff; border-radius: 12px; padding: 10px 14px; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.logo-tile img { display: block; height: 100%; width: auto; }
.signin-logo { height: 120px; align-self: flex-start; }
.signin-brand h1 { font-size: 30px; font-weight: 700; max-width: 520px; letter-spacing: -.01em; }
.signin-points { margin: 0; padding-left: 18px; color: #b6cdd8; display: grid; gap: 8px; font-size: 15px; }
.signin-card { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 56px; max-width: 460px; margin: 0 auto; width: 100%; }
.signin-card h2 { font-size: 24px; }

.partners { display: flex; gap: 14px; flex-wrap: wrap; }
.partners figure { margin: 0; display: flex; align-items: center; gap: 10px; }
.partners img { height: 64px; width: auto; background: #fff; border-radius: 8px; padding: 6px; }
.partners figcaption { font-size: 12.5px; color: #b6cdd8; max-width: 90px; line-height: 1.3; }
.partners.compact { gap: 8px; }
.partners.compact figure { flex-direction: column; align-items: flex-start; gap: 4px; }
.partners.compact img { height: 56px; padding: 4px; border-radius: 6px; }
.partners.compact figcaption { font-size: 10.5px; color: var(--side-muted); }

/* ------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--side-bg) 248px, transparent 248px); }
.sidebar {
  background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; padding: 16px 12px; gap: 8px; overflow-y: auto;
}
.brand { display: grid; justify-items: center; gap: 8px; padding: 4px 8px 14px; text-decoration: none; border-bottom: 1px solid #16303d; }
.brand .logo-tile { height: 92px; padding: 8px 18px; }
.brand .product { color: #7fe3f3; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.nav { display: grid; gap: 2px; }
.nav-group { margin: 14px 10px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--side-muted); }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--side-text); text-decoration: none; font-weight: 500;
}
.nav a u { text-decoration-color: #7fe3f3; text-underline-offset: 2px; }
.nav a:hover { background: #10262f; color: #fff; }
.nav a.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 #22d3ee; }
.nav .ico { width: 18px; text-align: center; color: #5fd4e8; }
.nav .count { margin-left: auto; background: #f59e0b; color: #1f1300; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 7px; }
.sidebar-foot { margin-top: auto; display: grid; gap: 12px; padding: 14px 8px 4px; border-top: 1px solid #16303d; color: var(--side-muted); font-size: 12px; }
.sidebar-foot .linkish { text-align: left; color: var(--side-muted); text-decoration: none; }
.sidebar-foot kbd { background: #10262f; border-color: #2a4655; color: #b6cdd8; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px;
  padding: 12px 24px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.menu-btn { display: none; }
.titles { min-width: 0; margin-right: auto; }
.crumb { margin: 0; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.titles h1 { font-size: 19px; font-weight: 700; }
.search { position: relative; display: flex; align-items: center; }
.search input { width: 300px; padding: 8px 34px 8px 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: inherit; }
.search kbd { position: absolute; right: 8px; }
.fy { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 600 13px var(--sans); }
.user { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #22d3ee, #10b981); color: #062029; font-weight: 800; font-size: 13px; }
.user-email { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { padding: 22px 24px 48px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; outline: none; }
.content > *, .grid-2 > *, .kpis > *, .grid > * { min-width: 0; }

/* ------------------------------------------------------------ cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 15px; font-weight: 650; margin-right: auto; }
.card-body { padding: 16px 18px; }
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg button { flex: none; }
.seg button { border: 0; background: var(--surface); color: var(--text-2); padding: 7px 12px; font: 600 12.5px var(--sans); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
select.input, input.input, textarea.input {
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font: inherit; width: 100%;
}

/* ------------------------------------------------------------ KPIs */
.kpis { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 14px; }
.kpi { padding: 16px 18px; display: grid; gap: 4px; align-content: start; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi .value { font-size: 24px; font-weight: 650; letter-spacing: -.01em; }
.kpi.hero { background: linear-gradient(135deg, #0b3b4a, #0b1c26); color: #e6f4f8; border-color: transparent; }
.kpi.hero .label { color: #9fd8e6; }
.kpi.hero .value { font-size: 48px; font-weight: 700; line-height: 1.05; }
.kpi .sub { font-size: 12.5px; color: var(--muted); }
.kpi.hero .sub { color: #9fd8e6; }

/* ------------------------------------------------------------ chart */
.chart { width: 100%; height: 240px; display: block; }
.chart .grid line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.chart .bar { fill: var(--accent); }
.chart .bar.current { fill: var(--brand-green); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar, .chart g:hover .bar { opacity: .82; }
.chart-wrap { position: relative; }
.tip {
  position: absolute; pointer-events: none; background: var(--text); color: var(--surface); padding: 6px 9px;
  border-radius: 6px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -110%); box-shadow: var(--shadow-lg);
}

/* ------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  font-weight: 650; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data th.num { text-align: right; }
.grid { display: grid; gap: 18px; align-content: start; }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr { cursor: pointer; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tfoot td { font-weight: 700; background: var(--surface-2); border-bottom: 0; }
table.data .sub { display: block; color: var(--muted); font-size: 11.5px; font-family: ui-monospace, Consolas, monospace; }
table.data .strong { font-weight: 600; }
table.data td.nowrap, table.data td.strong:first-child { white-space: nowrap; }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.empty strong { color: var(--text); font-size: 15px; }

/* ------------------------------------------------------------ status chips */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.paid, .chip.done { background: var(--good-soft); color: var(--good); }
.chip.unpaid, .chip.working, .chip.needs_approval { background: var(--warn-soft); color: var(--warn); }
.chip.overdue, .chip.failed, .chip.budget, .chip.dup { background: var(--bad-soft); color: var(--bad); }
.chip.cancelled { background: var(--neutral-soft); color: var(--muted); text-decoration: line-through; }
.chip.b2b { background: var(--info-soft); color: var(--info); }
.chip.b2c { background: var(--neutral-soft); color: var(--text-2); }
.chip.b2b::before, .chip.b2c::before { display: none; }

/* ------------------------------------------------------------ attention list */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* ------------------------------------------------------------ new bill */
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 4px; counter-reset: s; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 13px; }
.steps li::before { counter-increment: s; content: counter(s); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--neutral-soft); font-size: 12px; }
.steps li.on { color: var(--text); }
.steps li.on::before { background: var(--accent); color: var(--accent-text); }
.steps li + li::after { order: -1; content: ""; width: 28px; height: 2px; background: var(--border-strong); margin-right: 4px; }
.drop {
  display: grid; justify-items: center; gap: 6px; padding: 36px 16px; border: 2px dashed var(--border-strong);
  border-radius: var(--radius); cursor: pointer; text-align: center; background: var(--surface-2);
}
.drop strong { font-size: 15px; }
.drop.over, .drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.drop input, .file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-btn { position: relative; cursor: pointer; }
.files { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.files li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.files li > span:first-child { flex: 1; overflow-wrap: anywhere; }
.field { display: grid; gap: 5px; font-size: 13px; }
.field > span { color: var(--text-2); font-weight: 600; }
.seller { display: grid; gap: 6px; font-size: 13px; }
.seller dt { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.seller dd { margin: 0 0 6px; font-weight: 600; }

/* ------------------------------------------------------------ run workspace */
.transcript { display: grid; gap: 12px; max-height: 64vh; overflow-y: auto; padding: 16px 18px; }
.msg { border-radius: var(--radius); padding: 12px 14px; }
.msg.agent { background: var(--surface-2); border: 1px solid var(--border); }
.msg.user { background: var(--accent-soft); }
.who-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
summary.who-label { cursor: pointer; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.md p { margin: .3rem 0; }
.md ul, .md ol { margin: .3rem 0; padding-left: 1.3rem; }
.md h3 { font-size: 14px; margin: .5rem 0 .2rem; }
.md code { background: var(--neutral-soft); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.md pre { background: var(--surface); border: 1px solid var(--border); padding: 10px; border-radius: 8px; overflow-x: auto; }
.md table { border-collapse: collapse; font-size: 12.5px; }
.md td, .md th { border: 1px solid var(--border); padding: 4px 8px; }
.tool { margin: 0; padding-left: 12px; border-left: 2px solid var(--border-strong); font-size: 12.5px; color: var(--muted); }
.notice { background: var(--warn-soft); color: var(--warn); padding: 10px 12px; border-radius: 8px; margin: 0; font-size: 13px; }
.working::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--warn); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.composer { border-top: 1px solid var(--border); padding: 14px 18px; display: grid; gap: 10px; }
.composer .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.composer .row .grow { flex: 1; }

/* ------------------------------------------------------------ drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(8, 15, 22, .45); z-index: 20; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100vw); z-index: 21; background: var(--surface);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
}
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 20px; }
.drawer-body { padding: 18px 20px; overflow-y: auto; display: grid; gap: 18px; align-content: start; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin: 0; }
.facts div { display: grid; gap: 2px; }
.facts dt { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.taxbox { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.taxbox table { width: 100%; border-collapse: collapse; font-size: 13px; }
.taxbox td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.taxbox tr:last-child td { border-bottom: 0; font-weight: 700; font-size: 15px; background: var(--surface-2); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.logo-preview { height: 48px; width: auto; max-width: 160px; object-fit: contain; border: 1px solid var(--border); border-radius: 6px; background: #fff; padding: 4px; }
.preview iframe { width: 100%; height: 520px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.notice ul { margin: 6px 0; padding-left: 18px; }
table.data .sub.review { color: var(--bad); font-family: var(--sans); font-weight: 600; }
kbd.on-accent { background: transparent; border-color: color-mix(in srgb, var(--accent-text) 45%, transparent); color: var(--accent-text); }

/* ------------------------------------------------------------ profile form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ------------------------------------------------------------ misc */
.shortcuts { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); padding: 22px 24px; max-width: 520px; width: calc(100vw - 32px); box-shadow: var(--shadow-lg); }
.shortcuts::backdrop { background: rgba(8, 15, 22, .45); }
.shortcuts table { width: 100%; border-collapse: collapse; margin: 12px 0 16px; font-size: 13px; }
.shortcuts td { padding: 7px 4px; border-bottom: 1px solid var(--border); }
.shortcuts td:first-child { white-space: nowrap; width: 1%; padding-right: 16px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--surface); padding: 10px 16px; border-radius: 8px; z-index: 30; font-weight: 600; box-shadow: var(--shadow-lg); }
.note { font-size: 12.5px; color: var(--muted); padding: 10px 18px; border-top: 1px solid var(--border); }

@media (prefers-reduced-motion: reduce) { .working::before { animation: none; } }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi.hero { grid-column: 1 / -1; }
  .grid-2 { grid-template-columns: 1fr; }
  .search input { width: 200px; }
  .user-email { display: none; }
}
@media (max-width: 860px) {
  .signin { grid-template-columns: 1fr; }
  .signin-brand { padding: 32px 20px; }
  .signin-brand h1 { font-size: 22px; }
  .signin-card { padding: 28px 20px 40px; }
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 25; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-block; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .search { order: 5; width: 100%; }
  .search input { width: 100%; }
  .fy, .user .linkish { font-size: 12px; }
  .topbar > .btn.primary { display: none; }
  .content { padding: 16px 16px 40px; }
  .kpi.hero .value { font-size: 36px; }
  .form-grid, .facts { grid-template-columns: 1fr; }
  table.data .hide-sm { display: none; }
}

/* ------------------------------------------------------------ bill run (v2) */
.run-card { max-width: 920px; width: 100%; margin: 0 auto; overflow: hidden; }
.run-head { display: flex; gap: 16px; align-items: flex-start; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.run-head h2 { font-size: 18px; margin: 2px 0; }
.run-body { padding: 22px; display: grid; gap: 16px; }
.center { text-align: center; }
.working-view { display: grid; gap: 14px; justify-items: stretch; padding: 8px 0; }
.working-view .row { display: flex; align-items: center; gap: 10px; }
.working-view .grow { flex: 1; }
.pulse { width: 56px; height: 56px; border-radius: 50%; justify-self: center; background: radial-gradient(circle, var(--accent) 0 28%, transparent 30%);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); animation: ring 1.8s ease-out infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 100% { box-shadow: 0 0 0 26px transparent; } }
.stage { text-align: center; font-size: 17px; font-weight: 650; margin: 0; }
.bar { height: 10px; border-radius: 999px; background: var(--neutral-soft); overflow: hidden; }
.bar-fill { height: 100%; width: 5%; border-radius: 999px; transition: width .9s ease;
  background: linear-gradient(90deg, var(--accent), var(--brand-green), var(--accent)); background-size: 200% 100%; animation: shimmer 2.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.quote { margin: 10px auto 0; max-width: 620px; text-align: center; padding: 18px 20px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border); opacity: 0; transform: translateY(6px); }
.quote.in { animation: quote-in .7s ease forwards; }
@keyframes quote-in { to { opacity: 1; transform: none; } }
.quote-text { font-size: 16px; font-style: italic; margin: 0 0 6px; color: var(--text); }
.quote-who { margin: 0; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.result { border-radius: var(--radius); padding: 18px; display: grid; gap: 12px; border: 1px solid var(--border); }
.result h3 { margin: 0; font-size: 17px; }
.result p { margin: 0; }
.result.good { background: color-mix(in srgb, var(--good-soft) 55%, var(--surface)); border-color: color-mix(in srgb, var(--good) 30%, var(--border)); }
.result.warn { background: color-mix(in srgb, var(--warn-soft) 60%, var(--surface)); }
.result.bad { background: color-mix(in srgb, var(--bad-soft) 60%, var(--surface)); }
.inv-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 12px; }
.inv-main { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.inv-no { margin: 0; font-weight: 700; font-size: 16px; }
.inv-amt { display: grid; justify-items: end; gap: 4px; }
.amt { margin: 0; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.agent-note { background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: 8px; padding: 12px 16px; }
.agent-note .who-label { margin: 0 0 4px; }
.tech { border-top: 1px solid var(--border); }
.tech summary { padding: 10px 22px; cursor: pointer; color: var(--muted); font-size: 12.5px; }
.tech .transcript { max-height: 320px; padding: 4px 22px 16px; gap: 4px; font: 12px/1.5 ui-monospace, Consolas, monospace; }
.log-row { white-space: pre-wrap; overflow-wrap: anywhere; }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.ghost { background: transparent; }
.chip.draft { background: var(--info-soft); color: var(--info); }
.notice.info { background: var(--info-soft); color: var(--info); }
.toast { display: flex; gap: 14px; align-items: center; }
.toast .linkish { color: inherit; font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
  .pulse, .bar-fill { animation: none; }
  .quote.in { animation: none; opacity: 1; transform: none; }
}

.run-head > .grow { flex: 1; min-width: 0; }

.number-form { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.number-form .num-input { width: 150px; font-variant-numeric: tabular-nums; font-weight: 650; }

/* ------------------------------------------------------------ quotations */
.notice.ok { background: var(--good-soft); color: var(--good); }
.check { display: grid; gap: 8px; }
.check ul, .notice ul { margin: 4px 0 0; padding-left: 18px; }
table.items input.input { padding: 6px 8px; font-size: 13px; }
table.items input.small { margin-top: 4px; font-size: 12px; }
table.items td { padding: 6px 6px; vertical-align: top; }
table.items input.num { width: 90px; text-align: right; }
table.items td:first-child { min-width: 260px; }
table.items tbody tr { cursor: default; }
table.items tbody tr:hover { background: transparent; }
.totals { display: flex; gap: 18px; align-items: center; font-variant-numeric: tabular-nums; }
.totals strong { font-size: 16px; }
.field .toolbar { width: 100%; }
.field .toolbar input { flex: 1; min-width: 200px; }

/* ------------------------------------------------- services and data points */
.scope { display: grid; gap: 10px; }
.scope .toolbar select { max-width: 380px; }
.inline-field { display: flex; align-items: center; gap: 8px; }
.inline-field .input { width: 220px; }
.agent-box { display: grid; gap: 6px; padding: 10px; border: 1px dashed var(--line, #c9d2dc); border-radius: 8px; }
.check-all { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.scope-list { display: grid; gap: 8px; }
.scope-item { border: 1px solid var(--line, #dfe5ec); border-radius: 8px; padding: 8px 10px; display: grid; gap: 4px; }
.scope-item.off { opacity: .55; }
.scope-item p { margin: 0; }
.scope-head { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.scope-item .chips { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.chip-check { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; cursor: pointer; }
.scope-item .input.small { font-size: 12px; padding: 5px 8px; }

.agent-note:empty { display: none; }

/* ------------------------------------------------------------ companies */
.entity-head { display: flex; align-items: center; gap: 12px; }
.entity-logo { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; border: 1px solid var(--line, #dfe5ec); }
