/* Partner Portal prototype — shared components. Mirrors docs/UI_SYSTEM.md; the design system sheet shows every rule here with its states. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-family: var(--font); font-optical-sizing: auto; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; min-height: 100dvh; overflow-x: hidden; }
.atmos { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background: radial-gradient(1200px 700px at 88% -10%, var(--light-1), transparent 62%), radial-gradient(900px 640px at -10% 105%, var(--light-2), transparent 60%), radial-gradient(700px 500px at 45% 45%, var(--light-3), transparent 65%), linear-gradient(180deg, #F3F7FE 0%, var(--bg) 55%, var(--bg-deep) 100%); }
.atmos svg { position: absolute; right: -6%; top: -4%; width: 62vw; min-width: 760px; height: auto; opacity: .9; }
.atmos .blob { position: absolute; border-radius: 50%; filter: blur(70px); }
.atmos .b1 { left: -8%; bottom: -12%; width: 46vw; height: 46vw; background: rgba(140,180,255,.45); }
.atmos .b2 { left: 22%; bottom: -30%; width: 34vw; height: 34vw; background: rgba(255,255,255,.8); }
[hidden] { display: none !important; }
.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; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 100; padding: 8px 12px; background: var(--ink); color: #fff; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }
a { color: var(--accent-ink); }
button { font: inherit; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 16px; height: 16px; } svg.i.xs { width: 14px; height: 14px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 34px; font-weight: 700; letter-spacing: -.028em; line-height: 1.12; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -.012em; line-height: 1.3; }
h3 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
h4 { font-size: 13px; font-weight: 600; color: var(--ink-3); letter-spacing: .01em; }
code { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink-2); background: rgba(30,60,120,.06); padding: 1px 6px; border-radius: 6px; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.note { font-size: 12.5px; color: var(--ink-3); }

/* ---------- Liquid glass ---------- */
.glass { background: var(--glass-fill); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.7); backdrop-filter: blur(var(--glass-blur)) saturate(1.7); border-radius: var(--r-card); box-shadow: inset 0 1px 0 var(--glass-edge), inset 0 0 0 1px var(--glass-rim), 0 0 0 1px var(--glass-line), var(--shadow-glass); position: relative; }
.glass::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(115deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 38%); mask: linear-gradient(180deg, #000 0%, transparent 60%); -webkit-mask: linear-gradient(180deg, #000 0%, transparent 60%); }
.glass > * { position: relative; z-index: 1; }
.glass.strong { background: var(--glass-fill-strong); box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px var(--glass-rim), var(--shadow-elevated); }
.glass.lift { transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.glass.lift:hover, .glass.lift.is-hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 var(--glass-edge), inset 0 0 0 1px var(--glass-rim), 0 0 0 1px var(--glass-line), var(--shadow-glass-hover); }
a.glass { text-decoration: none; color: inherit; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: var(--inset); height: calc(100dvh - 2 * var(--inset)); margin: var(--inset) 0 var(--inset) var(--inset); display: flex; flex-direction: column; gap: 4px; padding: 22px 14px 16px; z-index: 30; border-radius: var(--r-panel); }
.brand { display: flex; align-items: center; padding: 4px 8px 20px; text-decoration: none; }
.brand-logo { width: 168px; height: auto; display: block; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 14.5px; line-height: 1.2; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.nav-item:hover { background: rgba(255,255,255,.55); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 1px 2px rgba(30,60,120,.06); }
.nav-item .label { flex: 1; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.brand-card { border-radius: 20px; padding: 18px 16px 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; color: #fff; background: radial-gradient(120% 90% at 0% 0%, rgba(255,255,255,.12), transparent 60%), linear-gradient(160deg, var(--partner-ink, #4F566B) 0%, var(--partner-deep, #2F3440) 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 0 0 1px rgba(255,255,255,.06), 0 14px 30px -14px rgba(30,60,120,.5); }
.brand-card p { font-size: 15px; font-weight: 600; letter-spacing: -.012em; line-height: 1.3; color: #fff; }
.brand-card .go { width: 36px; height: 36px; border-radius: 50%; background: var(--partner-gold, var(--accent-2)); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 4px 12px -4px rgba(0,0,0,.45); display: grid; place-items: center; color: var(--partner-deep, #2F3440); border: 0; cursor: pointer; flex: none; transition: transform 120ms var(--ease-out), filter var(--dur-fast); }
.brand-card .go:hover { filter: brightness(1.06); } .brand-card .go:active { transform: scale(.96); }
.powered { display: flex; align-items: center; gap: 8px; padding: 0 8px; font-size: 12px; color: var(--ink-3); text-decoration: none; }
.powered b { font-weight: 500; } .powered img { width: 18px; height: 18px; flex: none; }
.nav-scrim { position: fixed; inset: 0; z-index: 29; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity var(--dur-sheet) var(--ease-sheet); }
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: var(--inset) var(--gutter) 10px; background: linear-gradient(180deg, rgba(233,240,251,.92) 55%, rgba(233,240,251,0)); }
.topbar-actions { display: flex; align-items: center; gap: 8px; position: relative; }
.topbar .menu-btn { display: none; }
.search { display: flex; align-items: center; gap: 12px; height: 48px; flex: 1; max-width: 680px; margin-right: auto; padding: 0 12px 0 18px; border: 0; border-radius: var(--r-pill); cursor: text; color: var(--ink-3); font-size: 14.5px; text-align: left; }
.search > span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd { font: inherit; font-size: 12px; color: var(--ink-3); padding: 3px 8px; border-radius: 8px; background: rgba(255,255,255,.9); box-shadow: 0 0 0 1px var(--hairline); }
.vline { width: 1px; height: 28px; background: var(--hairline); margin: 0 4px; }
.user-chip { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 12px 0 6px; border-radius: var(--r-pill); border: 0; cursor: pointer; color: var(--ink); text-align: left; }
.user-chip b { display: block; font-weight: 600; font-size: 14px; line-height: 1.15; } .user-chip small { display: block; font-size: 12px; color: var(--ink-3); }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--ctl-h); padding: 0 18px; border: 0; border-radius: 14px; font-weight: 600; font-size: 14.5px; cursor: pointer; white-space: nowrap; text-decoration: none; position: relative; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform 120ms var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), filter var(--dur-fast); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--gradient-primary); color: var(--on-accent); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 8px 18px -8px rgba(47,111,232,.7); }
.btn-primary:hover, .btn-primary.is-hover { filter: brightness(1.06); }
.btn-glass { background: var(--glass-fill-strong); color: var(--accent-ink); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--glass-line), 0 4px 12px -6px rgba(30,60,120,.3); }
.btn-glass:hover, .btn-glass.is-hover { background: #fff; }
.btn-soft { background: rgba(30,60,120,.06); color: var(--ink); }
.btn-soft:hover, .btn-soft.is-hover { background: rgba(30,60,120,.1); }
.btn-quiet { background: transparent; color: var(--accent-ink); height: 36px; padding: 0 12px; font-weight: 500; }
.btn-quiet:hover, .btn-quiet.is-hover { background: var(--accent-soft); }
.btn-danger { background: var(--danger-soft); color: var(--danger-ink); }
.btn-danger:hover, .btn-danger.is-hover { background: #FBDBD7; }
.btn-sm { height: var(--ctl-h-sm); padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; filter: none; transform: none; }
.btn.is-focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.is-loading { color: transparent; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .8s linear infinite; }
.btn-glass.is-loading::after, .btn-soft.is-loading::after { border-color: rgba(30,60,120,.2); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative; text-decoration: none; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.icon-btn:hover, .icon-btn.is-hover { color: var(--ink); background: #fff; }
.icon-btn.plain { width: 36px; height: 36px; border-radius: 10px; box-shadow: none; background: transparent; }
.icon-btn.plain:hover, .icon-btn.plain.is-hover { background: rgba(30,60,120,.06); }
.icon-btn .badge-dot { position: absolute; top: 11px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px #fff; }
.pill-link { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-pill); background: rgba(255,255,255,.75); color: var(--accent-ink); font-size: 13px; font-weight: 500; text-decoration: none; border: 0; cursor: pointer; box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--glass-line); white-space: nowrap; }
.pill-link:hover { background: #fff; }
.pill-link.neutral { color: var(--ink-2); }
.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(30,60,120,.06); }
.segmented button { border: 0; background: transparent; color: var(--ink-2); padding: 6px 12px; border-radius: 9px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(30,60,120,.12); }
.segmented button .n { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hairline); }
.tabs button { border: 0; background: none; padding: 10px 12px; font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer; position: relative; border-radius: 10px 10px 0 0; }
.tabs button[aria-selected="true"] { color: var(--accent-ink); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--gradient-primary); color: #fff; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; flex: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
.avatar.tint { background: var(--t, var(--accent-soft)); color: var(--c, var(--accent-ink)); box-shadow: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; border-radius: 18px; }
.avatar.xs { width: 26px; height: 26px; font-size: 10.5px; }
.tile { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--t, var(--accent-soft)); color: var(--c, var(--accent)); box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.tile.sm { width: 36px; height: 36px; border-radius: 11px; } .tile.sm svg.i { width: 18px; height: 18px; }
.tile.round { border-radius: 50%; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.tag.up { background: var(--success-soft); color: var(--success-ink); } .tag.down { background: var(--danger-soft); color: var(--danger-ink); } .tag.flat { background: rgba(30,60,120,.06); color: var(--ink-2); }
.tag.warn { background: var(--warning-soft); color: var(--warning-ink); } .tag.info { background: var(--accent-soft); color: var(--accent-ink); }
.state { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.state.active, .state.ok { background: var(--success-soft); color: var(--success-ink); }
.state.onboarding, .state.warn { background: var(--warning-soft); color: var(--warning-ink); }
.state.waiting, .state.neutral { background: rgba(30,60,120,.07); color: var(--ink-2); }
.state.paused, .state.danger { background: var(--danger-soft); color: var(--danger-ink); }
.state.info { background: var(--accent-soft); color: var(--accent-ink); }
.sev { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; } .sev i { width: 8px; height: 8px; border-radius: 50%; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ink-4); display: inline-block; }
.dot.danger { background: var(--danger); } .dot.warning { background: var(--warning); } .dot.success { background: var(--success); } .dot.accent { background: var(--accent); }
.check { width: 22px; height: 22px; border-radius: 50%; border: 1.6px solid rgba(30,60,120,.28); background: rgba(255,255,255,.8); display: grid; place-items: center; color: #fff; cursor: pointer; flex: none; padding: 0; transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.check.square { border-radius: 7px; }
.check:hover { border-color: var(--accent); }
.check[aria-checked="true"] { background: var(--gradient-primary); border-color: transparent; }
.check svg { opacity: 0; transition: opacity var(--dur-fast); } .check[aria-checked="true"] svg { opacity: 1; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.switch { width: 46px; height: 28px; border-radius: 14px; border: 0; background: rgba(30,60,120,.18); position: relative; cursor: pointer; padding: 0; transition: background var(--dur-state) var(--ease-out); box-shadow: inset 0 1px 2px rgba(30,60,120,.15); flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(30,60,120,.3); transition: transform var(--dur-state) var(--ease-out); }
.switch[aria-checked="true"] { background: var(--accent); } .switch[aria-checked="true"]::after { transform: translateX(18px); }
.radio { display: flex; align-items: center; gap: 10px; cursor: pointer; position: relative; }
.radio i { width: 20px; height: 20px; border-radius: 50%; border: 1.6px solid rgba(30,60,120,.28); background: rgba(255,255,255,.8); }
.radio input { position: absolute; opacity: 0; } .radio input:checked + i { border-color: var(--accent); border-width: 6px; background: #fff; }
.meter { display: inline-block; height: 6px; border-radius: 3px; background: var(--accent-soft-2); overflow: hidden; width: 96px; vertical-align: middle; }
.meter > i { display: block; height: 100%; width: var(--v, 0%); border-radius: 3px; background: var(--gradient-primary); }
.steps { display: flex; align-items: center; }
.steps span { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.steps span i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: rgba(30,60,120,.07); color: var(--ink-2); font-style: normal; }
.steps span.done i { background: var(--success-soft); color: var(--success-ink); } .steps span.now i { background: var(--gradient-primary); color: #fff; } .steps span.now { color: var(--ink); font-weight: 500; }
.steps hr { flex: 1; height: 1px; border: 0; background: var(--hairline); margin: 0 10px; min-width: 16px; }
.tooltip { display: inline-block; background: var(--glass-fill-strong); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); color: var(--ink); font-size: 12.5px; line-height: 1.45; padding: 8px 12px; border-radius: 12px; box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--glass-line), var(--shadow-elevated); }

/* ---------- Form fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 13.5px; font-weight: 500; color: var(--ink); } .field label .opt { font-weight: 400; color: var(--ink-3); }
.field .help { font-size: 12.5px; color: var(--ink-3); }
.field .err { font-size: 12.5px; color: var(--danger-ink); display: flex; align-items: center; gap: 6px; }
.input { display: flex; align-items: center; gap: 10px; height: var(--ctl-h); padding: 0 14px; border-radius: var(--r-control); background: rgba(255,255,255,.75); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(30,60,120,.12); color: var(--ink); font: inherit; font-size: 14.5px; transition: box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out); width: 100%; }
.input input, .input select, .input textarea { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: inherit; outline: none; padding: 0; }
.input input::placeholder, .input textarea::placeholder { color: var(--ink-4); }
.input:hover { background: rgba(255,255,255,.9); }
.input:focus-within, .input.is-focus { background: #fff; box-shadow: inset 0 1px 0 #fff, 0 0 0 2px var(--accent), 0 0 0 5px var(--accent-soft-2); }
.input.is-error { box-shadow: inset 0 1px 0 #fff, 0 0 0 2px var(--danger); }
.input.is-disabled { opacity: .5; pointer-events: none; }
.input.pill { border-radius: var(--r-pill); }
.input.textarea { height: auto; padding: 12px 14px; align-items: flex-start; } .input.textarea textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.input .lead { color: var(--ink-3); }
.input select { appearance: none; -webkit-appearance: none; padding-right: 20px; cursor: pointer; } .input .caret { margin-left: -24px; pointer-events: none; color: var(--ink-3); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }

/* ---------- Page ---------- */
.main { width: 100%; max-width: calc(var(--content-max) + 2 * var(--gutter)); margin: 0 auto; padding: 6px var(--gutter) 60px; display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 14px 6px 10px; flex-wrap: wrap; }
.page-head .lead { margin-top: 8px; font-size: 16px; color: var(--ink-2); max-width: 60ch; }
.page-head .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.greet { font-size: 22px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.page-head h1 { margin-top: 6px; }
.page-meta { text-align: right; flex: none; }
.page-meta .date { font-size: 14.5px; font-weight: 500; color: var(--ink-2); }
.page-meta .quote { margin-top: 6px; font-size: 14px; font-style: italic; color: var(--ink-3); }
.page-meta .tagline { margin-top: 14px; font-size: 18px; font-weight: 600; font-style: italic; letter-spacing: -.012em; color: var(--accent-ink); line-height: 1.25; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; color: var(--ink-3); text-decoration: none; margin-bottom: 10px; }
.back:hover { color: var(--accent-ink); }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 0 6px; }
.toolbar .input { max-width: 360px; height: 40px; }
.toolbar .spacer { flex: 1; }

/* ---------- Panels ---------- */
.card { padding: var(--card-pad) calc(var(--card-pad) + 2px) calc(var(--card-pad) - 2px); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head .lead-icon { display: flex; align-items: center; gap: 12px; min-width: 0; }
.card-head h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .card-head .sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--hairline); font-size: 13px; color: var(--ink-3); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { padding: 18px 20px 14px; display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; overflow: hidden; }
.kpi .tile { grid-row: 1 / 3; }
.kpi-title { font-size: 15px; font-weight: 500; color: var(--ink); align-self: end; }
.kpi-value { display: flex; align-items: center; gap: 12px; margin-top: 4px; flex-wrap: wrap; } .kpi-value b { font-size: 32px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
.kpi-sub { grid-column: 2; font-size: 12.5px; color: var(--ink-3); margin-top: 6px; padding-right: 34%; }
.kpi .spark { position: absolute; right: -6px; bottom: -2px; width: 42%; height: 52px; overflow: visible; }
.spark path.l { fill: none; stroke: var(--c, var(--accent)); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.row-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) minmax(0, .95fr); gap: 16px; align-items: stretch; }
.row-3 { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.35fr) minmax(0, .95fr); gap: 16px; align-items: stretch; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.span-2 { grid-column: span 2; }
.chart { position: relative; height: 240px; margin-top: 8px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; border-radius: 8px; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .tick { fill: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .bar { transition: opacity var(--dur-fast); } .chart.is-hover .bar:not(.on) { opacity: .45; }
.legend { display: flex; gap: 18px; justify-content: center; margin-top: 12px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 7px; } .legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chart-tip { position: absolute; z-index: 2; pointer-events: none; background: var(--glass-fill-strong); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); color: var(--ink); font-size: 12.5px; line-height: 1.45; padding: 10px 12px; border-radius: 12px; box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--glass-line), var(--shadow-elevated); transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap; opacity: 0; transition: opacity var(--dur-fast) var(--ease-out); }
.chart-tip b { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; } .chart-tip span { display: flex; align-items: center; gap: 7px; } .chart-tip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chart.is-hover .chart-tip { opacity: 1; }
details.table { margin-top: 8px; font-size: 13px; color: var(--ink-3); } details.table summary { cursor: pointer; width: max-content; }
details.table table { border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; color: var(--ink); } details.table td, details.table th { padding: 4px 12px 4px 0; text-align: left; font-weight: 500; } details.table th { color: var(--ink-3); }

/* ---------- Lists and tables ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li + li { border-top: 1px solid var(--hairline); }
.feed-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; min-height: var(--row-h); }
.feed-row b { display: block; font-weight: 500; line-height: 1.3; } .feed-row small { display: block; font-size: var(--text-sm); color: var(--ink-3); margin-top: 1px; } .feed-row time { font-size: var(--text-sm); color: var(--ink-3); white-space: nowrap; }
.action-row { display: grid; grid-template-columns: 22px 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; }
.action-row .open { display: block; min-width: 0; background: none; border: 0; padding: 0; text-align: left; color: inherit; cursor: pointer; font: inherit; border-radius: 6px; }
.action-row .open b, .action-row b { display: block; font-weight: 500; line-height: 1.3; } .action-row .open small, .action-row small { display: block; font-size: var(--text-sm); color: var(--ink-3); margin-top: 1px; } .action-row small.hot { color: var(--danger-ink); font-weight: 500; }
.action-row time { font-size: var(--text-sm); color: var(--ink-3); white-space: nowrap; }
.action-row.done { opacity: .45; } .action-row.done b { text-decoration: line-through; }
.client-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto 36px; gap: 12px; align-items: center; padding: 9px 0; }
.client-row b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .client-row small { display: block; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 0; min-height: var(--row-h); }
.item-row b { display: block; font-weight: 500; } .item-row small { display: block; font-size: var(--text-sm); color: var(--ink-3); }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; color: var(--ink); }
.table-wrap { overflow: auto; margin: 0 -6px; padding: 0 6px; }
.table { width: 100%; border-collapse: collapse; font-size: var(--text); }
.table th { text-align: left; font-weight: 500; font-size: var(--text-sm); color: var(--ink-3); padding: 0 12px 10px 12px; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
.table th[aria-sort] { color: var(--ink); cursor: pointer; } .table th[aria-sort] svg { vertical-align: -3px; margin-left: 4px; }
.table td { padding: 0 12px; height: var(--row-h); border-bottom: 1px solid var(--hairline); vertical-align: middle; white-space: nowrap; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.link { cursor: pointer; }
.table tbody tr:hover td { background: rgba(255,255,255,.5); }
.table tr.is-selected td { background: var(--accent-soft); }
.table tr.is-selected td:first-child { border-radius: 10px 0 0 10px; } .table tr.is-selected td:last-child { border-radius: 0 10px 10px 0; }
.table .client { display: flex; align-items: center; gap: 10px; min-width: 0; } .table .client b { font-weight: 500; display: block; } .table .client small { display: block; font-size: 12.5px; color: var(--ink-3); }
.table .chan { display: inline-flex; gap: 6px; color: var(--ink-2); } .table .chan .off { opacity: .35; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; font-size: 13px; color: var(--ink-3); }
.pager .pages { display: inline-flex; gap: 4px; }
.pager .pages button { width: 32px; height: 32px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); cursor: pointer; font-weight: 500; }
.pager .pages button[aria-current="page"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(30,60,120,.12); }
.bulk { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-radius: 16px; background: var(--ink); color: #fff; font-size: 13.5px; box-shadow: var(--shadow-elevated); }
.bulk .btn { height: 34px; background: rgba(255,255,255,.14); color: #fff; box-shadow: none; }
.bulk .btn:hover { background: rgba(255,255,255,.24); }

/* ---------- Content blocks ---------- */
.channel { padding: 16px 12px 14px; border-radius: 18px; background: rgba(255,255,255,.55); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--glass-line); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.channel .tile { border-radius: 50%; width: 46px; height: 46px; } .channel b { font-size: 26px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; margin-top: 4px; } .channel small { font-size: 12.5px; color: var(--ink-3); }
.channels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
.presence { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
.presence li { padding: 14px; border-radius: 18px; background: rgba(255,255,255,.55); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--glass-line); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.presence .top { display: flex; align-items: center; gap: 10px; } .presence .top b { font-weight: 600; font-size: 14px; }
.presence small { font-size: 12.5px; color: var(--ink-3); }
.presence .btn { align-self: flex-start; margin-top: 2px; }
.feature { padding: 22px; border-radius: var(--r-card); position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; min-height: 200px; background: linear-gradient(160deg, rgba(255,255,255,.55) 0%, rgba(205,224,255,.85) 60%, rgba(160,196,255,.95) 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 0 0 1px rgba(30,60,120,.06), var(--shadow-glass); }
.feature::before { content: ""; position: absolute; inset: auto -30% -50% auto; width: 80%; height: 120%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,255,255,.9), rgba(255,255,255,0)); pointer-events: none; }
.feature .more { position: absolute; top: 14px; right: 14px; }
.feature h3 { font-size: 22px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; } .feature p { font-size: 14px; color: var(--ink-2); max-width: 30ch; }
.feature .btn { align-self: flex-start; margin-top: 6px; background: #fff; color: var(--ink); box-shadow: inset 0 1px 0 #fff, 0 6px 16px -8px rgba(30,60,120,.5); }
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px 0 4px; color: var(--ink-2); }
.empty.center { align-items: center; text-align: center; padding: 28px 0 20px; }
.empty .glyph { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--success-soft); color: var(--success-ink); margin-bottom: 6px; }
.empty .glyph.neutral { background: rgba(30,60,120,.07); color: var(--ink-2); }
.empty b { font-weight: 600; color: var(--ink); } .empty .btn { margin-top: 10px; }
.errbox { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 6px 0 2px; color: var(--ink-2); }
.errbox i { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.sk { position: relative; overflow: hidden; background: rgba(30,60,120,.07); border-radius: 8px; }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.8), transparent); animation: shimmer 1.6s var(--ease-out) infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-line { height: 12px; } .sk-stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------- States ---------- */
.v-loading, .v-empty, .v-error { display: none; }
html[data-state="loading"] .v-ready { display: none; }
html[data-state="loading"] .v-loading { display: block; }
html[data-state="empty"] .has-empty .v-ready { display: none; }
html[data-state="empty"] .has-empty .v-empty { display: block; }
html[data-state="error"] .has-error .v-ready { display: none; }
html[data-state="error"] .has-error .v-error { display: block; }
html[data-state="loading"] .kpis.v-loading, html[data-state="empty"] .kpis.v-empty { display: grid; }

/* ---------- Overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; }
.overlay .scrim { position: absolute; inset: 0; background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; transition: opacity var(--dur-sheet) var(--ease-sheet); }
.overlay.is-open .scrim { opacity: 1; }
.sheet { position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(460px, calc(100% - 24px)); display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-panel); background: var(--glass-fill-strong); -webkit-backdrop-filter: blur(30px) saturate(1.7); backdrop-filter: blur(30px) saturate(1.7); box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px var(--glass-rim), var(--shadow-elevated); transform: translateX(24px); opacity: 0; transition: transform var(--dur-sheet) var(--ease-sheet), opacity var(--dur-sheet) var(--ease-sheet); }
.sheet.wide { width: min(640px, calc(100% - 24px)); }
.overlay.is-open .sheet { transform: none; opacity: 1; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 20px 14px 26px; }
.sheet-head h2 { font-size: 20px; } .sheet-head p { color: var(--ink-2); margin-top: 4px; }
.sheet-body { padding: 4px 26px 20px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 18px; }
.sheet-body > * { flex-shrink: 0; }
.sheet-body .steps { flex-wrap: wrap; gap: 8px 14px; } .sheet-body .steps hr { display: none; }
.sheet-body p.note { font-size: 14px; color: var(--ink-2); }
.sheet-list { list-style: none; margin: 0; padding: 0; border-radius: 14px; background: rgba(255,255,255,.7); box-shadow: 0 0 0 1px var(--glass-line); }
.sheet-list li { display: flex; align-items: center; gap: 12px; padding: 11px 14px; } .sheet-list li + li { border-top: 1px solid var(--hairline); }
.sheet-list b { display: block; font-weight: 500; } .sheet-list small { display: block; font-size: 12.5px; color: var(--ink-3); }
.sheet-foot { display: flex; gap: 8px; padding: 14px 26px 22px; box-shadow: 0 -1px 0 var(--hairline); flex-wrap: wrap; }
.dialog { position: absolute; left: 50%; top: 50%; width: min(440px, calc(100% - 32px)); padding: 22px 24px 20px; border-radius: var(--r-panel); background: var(--glass-fill-strong); -webkit-backdrop-filter: blur(30px) saturate(1.7); backdrop-filter: blur(30px) saturate(1.7); box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px var(--glass-rim), var(--shadow-elevated); transform: translate(-50%, -50%) scale(.96); opacity: 0; transition: transform var(--dur-state) var(--ease-out), opacity var(--dur-state) var(--ease-out); }
.overlay.is-open .dialog { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.dialog h3 { font-size: 17px; } .dialog p { color: var(--ink-2); margin-top: 8px; font-size: 14px; } .dialog .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.palette { position: absolute; left: 50%; top: 12vh; width: min(660px, calc(100% - 32px)); border-radius: var(--r-panel); overflow: hidden; transform: translate(-50%, -8px) scale(.98); opacity: 0; transition: transform var(--dur-state) var(--ease-out), opacity var(--dur-state) var(--ease-out); background: var(--glass-fill-strong); -webkit-backdrop-filter: blur(30px) saturate(1.7); backdrop-filter: blur(30px) saturate(1.7); box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px var(--glass-rim), var(--shadow-elevated); }
.overlay.is-open .palette { transform: translate(-50%, 0) scale(1); opacity: 1; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 6px 18px 6px 20px; box-shadow: 0 1px 0 var(--hairline); color: var(--ink-3); }
.palette input { flex: 1; font: inherit; font-size: 16px; padding: 14px 0; border: 0; background: transparent; outline: none; color: var(--ink); } .palette input::placeholder { color: var(--ink-4); }
.palette .group { padding: 8px; } .palette .group + .group { box-shadow: 0 -1px 0 var(--hairline); }
.palette .group-title { font-size: 12px; font-weight: 500; color: var(--ink-3); padding: 6px 12px; }
.palette .item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; color: var(--ink); cursor: pointer; text-decoration: none; }
.palette .item .hint { margin-left: auto; font-size: 12.5px; color: var(--ink-3); } .palette .item.is-active { background: var(--accent-soft); color: var(--accent-ink); }
.palette-foot { display: flex; gap: 14px; padding: 8px 18px 10px; font-size: 12px; color: var(--ink-3); box-shadow: 0 -1px 0 var(--hairline); }
.menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 40; min-width: 280px; padding: 6px; border-radius: 18px; background: var(--glass-fill-strong); -webkit-backdrop-filter: blur(30px) saturate(1.7); backdrop-filter: blur(30px) saturate(1.7); box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px var(--glass-rim), var(--shadow-elevated); transform-origin: top right; transform: scale(.96) translateY(-4px); opacity: 0; transition: transform 180ms var(--ease-out), opacity 180ms var(--ease-out); }
.menu.is-open { transform: none; opacity: 1; }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: none; color: var(--ink); font-size: 14px; text-align: left; cursor: pointer; text-decoration: none; }
.menu button:hover, .menu a:hover, .menu button:focus-visible { background: var(--gradient-primary); color: #fff; outline: none; }
.menu .danger { color: var(--danger-ink); } .menu .danger:hover { background: var(--danger); color: #fff; }
.menu hr { border: 0; height: 1px; background: var(--hairline); margin: 6px; }
.menu-anchor { position: relative; display: inline-block; }
.no-scroll { overflow: hidden; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 70; transform: translate(-50%, 8px); opacity: 0; display: inline-flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 13.5px; box-shadow: var(--shadow-elevated); transition: transform var(--dur-state) var(--ease-out), opacity var(--dur-state) var(--ease-out); max-width: calc(100% - 32px); }
.toast.is-open { transform: translate(-50%, 0); opacity: 1; }
.toast button { background: none; border: 0; color: #fff; font-weight: 500; opacity: .85; cursor: pointer; padding: 4px 6px; border-radius: 6px; } .toast button:hover { opacity: 1; background: rgba(255,255,255,.12); }

/* ---------- Prototype chrome ---------- */
.proto { position: fixed; right: 12px; bottom: 12px; z-index: 80; display: flex; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 8px; background: rgba(21,25,43,.82); color: #fff; font-size: 11.5px; }
.proto a { color: #fff; opacity: .7; text-decoration: none; } .proto a:hover, .proto a.is-active { opacity: 1; text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 1179px) {
  :root { --gutter: 20px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-2, .row-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .row-2 > .growth { grid-column: 1 / -1; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-meta .quote { display: none; }
}
@media (min-width: 768px) and (max-width: 1179px) {
  .app { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  .sidebar { padding: 18px 10px 14px; }
  .brand { padding: 0 0 14px; justify-content: center; } .brand-logo { width: 54px; }
  .brand-card, .nav-item .label, .powered > span { display: none; }
  .nav-item { justify-content: center; padding: 12px; } .powered { justify-content: center; padding: 0; }
  .user-chip > span:not(.avatar) { display: none; } .user-chip { padding: 0 6px; }
}
@media (max-width: 899px) {
  .row-2, .row-3, .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .channels, .presence { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; } .kv dd { margin-bottom: 8px; }
}
@media (max-width: 767px) {
  :root { --gutter: 14px; --inset: 10px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; margin: 0; height: 100dvh; width: min(300px, 86vw); z-index: 60; border-radius: 0 26px 26px 0; transform: translateX(-100%); transition: transform var(--dur-sheet) var(--ease-sheet); }
  .app.nav-open .sidebar { transform: none; } .app.nav-open .nav-scrim { opacity: 1; pointer-events: auto; z-index: 59; }
  .topbar .menu-btn { display: inline-flex; }
  .topbar { padding: 10px var(--gutter) 8px; gap: 8px; }
  .search { flex: 0 0 48px; width: 48px; padding: 0; justify-content: center; margin-right: auto; } .search > span, .search kbd { display: none; }
  .topbar .btn-primary .label { display: none; } .topbar .btn-primary { width: 44px; padding: 0; }
  .user-chip > span:not(.avatar), .user-chip > svg { display: none; } .user-chip { padding: 0 4px; }
  .vline { display: none; }
  .main { gap: 14px; padding-bottom: 48px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 10px; padding: 8px 2px 4px; }
  .page-meta { text-align: left; } .page-meta .tagline { display: none; }
  h1 { font-size: 27px; } .greet { font-size: 18px; } .page-head .lead { font-size: 15px; }
  /* KPI cards become rows: tile, title and caption on the left, value and delta on the right */
  .kpis { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .kpi { padding: 14px 16px; grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px; align-items: center; }
  .kpi .tile { width: 40px; height: 40px; border-radius: 12px; grid-row: 1 / 3; } .kpi .tile svg.i { width: 19px; height: 19px; }
  .kpi-title { grid-column: 2; grid-row: 1; font-size: 14.5px; align-self: end; }
  .kpi-sub { grid-column: 2; grid-row: 2; margin-top: 0; padding-right: 0; align-self: start; }
  .kpi-value { grid-column: 3; grid-row: 1 / 3; margin: 0; flex-direction: column; align-items: flex-end; gap: 4px; flex-wrap: nowrap; }
  .kpi-value b { font-size: 26px; white-space: nowrap; } .kpi-value .tag { height: 22px; font-size: 11.5px; padding: 0 7px; }
  .kpi .spark { display: none; }
  .card { padding: 16px 16px 14px; }
  .card-head { flex-wrap: wrap; } .card-head .lead-icon { flex: 1 1 100%; } .card-head h2 { white-space: normal; }
  .chart { height: 200px; }
  .toolbar .input { max-width: none !important; }
  .toolbar .spacer { display: none; }
  /* Filters wrap as chips instead of scrolling sideways */
  .toolbar .segmented { flex-wrap: wrap; overflow: visible; background: transparent; padding: 0; gap: 8px; max-width: 100%; }
  .toolbar .segmented button { height: 40px; padding: 0 14px; border-radius: 999px; background: rgba(255,255,255,.7); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--glass-line); }
  .toolbar .segmented button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--accent-soft-2); }
  /* Touch: no iOS zoom on focus, 44px targets, hit areas on small controls */
  .input, .input input, .input select, .input textarea, .palette input { font-size: 16px; }
  .btn-sm, .btn-quiet { height: 40px; padding: 0 14px; }
  .pill-link { height: 40px; padding: 0 14px; }
  .icon-btn.plain { width: 44px; height: 44px; }
  .brand-card .go { width: 44px; height: 44px; }
  .back { min-height: 44px; display: inline-flex; align-items: center; margin-bottom: 0; }
  .powered { min-height: 44px; }
  .tabs button { min-height: 44px; padding: 10px 12px; }
  .check, .switch { position: relative; }
  .check::before, .switch::before { content: ""; position: absolute; inset: -11px; }
  .pager .pages button { width: 40px; height: 40px; }
  .radio input { font-size: 16px; }
  /* Page head actions fill the width in one row; the more menu stays on screen */
  .page-head .actions { width: 100%; flex-wrap: wrap; }
  .page-head .actions .btn { flex: 1 1 auto; padding: 0 14px; }
  .page-head .actions .icon-btn { flex: none; width: 44px; height: 44px; }
  .menu { max-width: calc(100vw - 28px); }
  /* Tables never scroll inside a card: cells wrap and columns share the width */
  .table-wrap { margin: 0; padding: 0; overflow: visible; }
  .table { table-layout: fixed; width: 100%; }
  .table td, .table th { white-space: normal; padding-left: 6px; padding-right: 6px; overflow: hidden; }
  .table .client > span:last-child { flex: 1 1 auto; min-width: 0; }
  .table .client b, .table .client small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .table td:first-child, .table th:first-child { padding-left: 0; } .table td:last-child, .table th:last-child { padding-right: 0; }
  .steps { flex-wrap: wrap; gap: 10px 16px; } .steps hr { display: none; }
  .sheet, .sheet.wide { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 88dvh; border-radius: 24px 24px 0 0; transform: translateY(40px); }
  .sheet-foot { flex-direction: column; padding-bottom: max(22px, env(safe-area-inset-bottom)); }
  .palette { top: 8vh; }
  .proto { left: 12px; right: auto; }
  .atmos svg { width: 120vw; min-width: 0; right: -30%; top: -2%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
  .sk::after { display: none; }
  .sheet, .palette, .menu, .toast, .dialog { transform: none !important; }
  .glass.lift:hover { transform: none; }
}
