/* UCH CRM + Studio · glass panels over a wallpaper, one accent colour (Settings → Appearance). Dark default, light optional. */

:root, :root[data-theme="dark"] {
  --accent: #3b82f6;
  --wall: radial-gradient(1200px 700px at 80% -10%, #2a2a31 0%, transparent 60%), #17171b;
  --bg: #17171b;
  --surface: rgba(38, 38, 44, .58);
  --surface-2: rgba(255, 255, 255, .045);
  --surface-3: rgba(255, 255, 255, .09);
  --solid: #1d1d22;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .11);
  --hi: rgba(255, 255, 255, .07);
  --text: #f2f2f5;
  --muted: #9b9ba6;
  --faint: #6c6c76;
  --island: #050506;
  --blur: blur(28px) saturate(140%);
  --ok: #22c55e; --ok-soft: rgba(34, 197, 94, .14);
  --warn: #f59e0b; --warn-soft: rgba(245, 158, 11, .14);
  --bad: #f43f5e; --bad-soft: rgba(244, 63, 94, .14);
  --info: #38bdf8; --info-soft: rgba(56, 189, 248, .13);
  --shadow: 0 10px 40px rgba(0, 0, 0, .3);
  --glass: rgba(24, 24, 28, .72);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --wall: radial-gradient(1200px 700px at 80% -10%, #ffffff 0%, transparent 60%), #e9e8ed;
  --bg: #e9e8ed;
  --surface: rgba(255, 255, 255, .62);
  --surface-2: rgba(0, 0, 0, .035);
  --surface-3: rgba(0, 0, 0, .07);
  --solid: #ffffff;
  --line: rgba(0, 0, 0, .07);
  --line-2: rgba(0, 0, 0, .12);
  --hi: rgba(255, 255, 255, .9);
  --text: #17171b;
  --muted: #61616b;
  --faint: #8b8b95;
  --ok: #16a34a; --ok-soft: rgba(22, 163, 74, .12);
  --warn: #c76a00; --warn-soft: rgba(199, 106, 0, .12);
  --bad: #e11d48; --bad-soft: rgba(225, 29, 72, .1);
  --info: #0284c7; --info-soft: rgba(2, 132, 199, .1);
  --shadow: 0 10px 40px rgba(0, 0, 0, .1);
  --glass: rgba(255, 255, 255, .8);
  color-scheme: light;
}
:root { --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent); --grad: linear-gradient(to bottom, color-mix(in srgb, var(--accent) 82%, #fff), var(--accent)); --r: 26px; --side: 232px; }
:root[data-glass="clear"] { --surface: rgba(38, 38, 44, .32); }
:root[data-theme="light"][data-glass="clear"] { --surface: rgba(255, 255, 255, .38); }
:root[data-solid="1"] { --blur: none; --surface: #222228; }
:root[data-solid="1"][data-theme="light"] { --surface: #ffffff; }

* { box-sizing: border-box; }
html, body { margin: 0; color: var(--text); }
html { background: var(--bg); -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
body { background: var(--wall); background-attachment: fixed; min-height: 100vh; font: 14.5px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a, button, .row, .tcard, .lead { touch-action: manipulation; }
.tabbar, .nav, .btn { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { letter-spacing: -.02em; margin: 0; }
.num, .money { font-variant-numeric: tabular-nums; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* glass surfaces */
.glass, .card, .side, .lane, .modal, .auth-card, .stat, .col, .pane, .smenu, .tools, .filters { background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--line-2); box-shadow: inset 0 1px 0 var(--hi), 0 10px 40px rgba(0, 0, 0, .18); }

.splash { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
.splash-logo { width: 96px; opacity: .9; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; } }

/* ---------- auth ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.auth::before { content: ""; position: absolute; width: 900px; height: 900px; border-radius: 50%; background: var(--accent); filter: blur(160px); opacity: .16; top: -560px; left: 50%; transform: translateX(-50%); pointer-events: none; }
.auth-card { position: relative; width: 100%; max-width: 400px; border-radius: 28px; padding: 32px 24px; }
.auth-card .logo { width: 84px; display: block; margin: 0 auto 20px; }
.auth-card h1 { font-size: 22px; text-align: center; }
.auth-card p.sub { text-align: center; color: var(--muted); margin: 6px 0 24px; font-size: 14px; }
.auth-langs { display: flex; justify-content: center; gap: 4px; margin-top: 20px; }
.qr { background: #fff; border-radius: 16px; padding: 12px; width: 196px; margin: 0 auto 12px; }
.qr img, .qr svg { width: 100%; display: block; }
.secret { font: 600 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: center; background: var(--surface-2); border-radius: 12px; padding: 10px; letter-spacing: .06em; user-select: all; word-break: break-all; margin-bottom: 16px; }
.code-input { font: 600 28px ui-monospace, SFMono-Regular, Menlo, monospace !important; text-align: center; letter-spacing: .4em; }
:root[data-theme="light"] .auth-card .logo, :root[data-theme="light"] .topbar .brand img { filter: invert(1); }

/* ---------- shell ---------- */
.side { position: fixed; left: 12px; top: 12px; bottom: 12px; width: var(--side); border-radius: 28px; display: flex; flex-direction: column; padding: 14px 10px; z-index: 20; overflow: hidden; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 12px; font-weight: 700; font-size: 15px; text-decoration: none; }
.logo-sq { width: 34px; height: 34px; border-radius: 11px; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 6px 18px var(--accent-soft); }
.logo-sq img { width: 24px; }
.side .brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.nav { overflow-y: auto; overflow-x: hidden; flex: 1; min-height: 0; margin: 0 -4px; padding: 0 4px; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-section { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 11px 12px 4px; }
.nav a { display: flex; align-items: center; gap: 11px; height: 33px; padding: 0 12px; border-radius: 18px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 13px; position: relative; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { color: var(--text); background: linear-gradient(to bottom, rgba(255, 255, 255, .13), rgba(255, 255, 255, .05)); box-shadow: inset 0 0 0 1px var(--line-2), 0 4px 14px rgba(0, 0, 0, .2); }
:root[data-theme="light"] .nav a.on { background: #fff; }
.nav svg { width: 17px; height: 17px; flex: none; }
.nav a span:not(.badge):not(.cnt) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nav .cnt, .nav .badge { margin-left: auto; flex: none; }
.cnt { background: var(--surface-3); border-radius: 8px; padding: 0 7px; font-size: 11px; color: var(--muted); line-height: 20px; font-weight: 700; }
.nav .pin-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin: 0 4px; }
.side .foot { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.mac { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 14px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; background: var(--surface-2); }
.mac i { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--bad); }
.mac.ok i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.me { display: flex; align-items: center; gap: 10px; padding: 2px 4px; }
.me b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me > div { min-width: 0; flex: 1; }
.ava { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: none; }
.me .btn { width: 32px; height: 32px; padding: 0; flex: none; }

.top { position: fixed; top: 12px; left: calc(var(--side) + 24px); right: 12px; height: 46px; z-index: 15; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.top > * { pointer-events: auto; }
.island { height: 36px; min-width: 180px; max-width: 46vw; border-radius: 18px; background: var(--island); color: #fff; display: flex; align-items: center; gap: 10px; padding: 0 14px; font-size: 12px; font-weight: 600; box-shadow: 0 8px 30px rgba(0, 0, 0, .35); transition: min-width .35s cubic-bezier(.2, .9, .3, 1.2); white-space: nowrap; overflow: hidden; }
.island:empty { display: none; }
.island.live { min-width: 280px; cursor: pointer; }
.island .clock { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--warn); }
.island .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.island .spinr { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .15); border-top-color: var(--warn); animation: spin 1s linear infinite; flex: none; }
.tools { position: absolute; right: 0; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 24px; }
.tools .search { display: flex; align-items: center; gap: 8px; height: 34px; width: 220px; padding: 0 8px 0 12px; border-radius: 17px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 13px; margin-right: 4px; }
.tools .search kbd { margin-left: auto; font: 600 11px -apple-system, sans-serif; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; }
.tools > button:not(.search) { width: 34px; height: 34px; border-radius: 50%; border: 0; background: none; color: var(--text); display: grid; place-items: center; cursor: pointer; position: relative; }
.tools > button:not(.search):hover { background: var(--surface-2); }
.tools svg { width: 18px; height: 18px; }
.tools .bdot { position: absolute; top: 6px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--island); }

.main { min-width: 0; padding: 16px 24px 64px calc(var(--side) + 36px); }
.main.enter { animation: fadein .26s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }
.page-head, .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; min-height: 60px; }
.page-head > div:first-child, .head > div:first-child { max-width: calc(50% - 160px); min-width: 240px; }
.page-head h1, .head h1 { font-size: 30px; font-weight: 750; line-height: 1.1; }
.page-head .sub, .head p { color: var(--muted); margin: 6px 0 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-self: flex-end; margin-top: 54px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); text-decoration: none; font-size: 13px; font-weight: 600; margin-bottom: 10px; background: none; border: 0; padding: 0; cursor: pointer; }
.back svg { width: 16px; height: 16px; }
.topbar, .tabbar { display: none; }

/* ---------- components ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 19px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .08s, background .15s; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.97); }
.btn.primary, .btn.acc { border-color: transparent; background: var(--grad); color: #fff; box-shadow: 0 6px 22px color-mix(in srgb, var(--accent) 40%, transparent), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn.primary:hover, .btn.acc:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12px; }
.btn.block { width: 100%; height: 46px; font-size: 15px; }
.btn[disabled], .btn:disabled { opacity: .5; pointer-events: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.avatar svg { width: 20px; height: 20px; }
.show-sm { display: none; }

.card { border-radius: var(--r); padding: 20px; min-width: 0; }
.card h2 { font-size: 17px; font-weight: 700; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head .meta { color: var(--muted); font-size: 13px; }
.card .sub { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.card .ch { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.card .ch .lnk, .lnk { margin-left: auto; color: var(--accent); font-weight: 600; font-size: 13px; background: none; border: 0; cursor: pointer; text-decoration: none; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack > * + * { margin-top: 14px; }

.kpi { position: relative; overflow: hidden; }
.kpi .lbl { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi .val { font-size: 28px; font-weight: 750; letter-spacing: -.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .val small { font-size: 14px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.kpi .foot { color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.kpi.hero::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 180px; height: 180px; border-radius: 50%; background: var(--accent); filter: blur(60px); opacity: .25; pointer-events: none; }
.progress { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 12px; }
.progress i { display: block; height: 100%; background: var(--grad); border-radius: 99px; min-width: 6px; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--muted); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pill > i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.pill.agent { color: var(--text); background: var(--surface-2); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.tag { height: 24px; padding: 0 9px; border-radius: 8px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; flex: none; }
.tag svg { width: 13px; height: 13px; }
.tag.high { color: var(--warn); background: var(--warn-soft); }
.tag.urgent { color: var(--bad); background: var(--bad-soft); }
.tag.ok { color: var(--ok); background: var(--ok-soft); }
.tag.mute { color: var(--muted); background: var(--surface-2); }

.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.row:last-child { border-bottom: 0; }
a.row:hover, .row.click:hover { background: var(--surface-2); border-radius: 14px; cursor: pointer; }
.row .main-col { flex: 1; min-width: 0; }
.row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .end { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.avatar { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-weight: 700; flex: none; background: var(--surface-3); color: var(--text); font-size: 15px; }
.avatar.partner { background: var(--grad); color: #fff; }
.avatar.own { background: var(--info-soft); color: var(--info); }
.avatar.former { opacity: .5; }
.empty { color: var(--muted); text-align: center; padding: 26px 12px; font-size: 14px; }

table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click:hover td { background: var(--surface-2); cursor: pointer; }
table.t .r, table.t td.n { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; margin: 0 -4px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line-2); flex-wrap: wrap; }
.seg button { border: 0; background: none; height: 30px; padding: 0 13px; border-radius: 15px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2), 0 2px 8px rgba(0, 0, 0, .18); }
.seg button svg { width: 15px; height: 15px; }
.seg.wide { display: flex; flex-wrap: nowrap; } .seg.wide button { flex: 1; justify-content: center; min-width: 0; padding: 0 8px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { flex: 1; min-width: 180px; max-width: 320px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span, label.l { font-size: 12px; font-weight: 600; color: var(--muted); }
label.l { display: block; margin-bottom: 6px; }
.field .hint, .hint { font-size: 12px; color: var(--faint); }
input.in, select.in, textarea.in { width: 100%; height: 42px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.in { height: auto; min-height: 96px; padding: 11px 14px; resize: vertical; }
textarea.in.code { font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; min-height: 460px; }
input.in[type=date] { -webkit-appearance: none; appearance: none; min-width: 0; display: block; line-height: 42px; text-align: left; }
input.in[type=date]::-webkit-date-and-time-value { text-align: left; }
input.in:focus, select.in:focus, textarea.in:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.in option { background: var(--solid); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid .full, .form .full { grid-column: 1 / -1; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin: 6px 0 16px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.err { background: var(--bad-soft); color: var(--bad); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-bottom: 14px; }

.items-editor .it { display: grid; grid-template-columns: minmax(0, 1fr) 80px 110px 110px 34px; gap: 8px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.items-editor .it .tot { text-align: right; padding-top: 12px; font-variant-numeric: tabular-nums; }
.items-editor .it .x { margin-top: 6px; padding: 0; width: 34px; }
.items-editor .it textarea.in { min-height: 40px; height: 40px; margin-top: 6px; font-size: 13px; }
.sum-box { margin-left: auto; width: 280px; margin-top: 12px; }
.sum-box div { display: flex; justify-content: space-between; padding: 4px 0; color: var(--muted); }
.sum-box .grand { color: var(--text); font-weight: 700; font-size: 18px; border-top: 1px solid var(--line-2); margin-top: 6px; padding-top: 10px; }

/* ---------- modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .15s; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; border-radius: 28px; padding: 22px; animation: pop .18s ease-out; background: var(--glass); }
.modal.wide { max-width: 880px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; }
.modal-head h2 { font-size: 19px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--island); color: #fff; padding: 11px 18px; border-radius: 20px; box-shadow: var(--shadow); z-index: 80; font-weight: 600; font-size: 13px; animation: pop .2s; max-width: calc(100vw - 32px); }
.toast.bad { background: var(--bad); }

/* ---------- CRM pages ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.lane { border-radius: 22px; padding: 12px; min-height: 120px; }
.lane h3 { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; margin-bottom: 10px; }
.lead { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; border: 1px solid var(--line); }
.lead:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.lead .title { font-weight: 600; font-size: 14px; }
.lead .meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.mt { margin-top: 16px; }
.hide { display: none !important; }
.note-box, .cap { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; font-size: 14px; color: var(--muted); line-height: 1.55; }
.note-box.caption, .cap { color: var(--text); }
.media { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.media img, .media video { width: 100%; border-radius: 14px; display: block; background: #000; max-height: 420px; object-fit: contain; }
.file-chip { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); text-decoration: none; font-size: 13px; overflow: hidden; }
.file-chip svg { width: 16px; height: 16px; flex: none; }
.mdbody { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.mdbody h3, .mdbody h4, .mdbody h5, .mdbody h6 { margin: 18px 0 6px; font-size: 15.5px; }
.mdbody p { margin: 6px 0; }
.mdbody ul, .mdbody ol { margin: 6px 0; padding-left: 22px; }
.mdbody code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.mdbody a { color: var(--accent); }
.mdbody hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.mdtable { overflow-x: auto; margin: 10px 0; border: 1px solid var(--line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.mdtable table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.mdtable th, .mdtable td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: normal; min-width: 90px; }
.mdtable th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.mdtable tbody tr:last-child td { border-bottom: 0; }
pre { white-space: pre-wrap; word-break: break-word; margin: 0; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.log { background: #08080a; color: #cfd0d6; border-radius: 16px; padding: 14px; max-height: 340px; overflow: auto; margin-top: 12px; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; }
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 16px; margin-bottom: 14px; font-size: 13px; font-weight: 600; background: var(--warn-soft); color: var(--warn); }
.banner svg { width: 16px; height: 16px; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin svg { animation: spin .6s linear infinite; }

/* ---------- studio: dashboard ---------- */
.bar2 { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.bar2 .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { min-width: 112px; padding: 9px 15px 11px; border-radius: 18px; }
.stat small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.stat b { font-size: 22px; letter-spacing: -.02em; }
.stat b span { font-size: 13px; color: var(--muted); font-weight: 600; }
.dash { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dash .wide { grid-column: 1 / -1; }
.rows > .r { display: flex; gap: 12px; align-items: center; padding: 11px 2px; border-top: 1px solid var(--line); cursor: pointer; }
.rows > .r:first-child { border-top: 0; }
.rows .rt { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .rm { display: flex; gap: 8px; align-items: center; margin-top: 5px; color: var(--muted); font-size: 12px; }
.circ { width: 22px; height: 22px; border-radius: 50%; border: 1.6px solid var(--faint); flex: none; display: grid; place-items: center; }
.circ.done { background: var(--accent); border-color: var(--accent); color: #fff; }
.circ svg { width: 13px; height: 13px; stroke-width: 2.6; }
.rings { display: flex; align-items: center; justify-content: center; gap: 28px; padding: 8px 0; flex-wrap: wrap; }
.legend-v > div { border-left: 3px solid; padding: 0 0 0 10px; margin: 8px 0; }
.legend-v small { display: block; color: var(--muted); font-size: 12px; }
.legend-v b { font-size: 20px; } .legend-v b span { font-size: 12px; color: var(--muted); }
.lg > div { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-weight: 600; }
.lg > div:first-child { border-top: 0; }
.lg i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.lg span { margin-left: auto; font-variant-numeric: tabular-nums; }
.lg em { font-style: normal; color: var(--muted); width: 42px; text-align: right; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 160px; margin-top: 14px; }
.bars .b { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; text-decoration: none; color: inherit; }
.bars .b div { width: 100%; border-radius: 10px; background: linear-gradient(to top, color-mix(in srgb, var(--accent) 45%, transparent), var(--accent)); min-height: 4px; }
.bars .b.zero div { background: var(--surface-2); }
.bars .b.dim div { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.bars .b small { color: var(--muted); font-size: 11px; font-weight: 600; }
.bars .b span { font-size: 12px; font-weight: 700; }
.next { border-radius: 18px; padding: 14px 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 30%, transparent), color-mix(in srgb, var(--accent) 10%, transparent)); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); margin-bottom: 8px; }
.next small { color: var(--muted); font-weight: 600; } .next small b { color: var(--text); }
.next h3 { margin: 4px 0 2px; font-size: 16px; }
.avs { display: flex; } .avs .av { margin-left: -6px; box-shadow: 0 0 0 2px #111; } .avs .av:first-child { margin-left: 0; }
.av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; flex: none; }
.av.lg2 { width: 44px; height: 44px; font-size: 14px; }
.sched > div { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-weight: 600; font-size: 13px; }
.sched > div i { width: 3px; height: 18px; border-radius: 2px; background: var(--accent); }
.sched > div span { margin-left: auto; color: var(--muted); font-weight: 500; }

/* team cards */
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.acard { border-radius: 22px; padding: 16px; position: relative; overflow: hidden; }
.acard.off { opacity: .6; }
.acard::before { content: ""; position: absolute; inset: 0 0 auto; height: 90px; background: radial-gradient(260px 90px at 70% 0%, var(--c), transparent 70%); opacity: .22; pointer-events: none; }
.acard .who { display: flex; gap: 12px; align-items: center; position: relative; }
.acard .who .av { position: relative; }
.acard .who .av::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--st); box-shadow: 0 0 0 2px #1d1d22; }
.acard .who b { display: block; font-size: 15px; } .acard .who small { color: var(--muted); font-size: 12px; }
.acard .ameta { display: flex; align-items: center; gap: 8px; margin: 12px 0; font-size: 12px; color: var(--muted); }
.acard .ameta i { width: 7px; height: 7px; border-radius: 50%; background: var(--st); }
.acard .ameta span { margin-left: auto; color: var(--text); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.acard .ameta svg { width: 14px; height: 14px; color: var(--muted); }
.load { border-radius: 14px; background: var(--surface-2); padding: 10px 12px; }
.load .lt { display: flex; font-size: 12px; font-weight: 600; color: var(--muted); } .load .lt b { margin-left: auto; color: var(--text); }
.load .track { height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.load .track div { height: 100%; border-radius: 3px; background: var(--ok); }
.acard .afoot { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.acard .afoot svg { width: 14px; height: 14px; }
.acard .afoot .btn { margin-left: auto; }
.icbtn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface-2); display: grid; place-items: center; cursor: pointer; color: var(--text); flex: none; }
.icbtn svg { width: 14px; height: 14px; }

/* posts board */
.filters { display: flex; gap: 8px; align-items: center; padding: 6px; border-radius: 24px; margin-bottom: 16px; flex-wrap: wrap; }
.filters select { height: 34px; border-radius: 17px; border: 1px solid var(--line-2); background: var(--surface-2); padding: 0 12px; font-weight: 600; font-size: 13px; }
.filters select option { background: var(--solid); }
.filters .q { flex: 1; min-width: 180px; display: flex; align-items: center; gap: 8px; color: var(--muted); height: 34px; padding: 0 12px; }
.filters .q input { border: 0; background: none; outline: none; width: 100%; color: var(--text); }
.toggle-chip { height: 34px; border-radius: 17px; border: 1px solid var(--line-2); background: var(--surface-2); padding: 0 12px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--muted); }
.toggle-chip.on { color: var(--text); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.col { border-radius: var(--r); padding: 12px; align-self: start; }
.col .cht { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; font-weight: 700; }
.col .cht .cnt { margin-left: 2px; }
.col .cht > i { width: 9px; height: 9px; border-radius: 50%; }
.tcard { border-radius: 18px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line-2); margin-bottom: 10px; cursor: pointer; transition: border-color .15s, transform .15s; overflow: hidden; }
.tcard:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); transform: translateY(-1px); }
.tcard.sel { border-color: var(--accent); }
.tcard .thumb { margin: -12px -14px 10px; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.tcard .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tcard .tt { font-weight: 600; margin: 9px 0 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tcard .tm { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.tcard .tm svg { width: 13px; height: 13px; }
.tcard .tm .av { margin-left: auto; width: 22px; height: 22px; font-size: 9px; }
.tcard.done .tt { color: var(--muted); }

/* side pane */
.pane { position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(500px, calc(100vw - 24px)); border-radius: 28px; z-index: 40; overflow: auto; padding: 22px; transform: translateX(calc(100% + 24px)); transition: transform .35s cubic-bezier(.2, .9, .3, 1); background: var(--glass); overscroll-behavior: contain; }
.pane.open { transform: none; }
.pane .x { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface-2); display: grid; place-items: center; cursor: pointer; color: var(--text); }
.pane .x svg { width: 18px; height: 18px; }
.pane h2 { font-size: 23px; letter-spacing: -.02em; margin: 14px 0 16px; padding-right: 40px; line-height: 1.2; }
.decide { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 18px; }
.tile { border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line-2); padding: 11px 14px; min-width: 0; }
.tile small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.tile div { display: flex; align-items: center; gap: 8px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile svg { width: 15px; height: 15px; color: var(--muted); }
.sec { display: flex; align-items: center; font-weight: 700; font-size: 15px; margin: 20px 0 10px; }
.sec > span { margin-left: auto; }
.inrow { display: flex; gap: 8px; margin-top: 10px; }
.inrow .in { flex: 1; }
.cmt { padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.cmt b { font-size: 12px; color: var(--muted); display: block; margin-bottom: 2px; }
.scrim { position: fixed; inset: 0; z-index: 39; background: rgba(0, 0, 0, .25); opacity: 0; pointer-events: none; transition: opacity .3s; }
.scrim.open { opacity: 1; pointer-events: auto; }

/* command palette */
.pal-bg { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .4); backdrop-filter: blur(4px); display: flex; justify-content: center; padding-top: 12vh; }
.pal { width: min(620px, calc(100vw - 32px)); border-radius: 24px; padding: 8px; align-self: flex-start; background: var(--glass); }
.pal input { width: 100%; height: 48px; border: 0; background: none; outline: none; font-size: 16px; padding: 0 14px; }
.pal .res { max-height: 50vh; overflow: auto; border-top: 1px solid var(--line); padding-top: 6px; }
.pal .it { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; cursor: pointer; }
.pal .it.on { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.pal .it .rt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pal .it small { color: var(--muted); }
.pal .it svg { width: 17px; height: 17px; color: var(--muted); }
.pal .grp { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--faint); padding: 8px 12px 4px; text-transform: uppercase; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dn { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 8px 4px; }
.cal .day { min-height: 112px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); padding: 8px; min-width: 0; }
.cal .day.out { opacity: .35; }
.cal .day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal .day .n { font-size: 12px; font-weight: 700; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cal .day.today .n { color: var(--accent); }
.cal .ev { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; padding: 3px 6px; border-radius: 7px; margin-top: 4px; background: var(--surface-2); cursor: pointer; overflow: hidden; white-space: nowrap; }
.cal .ev span { overflow: hidden; text-overflow: ellipsis; }
.cal .ev > i { width: 3px; height: 12px; border-radius: 2px; flex: none; }
.cal .ev.host > i { background: var(--warn); }
.cal .ev.inv > i { background: var(--ok); }
.cal .sch { font-size: 10px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 1px 6px; }

/* charts */
.chart { position: relative; }
.chart svg { width: 100%; height: 260px; display: block; overflow: visible; }
.chart .tip { position: absolute; pointer-events: none; background: #0b0b0e; color: #fff; border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; padding: 9px 12px; font-size: 12px; min-width: 150px; opacity: 0; transition: opacity .1s; }
.chart .tip b { display: block; margin-bottom: 4px; }
.chart .tip div { display: flex; gap: 8px; align-items: center; } .chart .tip div span { margin-left: auto; font-weight: 700; }
.chart .tip i { width: 7px; height: 7px; border-radius: 50%; }
.legend-h { display: flex; gap: 16px; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.legend-h i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.mbar { height: 6px; border-radius: 3px; background: var(--surface-3); width: 100px; overflow: hidden; } .mbar div { height: 100%; background: var(--accent); border-radius: 3px; }

/* settings */
.set { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.smenu { border-radius: 24px; padding: 8px; position: sticky; top: 76px; }
.smenu .mehead { display: flex; gap: 10px; align-items: center; padding: 8px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.smenu .mehead b { display: block; font-size: 14px; } .smenu .mehead small { color: var(--muted); font-size: 12px; }
.smenu button { width: 100%; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 8px; border: 0; background: none; border-radius: 14px; cursor: pointer; font-weight: 600; font-size: 13px; text-align: left; }
.smenu button.on { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.smenu button .chev { margin-left: auto; color: var(--muted); display: grid; }
.smenu button .chev svg { width: 15px; height: 15px; }
.ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; }
.ic svg { width: 16px; height: 16px; }
.walls { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 14px; margin-top: 10px; }
.wall { cursor: pointer; text-align: center; font-weight: 600; font-size: 13px; color: var(--muted); }
.wall div { height: 74px; border-radius: 16px; border: 2px solid transparent; margin-bottom: 6px; box-shadow: inset 0 0 0 1px var(--line-2); }
.wall.on div { border-color: var(--accent); } .wall.on { color: var(--text); }
.srow { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.card .ch + .srow { border-top: 0; }
.srow .tx { flex: 1; min-width: 160px; } .srow .tx b { display: block; } .srow .tx small { color: var(--muted); }
.swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.sw { width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; }
.sw svg { width: 16px; height: 16px; }
.sw.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px currentColor; }
.switch { width: 50px; height: 30px; border-radius: 15px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; cursor: pointer; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .2s; }
.switch.on { background: var(--ok); } .switch.on::after { left: 23px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tools .search { width: 38px; padding: 0; justify-content: center; } .tools .search span, .tools .search kbd { display: none; } }
@media (max-width: 1060px) { .dash, .set { grid-template-columns: minmax(0, 1fr); } .smenu { position: static; } }
@media (max-width: 900px) {
  .side, .top { display: none; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 10px) 14px 10px; background: var(--glass); backdrop-filter: saturate(1.6) blur(20px); -webkit-backdrop-filter: saturate(1.6) blur(20px); border-bottom: 1px solid var(--line); }
  .topbar .brand img { width: 44px; display: block; }
  .topbar .island { margin: 0 auto; min-width: 0; max-width: 52vw; } .topbar .island.live { min-width: 0; } .topbar .island .clock { display: none; }
  .topbar .tb-right { display: flex; gap: 2px; margin-left: auto; }
  .topbar .tb-right .btn { width: 34px; padding: 0; }
  .main { padding: 16px max(16px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .page-head > div:first-child, .head > div:first-child { max-width: none; }
  .page-head .actions { margin-top: 0; width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .page-head h1, .head h1 { font-size: 25px; }
  input.in, select.in, textarea.in { font-size: 16px; } /* below 16px iOS zooms the page on focus */
  .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: calc(10px + env(safe-area-inset-bottom)); left: 12px; right: 12px; z-index: 30; padding: 6px 4px; border-radius: 28px; background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--line-2); box-shadow: inset 0 1px 0 var(--hi), 0 10px 40px rgba(0, 0, 0, .3); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--faint); text-decoration: none; background: none; border: 0; padding: 5px 0; cursor: pointer; position: relative; border-radius: 20px; }
  .tabbar span:not(.badge) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding: 0 2px; }
  .tabbar a.on, .tabbar button.on { color: var(--text); background: var(--surface-2); }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .badge { position: absolute; top: 0; left: 55%; height: 16px; min-width: 16px; font-size: 10px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .g3.keep { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .modal-bg { place-items: end stretch; padding: 0; }
  .modal { max-width: none; border-radius: 26px 26px 0 0; max-height: 92vh; max-height: 92dvh; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: up .22s ease-out; }
  .modal::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: -6px auto 12px; }
  @keyframes up { from { transform: translateY(40%); opacity: .4; } }
  .items-editor .it { grid-template-columns: 1fr 64px 92px 30px; }
  .items-editor .it .tot { display: none; }
  .kv { grid-template-columns: 110px 1fr; }
  .pane { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 92dvh; border-radius: 26px 26px 0 0; transform: translateY(105%); }
  .pane.open { transform: none; }
  .cal .day { min-height: 74px; } .cal .ev span { display: none; }
  .donutwrap { grid-template-columns: 1fr !important; justify-items: center; } .donutwrap .lg { columns: 1 !important; width: 100%; }
  .bar2 .acts { margin-left: 0; }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .val { font-size: 22px; }
  .card { padding: 16px; border-radius: 22px; }
  .stat { min-width: 0; flex: 1 1 calc(50% - 5px); }
  .form-grid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr; }
  .sum-box { width: 100%; }
  table.t.stackable thead { display: none; }
  table.t.stackable tr { display: grid; grid-template-columns: 1fr auto; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.t.stackable td { border: 0; padding: 2px 4px; }
  table.t.stackable td.hide-sm { display: none; }
  .show-sm { display: inline; }
}

/* Password show/hide eye */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap > input { width: 100%; padding-right: 48px !important; }
.pw-eye { position: absolute; top: 0; right: 0; bottom: 0; width: 46px; display: flex; align-items: center; justify-content: center; padding: 0; margin: 0; border: 0; background: none; box-shadow: none; color: var(--muted); cursor: pointer; border-radius: 0 12px 12px 0; -webkit-tap-highlight-color: transparent; }
.pw-eye:hover { color: var(--text); }
.pw-eye:focus-visible { outline: 2px solid var(--accent); outline-offset: -6px; border-radius: 10px; }
.pw-eye svg { width: 20px; height: 20px; display: block; }
input::-ms-reveal, input::-ms-clear { display: none; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }
.g2.keep { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
#social { scroll-margin-top: 72px; }

/* phones: agenda calendar, swipeable board */
.agenda .card { padding: 14px 16px; }
.agenda .card.today { border-color: var(--accent); }
.ag-day { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ag-day b { font-size: 22px; letter-spacing: -.02em; }
.ag-day span { color: var(--muted); font-size: 13px; font-weight: 600; }
.ag-day .cal-sch { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 1px 7px; }
.agenda .ev { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--line); font-weight: 600; font-size: 14px; cursor: pointer; }
.agenda .ev > i { width: 4px; height: 18px; border-radius: 2px; flex: none; background: var(--accent); }
.agenda .ev.host > i { background: var(--warn); } .agenda .ev.inv > i { background: var(--ok); }
.agenda .ev span { flex: 1; min-width: 0; }
.agenda .ev svg { width: 16px; height: 16px; color: var(--faint); }
.cal .sch { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (max-width: 900px) {
  .board { grid-auto-columns: 86%; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 10px; scroll-padding: 0 16px; }
  .col { scroll-snap-align: start; }
  .head > div:first-child { min-width: 0; }
  .bar2 .acts .seg { flex: none; }
}
