@import "./tokens.css";

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--surface-canvas); }
body { margin: 0; color: var(--ink-950); background: var(--surface-canvas); font-family: var(--font-sans); font-size: var(--text-base); line-height: var(--leading-normal); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { color: inherit; font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { border: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; box-shadow: var(--focus); }
svg { display: block; }
.icon { flex: 0 0 auto; }
.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; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; width: var(--sidebar-width); flex-direction: column; padding: 22px 14px 18px; color: #e7f2ef; background: var(--brand-950); }
.brand { display: flex; align-items: center; gap: 11px; height: 42px; padding: 0 10px; margin-bottom: 28px; }
.brand-mark { position: relative; display: grid; width: 32px; height: 32px; place-items: center; color: white; background: linear-gradient(145deg, var(--brand-500), #65beac); border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.brand-mark::after { position: absolute; width: 8px; height: 8px; content: ""; background: var(--brand-950); border: 2px solid white; border-radius: 50%; }
.brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name strong { color: white; font-size: 1.03rem; letter-spacing: .01em; }
.brand-name span { margin-top: 4px; color: #91aaa4; font-size: .65rem; font-weight: 700; letter-spacing: .14em; }
.nav-label { padding: 0 12px 8px; color: #76928c; font-size: .66rem; font-weight: 750; letter-spacing: .13em; }
.side-nav { display: grid; gap: 5px; }
.nav-item { position: relative; display: flex; min-height: 44px; align-items: center; gap: 12px; padding: 10px 12px; color: #a9bbb7; background: transparent; border-radius: 10px; cursor: pointer; text-align: left; transition: color var(--transition), background var(--transition); }
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active { color: white; background: rgba(69, 172, 150, .16); }
.nav-item.active::before { position: absolute; left: 0; width: 3px; height: 20px; content: ""; background: #57bba6; border-radius: 0 4px 4px 0; }
.nav-item span { font-size: .875rem; font-weight: 650; }
.sidebar-foot { margin-top: auto; }
.system-mini { padding: 13px; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; }
.system-mini .row { display: flex; align-items: center; gap: 8px; color: #dce9e6; font-size: .75rem; font-weight: 650; }
.pulse { width: 7px; height: 7px; background: #58c7a8; border-radius: 50%; box-shadow: 0 0 0 4px rgba(88,199,168,.12); }
.system-mini p { margin: 7px 0 0; color: #78948e; font-size: .68rem; }

.main-shell { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; height: var(--topbar-height); align-items: center; justify-content: space-between; padding: 0 30px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.top-context { display: flex; align-items: center; gap: 10px; color: var(--ink-500); font-size: .78rem; font-weight: 600; }
.top-context strong { color: var(--ink-800); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { position: relative; display: inline-grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; color: var(--ink-600); background: transparent; border-radius: 10px; cursor: pointer; }
.icon-button:hover { color: var(--brand-700); background: var(--surface-muted); }
.notification-dot { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; background: var(--status-blocked-accent); border: 1.5px solid white; border-radius: 50%; }
.profile { display: flex; align-items: center; gap: 10px; padding-left: 11px; margin-left: 3px; border-left: 1px solid var(--line); }
.avatar { display: grid; width: 34px; height: 34px; place-items: center; color: var(--brand-800); background: var(--brand-100); border-radius: 10px; font-size: .75rem; font-weight: 800; }
.profile-copy { display: flex; flex-direction: column; line-height: 1.25; }
.profile-copy strong { font-size: .77rem; }
.profile-copy span { margin-top: 2px; color: var(--ink-500); font-size: .68rem; }
.mobile-menu { display: none; }

.page { width: min(1560px, 100%); padding: 30px 30px 52px; margin: 0 auto; animation: pageIn 200ms ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(3px); } }
.page-header { display: flex; min-height: 70px; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 24px; }
.page-heading { min-width: 0; }
.eyebrow { margin-bottom: 6px; color: var(--brand-700); font-size: .68rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.page-heading h1 { margin: 0; font-size: var(--text-2xl); line-height: var(--leading-tight); letter-spacing: -.035em; }
.page-heading p { max-width: 670px; margin: 8px 0 0; color: var(--ink-600); font-size: .85rem; overflow-wrap: anywhere; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; }
.btn { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: .78rem; font-weight: 750; line-height: 1.2; transition: transform var(--transition), background var(--transition), border var(--transition); }
.btn:active { transform: translateY(1px); }
.btn-primary { color: white; background: var(--brand-700); box-shadow: 0 4px 12px rgba(30,107,93,.15); }
.btn-primary:hover { background: var(--brand-800); }
.btn-secondary { color: var(--ink-800); background: white; border-color: var(--line-strong); }
.btn-secondary:hover { color: var(--brand-800); background: var(--brand-50); border-color: var(--brand-200); }
.btn-ghost { color: var(--brand-700); background: transparent; }
.btn-ghost:hover { background: var(--brand-50); }
.btn-danger { color: var(--status-blocked-fg); background: var(--status-blocked-bg); }
.link-button { display: inline-flex; min-height: 36px; align-items: center; gap: 4px; color: var(--brand-700); background: transparent; border-radius: 7px; cursor: pointer; font-size: .75rem; font-weight: 750; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.metric-card { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; min-width: 0; padding: 17px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.metric-icon { display: grid; width: 40px; height: 40px; grid-row: span 2; place-items: center; color: var(--status-fg); background: var(--status-bg); border-radius: 11px; }
.metric-copy { display: flex; min-width: 0; align-items: baseline; justify-content: space-between; gap: 8px; }
.metric-copy span { color: var(--ink-600); font-size: .75rem; font-weight: 650; }
.metric-copy strong { font-size: 1.3rem; line-height: 1; letter-spacing: -.03em; }
.metric-meta { display: flex; align-items: center; gap: 4px; color: var(--ink-500); font-size: .68rem; }
.metric-meta.positive { color: var(--status-normal-fg); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, .72fr); gap: 14px; }
.dashboard-bottom { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .76fr); gap: 14px; margin-top: 14px; }
.card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.card-head { display: flex; min-height: 66px; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 18px; border-bottom: 1px solid var(--line-soft); }
.card-head h2 { margin: 0; font-size: .93rem; letter-spacing: -.015em; }
.card-head p { margin: 4px 0 0; color: var(--ink-500); font-size: .68rem; }
.card-body { min-width: 0; padding: 18px; }
.segmented { display: inline-flex; padding: 3px; background: var(--surface-muted); border: 1px solid var(--line-soft); border-radius: 8px; }
.segmented button { min-width: 42px; min-height: 30px; padding: 4px 8px; color: var(--ink-500); background: transparent; border-radius: 6px; cursor: pointer; font-size: .67rem; font-weight: 700; }
.segmented button.active { color: var(--ink-950); background: white; box-shadow: 0 1px 5px rgba(20,58,51,.09); }

.chart-wrap { position: relative; height: 247px; padding: 4px 2px 0; }
.chart-wrap svg { width: 100%; height: 100%; overflow: visible; }
.chart-grid { stroke: var(--line-soft); stroke-width: 1; }
.chart-line { fill: none; stroke: var(--brand-600); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: url(#areaGradient); }
.chart-dot { fill: white; stroke: var(--brand-600); stroke-width: 2; }
.chart-label { fill: var(--ink-400); font-family: var(--font-sans); font-size: 9px; }
.chart-legend { display: flex; align-items: center; gap: 16px; margin-top: 5px; color: var(--ink-500); font-size: .67rem; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-line { width: 14px; height: 2px; background: var(--brand-600); }

.posture { display: flex; flex-direction: column; align-items: center; }
.posture-ring { position: relative; display: grid; width: 176px; height: 176px; place-items: center; margin: 6px auto 22px; background: conic-gradient(var(--brand-600) 0 91%, var(--line-soft) 91% 100%); border-radius: 50%; }
.posture-ring::after { position: absolute; width: 134px; height: 134px; content: ""; background: white; border-radius: 50%; }
.posture-ring div { position: relative; z-index: 1; text-align: center; }
.posture-ring strong { display: block; font-size: 2rem; letter-spacing: -.06em; line-height: 1; }
.posture-ring span { display: block; margin-top: 8px; color: var(--ink-500); font-size: .68rem; font-weight: 650; }
.status-summary { width: 100%; display: grid; gap: 10px; }
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: .75rem; }
.summary-row span { color: var(--ink-600); }
.summary-row strong { font-size: .78rem; }

[data-status="normal"] { --status-fg: var(--status-normal-fg); --status-bg: var(--status-normal-bg); --status-accent: var(--status-normal-accent); }
[data-status="warning"] { --status-fg: var(--status-warning-fg); --status-bg: var(--status-warning-bg); --status-accent: var(--status-warning-accent); }
[data-status="blocked"] { --status-fg: var(--status-blocked-fg); --status-bg: var(--status-blocked-bg); --status-accent: var(--status-blocked-accent); }
[data-status="info"] { --status-fg: var(--status-info-fg); --status-bg: var(--status-info-bg); --status-accent: var(--status-info-accent); }
.status-badge { display: inline-flex; min-height: 27px; align-items: center; gap: 6px; max-width: 100%; padding: 4px 9px; color: var(--status-fg); background: var(--status-bg); border-radius: 999px; font-size: .68rem; font-weight: 750; white-space: normal; }
.status-dot { width: 6px; height: 6px; flex: 0 0 auto; background: var(--status-accent); border-radius: 50%; }

.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; min-width: 690px; border-collapse: collapse; }
.data-table th { height: 38px; padding: 0 12px; color: var(--ink-500); background: var(--surface-muted); font-size: .66rem; font-weight: 750; letter-spacing: .02em; text-align: left; white-space: nowrap; }
.data-table th:first-child { border-radius: 7px 0 0 7px; }
.data-table th:last-child { border-radius: 0 7px 7px 0; }
.data-table td { height: 62px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); color: var(--ink-700); font-size: .73rem; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfc; }
.cell-main { display: flex; min-width: 170px; align-items: center; gap: 10px; }
.cell-icon { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; color: var(--status-fg); background: var(--status-bg); border-radius: 8px; }
.cell-copy { display: flex; min-width: 0; flex-direction: column; }
.cell-copy strong { color: var(--ink-950); font-size: .73rem; overflow-wrap: anywhere; }
.cell-copy span { margin-top: 2px; color: var(--ink-500); font-size: .64rem; }
.row-action { display: grid; width: 34px; height: 34px; place-items: center; color: var(--ink-500); background: transparent; border-radius: 7px; cursor: pointer; }
.row-action:hover { color: var(--brand-700); background: var(--surface-muted); }

.progress-wrap { display: flex; align-items: center; gap: 9px; }
.progress { width: 100%; height: 6px; overflow: hidden; background: var(--line-soft); border-radius: 8px; }
.progress span { display: block; height: 100%; background: var(--status-accent); border-radius: inherit; transition: width 260ms ease; }
.progress-wrap strong { min-width: 31px; font-size: .66rem; }
.agent-list { display: grid; gap: 15px; }
.agent-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; }
.os-icon { display: grid; width: 34px; height: 34px; place-items: center; color: var(--ink-600); background: var(--surface-muted); border: 1px solid var(--line-soft); border-radius: 9px; }
.agent-copy { min-width: 0; }
.agent-copy div { display: flex; justify-content: space-between; margin-bottom: 6px; }
.agent-copy strong { font-size: .72rem; }
.agent-copy span { color: var(--ink-500); font-size: .62rem; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 9px; padding: 13px 14px; margin-bottom: 14px; background: white; border: 1px solid var(--line); border-radius: var(--radius-md); }
.search-field { position: relative; display: flex; min-width: 220px; flex: 1; }
.search-field > svg { position: absolute; top: 50%; left: 13px; color: var(--ink-400); transform: translateY(-50%); pointer-events: none; }
.field, .select { width: 100%; min-height: 42px; padding: 9px 12px; color: var(--ink-800); background: white; border: 1px solid var(--line-strong); border-radius: 9px; font-size: .76rem; }
.search-field .field { padding-left: 39px; }
.field::placeholder { color: var(--ink-400); }
.select { width: auto; min-width: 130px; cursor: pointer; }
.result-count { display: flex; align-items: center; padding: 0 5px; color: var(--ink-500); font-size: .7rem; }

.policy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.policy-card { display: flex; min-height: 190px; flex-direction: column; padding: 18px; }
.policy-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.policy-glyph { display: grid; width: 38px; height: 38px; place-items: center; color: var(--status-fg); background: var(--status-bg); border-radius: 10px; }
.policy-card h3 { margin: 16px 0 6px; font-size: .87rem; }
.policy-card p { margin: 0; color: var(--ink-600); font-size: .7rem; overflow-wrap: anywhere; }
.policy-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; margin-top: auto; border-top: 1px solid var(--line-soft); color: var(--ink-500); font-size: .66rem; }
.policy-menu { position: absolute; z-index: 10; width: 150px; padding: 5px; background: white; border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow-md); }
.policy-menu button { display: flex; width: 100%; min-height: 36px; align-items: center; gap: 8px; padding: 7px 9px; background: transparent; border-radius: 6px; cursor: pointer; font-size: .7rem; text-align: left; }
.policy-menu button:hover { background: var(--surface-muted); }

.agent-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.device-card { padding: 17px; }
.device-card-head { display: flex; align-items: flex-start; gap: 11px; }
.device-card-head .cell-copy { flex: 1; }
.device-details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 13px 0; margin-top: 14px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.detail-item span { display: block; color: var(--ink-500); font-size: .62rem; }
.detail-item strong { display: block; margin-top: 3px; font-size: .69rem; }
.device-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; }
.device-card-foot span { color: var(--ink-500); font-size: .63rem; }

.event-severity { display: inline-flex; align-items: center; gap: 5px; color: var(--status-fg); font-weight: 750; }
.event-severity::before { width: 6px; height: 6px; content: ""; background: var(--status-accent); border-radius: 50%; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .67rem; }

.library-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 26px; overflow: hidden; padding: 28px; margin-bottom: 14px; color: white; background: var(--brand-950); border: 0; border-radius: var(--radius-lg); }
.library-hero::after { position: absolute; right: -80px; bottom: -160px; width: 340px; height: 340px; content: ""; background: radial-gradient(circle, rgba(72,181,157,.3), transparent 66%); }
.library-hero .eyebrow { color: #72c7b4; }
.library-hero h1 { max-width: 600px; margin: 0; font-size: 1.85rem; letter-spacing: -.04em; line-height: 1.25; }
.library-hero p { max-width: 590px; margin: 12px 0 0; color: #a9bdb8; font-size: .8rem; }
.hero-spec { position: relative; z-index: 1; align-self: center; padding: 17px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; }
.hero-spec div { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 8px 0; color: #9fb5b0; font-size: .68rem; }
.hero-spec div + div { border-top: 1px solid rgba(255,255,255,.08); }
.hero-spec strong { color: white; font-size: .7rem; }
.library-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(285px, .65fr); gap: 14px; }
.token-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.token { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.token-color { height: 58px; background: var(--token); }
.token-copy { padding: 9px; }
.token-copy strong { display: block; font-size: .67rem; }
.token-copy span { display: block; margin-top: 3px; color: var(--ink-500); font-family: ui-monospace, monospace; font-size: .58rem; overflow-wrap: anywhere; }
.demo-stage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.demo-panel { min-height: 226px; padding: 17px; background: var(--surface-muted); border: 1px solid var(--line-soft); border-radius: 11px; }
.demo-status-card { height: 100%; padding: 16px; background: white; border: 1px solid var(--line); border-top: 3px solid var(--status-accent); border-radius: 10px; box-shadow: var(--shadow-sm); }
.demo-icon { display: grid; width: 39px; height: 39px; place-items: center; color: var(--status-fg); background: var(--status-bg); border-radius: 10px; }
.demo-status-card h3 { margin: 13px 0 5px; color: var(--ink-950); font-size: .8rem; overflow-wrap: anywhere; }
.demo-status-card p { margin: 0 0 14px; color: var(--ink-600); font-size: .67rem; overflow-wrap: anywhere; }
.demo-status-card .status-badge { margin-top: auto; }
.playground-controls { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
.status-choice { min-height: 38px; padding: 7px 11px; color: var(--status-fg); background: var(--status-bg); border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: .68rem; font-weight: 750; }
.status-choice.active { border-color: var(--status-accent); box-shadow: 0 0 0 2px var(--status-bg); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line-soft); color: var(--ink-700); font-size: .7rem; }
.toggle { position: relative; width: 38px; height: 22px; padding: 0; background: var(--line-strong); border-radius: 999px; cursor: pointer; transition: background var(--transition); }
.toggle::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; content: ""; background: white; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.16); transition: transform var(--transition); }
.toggle[aria-checked="true"] { background: var(--brand-600); }
.toggle[aria-checked="true"]::after { transform: translateX(16px); }
.code-box { position: relative; padding: 16px; color: #d8e6e2; background: #172824; border-radius: 10px; font: .67rem/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-x: auto; }
.code-box .code-copy { position: absolute; top: 8px; right: 8px; color: #a8bdb8; background: rgba(255,255,255,.08); }
.code-accent { color: #72c7b4; }
.code-warn { color: #e7b86b; }
.doc-list { display: grid; gap: 8px; }
.doc-item { display: flex; min-height: 50px; align-items: center; gap: 10px; padding: 10px; color: inherit; background: var(--surface-muted); border: 1px solid transparent; border-radius: 9px; cursor: pointer; text-align: left; }
.doc-item:hover { background: var(--brand-50); border-color: var(--brand-100); }
.doc-item > span:first-child { display: grid; width: 30px; height: 30px; place-items: center; color: var(--brand-700); background: white; border-radius: 8px; }
.doc-item div { min-width: 0; flex: 1; }
.doc-item strong { display: block; font-size: .7rem; }
.doc-item small { display: block; margin-top: 2px; color: var(--ink-500); font-size: .6rem; }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(15,30,27,.46); backdrop-filter: blur(3px); }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: white; border-radius: var(--radius-lg); box-shadow: 0 24px 70px rgba(8,31,26,.25); animation: modalIn 180ms ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.05rem; }
.modal-head p { margin: 5px 0 0; color: var(--ink-500); font-size: .7rem; }
.modal-body { display: grid; gap: 16px; padding: 20px 22px; }
.form-group { display: grid; gap: 7px; }
.form-group label { color: var(--ink-800); font-size: .7rem; font-weight: 750; }
.form-group small { color: var(--ink-500); font-size: .62rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
textarea.field { min-height: 88px; resize: vertical; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px; background: var(--surface-muted); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 9px; width: min(360px, calc(100vw - 40px)); }
.toast { display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px; color: var(--ink-800); background: white; border: 1px solid var(--line); border-left: 3px solid var(--status-accent); border-radius: 10px; box-shadow: var(--shadow-md); animation: toastIn 200ms ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.toast > span { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; color: var(--status-fg); background: var(--status-bg); border-radius: 7px; }
.toast strong { display: block; font-size: .7rem; }
.toast p { margin: 2px 0 0; color: var(--ink-500); font-size: .64rem; }
.toast button { margin-left: auto; color: var(--ink-400); background: transparent; cursor: pointer; }
.empty-state { display: flex; min-height: 250px; flex-direction: column; align-items: center; justify-content: center; padding: 32px; text-align: center; }
.empty-icon { display: grid; width: 48px; height: 48px; place-items: center; color: var(--ink-500); background: var(--surface-muted); border-radius: 13px; }
.empty-state h3 { margin: 14px 0 5px; font-size: .82rem; }
.empty-state p { max-width: 390px; margin: 0 0 15px; color: var(--ink-500); font-size: .69rem; }

@media (max-width: 1180px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .policy-grid, .agent-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --sidebar-width: 78px; }
  .sidebar { padding-inline: 10px; }
  .brand { justify-content: center; padding: 0; }
  .brand-name, .nav-label, .nav-item span, .system-mini p, .system-mini .row span { display: none; }
  .nav-item { justify-content: center; padding-inline: 0; }
  .system-mini { display: grid; place-items: center; padding: 15px 8px; }
  .dashboard-grid, .dashboard-bottom, .library-hero { grid-template-columns: 1fr; }
  .hero-spec { max-width: 500px; }
}
@media (max-width: 680px) {
  :root { --topbar-height: 60px; }
  .sidebar { width: min(290px, 84vw); transform: translateX(-102%); transition: transform 200ms ease; box-shadow: var(--shadow-md); }
  .sidebar.open { transform: translateX(0); }
  .brand { justify-content: flex-start; padding: 0 10px; }
  .brand-name, .nav-label, .nav-item span, .system-mini p, .system-mini .row span { display: flex; }
  .nav-item { justify-content: flex-start; padding-inline: 12px; }
  .system-mini { display: block; padding: 13px; }
  .main-shell { margin-left: 0; }
  .topbar { padding: 0 14px; }
  .mobile-menu { display: inline-grid; }
  .top-context { display: none; }
  .profile-copy { display: none; }
  .profile { padding-left: 7px; }
  .page { padding: 22px 14px 40px; }
  .page-header { flex-direction: column; gap: 16px; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .page-actions .btn { flex: 1; }
  .metrics-grid, .policy-grid, .agent-cards, .demo-stage, .token-grid, .form-row { grid-template-columns: 1fr; }
  .metric-card { padding: 15px; }
  .card-head { align-items: flex-start; }
  .library-hero { padding: 22px; }
  .library-hero h1 { font-size: 1.5rem; }
  .filter-bar { flex-direction: column; }
  .search-field { min-width: 0; }
  .select { width: 100%; }
  .modal-backdrop { padding: 10px; }
  .modal { max-height: calc(100vh - 20px); }
}

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