:root {
  color-scheme: dark;
  --stone-950: #121311;
  --stone-900: #191a18;
  --stone-850: #20211f;
  --stone-800: #272825;
  --stone-700: #3a3b36;
  --cream: #f2ecdf;
  --cream-muted: #bbb4a6;
  --champagne: #cdb58d;
  --bronze: #9b744d;
  --green: #83ae86;
  --amber: #d4a45c;
  --red: #d78075;
  --border: rgba(242, 236, 223, .11);
  --shadow: 0 24px 70px rgba(0, 0, 0, .24);
  --sidebar: 264px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--stone-950); }
body { margin: 0; min-width: 320px; background: var(--stone-950); color: var(--cream); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--champagne); outline-offset: 3px; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 100; padding: 10px 14px; color: #111; background: var(--cream); border-radius: 8px; }
.skip-link:not(:focus) { clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
.skip-link:focus { top: 12px; }
.monitoring-filters { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.monitoring-filters .field { flex: 1 1 180px; }
.change-card code, .change-card small { overflow-wrap: anywhere; }
#monitorObjects small { display: block; margin-top: 5px; color: var(--cream-muted); line-height: 1.5; }
#monitorEmpty { min-height: 180px; }
#monitorDigest { display: block; margin: 16px 0; }
@media (max-width: 760px) {
  #monitorObjects { min-width: 0; }
  #monitorObjects thead { display: none; }
  #monitorObjects tbody, #monitorObjects tr, #monitorObjects td { display: block; width: 100%; }
  #monitorObjects tr { padding: 12px 0; border-bottom: 1px solid var(--border); }
  #monitorObjects td { padding: 5px 0; border: 0; }
  #monitorObjects td small { margin-top: 3px; }
}
.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; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 16px 18px; background: #151614; border-right: 1px solid var(--border); z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 23px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--champagne); color: var(--champagne); font-family: Georgia, serif; font-size: 26px; }
.brand-name { font: 600 20px/1 Georgia, serif; letter-spacing: .18em; }
.brand-subtitle { margin-top: 5px; color: var(--cream-muted); font-size: 9px; letter-spacing: .24em; }
.env-card { display: flex; gap: 10px; align-items: flex-start; margin: 0 6px 18px; padding: 12px; border: 1px solid rgba(131,174,134,.25); border-radius: 10px; background: rgba(131,174,134,.07); }
.env-card strong, .env-card small, .sidebar-footer strong, .sidebar-footer small { display: block; }
.env-card strong { font-size: 12px; font-weight: 600; }
.env-card small, .sidebar-footer small { margin-top: 3px; color: var(--cream-muted); font-size: 10px; }
.status-dot { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(131,174,134,.12); }
#navigation { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; padding: 0 5px 18px 0; }
#navigation::-webkit-scrollbar { width: 6px; }
#navigation::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(205,181,141,.38); }
.nav-label { margin: 11px 10px 5px; color: #77786f; font-size: 9px; letter-spacing: .16em; text-transform: uppercase; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; padding: 7px 11px; margin: 1px 0; border: 0; border-radius: 8px; background: transparent; color: #aaa99f; text-align: left; font-size: 13px; }
.nav-item:hover { color: var(--cream); background: rgba(255,255,255,.035); }
.nav-item.active { color: var(--cream); background: rgba(205,181,141,.11); box-shadow: inset 2px 0 var(--champagne); }
.nav-item.locked { opacity: .58; }
.nav-icon { width: 18px; color: var(--champagne); text-align: center; font-size: 12px; }
.nav-lock { margin-left: auto; font-size: 11px; line-height: 1; }
.sidebar-footer { flex: 0 0 auto; margin-top: 0; display: flex; align-items: center; gap: 10px; padding: 16px 10px 0; border-top: 1px solid var(--border); }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #191a18; background: var(--champagne); font-size: 11px; font-weight: 700; }
.sidebar-footer strong { font-size: 12px; }

.workspace { min-width: 0; }
.topbar { height: 72px; position: sticky; top: 0; z-index: 12; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; background: rgba(18,19,17,.88); border-bottom: 1px solid var(--border); backdrop-filter: blur(18px); }
.tenant-switcher { display: flex; align-items: center; gap: 12px; }
.tenant-switcher-logo { width: 34px; height: 34px; object-fit: contain; }
.tenant-switcher label { color: var(--cream-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.tenant-switcher select { min-width: 174px; padding: 9px 32px 9px 12px; color: var(--cream); border: 1px solid var(--border); border-radius: 8px; background: var(--stone-850); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.demo-badge, .pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; color: var(--champagne); background: rgba(205,181,141,.09); border: 1px solid rgba(205,181,141,.22); font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.icon-button { position: relative; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; color: var(--cream); border: 1px solid var(--border); border-radius: 9px; background: var(--stone-850); }
.notification-dot { position: absolute; top: 7px; right: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--champagne); }
.menu-button, .scrim { display: none; }

main { max-width: 1540px; margin: 0 auto; padding: 38px 42px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.eyebrow { color: var(--champagne); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 7px 0 8px; font: 500 clamp(29px, 3vw, 43px)/1.05 Georgia, serif; letter-spacing: -.02em; }
h2 { font: 500 23px/1.2 Georgia, serif; }
h3 { margin-bottom: 6px; font-size: 14px; }
.page-description { max-width: 720px; margin-bottom: 0; color: var(--cream-muted); font-size: 13px; line-height: 1.55; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.button { min-height: 39px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 8px; color: var(--cream); background: var(--stone-800); font-weight: 600; font-size: 12px; }
.button:hover { border-color: rgba(205,181,141,.45); }
.button.primary { color: #191a18; border-color: var(--champagne); background: var(--champagne); }
.button.danger { color: #ffd8d2; border-color: rgba(215,128,117,.4); background: rgba(215,128,117,.1); }
.button:disabled { cursor: not-allowed; opacity: .42; }

.grid { display: grid; gap: 16px; }
.kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.two-col { grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: linear-gradient(155deg, rgba(255,255,255,.025), rgba(255,255,255,.009)); box-shadow: 0 12px 40px rgba(0,0,0,.07); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head h2, .card-head h3 { margin-bottom: 0; }
.tenant-logo { display: block; max-width: 230px; max-height: 74px; object-fit: contain; object-position: left center; }
.tenant-logo-tech { width: 58px; }
.tenant-logo-group { width: min(100%, 230px); }
.tenant-card-brand { min-height: 76px; display: flex; align-items: center; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.kpi-label { display: flex; align-items: center; justify-content: space-between; color: var(--cream-muted); font-size: 11px; }
.kpi-value { margin: 18px 0 7px; font: 500 32px/1 Georgia, serif; }
.kpi-note { color: var(--cream-muted); font-size: 10px; }
.trend-up { color: var(--green); }
.trend-warn { color: var(--amber); }
.chart { height: 210px; display: flex; align-items: flex-end; gap: 9px; padding: 20px 4px 26px; border-bottom: 1px solid var(--border); }
.bar { position: relative; flex: 1; min-width: 12px; border-radius: 4px 4px 0 0; background: linear-gradient(to top, var(--bronze), var(--champagne)); opacity: .83; }
.bar span { position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%); color: #85857c; font-size: 9px; }
.list { display: grid; gap: 10px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-row p { margin: 3px 0 0; color: var(--cream-muted); font-size: 11px; }
.metric { color: var(--champagne); font: 500 18px Georgia, serif; }
.status { display: inline-flex; padding: 4px 7px; border-radius: 999px; font-size: 9px; font-weight: 700; }
.status.good { color: #bfe0bf; background: rgba(131,174,134,.12); }
.status.warn { color: #f0cd96; background: rgba(212,164,92,.12); }
.status.muted { color: #b8b8af; background: rgba(255,255,255,.06); }
.status.bad { color: #f0b0a8; background: rgba(215,128,117,.12); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 11px 12px; color: #7f8077; border-bottom: 1px solid var(--border); text-align: left; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
td { padding: 13px 12px; border-bottom: 1px solid var(--border); color: #d8d2c7; }
tr:last-child td { border-bottom: 0; }
.row-title { color: var(--cream); font-weight: 600; }
.row-sub { margin-top: 3px; color: #85857c; font-size: 10px; }
.progress { height: 5px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.06); }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--champagne); }

.gate { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; padding: 15px; border: 1px solid rgba(212,164,92,.25); border-radius: 10px; background: rgba(212,164,92,.06); }
.gate.approved { border-color: rgba(131,174,134,.25); background: rgba(131,174,134,.07); }
.gate-icon { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; color: var(--champagne); background: rgba(205,181,141,.11); }
.gate strong { display: block; margin-bottom: 4px; font-size: 12px; }
.gate p { margin: 0; color: var(--cream-muted); font-size: 11px; line-height: 1.5; }
.steps { counter-reset: step; display: grid; gap: 12px; }
.step { position: relative; padding: 16px 16px 16px 52px; border: 1px solid var(--border); border-radius: 10px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 15px; top: 15px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: var(--champagne); border: 1px solid rgba(205,181,141,.32); font-size: 10px; }
.step p { margin: 4px 0 0; color: var(--cream-muted); font-size: 11px; line-height: 1.5; }
.connector-card { position: relative; }
.connector-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.connector-logo { flex: 0 0 30px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: #191a18; background: var(--champagne); font-weight: 800; }
.connector-card .button { margin-top: 12px; width: 100%; }
.map { position: relative; min-height: 280px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: radial-gradient(circle at 35% 44%, rgba(205,181,141,.13), transparent 4%), radial-gradient(circle at 58% 62%, rgba(205,181,141,.11), transparent 5%), linear-gradient(33deg, transparent 48%, rgba(255,255,255,.03) 49%, transparent 51%), linear-gradient(-21deg, transparent 48%, rgba(255,255,255,.025) 49%, transparent 51%), #191a18; background-size: auto, auto, 70px 70px, 90px 90px; }
.map::after { content: "МОСКВА · МО · DEMO"; position: absolute; left: 16px; bottom: 14px; color: #75766d; font-size: 9px; letter-spacing: .12em; }
.pin { position: absolute; width: 11px; height: 11px; border-radius: 50% 50% 50% 0; background: var(--champagne); transform: rotate(-45deg); box-shadow: 0 0 0 6px rgba(205,181,141,.08); }
.pin:nth-child(1) { left: 34%; top: 45%; }.pin:nth-child(2) { left: 57%; top: 62%; }.pin:nth-child(3) { left: 66%; top: 29%; }.pin:nth-child(4) { left: 45%; top: 27%; }.pin:nth-child(5) { left: 73%; top: 49%; }
.callout { padding: 15px; border-left: 2px solid var(--champagne); background: rgba(205,181,141,.055); }
.callout p { margin: 5px 0 0; color: var(--cream-muted); font-size: 11px; line-height: 1.6; }
.empty { padding: 48px 20px; text-align: center; color: var(--cream-muted); }
.empty strong { display: block; margin-bottom: 7px; color: var(--cream); }

.modal { width: min(760px, calc(100% - 32px)); max-height: min(880px, calc(100vh - 32px)); padding: 0; color: var(--cream); border: 1px solid var(--border); border-radius: 14px; background: var(--stone-900); box-shadow: var(--shadow); overflow: auto; }
.modal::backdrop { background: rgba(0,0,0,.66); backdrop-filter: blur(3px); }
.modal-card { padding: 24px; }
.modal-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal-head h2 { margin: 5px 0 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.field { display: grid; gap: 7px; margin: 13px 0; }
.field label { color: var(--cream-muted); font-size: 11px; }
.field select, .field input { width: 100%; padding: 11px 12px; color: var(--cream); border: 1px solid var(--border); border-radius: 8px; background: var(--stone-850); }
.check-row { display: flex; gap: 10px; margin: 12px 0; color: var(--cream-muted); font-size: 11px; line-height: 1.45; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; max-width: 330px; padding: 12px 15px; border: 1px solid rgba(205,181,141,.3); border-radius: 9px; background: #252622; color: var(--cream); box-shadow: var(--shadow); font-size: 11px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

.wizard-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.wizard-step { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px 12px; color: #797a72; border: 1px solid var(--border); border-radius: 9px; background: rgba(255,255,255,.015); }
.wizard-step span { display: grid; place-items: center; flex: 0 0 23px; width: 23px; height: 23px; border-radius: 50%; border: 1px solid var(--border); font-size: 9px; }
.wizard-step small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wizard-step.active { color: var(--cream); border-color: rgba(205,181,141,.38); background: rgba(205,181,141,.08); }
.wizard-step.active span { color: #181916; border-color: var(--champagne); background: var(--champagne); }
.wizard-step.done { color: var(--green); }
.wizard-step.done span { border-color: rgba(131,174,134,.3); background: rgba(131,174,134,.1); }
.wizard-layout { align-items: start; }
.wizard-panel { min-height: 390px; }
.wizard-panel h2 { margin: 8px 0 22px; font-size: 28px; }
.wizard-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 18px; border-top: 1px solid var(--border); }
.context-card { position: sticky; top: 90px; }
.microcopy, .field small { color: #77786f; font-size: 10px; line-height: 1.5; }
.permission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 18px 0; }
.check-card { display: flex; align-items: center; gap: 9px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--cream-muted); font-size: 11px; }
.legal-check { padding: 14px; border: 1px solid rgba(205,181,141,.2); border-radius: 8px; background: rgba(205,181,141,.045); }
.quality-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 18px; }
.quality-grid > div { padding: 14px; border: 1px solid var(--border); border-radius: 9px; }
.quality-grid span, .quality-grid small { display: block; }
.quality-grid span { font: 500 24px Georgia, serif; }
.quality-grid small { margin-top: 5px; color: var(--cream-muted); }
.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.summary-strip > div { padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.summary-strip small, .summary-strip strong { display: block; }
.summary-strip small { margin-bottom: 6px; color: #77786f; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.summary-strip strong { font-size: 11px; }

.state-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.018); }
.state-toolbar > span { color: var(--cream-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.segmented { display: inline-flex; gap: 3px; padding: 3px; border-radius: 8px; background: #121311; }
.segmented button { padding: 7px 10px; color: #85867d; border: 0; border-radius: 6px; background: transparent; font-size: 10px; }
.segmented button.active { color: #181916; background: var(--champagne); }
.state-panel { min-height: 390px; display: grid; place-items: center; align-content: center; padding: 48px 20px; border: 1px dashed var(--border); border-radius: 12px; text-align: center; background: rgba(255,255,255,.012); }
.state-panel p { max-width: 590px; color: var(--cream-muted); line-height: 1.6; }
.state-panel .actions { justify-content: center; }
.state-panel.error { border-color: rgba(215,128,117,.28); background: rgba(215,128,117,.035); }
.state-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 16px; color: var(--champagne); border: 1px solid var(--border); border-radius: 50%; font: 500 22px Georgia, serif; }

.table-action { padding: 6px 9px; color: var(--champagne); border: 1px solid rgba(205,181,141,.25); border-radius: 6px; background: rgba(205,181,141,.06); font-size: 10px; }
.evidence-head { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.evidence-head small, .evidence-head strong { display: block; }
.evidence-head small, .evidence-meta small, .evidence-url small { color: #77786f; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.evidence-head strong { margin-top: 5px; }
.evidence-url { display: grid; gap: 7px; margin: 16px 0; padding: 12px; border-radius: 8px; background: #121311; }
.evidence-url code { overflow-wrap: anywhere; color: var(--champagne); font-size: 11px; }
blockquote { margin: 16px 0; padding: 18px; color: #d8d2c7; border-left: 2px solid var(--champagne); background: rgba(205,181,141,.04); font: 500 17px/1.55 Georgia, serif; }
.evidence-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.evidence-meta > div { padding: 11px; border: 1px solid var(--border); border-radius: 8px; }
.evidence-meta small, .evidence-meta strong { display: block; }
.evidence-meta strong { margin-top: 5px; font-size: 11px; }

.proposal-layout { align-items: start; }
.proposal-cover { min-height: 220px; display: flex; flex-direction: column; justify-content: flex-end; margin: 4px 0 18px; padding: 22px; border: 1px solid rgba(205,181,141,.22); background: radial-gradient(circle at 75% 20%, rgba(205,181,141,.12), transparent 36%), #141512; }
.proposal-brand { min-height: 72px; margin-bottom: auto; display: flex; align-items: flex-start; }
.proposal-brand .tenant-logo-tech { width: 66px; }
.proposal-brand .tenant-logo-group { width: 230px; }
.proposal-cover small { color: var(--champagne); font-size: 9px; letter-spacing: .12em; }
.proposal-cover h3 { margin: 8px 0; font: 500 27px/1.1 Georgia, serif; }
.proposal-cover p { margin: 0; color: var(--cream-muted); font-size: 11px; }
.button.full { width: 100%; margin-top: 14px; }
.timeline { margin: 8px 0 22px; }
.timeline-item { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding-bottom: 20px; color: var(--cream-muted); }
.timeline-item > span { width: 9px; height: 9px; margin-top: 4px; border: 2px solid var(--stone-900); border-radius: 50%; background: #676860; box-shadow: 0 0 0 1px var(--border); }
.timeline-item.active > span { background: var(--champagne); box-shadow: 0 0 0 1px var(--champagne); }
.timeline-item strong { color: var(--cream); font-size: 12px; }
.timeline-item p { margin: 5px 0; font-size: 11px; }
.timeline-item small { color: #77786f; font-size: 9px; }
.proposal-document { color: #292720; background: #f2ecdf; padding: 28px; border-radius: 9px; }
.proposal-doc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid rgba(41,39,32,.15); }
.proposal-doc-head > div small { display: block; }
.proposal-doc-head .tenant-logo { max-height: 66px; margin-bottom: 8px; }
.proposal-doc-head > div small { margin-top: 4px; color: #706a5e; font-size: 9px; }
.proposal-kicker { margin: 24px 0 7px; color: #8c6b49; font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.proposal-document h2 { margin-bottom: 10px; font-size: 32px; }
.lead-copy { color: #5d584f; line-height: 1.6; }
.proposal-section { padding: 16px 0; border-top: 1px solid rgba(41,39,32,.12); }
.proposal-section h3 { font-family: Georgia, serif; font-size: 17px; }
.proposal-section p, .proposal-section li { color: #4d4941; font-size: 12px; line-height: 1.6; }
.proposal-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.proposal-totals > div { padding: 13px; border: 1px solid rgba(41,39,32,.18); }
.proposal-totals small, .proposal-totals strong { display: block; }
.proposal-totals small { margin-bottom: 5px; color: #817a6d; font-size: 9px; text-transform: uppercase; }
.proposal-warning { margin-top: 16px; padding: 10px; color: #6c4f37; background: #e8dcc8; font-size: 10px; text-align: center; }
.report-preview .report-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.report-title .tenant-logo { max-height: 62px; }
.report-title small { color: var(--cream-muted); font-size: 9px; letter-spacing: .12em; }
.learning-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; gap: 9px; align-items: center; }
.learning-flow > div { min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 9px; }
.learning-flow span, .learning-flow strong, .learning-flow small { display: block; }
.learning-flow span { width: 22px; height: 22px; display: grid; place-items: center; margin-bottom: 12px; color: #171815; border-radius: 50%; background: var(--champagne); font-size: 9px; }
.learning-flow strong { font-size: 11px; }
.learning-flow small { margin-top: 5px; color: var(--cream-muted); font-size: 9px; line-height: 1.4; }
.learning-flow i { color: var(--champagne); font-style: normal; }

.site-analysis-form { margin-bottom: 16px; }
.site-analysis-fields { display: grid; grid-template-columns: minmax(260px, 1.5fr) minmax(180px, .7fr) minmax(170px, .6fr) auto; gap: 12px; align-items: end; }
.site-analysis-fields .field { margin: 0; }
.site-analysis-fields .button { min-height: 41px; }
.analysis-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 16px; }
.analysis-summary > div { min-width: 0; padding: 13px; border: 1px solid var(--border); border-radius: 9px; background: rgba(255,255,255,.018); }
.analysis-summary small, .analysis-summary strong { display: block; }
.analysis-summary small { margin-bottom: 6px; color: #77786f; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.analysis-summary strong { overflow-wrap: anywhere; font-size: 12px; }
.site-audit-grid { margin-bottom: 16px; }
.site-audit-card { display: flex; flex-direction: column; }
.site-audit-card h2 { font-size: 18px; line-height: 1.3; }
.compact-evidence { display: grid; gap: 7px; margin: 4px 0 14px; padding: 12px; border-radius: 8px; background: #121311; }
.compact-evidence small { color: #77786f; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.compact-evidence code { overflow-wrap: anywhere; color: var(--champagne); font-size: 10px; }
.compact-evidence p { margin: 2px 0; color: #d8d2c7; font: 500 13px/1.5 Georgia, serif; }
.compact-evidence > div { display: flex; justify-content: space-between; gap: 10px; color: #77786f; font-size: 9px; }
.site-fix { margin-bottom: 14px; }
.site-fix small { color: #77786f; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.site-fix p { margin: 6px 0 0; color: var(--cream-muted); font-size: 11px; line-height: 1.5; }
.site-audit-card .table-action { align-self: flex-start; margin-top: auto; }
.comparison-card, .action-list { margin-bottom: 16px; }
.action-list ol { margin: 0; padding-left: 20px; color: var(--cream-muted); }
.action-list li { padding: 5px 0; line-height: 1.5; }
.analysis-progress { width: min(440px, 80%); }
.analysis-progress span { width: 68%; animation: demo-progress 1.2s ease-in-out infinite alternate; }
@keyframes demo-progress { from { transform: translateX(-15%); } to { transform: translateX(45%); } }

.monitoring-layout { align-items: start; margin-bottom: 24px; }
.digest-card { position: sticky; top: 90px; }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-title h2 { margin: 6px 0 0; }
.change-feed { display: grid; gap: 10px; }
.change-card { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 14px; }
.change-marker { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #77786f; box-shadow: 0 0 0 5px rgba(255,255,255,.035); }
.change-marker.good { background: var(--green); box-shadow: 0 0 0 5px rgba(131,174,134,.08); }
.change-marker.warn { background: var(--amber); box-shadow: 0 0 0 5px rgba(212,164,92,.08); }
.change-marker.bad { background: var(--red); box-shadow: 0 0 0 5px rgba(215,128,117,.08); }
.change-card h3 { margin: 5px 0 0; font: 500 19px/1.25 Georgia, serif; }
.change-card .card-head { margin-bottom: 9px; }
.change-card .card-head small { color: #77786f; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.change-card > div > p { margin-bottom: 12px; color: var(--cream-muted); font-size: 11px; }

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .three-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
  .site-analysis-fields { grid-template-columns: 1fr 1fr; }
  .digest-card { position: static; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; width: min(86vw, 290px); transform: translateX(-105%); transition: transform .22s ease; box-shadow: var(--shadow); }
  body.menu-open .sidebar { transform: translateX(0); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 16; width: 100%; border: 0; background: rgba(0,0,0,.56); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.menu-open .scrim { opacity: 1; pointer-events: auto; }
  .topbar { height: 64px; padding: 0 16px; }
  .menu-button { display: grid; }
  .tenant-switcher label, .demo-badge { display: none; }
  .tenant-switcher-logo { width: 30px; height: 30px; }
  .tenant-switcher select { min-width: 150px; max-width: 46vw; }
  main { padding: 28px 16px 50px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head .actions { width: 100%; }
  .page-head .button { flex: 1; }
  .kpi-grid, .three-col { grid-template-columns: 1fr; }
  .card { padding: 17px; }
  .modal-card { padding: 18px; }
  .wizard-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .wizard-step { justify-content: flex-start; flex-direction: column; gap: 4px; padding: 7px 2px; text-align: center; }
  .wizard-step small { display: block; max-width: 100%; font-size: 7px; }
  .wizard-panel { min-height: 0; }
  .context-card { position: static; }
  .permission-grid, .quality-grid, .summary-strip, .evidence-meta, .proposal-totals, .analysis-summary, .site-analysis-fields { grid-template-columns: 1fr; }
  .state-toolbar { align-items: flex-start; flex-direction: column; }
  .segmented { width: 100%; overflow-x: auto; }
  .segmented button { flex: 1; white-space: nowrap; }
  .proposal-document { padding: 20px; }
  .proposal-doc-head { align-items: flex-start; flex-direction: column; }
  .learning-flow { grid-template-columns: 1fr; }
  .learning-flow i { transform: rotate(90deg); text-align: center; }
  .compact-evidence > div, .section-title, .change-card .card-head { align-items: flex-start; flex-direction: column; }
  .site-analysis-fields .button { width: 100%; }
  .change-card { grid-template-columns: 8px minmax(0, 1fr); gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
