/* =====================================================================
   DAEMA CRM v2 — design system
   Warm architectural minimalism · accent var(--accent) · Geist / Instrument Serif
   ===================================================================== */

:root {
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --bg: #f3efe8;
  --surface: #fffdf9;
  --surface-2: #faf7f1;
  --surface-3: #f2ede5;
  --line: rgba(32, 24, 14, .08);
  --line-2: rgba(32, 24, 14, .13);
  --line-3: rgba(32, 24, 14, .22);
  --text: #16130f;
  --text-2: #5e574e;
  --text-3: #968d81;
  --track: rgba(32, 24, 14, .075);

  --accent: var(--accent);
  --accent-2: color-mix(in oklab, var(--accent) 74%, white);
  --accent-3: color-mix(in oklab, var(--accent) 45%, #9a8a74);
  --accent-ink: color-mix(in oklab, var(--accent) 80%, black);
  --accent-soft: color-mix(in srgb, var(--accent) 9%, transparent);
  --accent-soft-2: color-mix(in srgb, var(--accent) 17%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 30%, transparent);
  --accent-shadow: color-mix(in oklab, var(--accent) 45%, black);
  --accent-grad: linear-gradient(100deg, var(--accent-3), var(--accent) 55%, var(--accent-2));
  --on-accent: #fff;

  --green: #1f8a52; --green-soft: rgba(31, 138, 82, .1);
  --red: #d03b2f; --red-soft: rgba(208, 59, 47, .09);
  --amber: #b47a0b; --amber-soft: rgba(201, 138, 18, .13);
  --blue: #2f6fd0; --blue-soft: rgba(47, 111, 208, .1);
  --violet: #7a5cd6; --violet-soft: rgba(122, 92, 214, .11);
  --teal: #1b9a8f; --teal-soft: rgba(27, 154, 143, .11);
  --gray-soft: rgba(32, 24, 14, .06);

  --rs: 1;
  --r-sm: calc(9px * var(--rs)); --r: calc(12px * var(--rs)); --r-lg: calc(18px * var(--rs)); --r-xl: calc(24px * var(--rs));
  --sh-1: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 1px 2px rgba(32, 24, 14, .04), 0 3px 10px -4px rgba(32, 24, 14, .06);
  --sh-2: 0 1px 2px rgba(32, 24, 14, .05), 0 12px 28px -10px rgba(32, 24, 14, .16);
  --sh-3: 0 2px 6px rgba(32, 24, 14, .06), 0 30px 70px -18px rgba(32, 24, 14, .32);
  --glass: rgba(255, 253, 249, .68);
  --glass-strong: rgba(255, 253, 249, .86);
  --glass-line: rgba(255, 255, 255, .6);
  --scrim: rgba(24, 18, 12, .32);

  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --spring: cubic-bezier(.34, 1.36, .64, 1);
  --drawer: cubic-bezier(.32, .72, 0, 1);
  --sb-w: 268px;
  --tb-h: 64px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0e0d0b;
  --surface: #171512;
  --surface-2: #1c1a16;
  --surface-3: #23201b;
  --line: rgba(255, 244, 228, .07);
  --line-2: rgba(255, 244, 228, .11);
  --line-3: rgba(255, 244, 228, .19);
  --text: #f4efe7;
  --text-2: #b5ac9f;
  --text-3: #7e766b;
  --track: rgba(255, 244, 228, .08);
  --accent-ink: color-mix(in oklab, var(--accent) 62%, white);
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-soft-2: color-mix(in srgb, var(--accent) 24%, transparent);
  --accent-line: color-mix(in srgb, var(--accent-2) 38%, transparent);
  --green: #45b77e; --green-soft: rgba(69, 183, 126, .13);
  --red: #f06b5e; --red-soft: rgba(240, 107, 94, .13);
  --amber: #e2a73a; --amber-soft: rgba(226, 167, 58, .14);
  --blue: #6c9ff0; --blue-soft: rgba(108, 159, 240, .14);
  --violet: #a78ef2; --violet-soft: rgba(167, 142, 242, .14);
  --teal: #44c6b9; --teal-soft: rgba(68, 198, 185, .13);
  --gray-soft: rgba(255, 244, 228, .07);
  --sh-1: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 1px 2px rgba(0, 0, 0, .35);
  --sh-2: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 30px -10px rgba(0, 0, 0, .6);
  --sh-3: 0 2px 6px rgba(0, 0, 0, .4), 0 30px 70px -18px rgba(0, 0, 0, .8);
  --glass: rgba(23, 21, 18, .64);
  --glass-strong: rgba(28, 26, 22, .88);
  --glass-line: rgba(255, 255, 255, .06);
  --scrim: rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------------- base ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: 'ss01', 'cv11';
  transition: background-color .4s var(--ease), color .3s;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
em.serif, .serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tnum { font-variant-numeric: tabular-nums; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: calc(6px * var(--rs)); }
.i { flex: none; display: block; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.orange { color: var(--accent-ink); }
.red { color: var(--red); } .green { color: var(--green); } .amber { color: var(--amber); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.spacer { flex: 1; }
.hide { display: none !important; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--line-3); background-clip: padding-box; border: 3px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- ambient background ---------------- */
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.amb-orb { position: absolute; border-radius: 50%; will-change: transform; }
.amb-orb.o1 { width: 72vw; height: 72vw; top: -38vw; right: -24vw; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 15%, transparent), color-mix(in srgb, var(--accent) 5%, transparent) 55%, transparent); animation: drift1 34s ease-in-out infinite alternate; }
.amb-orb.o2 { width: 64vw; height: 64vw; bottom: -36vw; left: -10vw; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent-3) 16%, transparent), transparent 70%); animation: drift2 42s ease-in-out infinite alternate; }
.amb-orb.o3 { width: 36vw; height: 36vw; top: 30vh; left: 38vw; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent-2) 6%, transparent), transparent 70%); animation: drift1 50s ease-in-out infinite alternate-reverse; }
[data-theme="dark"] .amb-orb.o1 { background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), color-mix(in srgb, var(--accent) 4%, transparent) 55%, transparent); }
[data-theme="dark"] .amb-orb.o2 { background: radial-gradient(closest-side, color-mix(in srgb, var(--accent-3) 8%, transparent), transparent 70%); }
.amb-grain { position: absolute; inset: 0; opacity: .045; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
[data-theme="dark"] .amb-grain { opacity: .06; mix-blend-mode: screen; }
@keyframes drift1 { to { transform: translate3d(-8vw, 6vw, 0) scale(1.08); } }
@keyframes drift2 { to { transform: translate3d(10vw, -5vw, 0) scale(1.12); } }

/* ---------------- fan mark ---------------- */
.fan-mark { display: block; overflow: visible; }
.fan-bar { transform: rotate(var(--r)); }
.fan-tray { color: #8a8580; }

/* ---------------- splash ---------------- */
.splash { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: #12100d; color: #f4efe7; }
.splash-in { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.splash .fan-mark { width: 96px; height: 96px; }
.splash .fan-bar { animation: fanOpen .9s var(--spring) var(--d) both; }
.splash .fan-tray { stroke-dasharray: 140; animation: trayDraw .8s var(--ease) both; }
.splash-word { display: flex; gap: 1px; font-size: 40px; font-weight: 600; letter-spacing: -.05em; line-height: 1; overflow: hidden; }
.splash-word span { display: inline-block; animation: riseIn .7s var(--ease) both; }
.splash-word span:nth-child(-n+2) { color: var(--accent); }
.splash-sub { font-family: var(--mono); font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: var(--accent-2); animation: fadeIn .8s .7s both; }
.splash-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .06); }
.splash-bar i { display: block; height: 100%; background: var(--accent-grad); transform-origin: 0 50%; animation: barFill 1.3s var(--ease-io) both; }
.splash.out { animation: splashOut .75s var(--ease-io) forwards; }
@keyframes fanOpen { from { transform: rotate(14deg); opacity: 0; } }
@keyframes trayDraw { from { stroke-dashoffset: 140; } to { stroke-dashoffset: 0; } }
@keyframes barFill { from { transform: scaleX(0); } }
@keyframes splashOut { to { clip-path: inset(0 0 100% 0); } }

/* ---------------- login ---------------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, .9fr) 1.1fr; }
.login-panel { position: relative; display: flex; flex-direction: column; padding: 40px clamp(28px, 5vw, 72px); background: var(--surface); }
.login-logo { width: auto; }
.login-main { margin: auto 0; max-width: 480px; padding: 48px 0; }
.login-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.login-kicker::before { content: ''; width: 22px; height: 1px; background: currentColor; }
.login h1 { font-size: clamp(34px, 3.4vw, 46px); font-weight: 600; letter-spacing: -.04em; line-height: 1.04; }
.login h1 em { font-family: var(--serif); font-weight: 400; font-style: italic; color: var(--accent); letter-spacing: -.02em; }
.login-lead { margin-top: 16px; color: var(--text-2); font-size: 15px; line-height: 1.6; max-width: 420px; }
.accts { margin-top: 30px; display: grid; gap: 8px; }
.acct { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: calc(16px * var(--rs)); border: 1px solid var(--line-2); background: var(--surface); text-align: left; transition: transform .35s var(--ease), border-color .25s, box-shadow .3s, background .25s; }
.acct:hover { transform: translateX(4px); border-color: var(--accent-line); box-shadow: 0 10px 30px -14px color-mix(in srgb, var(--accent) 40%, transparent); background: linear-gradient(90deg, var(--accent-soft), transparent 70%), var(--surface); }
.acct-meta { flex: 1; min-width: 0; }
.acct-name { display: block; font-weight: 600; font-size: 14.5px; }
.acct-role { display: block; font-size: 12.5px; color: var(--text-2); }
.acct-go { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); transition: background .25s, color .25s, transform .35s var(--ease); }
.acct:hover .acct-go { background: var(--accent); color: var(--on-accent); transform: rotate(-45deg); }
.acct-badge { font-size: 11px; color: var(--text-3); }
.login-foot { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--text-3); }
.login-visual { position: relative; overflow: hidden; background: #d9cfbf; }
.login-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; animation: kenburns 22s ease-out both; }
.login-visual::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255, 253, 249, .35), transparent 35%), linear-gradient(0deg, rgba(18, 14, 10, .55), transparent 45%); }
.lv-quote { position: absolute; left: 44px; right: 44px; bottom: 44px; z-index: 2; color: #fff; }
.lv-quote p { font-family: var(--serif); font-style: italic; font-size: clamp(28px, 2.6vw, 40px); line-height: 1.12; max-width: 560px; letter-spacing: -.01em; }
.lv-quote span { display: block; margin-top: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; opacity: .75; }
.float-card { position: absolute; z-index: 2; padding: 14px 16px; border-radius: calc(18px * var(--rs)); background: rgba(255, 253, 249, .62); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); border: 1px solid rgba(255, 255, 255, .6); box-shadow: 0 20px 50px -20px rgba(30, 20, 10, .45); color: #16130f; animation: floatY 7s ease-in-out infinite; }
.float-card .fc-k { font-size: 11.5px; color: #5e574e; display: flex; align-items: center; gap: 6px; }
.float-card .fc-v { font-size: 22px; font-weight: 600; letter-spacing: -.03em; margin-top: 2px; }
.float-card .fc-v small { font-size: 12px; color: var(--green); font-weight: 600; margin-left: 6px; }
.float-card.f1 { top: 12%; left: 9%; animation-delay: -1s; }
.float-card.f2 { top: 34%; right: 8%; animation-delay: -3.5s; }
.float-card.f3 { top: 58%; left: 16%; animation-delay: -5s; }
@keyframes kenburns { from { transform: scale(1.12); } to { transform: scale(1.02); } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------------- app shell ---------------- */
.app { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .45s var(--ease); }
body.sb-collapsed .app { grid-template-columns: 78px minmax(0, 1fr); }

.sb { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: color-mix(in oklab, var(--surface) 78%, transparent); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4); border-right: 1px solid var(--line); z-index: 60; }
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 18px 10px 22px; height: 70px; }
.sb-logo { display: block; height: 40px; }
.sb-logo img { height: 100%; width: auto; }
.sb-logo .logo-dark, .tb-brand .logo-dark { display: none; }
[data-theme="dark"] .sb-logo .logo-light, [data-theme="dark"] .tb-brand .logo-light { display: none; }
[data-theme="dark"] .sb-logo .logo-dark, [data-theme="dark"] .tb-brand .logo-dark { display: block; }
.tb-brand { display: none; }
.sb-mark { display: none; }
.sb-collapse { width: 28px; height: 28px; border-radius: calc(8px * var(--rs)); display: grid; place-items: center; border: 0; background: transparent; color: var(--text-3); transition: background .2s, color .2s, transform .45s var(--ease); }
.sb-collapse:hover { background: var(--surface-3); color: var(--text); }
body.sb-collapsed .sb-collapse { transform: rotate(180deg); }
.sb-create { margin: 4px 14px 6px; }
.sb-create .btn { width: 100%; justify-content: center; height: 40px; }
.sb-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 12px 16px; scrollbar-width: none; }
.sb-scroll::-webkit-scrollbar { display: none; }
.sb-nav { position: relative; }
.sb-group { margin-top: 10px; }
.sb-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); padding: 6px 12px 6px; white-space: nowrap; }
.sb-item { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; height: 34px; padding: 0 10px 0 12px; border-radius: calc(10px * var(--rs)); color: var(--text-2); font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: color .2s, background .2s; }
.sb-item .i { color: var(--text-3); transition: color .2s, transform .35s var(--spring); }
.sb-item:hover { color: var(--text); background: var(--gray-soft); }
.sb-item:hover .i { color: var(--text); }
.sb-item.on { color: var(--text); font-weight: 600; }
.sb-item.on:hover { background: transparent; }
.sb-item.on .i { color: var(--accent); }
.sb-txt { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sb-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; font-size: 11px; font-weight: 600; display: grid; place-items: center; background: var(--gray-soft); color: var(--text-2); font-variant-numeric: tabular-nums; }
.sb-count.hot { background: var(--accent); color: var(--on-accent); box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--accent) 60%, transparent); }
.sb-ind { position: absolute; left: 0; right: 0; top: 0; height: 34px; border-radius: calc(10px * var(--rs)); z-index: 0; pointer-events: none; background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 13%, transparent), color-mix(in srgb, var(--accent) 3.5%, transparent) 70%), var(--surface); border: 1px solid var(--accent-line); box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--accent) 55%, transparent), inset 0 1px 0 rgba(255, 255, 255, .6); transition: transform .5s var(--spring), opacity .25s; }
.sb-ind::before { content: ''; position: absolute; left: -1px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
[data-theme="dark"] .sb-ind { background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 20%, transparent), color-mix(in srgb, var(--accent) 4%, transparent) 70%), var(--surface-2); box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--accent) 60%, transparent); }
.sb-foot { padding: 10px 14px 14px; display: grid; gap: 10px; border-top: 1px solid var(--line); }
.guide-card { position: relative; overflow: hidden; border-radius: calc(18px * var(--rs)); padding: 12px 14px; min-height: 104px; color: #fff; background: radial-gradient(120% 130% at 100% 0%, color-mix(in srgb, var(--accent) 60%, transparent), transparent 62%), linear-gradient(160deg, #2a241d, #14110d); border: 0; text-align: left; display: flex; flex-direction: column; justify-content: flex-end; isolation: isolate; transition: transform .4s var(--ease), box-shadow .4s; }
.guide-card::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 32%, transparent), rgba(20, 15, 10, .15) 38%, rgba(16, 12, 8, .86)); }
.guide-card:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--accent) 60%, transparent); }
.gc-kicker { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; opacity: .85; display: flex; align-items: center; gap: 6px; }
.gc-title { font-size: 14px; font-weight: 600; margin-top: 4px; line-height: 1.3; }
.gc-prog { margin-top: 10px; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.gc-prog i { display: block; height: 100%; width: var(--w); background: var(--accent-grad); border-radius: 99px; transition: width .8s var(--ease); }
.gc-meta { margin-top: 6px; font-size: 11.5px; opacity: .8; display: flex; justify-content: space-between; }
.sb-slogan { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--text-2); padding: 0 6px; line-height: 1.3; }
body.sb-collapsed .sb-txt, body.sb-collapsed .sb-label, body.sb-collapsed .sb-count, body.sb-collapsed .sb-logo, body.sb-collapsed .sb-foot .guide-card .gc-title, body.sb-collapsed .sb-slogan, body.sb-collapsed .sb-create .btn span, body.sb-collapsed .sb-create kbd, body.sb-collapsed .gc-meta, body.sb-collapsed .gc-kicker span { display: none; }
body.sb-collapsed .sb-mark { display: inline-grid; }
body.sb-collapsed .sb-head { padding: 20px 10px 14px 18px; flex-direction: column; height: auto; gap: 10px; }
body.sb-collapsed .sb-item { justify-content: center; padding: 0; }
body.sb-collapsed .sb-label { height: 1px; padding: 0; margin: 8px 12px; background: var(--line); }
body.sb-collapsed .guide-card { min-height: 64px; padding: 10px; align-items: center; }
body.sb-collapsed .sb-item[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); padding: 6px 10px; border-radius: calc(8px * var(--rs)); background: var(--text); color: var(--bg); font-size: 12px; font-weight: 550; white-space: nowrap; box-shadow: var(--sh-2); animation: tipIn .2s var(--ease); z-index: 90; }
@keyframes tipIn { from { opacity: 0; transform: translate(-4px, -50%); } }

.main { min-width: 0; display: flex; flex-direction: column; }
.tb { position: sticky; top: 0; z-index: 50; height: var(--tb-h); display: flex; align-items: center; gap: 16px; padding: 0 28px; background: color-mix(in oklab, var(--bg) 72%, transparent); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); border-bottom: 1px solid var(--line); }
.tb .tb-burger { display: none; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); white-space: nowrap; min-width: 0; }
.crumbs b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.crumbs .i { opacity: .6; }
.tb-search { flex: 1; max-width: 460px; margin-left: auto; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 8px 0 12px; border-radius: calc(12px * var(--rs)); border: 1px solid var(--line-2); background: var(--surface); color: var(--text-3); font-size: 13.5px; box-shadow: var(--sh-1); transition: border-color .2s, box-shadow .3s, transform .3s var(--ease); }
.tb-search:hover { border-color: var(--line-3); box-shadow: var(--sh-2); }
.tb-search span { flex: 1; min-width: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-actions { display: flex; align-items: center; gap: 8px; }
.tb-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); animation: pop .5s var(--spring) both; font-variant-numeric: tabular-nums; }
.bell-ring .i { animation: ring 1.2s .8s var(--ease) both; transform-origin: 50% 10%; }
@keyframes ring { 0% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 75% { transform: rotate(2deg); } 100% { transform: rotate(0); } }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 3px 10px 3px 3px; border-radius: 99px; border: 1px solid transparent; background: transparent; transition: background .2s, border-color .2s; }
.user-chip:hover { background: var(--surface); border-color: var(--line-2); }
.uc-name { font-size: 13px; font-weight: 600; line-height: 1.15; text-align: left; }
.uc-role { font-size: 11.5px; color: var(--text-3); text-align: left; }
.page { width: 100%; max-width: 1520px; margin: 0 auto; padding: 28px 32px 96px; }
.page.page-enter .rise { animation: riseIn .7s var(--ease) calc(var(--i, 0) * 55ms + 40ms) both; }
.no-anim .rise, .no-anim .grow, .no-anim .draw, .no-anim .spark-line, .no-anim .spark-area, .no-anim .spark-dot, .no-anim .ring-val, .no-anim .gauge-val,
.no-anim .prog i, .no-anim .hb-track i, .no-anim .fn-bar i, .no-anim .gt-bar, .no-anim .kb-col-bar i, .no-anim .load-bar i, .no-anim .range i, .no-anim .aging i,
.no-anim .cw-ev, .no-anim .hero-img, .no-anim .hero-sweep, .no-anim .hero h1 .w > span, .no-anim .qb-row, .no-anim .glass-chip { animation: none !important; }
.no-anim .glass-chip { animation: floatY 7s ease-in-out infinite !important; }
.i.inline { display: inline-block; vertical-align: -2px; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

/* ---------------- buttons & controls ---------------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: calc(11px * var(--rs)); border: 1px solid transparent; font-size: 13.5px; font-weight: 550; white-space: nowrap; letter-spacing: -.005em; overflow: hidden; isolation: isolate; transition: transform .25s var(--ease), box-shadow .3s var(--ease), background-color .2s, border-color .2s, color .2s, filter .2s; user-select: none; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { color: var(--on-accent); background: linear-gradient(180deg, color-mix(in oklab, var(--accent) 86%, white), color-mix(in oklab, var(--accent) 94%, black)); border-color: color-mix(in oklab, var(--accent) 80%, black); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 1px 2px color-mix(in srgb, var(--accent-shadow) 25%, transparent), 0 8px 20px -8px color-mix(in srgb, var(--accent) 65%, transparent); text-shadow: 0 1px 0 color-mix(in srgb, var(--accent-shadow) 20%, transparent); }
.btn-primary::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .38) 50%, transparent 70%); transform: translateX(-120%); transition: transform .8s var(--ease); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 2px 4px color-mix(in srgb, var(--accent-shadow) 20%, transparent), 0 14px 28px -10px color-mix(in srgb, var(--accent) 75%, transparent); }
.btn-primary:hover::after { transform: translateX(120%); }
.btn-secondary { background: var(--surface); border-color: var(--line-2); box-shadow: var(--sh-1); color: var(--text); }
.btn-secondary:hover:not(:disabled) { border-color: var(--line-3); background: var(--surface-2); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--gray-soft); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; border-color: transparent; box-shadow: 0 8px 20px -10px rgba(208, 59, 47, .7); }
.btn-danger:hover { filter: brightness(1.06); }
.btn-ghost-danger { background: transparent; color: var(--red); }
.btn-ghost-danger:hover { background: var(--red-soft); }
.btn-dark { background: var(--text); color: var(--bg); }
.btn-dark:hover { transform: translateY(-1px); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: calc(9px * var(--rs)); gap: 6px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14.5px; border-radius: calc(13px * var(--rs)); }
.btn-icon { width: 36px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn-kbd { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: calc(6px * var(--rs)); background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .25); margin-left: 2px; }
.btn-secondary .btn-kbd, .btn-ghost .btn-kbd { background: var(--surface-3); border-color: var(--line); color: var(--text-3); }
.icon-btn { position: relative; width: 36px; height: 36px; flex: none; border-radius: calc(11px * var(--rs)); display: grid; place-items: center; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); box-shadow: var(--sh-1); transition: background .2s, color .2s, border-color .2s, transform .25s var(--ease); }
.icon-btn:hover { color: var(--text); border-color: var(--line-3); transform: translateY(-1px); }
.icon-btn:active { transform: scale(.95); }
.icon-btn.plain { border-color: transparent; background: transparent; box-shadow: none; }
.icon-btn.plain:hover { background: var(--gray-soft); }
kbd, .kbds kbd { font-family: var(--mono); font-size: 11px; min-width: 20px; height: 20px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: calc(6px * var(--rs)); border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--surface-2); color: var(--text-2); line-height: 1; }
.kbds { display: inline-flex; gap: 3px; }

.input { width: 100%; height: 38px; padding: 0 12px; border-radius: calc(11px * var(--rs)); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; transition: border-color .2s, box-shadow .25s, background .2s; outline: none; appearance: none; -webkit-appearance: none; }
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: var(--line-3); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft-2); }
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
input[type="date"].input, input[type="datetime-local"].input { padding-right: 8px; }
.select-wrap { position: relative; }
.select-wrap .input { padding-right: 34px; cursor: pointer; }
.select-ico { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-adorn { position: relative; }
.input-adorn .input { padding-right: 36px; font-variant-numeric: tabular-nums; }
.adorn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12.5px; color: var(--text-3); pointer-events: none; }
.search { position: relative; display: flex; align-items: center; }
.search .i { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 36px; min-width: 240px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.span2 { grid-column: 1 / -1; }
.label { font-size: 12.5px; font-weight: 550; color: var(--text-2); }
.req { color: var(--accent); font-style: normal; margin-left: 2px; }
.hint { font-size: 11.5px; color: var(--text-3); }
.err { font-size: 11.5px; color: var(--red); min-height: 0; }
.field.invalid .input { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.form-sep { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-top: 6px; }
.form-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: calc(13px * var(--rs)); font-size: 12.8px; line-height: 1.5; background: var(--accent-soft); color: var(--text); border: 1px solid var(--accent-line); }
.notice .i { color: var(--accent); margin-top: 1px; }
.notice.warn { background: var(--amber-soft); border-color: color-mix(in oklab, var(--amber) 35%, transparent); }
.notice.warn .i { color: var(--amber); }
.notice.danger { background: var(--red-soft); border-color: color-mix(in oklab, var(--red) 30%, transparent); }
.notice.danger .i { color: var(--red); }
.notice.info { background: var(--blue-soft); border-color: color-mix(in oklab, var(--blue) 26%, transparent); }
.notice.info .i { color: var(--blue); }

.seg { position: relative; display: inline-flex; padding: 3px; border-radius: calc(12px * var(--rs)); background: var(--surface-3); border: 1px solid var(--line); isolation: isolate; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg-opt { position: relative; z-index: 1; flex: none; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: calc(9px * var(--rs)); font-size: 12.8px; font-weight: 550; color: var(--text-2); cursor: pointer; white-space: nowrap; transition: color .2s; }
.seg-opt input:checked + span { color: var(--text); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.seg-opt:hover span { color: var(--text); }
.seg-thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; border-radius: calc(9px * var(--rs)); background: var(--surface); box-shadow: 0 1px 2px rgba(32, 24, 14, .08), 0 2px 8px -2px rgba(32, 24, 14, .1); opacity: 0; transition: transform .42s var(--spring), width .42s var(--spring); }
[data-theme="dark"] .seg-thumb { background: var(--surface-3); box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 2px 8px rgba(0, 0, 0, .4); }
[data-theme="dark"] .seg { background: var(--surface-2); }
.seg-sm .seg-opt span { height: 26px; padding: 0 10px; font-size: 12px; }
.seg .count { font-size: 11px; color: var(--text-3); font-weight: 600; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { position: relative; width: 38px; height: 22px; border-radius: 99px; background: var(--line-3); transition: background .3s var(--ease); flex: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .4s var(--spring); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { width: 20px; height: 20px; border-radius: calc(7px * var(--rs)); border: 1.5px solid var(--line-3); display: grid; place-items: center; background: var(--surface); color: #fff; flex: none; transition: background .25s, border-color .25s, transform .3s var(--spring); }
.check .i { opacity: 0; transform: scale(.4); transition: opacity .2s, transform .35s var(--spring); }
.check.on { background: var(--green); border-color: var(--green); }
.check.on .i { opacity: 1; transform: none; }
.check:hover { border-color: var(--green); transform: scale(1.08); }

/* ---------------- pills / avatars / chips ---------------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 23px; padding: 0 9px; border-radius: 99px; font-size: 11.8px; font-weight: 600; white-space: nowrap; line-height: 1; letter-spacing: -.005em; }
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.t-gray { background: var(--gray-soft); color: var(--text-2); }
.t-orange { background: var(--accent-soft); color: var(--accent-ink); }
.t-green { background: var(--green-soft); color: var(--green); }
.t-red { background: var(--red-soft); color: var(--red); }
.t-amber { background: var(--amber-soft); color: var(--amber); }
.t-blue { background: var(--blue-soft); color: var(--blue); }
.t-violet { background: var(--violet-soft); color: var(--violet); }
.t-teal { background: var(--teal-soft); color: var(--teal); }
.pill.solid.t-orange { background: var(--accent); color: var(--on-accent); }
.pill-stage { background: color-mix(in oklab, var(--c) 12%, transparent); color: color-mix(in oklab, var(--c) 78%, var(--text)); }
.pill-stage .pill-dot { background: var(--c); box-shadow: 0 0 0 3px color-mix(in oklab, var(--c) 20%, transparent); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-size: 12.5px; font-weight: 550; color: var(--text-2); transition: all .2s var(--ease); white-space: nowrap; }
.chip:hover { border-color: var(--line-3); color: var(--text); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .count { font-size: 11px; opacity: .7; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: calc(8px * var(--rs)); background: var(--surface-3); border: 1px solid var(--line); font-size: 12px; color: var(--text-2); white-space: nowrap; }
.av { --av: #8B857C; display: inline-grid; place-items: center; flex: none; border-radius: 50%; color: #fff; font-weight: 650; letter-spacing: .01em; background: linear-gradient(145deg, color-mix(in oklab, var(--av) 70%, #fff), var(--av) 70%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .12); user-select: none; }
.av-xs { width: 22px; height: 22px; font-size: 9.5px; }
.av-sm { width: 28px; height: 28px; font-size: 11px; }
.av-md { width: 36px; height: 36px; font-size: 13px; }
.av-lg { width: 48px; height: 48px; font-size: 16px; }
.av-xl { width: 64px; height: 64px; font-size: 21px; }
.av-more { background: var(--surface-3); color: var(--text-2); box-shadow: none; }
.av-stack { display: inline-flex; }
.av-stack .av { box-shadow: 0 0 0 2px var(--surface); }
.av-stack .av + .av { margin-left: -7px; }
.prog { position: relative; display: block; height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; min-width: 40px; }
.prog.thin { height: 4px; }
.prog i { position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 99px; background: var(--accent); animation: growW 1s var(--ease) .15s both; }
.prog.t-green i { background: var(--green); } .prog.t-red i { background: var(--red); } .prog.t-amber i { background: var(--amber); } .prog.t-blue i { background: var(--blue); }
.prog.t-orange i { background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.prog.t-orange, .prog.t-green, .prog.t-red, .prog.t-amber, .prog.t-blue { color: inherit; background: var(--track); }
@keyframes growW { from { width: 0; } }

/* ---------------- page head / layout ---------------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.ph-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.ph-title { font-size: 30px; font-weight: 600; letter-spacing: -.035em; line-height: 1.1; }
.ph-title em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); letter-spacing: -.01em; }
.ph-sub { margin-top: 6px; color: var(--text-2); font-size: 14px; max-width: 680px; }
.ph-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.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)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.g-main-r { grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); }
.mt { margin-top: 16px; } .mt2 { margin-top: 24px; } .mb { margin-bottom: 16px; }

/* ---------------- cards ---------------- */
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.card-title { font-size: 15px; font-weight: 600; letter-spacing: -.015em; }
.card-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.card-actions { display: flex; align-items: center; gap: 6px; }
.card-body { padding: 16px 20px 20px; }
.card.flush .card-body { padding: 8px 0 4px; }
.card.flush .tbl th:first-child, .card.flush .tbl td:first-child { padding-left: 20px; }
.card.flush .tbl th:last-child, .card.flush .tbl td:last-child { padding-right: 20px; }
.spot { isolation: isolate; }
.spot::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1; opacity: 0; transition: opacity .4s; background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 9%, transparent), transparent 45%); }
.spot::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; padding: 1px; opacity: 0; transition: opacity .4s; background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 55%, transparent), transparent 55%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.spot:hover::before, .spot:hover::after { opacity: 1; }
.link-more { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--text-2); transition: color .2s, gap .3s var(--ease); }
.link-more:hover { color: var(--accent-ink); gap: 7px; }

/* ---------------- KPI ---------------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpis.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { position: relative; display: flex; flex-direction: column; padding: 16px 18px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); overflow: hidden; min-width: 0; transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
a.kpi[href]:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.kpi-ico { width: 36px; height: 36px; border-radius: calc(11px * var(--rs)); display: grid; place-items: center; background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 20%, transparent), color-mix(in srgb, var(--accent) 6%, transparent)); border: 1px solid var(--accent-line); color: var(--accent-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.kpi-ico.t-green { background: linear-gradient(145deg, rgba(31, 138, 82, .18), rgba(31, 138, 82, .05)); border-color: rgba(31, 138, 82, .25); color: var(--green); }
.kpi-ico.t-red { background: linear-gradient(145deg, rgba(208, 59, 47, .16), rgba(208, 59, 47, .04)); border-color: rgba(208, 59, 47, .25); color: var(--red); }
.kpi-ico.t-blue { background: linear-gradient(145deg, rgba(47, 111, 208, .16), rgba(47, 111, 208, .04)); border-color: rgba(47, 111, 208, .25); color: var(--blue); }
.kpi-ico.t-violet { background: linear-gradient(145deg, rgba(122, 92, 214, .16), rgba(122, 92, 214, .04)); border-color: rgba(122, 92, 214, .25); color: var(--violet); }
.kpi-go { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); background: var(--surface-3); transition: transform .4s var(--spring), background .25s, color .25s; }
a.kpi:hover .kpi-go { background: var(--accent); color: var(--on-accent); transform: rotate(45deg); }
.kpi-label { font-size: 12.5px; color: var(--text-2); font-weight: 550; }
.kpi-row { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.kpi-value { font-size: 28px; font-weight: 600; letter-spacing: -.035em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-delta { display: inline-flex; align-items: center; gap: 2px; font-size: 11.8px; font-weight: 650; padding: 2px 7px 2px 5px; border-radius: 99px; }
.kpi-delta.up { color: var(--green); background: var(--green-soft); }
.kpi-delta.down { color: var(--red); background: var(--red-soft); }
.kpi-delta.flat { color: var(--text-2); background: var(--gray-soft); }
.kpi-foot { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.kpi-spark { margin: 10px -18px -16px; height: 40px; }
.kpi-spark .spark { width: 100%; height: 40px; display: block; }
.kpi-dark { background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--accent) 38%, transparent), transparent 55%), linear-gradient(160deg, #221d17, #12100d); border-color: #2a241d; color: #f4efe7; box-shadow: 0 18px 40px -20px rgba(18, 14, 10, .7); }
.kpi-dark .kpi-label, .kpi-dark .kpi-foot { color: rgba(244, 239, 231, .62); }
.kpi-dark .kpi-ico { background: color-mix(in srgb, var(--accent) 22%, transparent); border-color: color-mix(in srgb, var(--accent-2) 45%, transparent); color: #ffb37a; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
.kpi-dark .kpi-go { background: rgba(255, 255, 255, .1); color: #fff; }
.kpi-dark .kpi-delta.up { color: #8fe0b2; background: rgba(69, 183, 126, .18); }
.kpi-dark::after { content: ''; position: absolute; right: -56px; top: -56px; width: 150px; height: 150px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent-2) 22%, transparent); box-shadow: 0 0 0 18px color-mix(in srgb, var(--accent-2) 4.5%, transparent), 0 0 0 36px color-mix(in srgb, var(--accent-2) 2.5%, transparent); animation: breathe 6s ease-in-out infinite; pointer-events: none; }
@keyframes breathe { 50% { transform: scale(1.08); opacity: .6; } }

/* ---------------- tables ---------------- */
.tbl-wrap { width: 100%; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { position: sticky; top: var(--tb-h); z-index: 2; text-align: left; font-size: 12px; font-weight: 550; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: color-mix(in oklab, var(--surface) 92%, transparent); backdrop-filter: blur(8px); }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th span { display: inline-flex; align-items: center; gap: 4px; }
.tbl th .sort-ico { opacity: 0; transition: opacity .2s; }
.tbl th.sortable:hover .sort-ico { opacity: .5; }
.tbl th.sorted { color: var(--text); }
.tbl th.sorted .sort-ico { opacity: 1; color: var(--accent); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl.dense td { padding: 9px 14px; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr[data-row] { cursor: pointer; }
.tbl tbody tr[data-row]:hover { background: color-mix(in oklab, var(--accent) 3.5%, var(--surface-2)); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .empty-row td { padding: 0; }
.cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.cell-t { font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.cell-s { font-size: 12.3px; color: var(--text-3); line-height: 1.35; margin-top: 1px; }
.cell-txt { min-width: 0; }
.cell-txt .cell-t, .cell-txt .cell-s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px; }
.amount { font-variant-numeric: tabular-nums; font-size: 13.5px; font-weight: 550; white-space: nowrap; letter-spacing: -.015em; }
.amount.big { font-size: 14px; font-weight: 650; }
.ico-tile { width: 34px; height: 34px; flex: none; border-radius: calc(10px * var(--rs)); display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line); }
.ico-tile.t-orange { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.ico-tile.t-green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.ico-tile.t-blue { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.ico-tile.t-violet { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.ico-tile.t-red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.ico-tile.t-amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.ico-tile.t-teal { background: var(--teal-soft); color: var(--teal); border-color: transparent; }

/* ---------------- tabs ---------------- */
.tabs { position: relative; display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 12px; border: 0; background: none; color: var(--text-3); font-size: 13.5px; font-weight: 550; white-space: nowrap; transition: color .2s; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); }
.tab.on .i { color: var(--accent); }
.tab-count { font-size: 11px; font-weight: 650; padding: 1px 6px; border-radius: 99px; background: var(--gray-soft); color: var(--text-2); }
.tab.on .tab-count { background: var(--accent-soft); color: var(--accent-ink); }
.tabs-ind { position: absolute; left: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent); transition: transform .45s var(--ease), width .45s var(--ease); }

/* ---------------- kanban ---------------- */
.kb { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 18px; align-items: flex-start; scroll-behavior: smooth; }
.kb-col { flex: 1 0 280px; max-width: 400px; display: flex; flex-direction: column; max-height: calc(100vh - 240px); border-radius: calc(20px * var(--rs)); background: color-mix(in oklab, var(--surface-2) 75%, transparent); border: 1px solid var(--line); transition: border-color .25s, background .25s, box-shadow .3s; }
.kb-col.over { border-color: color-mix(in oklab, var(--c) 55%, transparent); background: color-mix(in oklab, var(--c) 6%, var(--surface-2)); box-shadow: 0 0 0 4px color-mix(in oklab, var(--c) 10%, transparent); }
.kb-col-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px; }
.kb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in oklab, var(--c) 18%, transparent); flex: none; }
.kb-col-name { font-size: 13px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-count { font-size: 11px; font-weight: 650; color: var(--text-2); background: var(--gray-soft); border-radius: 99px; padding: 1px 7px; }
.kb-col-val { margin-left: auto; font-size: 12px; font-weight: 550; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.kb-col-bar { height: 2px; margin: 0 14px 8px; border-radius: 2px; background: var(--track); overflow: hidden; }
.kb-col-bar i { display: block; height: 100%; width: var(--w); background: var(--c); border-radius: 2px; animation: growW 1s var(--ease) .3s both; }
.kb-list { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 2px 10px 10px; overflow-y: auto; min-height: 90px; scrollbar-width: thin; }
.kb-empty { display: none; align-items: center; justify-content: center; min-height: 72px; border: 1.5px dashed var(--line-2); border-radius: calc(14px * var(--rs)); font-size: 12px; color: var(--text-3); }
.kb-list:not(:has(.kb-card:not(.kb-hidden))):not(:has(.kb-ph)) .kb-empty { display: flex; }
.kb-col-foot { padding: 0 10px 10px; }
.kb-add { width: 100%; height: 34px; border-radius: calc(11px * var(--rs)); border: 1px dashed var(--line-2); background: transparent; color: var(--text-3); font-size: 12.5px; font-weight: 550; display: flex; align-items: center; justify-content: center; gap: 6px; transition: all .2s; }
.kb-add:hover { border-color: var(--accent-line); color: var(--accent-ink); background: var(--accent-soft); }
.kb-card { position: relative; padding: 12px 13px 12px; border-radius: calc(15px * var(--rs)); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); cursor: pointer; transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .2s; user-select: none; -webkit-user-select: none; outline: none; }
.kb-card.draggable { cursor: grab; touch-action: pan-y; }
.kb-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--line-2); }
.kb-card:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.kb-card.dropped { box-shadow: 0 0 0 2px var(--accent), var(--sh-2); }
.kb-hidden { display: none !important; }
.kb-ph { border-radius: calc(15px * var(--rs)); border: 1.5px dashed var(--accent); background: repeating-linear-gradient(-45deg, var(--accent-soft), var(--accent-soft) 6px, transparent 6px, transparent 12px); animation: phIn .25s var(--ease); flex: none; }
@keyframes phIn { from { opacity: 0; transform: scaleY(.6); } }
.kb-ghost { position: fixed; z-index: 600; pointer-events: none; margin: 0; cursor: grabbing; box-shadow: 0 30px 60px -20px rgba(32, 24, 14, .45), 0 0 0 1px var(--accent-line); border-color: var(--accent-line); opacity: .97; transition: none; will-change: transform; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none !important; }
.kc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kc-title { font-size: 13.5px; font-weight: 600; line-height: 1.32; letter-spacing: -.01em; }
.kc-sub { display: flex; align-items: center; gap: 6px; font-size: 12.2px; color: var(--text-2); margin-top: 6px; min-width: 0; }
.kc-sub span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--line); }
.kc-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); }
.kc-meta .i { opacity: .8; }
.prio { width: 7px; height: 7px; border-radius: 50%; flex: none; margin-top: 6px; }
.prio.vysoka { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.prio.stredna { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.prio.nizka { background: var(--line-3); }
.src-ico { width: 22px; height: 22px; border-radius: calc(7px * var(--rs)); display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; }
.src-ico.web { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------------- overlays ---------------- */
.ov { position: fixed; inset: 0; z-index: 200; }
.ov-modal { display: grid; place-items: center; padding: 24px; background: var(--scrim); backdrop-filter: blur(6px) saturate(1.2); -webkit-backdrop-filter: blur(6px) saturate(1.2); animation: fadeIn .28s var(--ease); overflow-y: auto; }
.ov-modal.out { animation: fadeOut .24s ease forwards; }
.ov-modal.out .modal { animation: modalOut .24s ease forwards; }
.modal { width: 100%; max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-2); border-radius: calc(22px * var(--rs)); box-shadow: var(--sh-3); animation: modalIn .5s var(--spring); overflow: hidden; }
.sz-sm { max-width: 440px; } .sz-md { max-width: 580px; } .sz-lg { max-width: 800px; } .sz-xl { max-width: 1180px; }
.md-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 22px 6px; }
.md-ico { width: 40px; height: 40px; border-radius: calc(12px * var(--rs)); display: grid; place-items: center; flex: none; background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 20%, transparent), color-mix(in srgb, var(--accent) 5%, transparent)); border: 1px solid var(--accent-line); color: var(--accent-ink); }
.md-danger .md-ico { background: var(--red-soft); border-color: transparent; color: var(--red); }
.md-titles { flex: 1; min-width: 0; padding-top: 2px; }
.md-title { font-size: 17.5px; font-weight: 600; letter-spacing: -.02em; }
.md-sub { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.md-x { margin: -4px -4px 0 0; }
.md-body { padding: 16px 22px 22px; overflow-y: auto; }
.md-text { color: var(--text-2); font-size: 14px; line-height: 1.6; }
.md-foot { display: flex; align-items: center; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.965); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }

.ov-drawer { background: var(--scrim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fadeIn .35s var(--ease); }
.ov-drawer.out { animation: fadeOut .4s ease forwards; }
.drawer { position: absolute; top: 10px; right: 10px; bottom: 10px; width: min(var(--dw, 720px), calc(100vw - 20px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-2); border-radius: calc(24px * var(--rs)); box-shadow: var(--sh-3); overflow: hidden; animation: drawerIn .6s var(--drawer); }
.ov-drawer.out .drawer { animation: drawerOut .42s var(--ease-io) forwards; }
@keyframes drawerIn { from { transform: translateX(calc(100% + 30px)); } }
@keyframes drawerOut { to { transform: translateX(calc(100% + 30px)); } }
.dr-inner { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.dr-head { padding: 18px 24px 14px; }
.dr-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.dr-mtitle { display: none; }
.dr-kicker { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; color: var(--text-3); min-width: 0; }
.dr-tools { display: flex; align-items: center; gap: 6px; }
.dr-title { font-size: 23px; font-weight: 600; letter-spacing: -.03em; line-height: 1.18; }
.dr-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; color: var(--text-2); font-size: 13px; }
.dr-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--line-3); }
.dr-tabs { padding: 0 24px; }
.dr-body { flex: 1; overflow-y: auto; padding: 20px 24px 28px; min-height: 0; }
.dr-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 24px; border-top: 1px solid var(--line); background: color-mix(in oklab, var(--surface-2) 88%, transparent); }
.dr-inner:not(.no-anim) .dr-body > * { animation: riseIn .6s var(--ease) both; }
.dr-inner:not(.no-anim) .dr-body > *:nth-child(2) { animation-delay: .05s; }
.dr-inner:not(.no-anim) .dr-body > *:nth-child(3) { animation-delay: .1s; }
.dr-inner:not(.no-anim) .dr-body > *:nth-child(4) { animation-delay: .15s; }
.dr-inner:not(.no-anim) .dr-body > *:nth-child(n+5) { animation-delay: .2s; }
.dr-hero { margin: 0 24px 6px; padding: 14px; border-radius: calc(16px * var(--rs)); background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 12px; }
.dr-section { margin-bottom: 22px; }
.dr-section > h4 .link-more, .dr-section > h4 .btn, .dr-section > h4 .tiny { font-family: var(--font); text-transform: none; letter-spacing: 0; }
.dr-section > h4 { font-size: 12px; font-weight: 600; color: var(--text-3); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border-radius: calc(14px * var(--rs)); overflow: hidden; border: 1px solid var(--line); background: var(--line); }
.facts.f3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fact { background: var(--surface); padding: 11px 14px; min-width: 0; }
.fact dt { font-size: 11.5px; color: var(--text-3); margin-bottom: 3px; display: flex; align-items: center; gap: 5px; }
.fact dd { margin: 0; font-size: 13.5px; font-weight: 550; overflow-wrap: anywhere; }
.facts dl { margin: 0; }
.mini-stats { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 10px; }
.ms { padding: 12px 14px; border-radius: calc(14px * var(--rs)); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.ms-l { font-size: 11.5px; color: var(--text-3); }
.ms-v { font-size: 17px; font-weight: 600; letter-spacing: -.03em; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ms-s { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.pop { position: fixed; z-index: 450; background: var(--glass-strong); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); border: 1px solid var(--line-2); border-radius: calc(16px * var(--rs)); box-shadow: var(--sh-3); animation: popIn .26s var(--ease); transform-origin: top right; overflow: hidden; }
.pop.up { transform-origin: bottom right; }
.pop.out { animation: popOut .16s ease forwards; }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(.96); } }
@keyframes popOut { to { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu { padding: 6px; display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: calc(9px * var(--rs)); border: 0; background: none; text-align: left; font-size: 13.2px; font-weight: 500; color: var(--text); transition: background .15s, color .15s; }
.menu-item .i { color: var(--text-3); }
.menu-item:hover { background: var(--accent-soft); color: var(--accent-ink); }
.menu-item:hover .i { color: var(--accent); }
.menu-item.danger { color: var(--red); }
.menu-item.danger .i { color: var(--red); }
.menu-item.danger:hover { background: var(--red-soft); }
.menu-item:disabled { opacity: .45; pointer-events: none; }
.menu-item kbd { margin-left: auto; }
.mi-label { flex: 1; }
.mi-sp { width: 15px; }
.mi-check { color: var(--accent) !important; }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu-head { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); padding: 8px 10px 4px; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 900; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; transition: right .5s var(--drawer); }
body.has-drawer .toasts { right: calc(var(--drawer-w, 720px) + 30px); }
body.has-modal .toasts, body.has-drawer.has-modal .toasts { right: 20px; }
.toast { position: relative; pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; width: 380px; max-width: calc(100vw - 40px); padding: 13px 12px 15px 14px; border-radius: calc(16px * var(--rs)); background: rgba(24, 20, 16, .9); color: #f6f1ea; backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .55); overflow: hidden; animation: toastIn .55s var(--spring); }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(18px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }
.toast-ico { flex: none; margin-top: 1px; }
.toast.t-success .toast-ico { color: #6fdc9f; } .toast.t-error .toast-ico { color: #ff8a7e; } .toast.t-info .toast-ico { color: #8fb6ff; } .toast.t-warning .toast-ico { color: #f6c35b; } .toast.t-sim .toast-ico { color: #ffab6e; }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.toast-msg { font-size: 13px; line-height: 1.45; color: rgba(246, 241, 234, .86); }
.toast-act { flex: none; height: 28px; padding: 0 10px; border-radius: calc(8px * var(--rs)); border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .08); color: #fff; font-size: 12.5px; font-weight: 600; transition: background .2s; }
.toast-act:hover { background: rgba(255, 255, 255, .16); }
.toast-x { flex: none; width: 24px; height: 24px; border-radius: calc(7px * var(--rs)); border: 0; background: transparent; color: rgba(255, 255, 255, .5); display: grid; place-items: center; }
.toast-x:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--accent-grad); transform-origin: 0 50%; animation: toastBar var(--dur) linear forwards; opacity: .9; }
.toast.paused .toast-bar { animation-play-state: paused; }
@keyframes toastBar { to { transform: scaleX(0); } }
.sim-chip { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; padding: 2px 6px; border-radius: calc(5px * var(--rs)); background: color-mix(in srgb, var(--accent) 30%, transparent); color: #ffc69e; border: 1px solid color-mix(in srgb, var(--accent-2) 45%, transparent); }
.sim-badge { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; padding: 3px 7px; border-radius: calc(6px * var(--rs)); background: var(--amber-soft); color: var(--amber); border: 1px solid color-mix(in oklab, var(--amber) 30%, transparent); white-space: nowrap; }
.beta-badge { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; padding: 3px 7px; border-radius: calc(6px * var(--rs)); background: var(--accent-soft); color: var(--accent-ink); border: 1px solid var(--accent-line); }

.cmdk-ov { position: fixed; inset: 0; z-index: 700; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 20px 20px; background: var(--scrim); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fadeIn .2s ease; }
.cmdk-ov.out { animation: fadeOut .18s ease forwards; }
.cmdk { width: 100%; max-width: 660px; background: var(--glass-strong); backdrop-filter: blur(30px) saturate(1.7); -webkit-backdrop-filter: blur(30px) saturate(1.7); border: 1px solid var(--line-2); border-radius: calc(22px * var(--rs)); box-shadow: var(--sh-3), 0 0 0 1px var(--glass-line) inset; overflow: hidden; animation: cmdkIn .38s var(--spring); }
@keyframes cmdkIn { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
.cmdk-in { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 60px; border-bottom: 1px solid var(--line); }
.cmdk-in .i { color: var(--accent); }
.cmdk-in input { flex: 1; height: 100%; border: 0; background: transparent; font: inherit; font-size: 16.5px; color: var(--text); outline: none; letter-spacing: -.01em; }
.cmdk-in input::placeholder { color: var(--text-3); }
.cmdk-list { max-height: min(460px, 58vh); overflow-y: auto; padding: 8px; scroll-padding: 8px; }
.cmdk-group { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); padding: 10px 10px 6px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border-radius: calc(12px * var(--rs)); border: 0; background: none; text-align: left; color: var(--text); position: relative; transition: background .12s; }
.cmdk-item .ico-tile { width: 32px; height: 32px; }
.cmdk-item.on { background: var(--accent-soft); }
.cmdk-item.on::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: calc(3px * var(--rs)); background: var(--accent); }
.cmdk-item .ci-t { font-size: 13.8px; font-weight: 550; }
.cmdk-item .ci-s { font-size: 12px; color: var(--text-3); }
.cmdk-item .ci-r { margin-left: auto; font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.cmdk-item mark { background: none; color: var(--accent-ink); font-weight: 650; }
.cmdk-foot { display: flex; gap: 16px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--text-3); background: color-mix(in oklab, var(--surface-2) 70%, transparent); }
.cmdk-foot span { display: flex; align-items: center; gap: 6px; }
.cmdk-empty { padding: 40px 16px; text-align: center; color: var(--text-3); font-size: 13.5px; }

.spotlight { position: fixed; z-index: 800; border-radius: calc(14px * var(--rs)); pointer-events: none; box-shadow: 0 0 0 2px var(--accent), 0 0 0 7px color-mix(in srgb, var(--accent) 25%, transparent), 0 0 0 100vmax rgba(20, 14, 8, .38); animation: spotIn .4s var(--ease), spotPulse 1.8s 0.4s ease-in-out infinite; }
.spotlight.out { animation: fadeOut .3s forwards; }
.spotlight-tip { position: absolute; top: calc(100% + 14px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; width: max-content; max-width: 320px; padding: 10px 14px; border-radius: calc(12px * var(--rs)); background: #16130f; color: #fff; font-size: 13px; font-weight: 500; box-shadow: var(--sh-3); }
.spotlight-tip .i { color: var(--accent-2); }
.spotlight-tip::before { content: ''; position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; background: #16130f; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
@keyframes spotIn { from { opacity: 0; transform: scale(1.15); } }
@keyframes spotPulse { 50% { box-shadow: 0 0 0 2px var(--accent), 0 0 0 12px color-mix(in srgb, var(--accent) 14%, transparent), 0 0 0 100vmax rgba(20, 14, 8, .38); } }

.ov-lightbox { display: grid; place-items: center; background: rgba(10, 8, 6, .86); backdrop-filter: blur(10px); animation: fadeIn .3s; cursor: zoom-out; z-index: 950; }
.ov-lightbox.out { animation: fadeOut .25s forwards; }
.lb { margin: 0; max-width: 90vw; animation: modalIn .5s var(--spring); }
.lb img { max-width: 90vw; max-height: 82vh; border-radius: calc(16px * var(--rs)); box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .7); }
.lb figcaption { color: rgba(255, 255, 255, .75); text-align: center; margin-top: 14px; font-size: 13px; }
.lb-x { position: fixed; top: 20px; right: 20px; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .15); color: #fff; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 990; }

/* ---------------- charts ---------------- */
.chart { position: relative; width: 100%; }
.chart-svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-dasharray: 2 5; }
.chart .grid.zero { stroke: var(--line-2); stroke-dasharray: none; }
.chart .axis { fill: var(--text-3); font: 500 10.5px var(--mono); }
.chart .line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.chart .line.draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw 1.4s var(--ease) .4s both; }
.chart .cross { stroke: var(--line-3); stroke-dasharray: 3 3; opacity: 0; transition: opacity .15s; }
.chart .hdot { opacity: 0; stroke: var(--surface); stroke-width: 2.5; transition: opacity .15s; }
.chart svg.hover .cross, .chart svg.hover .hdot { opacity: 1; }
.chart .hit { cursor: crosshair; }
.chart .bar.grow { transform-box: fill-box; transform-origin: 50% 100%; animation: barGrow .9s var(--ease) var(--d) both; }
.chart .band { fill: transparent; transition: fill .15s; }
.chart .band.on { fill: var(--accent-soft); }
@keyframes barGrow { from { transform: scaleY(0); } }
@keyframes draw { from { stroke-dashoffset: 1; } }
.chart-tip { position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none; min-width: 180px; padding: 10px 12px; border-radius: calc(13px * var(--rs)); background: var(--glass-strong); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); border: 1px solid var(--line-2); box-shadow: var(--sh-2); font-size: 12.5px; opacity: 0; transition: opacity .15s, transform .18s var(--ease); }
.chart-tip.on { opacity: 1; }
.tt-title { font-weight: 600; margin-bottom: 6px; text-transform: capitalize; }
.tt-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; color: var(--text-2); }
.tt-row i { width: 8px; height: 8px; border-radius: calc(3px * var(--rs)); flex: none; }
.tt-row b { margin-left: auto; color: var(--text); font-weight: 650; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.legend-inline { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend-inline span { display: inline-flex; align-items: center; gap: 7px; }
.legend-inline i { width: 9px; height: 9px; border-radius: calc(3px * var(--rs)); }
.donut-wrap { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.donut { position: relative; flex: none; }
.donut .seg { transition: opacity .25s, stroke-width .25s; cursor: pointer; }
.donut .seg.dim { opacity: .22; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.dc-value { font-size: 24px; font-weight: 600; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.dc-label { font-size: 12px; color: var(--text-3); max-width: 110px; }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 200px; display: grid; gap: 2px; }
.lg-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: calc(10px * var(--rs)); font-size: 13px; cursor: default; transition: background .15s; }
.lg-item.on { background: var(--surface-3); }
.lg-item i { width: 10px; height: 10px; border-radius: calc(3px * var(--rs)); flex: none; }
.lg-label { flex: 1; color: var(--text-2); }
.lg-val { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.lg-pct { width: 44px; text-align: right; color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.spark-line { stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw 1.6s var(--ease) .35s both; }
.spark-area { animation: fadeIn 1.2s .7s both; }
.spark-dot { animation: pop .5s 1.6s var(--spring) both; transform-box: fill-box; transform-origin: center; }
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { display: block; }
.ring-val { animation: ringFill 1.3s var(--ease) .25s both; }
@keyframes ringFill { from { stroke-dasharray: 0 100; } }
.ring-label { position: absolute; font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.gauge { position: relative; margin: 0 auto; }
.gauge svg { display: block; }
.gauge-val { animation: ringFill 1.6s var(--ease) .2s both; }
.gauge-c { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; }
.gauge-v { font-size: 30px; font-weight: 600; letter-spacing: -.04em; }
.gauge-l { font-size: 12px; color: var(--text-3); }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.hb-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.hb-label { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.hb-val { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hb-val em { font-style: normal; color: var(--text-3); margin-left: 6px; font-family: var(--font); font-size: 12px; }
.hb-track { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.hb-track i { display: block; height: 100%; width: var(--w); border-radius: 99px; background: var(--c); animation: growW 1.1s var(--ease) var(--d) both; }
.funnel { display: grid; gap: 4px; }
.fn-row { display: grid; grid-template-columns: 150px 1fr 90px; align-items: center; gap: 12px; }
.fn-label { font-size: 13px; color: var(--text-2); }
.fn-bar { height: 34px; border-radius: calc(10px * var(--rs)); background: var(--surface-3); overflow: hidden; }
.fn-bar i { display: flex; align-items: center; justify-content: flex-end; height: 100%; width: var(--w); padding-right: 10px; border-radius: calc(10px * var(--rs)); background: linear-gradient(90deg, color-mix(in oklab, var(--c) 55%, transparent), var(--c)); animation: growW 1.1s var(--ease) var(--d) both; }
.fn-bar b { color: #fff; font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.fn-sub { font-size: 12px; color: var(--text-3); font-family: var(--mono); }
.fn-conv { margin-left: 162px; font-size: 11px; color: var(--text-3); font-family: var(--mono); padding: 1px 0; }

/* ---------------- lists / timeline / stepper ---------------- */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); border-radius: 0; transition: background .15s, padding .25s var(--ease); min-width: 0; }
.li:last-child { border-bottom: 0; }
a.li:hover, button.li:hover, .li.click:hover { background: color-mix(in oklab, var(--accent) 3%, var(--surface-2)); padding-left: 10px; padding-right: 10px; border-radius: calc(12px * var(--rs)); border-color: transparent; }
button.li { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.li-main { flex: 1; min-width: 0; }
.li-t { font-weight: 600; font-size: 13.5px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-s { font-size: 12.3px; color: var(--text-3); display: flex; align-items: center; gap: 10px; margin-top: 2px; flex-wrap: wrap; }
.li-s > span { display: inline-flex; align-items: center; gap: 4px; }
.li-r { display: flex; align-items: center; gap: 8px; flex: none; }
.li-time { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); width: 46px; flex: none; }
.li .chev { color: var(--text-3); transition: transform .3s var(--ease), color .2s; }
.li:hover .chev { transform: translateX(3px); color: var(--accent); }
.tl { position: relative; display: flex; flex-direction: column; }
.tl-item { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.tl-item:not(:last-child)::before { content: ''; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 1px; background: linear-gradient(var(--line-2), var(--line)); }
.tl-ico { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line); }
.tl-ico.t-orange { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.tl-ico.t-green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.tl-ico.t-blue { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.tl-ico.t-violet { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.tl-ico.t-red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.tl-body { flex: 1; min-width: 0; padding-top: 3px; }
.tl-text { font-size: 13.3px; line-height: 1.45; }
.tl-meta { font-size: 11.8px; color: var(--text-3); margin-top: 2px; display: flex; gap: 6px; align-items: center; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px; border-radius: calc(14px * var(--rs)); border: 1px solid var(--line-2); background: var(--surface); margin-bottom: 18px; transition: border-color .2s, box-shadow .25s; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft-2); }
.composer textarea { flex: 1; border: 0; outline: none; resize: none; background: transparent; font: inherit; font-size: 13.5px; color: var(--text); min-height: 22px; max-height: 120px; padding: 6px 4px; }
.stepper { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-start; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; position: relative; text-align: center; min-width: 0; }
.step::before { content: ''; position: absolute; top: 10px; left: calc(-50% + 14px); right: calc(50% + 14px); height: 2px; border-radius: 2px; background: var(--track); }
.step:first-child::before { display: none; }
.step.done::before, .step.cur::before { background: var(--accent); }
.step-dot { position: relative; z-index: 1; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line-2); color: #fff; transition: all .35s var(--spring); }
.step.done .step-dot { background: var(--accent); border-color: var(--accent); }
.step.cur .step-dot { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft-2); }
.step.cur .step-dot::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulseDot 1.8s ease-in-out infinite; }
.step.st-red.cur .step-dot { border-color: var(--red); box-shadow: 0 0 0 5px var(--red-soft); }
.step.st-red.cur .step-dot::after { background: var(--red); }
.step.st-green.cur .step-dot, .step.st-green.done .step-dot { border-color: var(--green); background: var(--green); box-shadow: 0 0 0 5px var(--green-soft); }
.step.st-green.cur .step-dot::after { display: none; }
.step-label { font-size: 11.5px; color: var(--text-3); line-height: 1.25; padding: 0 2px; }
.step.cur .step-label, .step.done .step-label { color: var(--text); font-weight: 550; }
.stepper.clickable .step { cursor: pointer; }
.stepper.clickable .step:hover .step-dot { transform: scale(1.15); border-color: var(--accent); }
@keyframes pulseDot { 50% { transform: scale(.6); opacity: .6; } }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 44px 20px; color: var(--text-3); }
.empty-ico { width: 52px; height: 52px; border-radius: calc(16px * var(--rs)); display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); margin-bottom: 8px; border: 1px solid var(--line); }
.empty-title { font-size: 14.5px; font-weight: 600; color: var(--text); }
.empty-text { font-size: 13px; max-width: 360px; }
.empty .btn { margin-top: 12px; }

/* ---------------- dashboard ---------------- */
.hero { position: relative; overflow: hidden; border-radius: calc(26px * var(--rs)); min-height: 252px; margin-bottom: 16px; background: #ddd3c4; border: 1px solid var(--line); isolation: isolate; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 46%; z-index: -2; animation: heroZoom 2.6s var(--ease) both; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, var(--bg) 0%, color-mix(in oklab, var(--bg) 92%, transparent) 30%, color-mix(in oklab, var(--bg) 30%, transparent) 58%, transparent 78%); }
[data-theme="dark"] .hero::before { background: linear-gradient(90deg, var(--bg) 0%, color-mix(in oklab, var(--bg) 92%, transparent) 32%, color-mix(in oklab, var(--bg) 45%, transparent) 60%, rgba(14, 13, 11, .2) 85%); }
[data-theme="dark"] .hero-img { filter: brightness(.82) saturate(.9); }
.hero-sweep { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(105deg, transparent 40%, rgba(255, 240, 220, .55) 50%, transparent 60%); transform: translateX(-100%); animation: sweep 2.4s .5s var(--ease-io) both; mix-blend-mode: soft-light; }
.hero-glow { position: absolute; z-index: -1; right: 18%; top: -30%; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent-2) 45%, transparent), transparent); mix-blend-mode: soft-light; animation: glowPulse 8s ease-in-out infinite; pointer-events: none; }
.hero-in { position: relative; display: flex; justify-content: space-between; align-items: stretch; gap: 24px; padding: 30px 34px; min-height: 252px; }
.hero-left { max-width: 620px; display: flex; flex-direction: column; justify-content: center; }
.hero-date { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; height: 30px; padding: 0 12px; border-radius: 99px; font-size: 12.5px; font-weight: 600; color: var(--accent-ink); background: color-mix(in oklab, var(--surface) 62%, transparent); backdrop-filter: blur(14px) saturate(1.5); -webkit-backdrop-filter: blur(14px) saturate(1.5); border: 1px solid var(--accent-line); box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--accent) 45%, transparent); margin-bottom: 16px; }
.hero-date .live { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(31, 138, 82, .5); animation: livePulse 2s infinite; }
.hero h1 { font-size: clamp(32px, 3.1vw, 44px); font-weight: 600; letter-spacing: -.045em; line-height: 1.04; }
.hero h1 em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); letter-spacing: -.02em; padding-right: 4px; }
.hero h1 .w { display: inline-block; overflow: hidden; vertical-align: bottom; }
.hero h1 .w > span { display: inline-block; animation: wordUp .9s var(--ease) both; }
.hero-brief { margin-top: 14px; font-size: 14.5px; line-height: 1.6; color: var(--text-2); max-width: 560px; }
.hero-brief a { color: var(--text); font-weight: 600; border-bottom: 1px solid var(--accent-line); transition: color .2s, border-color .2s; }
.hero-brief a:hover { color: var(--accent-ink); border-color: var(--accent); }
.hero-right { display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-end; gap: 10px; }
.glass-chip { display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; border-radius: calc(16px * var(--rs)); background: rgba(255, 253, 249, .58); backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6); border: 1px solid rgba(255, 255, 255, .62); box-shadow: 0 16px 40px -18px rgba(30, 20, 10, .45); color: #16130f; animation: chipIn .9s var(--spring) both, floatY 7s ease-in-out 1s infinite; transition: transform .3s var(--ease); }
.glass-chip:hover { transform: translateY(-3px); }
.glass-chip:nth-child(2) { animation-delay: .15s, 1.6s; }
.glass-chip:nth-child(3) { animation-delay: .3s, 2.2s; }
[data-theme="dark"] .glass-chip { background: rgba(23, 21, 18, .55); border-color: rgba(255, 255, 255, .1); color: #f4efe7; }
.gc-ico { width: 34px; height: 34px; border-radius: calc(11px * var(--rs)); display: grid; place-items: center; background: linear-gradient(145deg, var(--accent-2), color-mix(in oklab, var(--accent) 94%, black)); color: #fff; box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--accent) 80%, transparent); }
.gc-k { font-size: 11.5px; opacity: .7; }
.gc-v { font-size: 15px; font-weight: 650; letter-spacing: -.02em; }
@keyframes heroZoom { from { transform: scale(1.1); } }
@keyframes sweep { to { transform: translateX(100%); } }
@keyframes glowPulse { 50% { transform: scale(1.15) translateX(-20px); opacity: .7; } }
@keyframes wordUp { from { transform: translateY(105%); } }
@keyframes chipIn { from { opacity: 0; transform: translateY(16px) scale(.94); } }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(31, 138, 82, .5); } 70% { box-shadow: 0 0 0 8px rgba(31, 138, 82, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 138, 82, 0); } }
.agenda-time { display: flex; flex-direction: column; align-items: center; width: 48px; flex: none; }
.agenda-time b { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.agenda-time span { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.quick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.qa { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: calc(16px * var(--rs)); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--sh-1); text-align: left; transition: transform .4s var(--ease), box-shadow .4s, border-color .25s; overflow: hidden; }
.qa:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--accent-line); }
.qa .ico-tile { transition: transform .45s var(--spring), background .25s, color .25s; }
.qa:hover .ico-tile { transform: rotate(-8deg) scale(1.08); background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.qa-t { font-weight: 600; font-size: 13.5px; }
.qa-s { font-size: 11.8px; color: var(--text-3); }
.qa kbd { position: absolute; top: 10px; right: 10px; }
.proj-mini { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.proj-mini:last-child { border-bottom: 0; }

/* ---------------- planner inbox ---------------- */
.inbox { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 16px; align-items: start; }
.inbox-list { position: sticky; top: calc(var(--tb-h) + 16px); max-height: calc(100vh - var(--tb-h) - 40px); display: flex; flex-direction: column; overflow: hidden; }
.inbox-scroll { overflow-y: auto; padding: 6px; }
.ib-item { position: relative; display: block; width: 100%; text-align: left; padding: 13px 14px 13px 26px; border-radius: calc(14px * var(--rs)); border: 1px solid transparent; background: none; transition: background .2s, border-color .2s, transform .3s var(--ease); }
.ib-item:hover { background: var(--surface-2); }
.ib-item.on { background: linear-gradient(100deg, var(--accent-soft), transparent 80%), var(--surface); border-color: var(--accent-line); box-shadow: var(--sh-1); }
.ib-item.new::before { content: ''; position: absolute; left: 11px; top: 19px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft-2); animation: pulseDot 2s ease-in-out infinite; }
.ib-item.arrive { animation: arrive .9s var(--spring) both; }
@keyframes arrive { 0% { opacity: 0; transform: translateY(-14px) scale(.96); background: var(--accent-soft-2); } 60% { opacity: 1; } }
.ib-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ib-name { font-weight: 600; font-size: 13.8px; }
.ib-time { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.ib-type { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.ib-meta { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 11.8px; color: var(--text-3); flex-wrap: wrap; }
.range { position: relative; height: 10px; border-radius: 99px; background: var(--track); margin: 28px 0 8px; }
.range i { position: absolute; top: 0; bottom: 0; left: var(--a); right: calc(100% - var(--b)); border-radius: 99px; background: var(--accent-grad); box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--accent) 60%, transparent); animation: growW 1s var(--ease) both; }
.range .lbl { position: absolute; top: -24px; font-size: 12px; font-weight: 650; transform: translateX(-50%); white-space: nowrap; font-variant-numeric: tabular-nums; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.ph-tile { position: relative; aspect-ratio: 4 / 3; border-radius: calc(12px * var(--rs)); overflow: hidden; background: linear-gradient(135deg, var(--surface-3), var(--surface-2)); border: 1px solid var(--line); display: grid; place-items: center; color: var(--text-3); cursor: zoom-in; }
.ph-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.ph-tile:hover img { transform: scale(1.06); }
.ph-tile .ph-cap { position: absolute; left: 8px; bottom: 8px; padding: 2px 7px; border-radius: calc(6px * var(--rs)); font-size: 10.5px; font-weight: 600; background: rgba(20, 16, 12, .6); color: #fff; backdrop-filter: blur(6px); }
.ph-tile.placeholder { cursor: default; flex-direction: column; gap: 4px; font-size: 11px; }
.integr { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: calc(18px * var(--rs)); border: 1px solid var(--line); background: linear-gradient(100deg, var(--accent-soft), transparent 60%), var(--surface); box-shadow: var(--sh-1); margin-bottom: 16px; }
.integr-dot { position: relative; width: 10px; height: 10px; border-radius: 50%; background: var(--green); flex: none; }
.integr-dot::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--green); opacity: .5; animation: livePulse2 2s infinite; }
@keyframes livePulse2 { 70% { transform: scale(1.8); opacity: 0; } 100% { opacity: 0; } }

/* ---------------- calendar ---------------- */
.cal-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-title { font-size: 20px; font-weight: 600; letter-spacing: -.03em; min-width: 190px; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-radius: calc(20px * var(--rs)); overflow: hidden; border: 1px solid var(--line); background: var(--line); gap: 1px; box-shadow: var(--sh-1); }
.cal-dow { background: var(--surface-2); padding: 10px 12px; font-size: 11.5px; font-weight: 600; color: var(--text-3); font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.cal-cell { position: relative; background: var(--surface); min-height: 124px; padding: 8px 8px 10px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; transition: background .15s; min-width: 0; }
.cal-cell:hover { background: color-mix(in oklab, var(--accent) 3%, var(--surface)); }
.cal-cell.out { background: var(--surface-2); }
.cal-cell.out .cal-n { color: var(--text-3); opacity: .6; }
.cal-cell.we { background: color-mix(in oklab, var(--surface-2) 60%, var(--surface)); }
.cal-n { align-self: flex-start; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; margin-bottom: 2px; }
.cal-cell.today .cal-n { background: var(--accent); color: var(--on-accent); box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--accent) 80%, transparent); }
.cal-cell .cal-add { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: calc(7px * var(--rs)); display: grid; place-items: center; color: var(--text-3); opacity: 0; transition: opacity .2s, background .2s; }
.cal-cell:hover .cal-add { opacity: 1; }
.cal-cell .cal-add:hover { background: var(--accent-soft); color: var(--accent-ink); }
.cal-ev { display: flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: calc(7px * var(--rs)); font-size: 11.5px; font-weight: 550; background: color-mix(in oklab, var(--c) 11%, var(--surface)); color: color-mix(in oklab, var(--c) 72%, var(--text)); border-left: 3px solid var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: transform .2s var(--ease), box-shadow .2s; min-width: 0; }
.cal-ev:hover { transform: translateX(2px); box-shadow: var(--sh-1); }
.cal-ev .t { font-family: var(--mono); font-size: 10.5px; opacity: .75; flex: none; }
.cal-ev span { overflow: hidden; text-overflow: ellipsis; }
.cal-ev.done { opacity: .55; text-decoration: line-through; text-decoration-color: color-mix(in oklab, var(--c) 50%, transparent); }
.cal-more { font-size: 11px; color: var(--text-3); padding-left: 4px; font-weight: 600; }
.cal-week { display: grid; grid-template-columns: 58px repeat(7, minmax(0, 1fr)); border-radius: calc(20px * var(--rs)); border: 1px solid var(--line); background: var(--surface); overflow: hidden; box-shadow: var(--sh-1); }
.cw-head { position: sticky; top: var(--tb-h); z-index: 3; padding: 10px 8px; border-bottom: 1px solid var(--line); background: color-mix(in oklab, var(--surface) 92%, transparent); backdrop-filter: blur(8px); text-align: center; }
.cw-head .d { font-size: 11px; color: var(--text-3); font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.cw-head .n { font-size: 20px; font-weight: 600; letter-spacing: -.03em; }
.cw-head.today .n { color: var(--accent); }
.cw-hours { border-right: 1px solid var(--line); }
.cw-h { height: 56px; font-family: var(--mono); font-size: 10.5px; color: var(--text-3); text-align: right; padding: 0 8px; transform: translateY(-7px); }
.cw-col { position: relative; border-right: 1px solid var(--line); background-image: repeating-linear-gradient(var(--line) 0 1px, transparent 1px 56px); }
.cw-col:last-child { border-right: 0; }
.cw-col.today { background-color: color-mix(in oklab, var(--accent) 3%, transparent); }
.cw-ev { position: absolute; left: 4px; right: 4px; border-radius: calc(10px * var(--rs)); padding: 6px 8px; font-size: 11.8px; overflow: hidden; background: color-mix(in oklab, var(--c) 14%, var(--surface)); border: 1px solid color-mix(in oklab, var(--c) 30%, transparent); border-left: 3px solid var(--c); color: color-mix(in oklab, var(--c) 65%, var(--text)); cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s; animation: riseIn .6s var(--ease) both; }
.cw-ev:hover { transform: scale(1.02); box-shadow: var(--sh-2); z-index: 2; }
.cw-ev b { display: block; font-weight: 600; line-height: 1.25; }
.cw-ev .t { font-family: var(--mono); font-size: 10.5px; opacity: .8; }
.cw-now { position: absolute; left: -1px; right: 0; height: 2px; background: var(--red); z-index: 4; }
.cw-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.agenda-day { margin-bottom: 18px; }
.agenda-day h4 { font-size: 13px; font-weight: 600; margin-bottom: 8px; display: flex; gap: 8px; align-items: baseline; }
.agenda-day h4 span { color: var(--text-3); font-weight: 500; }
.ev-type { width: 4px; align-self: stretch; border-radius: calc(4px * var(--rs)); background: var(--c); flex: none; }

/* ---------------- gantt ---------------- */
.gantt { display: grid; grid-template-columns: 290px minmax(0, 1fr); border-radius: calc(20px * var(--rs)); border: 1px solid var(--line); background: var(--surface); overflow: hidden; box-shadow: var(--sh-1); }
.gt-side { border-right: 1px solid var(--line); background: var(--surface); position: relative; z-index: 2; }
.gt-side-head, .gt-head { height: 56px; border-bottom: 1px solid var(--line); }
.gt-side-head { display: flex; align-items: flex-end; padding: 0 16px 10px; font-size: 12px; color: var(--text-3); font-weight: 600; }
.gt-row-l { height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); font-size: 13px; min-width: 0; cursor: pointer; transition: background .15s; }
.gt-row-l:hover { background: var(--surface-2); }
.gt-row-l.proj { font-weight: 600; background: var(--surface-2); }
.gt-row-l.phase { padding-left: 34px; color: var(--text-2); }
.gt-row-l .gt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.gt-row-l .gt-chev { display: grid; place-items: center; width: 16px; flex: none; transition: transform .3s var(--ease); }
.gt-scroll { overflow-x: auto; position: relative; }
.gt-inner { position: relative; }
.gt-head { position: relative; }
.gt-month { position: absolute; top: 8px; font-size: 12px; font-weight: 600; padding-left: 8px; border-left: 1px solid var(--line-2); height: 40px; text-transform: capitalize; }
.gt-week { position: absolute; bottom: 6px; font-family: var(--mono); font-size: 10px; color: var(--text-3); transform: translateX(-50%); }
.gt-grid { position: absolute; top: 56px; bottom: 0; width: 1px; background: var(--line); }
.gt-grid.m { background: var(--line-2); }
.gt-row { position: relative; height: 44px; border-bottom: 1px solid var(--line); }
.gt-row.proj { background: color-mix(in oklab, var(--surface-2) 60%, transparent); }
.gt-bar { position: absolute; top: 12px; height: 20px; border-radius: calc(7px * var(--rs)); background: color-mix(in oklab, var(--c) 22%, var(--surface)); border: 1px solid color-mix(in oklab, var(--c) 45%, transparent); overflow: hidden; cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s; transform-origin: left center; animation: ganttIn .9s var(--ease) var(--d) both; }
.gt-bar:hover { box-shadow: 0 6px 16px -6px color-mix(in oklab, var(--c) 70%, transparent); transform: translateY(-1px); }
.gt-bar i { position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--c); }
.gt-bar.cur i { background: repeating-linear-gradient(-45deg, var(--c), var(--c) 6px, color-mix(in oklab, var(--c) 75%, #fff) 6px, color-mix(in oklab, var(--c) 75%, #fff) 12px); background-size: 17px 17px; animation: stripes 1s linear infinite; }
.gt-bar.late { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-soft); }
.gt-bar span { position: relative; z-index: 1; display: block; font-size: 10.5px; font-weight: 650; color: #fff; padding: 0 8px; line-height: 18px; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.gt-bar.proj { top: 14px; height: 16px; border-radius: 99px; }
.gt-plan { position: absolute; top: 34px; height: 3px; border-radius: calc(3px * var(--rs)); background: var(--line-3); }
.gt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 3; box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 60%, transparent); }
.gt-today span { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); padding: 2px 7px; border-radius: calc(6px * var(--rs)); background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 700; font-family: var(--mono); white-space: nowrap; }
@keyframes ganttIn { from { transform: scaleX(0); opacity: 0; } }
@keyframes stripes { to { background-position: 17px 0; } }

/* ---------------- quote builder & paper ---------------- */
.qb { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.qb-items { border: 1px solid var(--line); border-radius: calc(16px * var(--rs)); overflow: hidden; }
.qb-row { display: grid; grid-template-columns: 26px minmax(0, 2.6fr) 104px 78px 70px 96px var(--costcol, 0px) 98px 32px; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface); animation: riseIn .45s var(--ease) both; }
.qb.show-cost .qb-row { --costcol: 92px; }
.qb-row.head { background: var(--surface-2); font-size: 11.5px; color: var(--text-3); font-weight: 600; padding-top: 9px; padding-bottom: 9px; animation: none; }
.qb-row:last-child { border-bottom: 0; }
.qb-row .input { height: 34px; font-size: 13px; padding: 0 9px; border-radius: calc(9px * var(--rs)); }
.qb-row .cost-cell { overflow: hidden; }
.qb:not(.show-cost) .cost-cell { visibility: hidden; }
.qb-n { font-family: var(--mono); font-size: 11px; color: var(--text-3); text-align: center; }
.qb-sum { font-size: 13px; font-weight: 650; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qb-side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 12px; }
.sumcard { padding: 16px; border-radius: calc(18px * var(--rs)); background: linear-gradient(160deg, #221d17, #12100d); color: #f4efe7; box-shadow: 0 20px 40px -20px rgba(18, 14, 10, .7); position: relative; overflow: hidden; }
.sumcard::after { content: ''; position: absolute; top: -60px; right: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 45%, transparent), transparent); }
.sum-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 5px 0; color: rgba(244, 239, 231, .7); position: relative; z-index: 1; }
.sum-row b { font-weight: 600; color: #f4efe7; font-variant-numeric: tabular-nums; }
.sum-total { margin-top: 8px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .12); position: relative; z-index: 1; }
.sum-total .l { font-size: 12px; color: rgba(244, 239, 231, .6); }
.sum-total .v { font-size: 28px; font-weight: 600; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.margin-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: calc(16px * var(--rs)); border: 1px solid var(--line); background: var(--surface-2); }
.paper-wrap { padding: 20px; border-radius: calc(18px * var(--rs)); background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 10px, var(--surface-3) 10px, var(--surface-3) 20px); }
.paper { position: relative; background: #fffefb; color: #16130f; border-radius: calc(6px * var(--rs)); max-width: 760px; margin: 0 auto; padding: 46px 50px 40px; font-size: 12px; line-height: 1.55; box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 30px 60px -28px rgba(0, 0, 0, .35); font-family: var(--font); }
.paper::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px; border-radius: 6px 6px 0 0; background: var(--accent-grad); }
.pp-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.pp-logo { width: 150px; }
.pp-company { text-align: right; font-size: 11px; color: #5e574e; line-height: 1.6; }
.pp-title { margin-top: 30px; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding-bottom: 14px; border-bottom: 1px solid #e8e1d6; }
.pp-title h2 { font-size: 24px; font-weight: 600; letter-spacing: -.03em; }
.pp-title .no { font-family: var(--mono); font-size: 12px; color: var(--accent-ink); }
.pp-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 18px 0 22px; }
.pp-label { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: #968d81; margin-bottom: 5px; }
.pp-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.pp-table th { text-align: left; font-weight: 600; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #968d81; padding: 8px 6px; border-bottom: 1.5px solid #16130f; }
.pp-table td { padding: 8px 6px; border-bottom: 1px solid #efe9df; vertical-align: top; }
.pp-table .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pp-totals { margin: 16px 0 0 auto; width: 280px; font-size: 12px; }
.pp-totals div { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.pp-totals .grand { margin-top: 6px; padding-top: 10px; border-top: 1.5px solid #16130f; font-size: 16px; font-weight: 650; }
.pp-note { margin-top: 26px; padding: 12px 14px; border-radius: calc(8px * var(--rs)); background: #faf6ef; color: #5e574e; font-size: 11px; }
.pp-foot { margin-top: 26px; padding-top: 12px; border-top: 1px solid #efe9df; display: flex; justify-content: space-between; gap: 16px; font-size: 10px; color: #968d81; }
.pp-stamp { position: absolute; right: 50px; top: 150px; transform: rotate(-12deg); border: 2.5px solid currentColor; border-radius: calc(10px * var(--rs)); padding: 6px 14px; font-family: var(--mono); font-weight: 700; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.pp-stamp.green { color: #1f8a52; } .pp-stamp.red { color: #d03b2f; }

/* ---------------- documents ---------------- */
.docs { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; align-items: start; }
.doc-nav { position: sticky; top: calc(var(--tb-h) + 16px); padding: 8px; }
.dn-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border-radius: calc(10px * var(--rs)); border: 0; background: none; font-size: 13.3px; color: var(--text-2); font-weight: 500; text-align: left; transition: background .15s, color .15s; }
.dn-item:hover { background: var(--gray-soft); color: var(--text); }
.dn-item.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.dn-item .c { margin-left: auto; font-size: 11.5px; color: var(--text-3); }
.drop { position: relative; display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: calc(18px * var(--rs)); border: 1.5px dashed var(--line-3); background: var(--surface); margin-bottom: 16px; transition: border-color .25s, background .25s, transform .3s var(--ease); cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 4%, var(--surface)); }
.drop.over { transform: scale(1.01); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; }
.file { position: relative; display: flex; flex-direction: column; border-radius: calc(16px * var(--rs)); overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--sh-1); text-align: left; padding: 0; transition: transform .4s var(--ease), box-shadow .4s; }
.file:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.file-thumb { position: relative; aspect-ratio: 4 / 3; background: var(--surface-3); display: grid; place-items: center; overflow: hidden; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.file:hover .file-thumb img { transform: scale(1.06); }
.file-type { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.file-type .big { width: 56px; height: 70px; border-radius: 8px 18px 8px 8px; background: var(--surface); border: 1px solid var(--line-2); display: grid; place-items: center; box-shadow: var(--sh-1); color: var(--ft, var(--text-3)); position: relative; }
.file-type .ext { position: absolute; bottom: 8px; left: -8px; padding: 2px 6px; border-radius: calc(5px * var(--rs)); background: var(--ft, #8b857c); color: #fff; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.file-meta { padding: 11px 12px 12px; }
.file-name { font-size: 12.8px; font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 34px; }
.file-sub { font-size: 11.5px; color: var(--text-3); margin-top: 4px; display: flex; justify-content: space-between; gap: 6px; }
.stage-badge { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: calc(7px * var(--rs)); font-size: 10.5px; font-weight: 650; background: rgba(20, 16, 12, .55); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

/* ---------------- settings / permissions ---------------- */
.settings { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 20px; align-items: start; }
.set-nav { position: sticky; top: calc(var(--tb-h) + 16px); padding: 8px; }
.set-sec { margin-bottom: 16px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .t { font-weight: 600; font-size: 13.8px; }
.set-row .s { font-size: 12.5px; color: var(--text-3); margin-top: 2px; max-width: 520px; }
.perm { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.perm th { font-size: 12px; font-weight: 600; color: var(--text-2); padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.perm th:first-child { text-align: left; padding-left: 20px; }
.perm td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: center; }
.perm td:first-child { text-align: left; padding-left: 20px; font-weight: 550; }
.perm tr:last-child td { border-bottom: 0; }
.perm-cell { width: 38px; height: 30px; border-radius: calc(9px * var(--rs)); border: 1px solid transparent; display: inline-grid; place-items: center; background: transparent; transition: transform .3s var(--spring), background .2s; }
.perm-cell:hover:not(:disabled) { transform: scale(1.12); }
.perm-cell.full { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.perm-cell.view { background: var(--blue-soft); color: var(--blue); }
.perm-cell.none { color: var(--text-3); background: var(--gray-soft); }
.perm-cell:disabled { cursor: default; }
.swatches { display: flex; gap: 6px; }
.swatch { width: 22px; height: 22px; border-radius: calc(7px * var(--rs)); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; transition: transform .25s var(--spring); }
.swatch:hover { transform: scale(1.15); }
.swatch.on { box-shadow: 0 0 0 2px var(--text); }
.stage-edit { display: grid; grid-template-columns: 28px 1fr 160px 90px 64px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.feature-row { display: grid; grid-template-columns: 1fr 140px; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; font-size: 13px; }

/* ---------------- misc modules ---------------- */
.team-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.load-bar { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; position: relative; }
.load-bar i { position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 99px; background: var(--c, var(--green)); animation: growW 1.1s var(--ease) .2s both; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); transition: background .15s; border-radius: 0; }
.task-row:hover { background: var(--surface-2); }
.task-row.done .li-t { text-decoration: line-through; color: var(--text-3); }
.task-row .li-t { transition: color .3s; }
.group-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-3); margin: 18px 0 6px; font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.group-title .n { font-weight: 500; }
.proj-card { display: flex; flex-direction: column; border-radius: calc(20px * var(--rs)); overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--sh-1); transition: transform .45s var(--ease), box-shadow .45s; text-align: left; padding: 0; }
.proj-card:hover { transform: translateY(-4px); box-shadow: var(--sh-2); }
.pc-cover { position: relative; height: 126px; overflow: hidden; background: linear-gradient(135deg, #e9dfd0, #d8cbb8); }
.pc-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.proj-card:hover .pc-cover img { transform: scale(1.06); }
.pc-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(16, 12, 8, .55)); }
.pc-cover .pc-num { position: absolute; left: 14px; bottom: 10px; z-index: 1; color: #fff; font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; }
.pc-cover .pill { position: absolute; top: 12px; left: 12px; z-index: 1; background: rgba(255, 253, 249, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.proj-card { position: relative; }
.proj-card > .ring { position: absolute; right: 14px; top: 100px; z-index: 2; background: var(--surface); border-radius: 50%; box-shadow: var(--sh-2); padding: 3px; }
.pc-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.pc-title { font-size: 15px; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; padding-right: 50px; }
.pc-sub { font-size: 12.5px; color: var(--text-3); display: flex; gap: 6px; align-items: center; }
.pc-fin { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pc-fin .l { font-size: 11px; color: var(--text-3); }
.pc-fin .v { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pc-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--line); }
.supplier-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: transform .45s var(--ease), box-shadow .45s; }
.supplier-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.stars { display: inline-flex; gap: 1px; color: var(--line-3); }
.stars .on { color: #e8a317; fill: #e8a317; }
.stock { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.stock .prog { flex: 1; }
.aging { display: flex; height: 12px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--track); }
.aging i { display: block; height: 100%; animation: growW 1.1s var(--ease) both; }
.guide-step { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: calc(16px * var(--rs)); border: 1px solid var(--line); background: var(--surface); margin-bottom: 8px; transition: border-color .2s, background .3s; }
.guide-step.done { background: color-mix(in oklab, var(--green) 5%, var(--surface)); border-color: color-mix(in oklab, var(--green) 25%, transparent); }
.guide-step.cur { border-color: var(--accent-line); box-shadow: 0 10px 30px -18px color-mix(in srgb, var(--accent) 60%, transparent); }
.gs-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; font-family: var(--mono); font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); }
.guide-step.done .gs-n { background: var(--green); color: #fff; }
.guide-step.cur .gs-n { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 5px var(--accent-soft-2); }
.gs-t { font-weight: 600; font-size: 13.8px; }
.gs-s { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

/* ---------------- keyframes ---------------- */
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes pop { from { transform: scale(0); } }

/* ---------------- responsive ---------------- */
@media (max-width: 1360px) {
  .kpis.k5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g-main-r, .g3 { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qb { grid-template-columns: minmax(0, 1fr); }
  .qb-side { position: static; }
  .inbox { grid-template-columns: 320px minmax(0, 1fr); }
  .hero-right { display: none; }
}
@media (max-width: 980px) {
  .app, body.sb-collapsed .app { grid-template-columns: minmax(0, 1fr); }
  .sb { position: fixed; left: 0; top: 0; width: 284px; transform: translateX(-104%); transition: transform .5s var(--drawer); box-shadow: var(--sh-3); background: var(--surface); }
  body.sb-open .sb { transform: none; }
  body.sb-open::after { content: ''; position: fixed; inset: 0; z-index: 55; background: var(--scrim); animation: fadeIn .3s; }
  body.sb-collapsed .sb-txt, body.sb-collapsed .sb-label, body.sb-collapsed .sb-count, body.sb-collapsed .sb-logo { display: initial; }
  .sb-collapse { display: none; }
  .tb { padding: 0 16px; gap: 10px; }
  .tb .tb-burger { display: grid; }
  .tb-search { max-width: 44px; padding: 0; justify-content: center; }
  .tb-search span, .tb-search .kbds { display: none; }
  .uc-text, .tb-new span, .tb-new kbd { display: none; }
  .page { padding: 20px 16px 80px; }
  .g2, .g4 { grid-template-columns: minmax(0, 1fr); }
  .inbox, .docs, .settings { grid-template-columns: minmax(0, 1fr); }
  .inbox-list, .doc-nav, .set-nav { position: static; max-height: none; }
  .gantt { grid-template-columns: 170px minmax(0, 1fr); }
  .tbl-wrap { overflow-x: auto; }
  .tbl th { position: static; }
  .cal-cell { min-height: 92px; }
  .cal-ev span { display: none; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-visual { display: none; }
}
@media (max-width: 640px) {
  .kpis, .kpis.k3, .kpis.k5, .quick { grid-template-columns: minmax(0, 1fr); }
  .ph-title { font-size: 25px; }
  .hero-in { padding: 22px; }
  .hero h1 { font-size: 30px; }
  .kb-col { flex-basis: 84vw; }
  .kb { scroll-snap-type: x mandatory; }
  .kb-col { scroll-snap-align: start; }
  .ov-modal { padding: 0; align-items: end; }
  .modal { border-radius: 22px 22px 0 0; max-height: 92vh; }
  .drawer { top: 0; right: 0; bottom: 0; border-radius: 0; width: 100vw; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .facts, .facts.f3 { grid-template-columns: minmax(0, 1fr); }
  .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .fn-row { grid-template-columns: 96px 1fr; }
  .fn-sub { display: none; }
  .fn-conv { margin-left: 108px; }
  .toast { width: calc(100vw - 32px); }
  .toasts { right: 16px; left: 16px; bottom: 16px; }
  .cal-dow { padding: 8px 4px; font-size: 10px; text-align: center; }
  .cal-cell { min-height: 64px; padding: 4px; }
  .cal-ev { padding: 0; height: 6px; border-left-width: 0; background: var(--c); }
  .tb { gap: 6px; padding: 0 10px; }
  .crumbs span, .crumbs .i, .beta-badge, #themeBtn { display: none; }
  .crumbs b { font-size: 14px; }
  .tb-search { width: 36px; height: 36px; flex: none; margin-left: auto; border-radius: calc(11px * var(--rs)); }
  .user-chip { padding: 2px; } .user-chip > .i { display: none; }
  .hero::before { background: linear-gradient(180deg, color-mix(in oklab, var(--bg) 88%, transparent) 0%, color-mix(in oklab, var(--bg) 80%, transparent) 70%, color-mix(in oklab, var(--bg) 55%, transparent)); }
  .stepper { overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .stepper::-webkit-scrollbar { display: none; }
  .step { min-width: 80px; }
  .dr-head, .dr-body { padding-left: 18px; padding-right: 18px; }
  .dr-tabs { padding: 0 18px; } .dr-hero { margin: 0 18px 6px; }
  .dr-foot { padding: 12px 18px; } .dr-foot .spacer { display: none; } .dr-foot .btn { flex: 1 1 calc(50% - 8px); }
  .dr-title { font-size: 20px; }
  .ph { margin-bottom: 18px; } .ph-actions { width: 100%; } .ph-actions .btn-primary { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* =====================================================================
   NATIVE MOBILE APP LAYER — tab bar, sheets, full-screen details, gestures
   ===================================================================== */
.tabbar, .dr-back, .m-only, .login-mhero, .touch-hint, .cmdk-cancel, .md-grab { display: none; }
.tb-dot { position: absolute; top: -3px; right: 10px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 700; font-style: normal; display: grid; place-items: center; border: 2px solid var(--surface); line-height: 1; }
.tb-dot.muted { background: var(--text-3); }

.ov-sheet { position: fixed; inset: 0; z-index: 650; display: flex; align-items: flex-end; justify-content: center; background: var(--scrim); animation: fadeIn .3s ease; }
.ov-sheet.out { animation: fadeOut .32s ease forwards; }
.sheet { position: relative; width: 100%; max-width: 560px; max-height: calc(100dvh - env(safe-area-inset-top) - 28px); display: flex; flex-direction: column; background: var(--surface); border-radius: 28px 28px 0 0; box-shadow: 0 -20px 60px -20px rgba(20, 14, 8, .45); padding-bottom: env(safe-area-inset-bottom); animation: sheetIn .55s var(--drawer); will-change: transform; transition: transform .35s var(--drawer); }
.ov-sheet.out .sheet { animation: sheetOut .32s var(--ease-io) forwards; }
.grab { display: flex; justify-content: center; padding: 9px 0 5px; flex: none; touch-action: none; }
.grab i { width: 38px; height: 5px; border-radius: 99px; background: var(--line-3); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 14px 8px 20px; flex: none; touch-action: none; }
.sheet-head h3 { font-size: 17px; font-weight: 650; letter-spacing: -.02em; line-height: 1.25; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0 10px 14px; }
.sheet .menu { padding: 0; }
.sheet .menu-item { height: 52px; font-size: 15.5px; border-radius: calc(14px * var(--rs)); padding: 0 12px; gap: 12px; }
.sheet .menu-item .i { width: 20px; height: 20px; }
.sheet .menu-head { padding: 14px 12px 6px; }
.sheet .menu-sep { margin: 6px 12px; }
.sheet .notif > .row-between:first-child { padding-top: 4px !important; }
.sheet .notif-list { max-height: none !important; }
.more-profile { display: flex; align-items: center; gap: 12px; padding: 4px 10px 14px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.more-group { padding: 8px 2px 2px; }
.more-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); padding: 4px 10px 8px; }
.more-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
.more-tile { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 8px 2px; border-radius: calc(16px * var(--rs)); text-align: center; font-size: 11.5px; font-weight: 550; color: var(--text-2); line-height: 1.2; -webkit-user-select: none; user-select: none; }
.more-tile:active { background: var(--surface-2); }
.more-ico { position: relative; width: 54px; height: 54px; border-radius: calc(17px * var(--rs)); display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); transition: transform .3s var(--spring); }
.more-tile:active .more-ico { transform: scale(.9); }
.more-tile.on .more-ico { background: linear-gradient(145deg, var(--accent-2), color-mix(in oklab, var(--accent) 94%, black)); color: #fff; border-color: transparent; box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.more-ico .tb-dot { top: -6px; right: -6px; }
.more-txt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 28px; }
.more-list { margin-top: 12px; border-top: 1px solid var(--line); padding: 6px 4px 0; }
.more-list .li { padding: 11px 6px; }
.more-foot { text-align: center; font-size: 11.5px; color: var(--text-3); padding: 14px 0 6px; }
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }
@keyframes pageIn { from { transform: translateX(100%); } }
@keyframes pageOut { to { transform: translateX(100%); } }
@keyframes toastOutDown { to { opacity: 0; transform: translateY(24px) scale(.97); } }

@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  :root { --tb-h: calc(58px + env(safe-area-inset-top)); --tab-h: calc(62px + env(safe-area-inset-bottom)); }
  html { -webkit-tap-highlight-color: transparent; }
  html, body { overscroll-behavior-y: none; }
  html.locked, html.locked body { overflow: hidden; }
  body { -webkit-text-size-adjust: 100%; }
  button, a, label, .kb-card, .li, .chip, .seg-opt span, .tb-tab, .more-tile { touch-action: manipulation; }
  .m-only { display: inline; } .d-only { display: none !important; } .m-hide { display: none !important; }
  .btn-kbd, .kbds, .qa kbd { display: none !important; }

  /* ---- app chrome ---- */
  .app, body.sb-collapsed .app { display: block; }
  .sb, body.sb-open::after { display: none !important; }
  .tb { height: var(--tb-h); padding: env(safe-area-inset-top) 12px 0 18px; gap: 8px; background: color-mix(in oklab, var(--bg) 80%, transparent); border-bottom-color: transparent; transition: border-color .3s, background .3s; }
  body.scrolled .tb { border-bottom-color: var(--line); }
  .tb .tb-burger { display: none !important; }
  .tb-brand { display: flex; align-items: center; position: absolute; left: 18px; bottom: 0; height: 58px; transition: opacity .25s, transform .4s var(--ease); }
  .tb-brand img { height: 26px; width: auto; }
  body.scrolled .tb-brand { opacity: 0; transform: translateY(-8px); pointer-events: none; }
  .crumbs { flex: 1; min-width: 0; }
  .crumbs > span, .crumbs > .i { display: none; }
  .crumbs b { display: block; font-size: 17px; font-weight: 650; letter-spacing: -.02em; opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .4s var(--ease); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.scrolled .crumbs b { opacity: 1; transform: none; }
  .tb-search { width: 40px; height: 40px; max-width: none; flex: none; margin: 0; padding: 0; justify-content: center; border-radius: calc(13px * var(--rs)); }
  .tb-search span, .beta-badge, #themeBtn, .uc-text, .user-chip > .i { display: none !important; }
  .tb-actions { gap: 6px; }
  .tb .icon-btn { width: 40px; height: 40px; border-radius: calc(13px * var(--rs)); }
  .user-chip { padding: 0; border: 0 !important; background: none !important; }
  .user-chip .av { width: 38px; height: 38px; }
  .page { padding: 10px 16px calc(var(--tab-h) + 30px); }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: start; height: var(--tab-h); padding: 7px 4px env(safe-area-inset-bottom); background: color-mix(in oklab, var(--surface) 82%, transparent); backdrop-filter: blur(26px) saturate(1.8); -webkit-backdrop-filter: blur(26px) saturate(1.8); border-top: 1px solid var(--line); -webkit-user-select: none; user-select: none; }
  .tb-tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--text-3); font-size: 10.5px; font-weight: 600; letter-spacing: .01em; }
  .tb-ico { position: relative; display: grid; place-items: center; width: 58px; height: 30px; border-radius: 99px; transition: background .35s var(--ease), color .2s, transform .35s var(--spring); }
  .tb-tab.on { color: var(--accent-ink); }
  .tb-tab.on .tb-ico { background: var(--accent-soft-2); color: var(--accent); }
  .tb-tab:active .tb-ico { transform: scale(.86); }
  .tb-lbl { line-height: 1; white-space: nowrap; }
  .tb-fab { justify-self: center; width: 54px; height: 54px; margin-top: -20px; border-radius: calc(19px * var(--rs)); border: 0; display: grid; place-items: center; color: #fff; background: linear-gradient(180deg, #f07a30, color-mix(in oklab, var(--accent) 94%, black)); box-shadow: 0 12px 26px -10px color-mix(in srgb, var(--accent) 85%, transparent), inset 0 1px 0 rgba(255, 255, 255, .3); transition: transform .35s var(--spring); }
  .tb-fab:active { transform: scale(.88) rotate(90deg); }

  /* ---- page content ---- */
  .ph { margin-bottom: 16px; gap: 12px; }
  .ph-kicker { margin-bottom: 6px; }
  .ph-title { font-size: 29px; letter-spacing: -.04em; }
  .ph-sub { font-size: 13.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .li-t { white-space: normal; overflow: visible; }
  .agenda-day .li-r .pill { display: none; }
  .li { align-items: center; }
  .ph-actions { width: 100%; }
  .ph-actions .seg { flex: 1 1 auto; }
  .ph-actions .seg .seg-opt { flex: 1 1 0; }
  .ph-actions .seg .seg-opt span { justify-content: center; padding: 0 8px; }
  .ph-actions .btn-primary { flex: 1 1 auto; height: 42px; }
  .ph-actions > .btn-secondary { flex: 1 1 auto; height: 42px; }
  .kpis, .kpis.k3, .kpis.k5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
  .kpi { padding: 14px; border-radius: calc(18px * var(--rs)); }
  .kpi-top { margin-bottom: 10px; }
  .kpi-ico { width: 32px; height: 32px; border-radius: calc(10px * var(--rs)); }
  .kpi-go, .kpi-dark::after { display: none; }
  .kpi-label { font-size: 12px; }
  .kpi-value { font-size: 22px; }
  .kpi-row { gap: 6px; }
  .kpi-delta { font-size: 10.5px; padding: 2px 6px 2px 4px; }
  .kpi-foot { font-size: 11.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .kpi-spark { margin: 8px -14px -14px; height: 34px; }
  .kpi-spark .spark { height: 34px; }
  .mini-stats { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; margin-left: -16px; margin-right: -16px; padding: 2px 16px 4px; scrollbar-width: none; }
  .mini-stats::-webkit-scrollbar { display: none; }
  .mini-stats > .ms { flex: 0 0 auto; min-width: 148px; max-width: 74vw; scroll-snap-align: start; }
  .dr-hero .mini-stats, .dr-body .mini-stats { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  .ms { padding: 11px 13px; border-radius: calc(15px * var(--rs)); }
  .ms-v { font-size: 16px; }
  .hero { min-height: 0; border-radius: calc(24px * var(--rs)); margin-bottom: 12px; }
  .hero-in { padding: 20px 18px 22px; min-height: 0; }
  .hero::before { background: linear-gradient(180deg, color-mix(in oklab, var(--bg) 90%, transparent) 0%, color-mix(in oklab, var(--bg) 82%, transparent) 65%, color-mix(in oklab, var(--bg) 60%, transparent)); }
  .hero h1 { font-size: 30px; }
  .hero-brief { font-size: 14px; margin-top: 10px; }
  .hero-date { margin-bottom: 12px; font-size: 12px; }
  .grid { gap: 12px; }
  .mb { margin-bottom: 12px; }
  .card { border-radius: calc(20px * var(--rs)); }
  .card-head { padding: 16px 16px 0; }
  .card-body { padding: 14px 16px 16px; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .qa { padding: 12px; gap: 10px; border-radius: calc(16px * var(--rs)); }
  .qa .ico-tile { width: 32px; height: 32px; }
  .qa-s { display: none; }
  .main { overflow-x: clip; max-width: 100vw; }
  .donut-wrap { justify-content: center; gap: 14px; }
  .donut-wrap .legend { flex: 1 1 100%; min-width: 0; width: 100%; }
  .notice .nowrap { white-space: normal; }
  .card-head { flex-wrap: wrap; row-gap: 10px; }
  .card-head > div:first-child { flex: 1 1 60%; min-width: 0; }
  .card-actions:has(.seg) { flex: 1 1 100%; }
  .card-actions .seg { width: 100%; }
  .card-actions .seg .seg-opt { flex: 1 1 0; }
  .card-actions .seg .seg-opt span { justify-content: center; }
  .chart-tip { min-width: 150px; }

  /* ---- toolbars & controls ---- */
  .toolbar { gap: 8px; margin-bottom: 12px; }
  .toolbar .search { flex: 1 1 100%; }
  .search .input { min-width: 0; width: 100%; }
  .toolbar .chips, .cal-tools .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px; scrollbar-width: none; flex: 1 1 100%; max-width: none; }
  .toolbar .chips::-webkit-scrollbar, .cal-tools .chips::-webkit-scrollbar { display: none; }
  .toolbar .spacer { display: none; }
  .toolbar .select-wrap { flex: 1 1 calc(50% - 4px); width: auto !important; }
  .toolbar > .seg { flex: 1 1 100%; overflow-x: auto; }
  .toolbar > .switch { margin-left: auto; }
  .input, textarea.input, select.input, .composer textarea, .cmdk-in input { font-size: 16px !important; }
  .input { height: 46px; border-radius: calc(13px * var(--rs)); }
  textarea.input { height: auto; }
  .btn { height: 42px; }
  .btn-sm { height: 36px; }
  .chip { height: 34px; padding: 0 13px; }
  .seg-opt span { height: 34px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .switch i { width: 46px; height: 28px; }
  .switch i::after { width: 22px; height: 22px; }
  .switch input:checked + i::after { transform: translateX(18px); }

  /* ---- tables become native card lists ---- */
  .card.flush .card-body { padding: 0; }
  .tbl.dt, .tbl.dt tbody { display: block; width: 100%; }
  .tbl.dt thead { display: none; }
  .tbl.dt tbody tr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .tbl.dt tbody tr:last-child { border-bottom: 0; }
  .tbl.dt tbody tr[data-row]:active { background: var(--surface-2); }
  .tbl.dt td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 !important; border: 0; min-width: 0; font-size: 13.5px; text-align: right; }
  .tbl.dt td::before { content: attr(data-label); font-size: 12.5px; color: var(--text-3); font-weight: 500; flex: none; text-align: left; }
  .tbl.dt td:first-child { padding-bottom: 3px !important; text-align: left; }
  .tbl.dt td:first-child::before, .tbl.dt td[data-label=""]::before, .tbl.dt .empty-row td::before { display: none; }
  .tbl.dt td[data-label=""] { justify-content: flex-end; }
  .tbl.dt td:first-child .cell-txt .cell-t, .tbl.dt td:first-child .cell-txt .cell-s { max-width: none; white-space: normal; }
  .tbl.dt .empty-row { display: block !important; padding: 0 !important; }
  .tbl.dt .stock { min-width: 0; flex: 1; justify-content: flex-end; }
  .tbl.dt .stock .prog { max-width: 120px; }
  .tbl.dt td > div[style*="min-width"] { min-width: 0 !important; }
  .tbl:not(.dt) { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card.flush .tbl:not(.dt) th:first-child, .card.flush .tbl:not(.dt) td:first-child { padding-left: 16px; }
  .perm th:first-child, .perm td:first-child { padding-left: 14px; position: sticky; left: 0; background: var(--surface); z-index: 1; }

  /* ---- kanban ---- */
  .kb { margin: 0 -16px; padding: 2px 16px 16px; scroll-snap-type: x mandatory; scroll-padding: 0 16px; gap: 10px; }
  .kb-col { flex: 0 0 84vw; max-width: none; max-height: none; scroll-snap-align: start; border-radius: calc(22px * var(--rs)); }
  .kb-list { overflow: visible; }
  .kb-card { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: pan-x pan-y; border-radius: calc(16px * var(--rs)); }
  .btn, .icon-btn, .tb-tab, .tb-fab, .more-tile, .seg, .tab, .chip, .dr-back, .menu-item, .li, .cmdk-item { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .kb-card.pressing { transform: scale(.965); box-shadow: 0 0 0 2px var(--accent-line), var(--sh-2); transition: transform .5s var(--ease), box-shadow .3s; }
  .kb-add { height: 42px; }
  .touch-hint { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); margin: -2px 0 10px; }
  .touch-hint .i { color: var(--accent); }

  /* ---- record detail = full-screen native page ---- */
  .ov-drawer { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .ov-drawer.out { animation: none; }
  .drawer { inset: 0; width: 100vw; height: 100%; border-radius: 0; border: 0; box-shadow: none; animation: pageIn .5s var(--drawer); transition: transform .35s var(--drawer); }
  .ov-drawer.out .drawer { animation: pageOut .34s var(--ease-io) forwards; }
  /* one scroll container for the whole page: sticky nav bar + sticky tabs + sticky footer */
  .dr-inner { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; --drtop: calc(env(safe-area-inset-top) + 52px); }
  .dr-inner > * { flex-shrink: 0; }
  .dr-head { display: contents; }
  .dr-top { position: sticky; top: 0; z-index: 6; height: var(--drtop); margin: 0; padding: calc(env(safe-area-inset-top) + 6px) 16px 6px; gap: 8px; background: color-mix(in oklab, var(--surface) 0%, transparent); border-bottom: 1px solid transparent; transition: background .25s, border-color .25s; }
  .drawer.scrolled .dr-top { background: color-mix(in oklab, var(--surface) 84%, transparent); backdrop-filter: blur(22px) saturate(1.7); -webkit-backdrop-filter: blur(22px) saturate(1.7); border-bottom-color: var(--line); }
  .dr-mtitle { display: block; flex: 1; min-width: 0; text-align: center; font-size: 16px; font-weight: 650; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .3s var(--ease); }
  .dr-mtitle .av, .dr-mtitle .i, .dr-mtitle .pill { display: none; }
  .drawer.scrolled .dr-mtitle { opacity: 1; transform: none; }
  .dr-title { margin: 2px 16px 0; }
  .dr-meta { margin: 10px 16px 0; }
  .dr-head + * { margin-top: 14px; }
  .dr-back { display: inline-flex; align-items: center; gap: 0; height: 40px; padding: 0 10px 0 0; margin-left: -8px; border: 0; background: none; color: var(--accent-ink); font-size: 16.5px; font-weight: 550; letter-spacing: -.01em; }
  .dr-back:active { opacity: .5; }
  .dr-kicker, .dr-tools [data-dclose] { display: none; }
  .dr-tools .icon-btn { width: 40px; height: 40px; border-radius: calc(13px * var(--rs)); }
  .dr-title { font-size: 23px; line-height: 1.2; }
  .dr-title .av-lg { width: 40px; height: 40px; }
  .dr-meta { gap: 6px 8px; font-size: 12.5px; }
  .dr-meta .sep { display: none; }
  .dr-hero { margin: 0 16px 8px; padding: 12px; border-radius: calc(18px * var(--rs)); }
  .dr-hero:has(> .row) { overflow: hidden; }
  .dr-hero > .mini-stats { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; scroll-padding-left: 16px; }
  .dr-hero .row { flex-wrap: nowrap; }
  .dr-hero .row > .mini-stats { flex: 1 1 0; min-width: 0; margin-right: -12px; padding-right: 12px; }
  .dr-tabs { position: sticky; top: var(--drtop); z-index: 5; padding: 0 16px; background: color-mix(in oklab, var(--surface) 84%, transparent); backdrop-filter: blur(22px) saturate(1.7); -webkit-backdrop-filter: blur(22px) saturate(1.7); }
  .dr-tabs .tab { height: 44px; padding: 0 10px; }
  .dr-body { flex: 1 0 auto; overflow: visible; min-height: auto; padding: 16px 16px 28px; }
  .dr-foot { position: sticky; bottom: 0; z-index: 5; margin-top: auto; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); gap: 8px; background: color-mix(in oklab, var(--surface-2) 84%, transparent); backdrop-filter: blur(22px) saturate(1.7); -webkit-backdrop-filter: blur(22px) saturate(1.7); }
  .dr-foot .spacer { display: none; }
  .dr-foot .btn { flex: 1 1 calc(50% - 4px); height: 46px; min-width: 0; }
  .dr-foot .btn span { overflow: hidden; text-overflow: ellipsis; }
  .dr-foot .btn-primary { flex: 1 1 calc(50% - 4px); order: 10; }
  .dr-foot .btn-ghost { flex: 0 0 auto; order: 9; padding: 0 16px; }
  .facts, .facts.f3 { grid-template-columns: minmax(0, 1fr); }
  .stepper { overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .stepper::-webkit-scrollbar { display: none; }
  .step { min-width: 82px; }
  .paper-wrap { padding: 8px; margin: 0 -8px; }
  .paper { padding: 26px 20px; font-size: 11px; }
  .pp-head { flex-direction: column; gap: 14px; }
  .pp-company { text-align: left; }
  .pp-title { flex-direction: column; align-items: flex-start; gap: 6px; }
  .pp-parties { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .pp-table { display: block; overflow-x: auto; }
  .pp-totals { width: 100%; }
  .pp-title > div { text-align: left !important; }
  .pp-stamp { top: 30px; right: 16px; font-size: 11px; padding: 4px 10px; border-width: 2px; border-radius: calc(8px * var(--rs)); }
  .composer { margin-bottom: 14px; }
  .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }

  /* ---- modal = bottom sheet ---- */
  .ov-modal { padding: 0; align-items: end; backdrop-filter: none; -webkit-backdrop-filter: none; overflow: hidden; }
  .modal { max-width: none !important; width: 100%; max-height: calc(100dvh - env(safe-area-inset-top) - 16px); border-radius: 28px 28px 0 0; border: 0; animation: sheetIn .55s var(--drawer); transition: transform .35s var(--drawer); }
  .ov-modal.out .modal { animation: sheetOut .3s var(--ease-io) forwards; }
  .md-grab { display: flex; }
  .md-head { padding: 2px 18px 4px; gap: 12px; touch-action: none; }
  .md-ico { width: 36px; height: 36px; border-radius: calc(11px * var(--rs)); }
  .md-title { font-size: 18px; }
  .md-x { display: none; }
  .md-body { padding: 12px 18px 18px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .md-foot { padding: 10px 18px calc(12px + env(safe-area-inset-bottom)); gap: 8px; }
  .md-foot .spacer { display: none; }
  .md-foot .btn { height: 48px; flex: 1 1 0; border-radius: calc(14px * var(--rs)); }
  .md-foot .btn-ghost { flex: 0 0 auto; }

  /* ---- toasts as snackbars docked above the bottom chrome ---- */
  .toasts, body.has-drawer .toasts, body.has-modal .toasts { top: auto; bottom: var(--toast-b, calc(var(--tab-h) + 10px)); left: 10px; right: 10px; align-items: stretch; transition: bottom .3s var(--drawer); }
  .toast { width: auto; max-width: none; border-radius: calc(18px * var(--rs)); padding: 12px 10px 14px 14px; animation: toastIn .5s var(--spring); transition: transform .3s var(--drawer), opacity .3s; }
  .toast.dragging { transition: none; }
  .toast.out { animation: toastOutDown .28s ease forwards; }
  .toast.out.flung { animation: none; opacity: 0; }
  .toast-x { width: 32px; height: 32px; margin: -4px -2px -4px 0; }
  .toast-act { height: 34px; padding: 0 12px; }

  /* ---- command palette = full screen search ---- */
  .cmdk-ov { padding: 0; align-items: stretch; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); }
  .cmdk { max-width: none; border-radius: 0; height: 100dvh; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); border: 0; box-shadow: none; background: var(--surface); animation: fadeIn .2s ease; }
  .cmdk-in { height: 58px; padding: 0 10px 0 16px; }
  .cmdk-in .kbds { display: none; }
  .cmdk-cancel { display: block; border: 0; background: none; color: var(--accent-ink); font-size: 16px; font-weight: 550; padding: 8px 6px; }
  .cmdk-list { max-height: none; flex: 1; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .cmdk-item { padding: 10px; }
  .cmdk-foot { display: none; }

  /* ---- module specifics ---- */
  .cal-tools { gap: 8px; }
  .cal-title { order: 0; flex: 1 1 100%; min-width: 0; font-size: 20px; }
  .cal-tools > .row { order: 1; }
  .cal-tools > .seg { order: 2; margin-left: auto; }
  .cal-tools .chips { order: 4; }
  .cal-tools .select-wrap { order: 5; flex: 1 1 100%; width: auto !important; }
  .cal-tools .spacer { display: none; }
  .cal-month { border-radius: calc(18px * var(--rs)); }
  .cal-dow { padding: 8px 2px; text-align: center; font-size: 10px; }
  .cal-cell { min-height: 54px; padding: 5px 3px; flex-direction: row; flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: 3px; }
  .cal-n { flex-basis: 100%; width: auto; height: 24px; margin: 0 auto 2px; font-size: 13px; }
  .cal-cell.today .cal-n { width: 26px; flex-basis: auto; margin: 0 calc(50% - 13px) 2px; }
  .cal-ev { width: 6px; height: 6px; padding: 0; border: 0; border-radius: 50%; background: var(--c); }
  .cal-ev .t, .cal-ev span, .cal-more, .cal-add { display: none; }
  .cal-ev.done { opacity: .4; }
  .agenda-day h4 { font-size: 14px; }
  .gantt { grid-template-columns: 132px minmax(0, 1fr); margin: 0 -16px; border-radius: 0; border-left: 0; border-right: 0; }
  .gt-row-l { padding: 0 10px; font-size: 12px; gap: 6px; }
  .gt-row-l.phase { padding-left: 14px; }
  .gt-row-l .ring, .gt-row-l .pill { display: none; }
  #ibDetail { display: none; }
  .inbox-list { max-height: none; }
  .ib-item { padding: 14px 14px 14px 26px; }
  .integr { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .doc-nav, .set-nav { display: flex; overflow-x: auto; gap: 6px; padding: 6px 16px; margin: 0 -16px; border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; background: transparent; scrollbar-width: none; }
  .doc-nav::-webkit-scrollbar, .set-nav::-webkit-scrollbar { display: none; }
  .doc-nav .dn-item, .set-nav .dn-item { width: auto; flex: none; white-space: nowrap; height: 38px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 99px; }
  .doc-nav .dn-item.on, .set-nav .dn-item.on { background: var(--text); color: var(--bg); border-color: var(--text); }
  .doc-nav .dn-item .c { color: inherit; opacity: .6; }
  .doc-storage, .doc-nav .menu-sep { display: none !important; }
  .files { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .file-meta { padding: 9px 10px 10px; }
  .drop { padding: 14px; gap: 12px; }
  .drop .sim-badge { display: none; }
  .set-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .stage-edit { grid-template-columns: 22px 1fr; }
  .stage-edit .swatches { grid-column: 2; } .stage-edit .input-adorn, .stage-edit > .pill, .stage-edit > .tiny { grid-column: 2; }
  .feature-row { grid-template-columns: 1fr auto; }
  .proj-card > .ring { top: 98px; }
  .team-card { padding: 16px; }
  .fn-row { grid-template-columns: 92px 1fr; gap: 8px; }
  .fn-label { font-size: 12px; }

  /* ---- quote builder ---- */
  .qb { gap: 14px; }
  .qb-items { border: 0; overflow: visible; display: grid; gap: 10px; }
  .qb-row.head, .qb-n { display: none; }
  .qb-row { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "desc desc del" "type qty unit" "price cost sum"; gap: 10px 8px; padding: 12px; border: 1px solid var(--line); border-radius: calc(18px * var(--rs)); }
  .qb-row:last-child { border-bottom: 1px solid var(--line); }
  .qb-desc { grid-area: desc; } .qb-type { grid-area: type; } .qb-qty { grid-area: qty; } .qb-unit { grid-area: unit; }
  .qb-price { grid-area: price; } .qb-cost { grid-area: cost; } .qb-sum { grid-area: sum; align-self: end; padding-bottom: 13px; font-size: 14px; }
  .qb-del { grid-area: del; justify-self: end; align-self: end; margin-bottom: 4px; }
  .qb-f::before { content: attr(data-cap); display: block; font-size: 11.5px; color: var(--text-3); font-weight: 550; margin-bottom: 5px; }
  .qb-type .select-ico { top: auto; bottom: 15px; transform: none; }
  .qb:not(.show-cost) .qb-cost { display: none; }
  .qb-row .input { height: 44px; padding: 0 10px; }
  .sumcard { border-radius: calc(20px * var(--rs)); }
  .sum-total .v { font-size: 26px; }

  /* ---- login ---- */
  .login { min-height: 100dvh; }
  .login-panel { padding: 0 20px calc(22px + env(safe-area-inset-bottom)); }
  .login-mhero { display: block; position: relative; height: 32vh; min-height: 200px; margin: 0 -20px 4px; overflow: hidden; border-radius: 0 0 30px 30px; }
  .login-mhero img { width: 100%; height: 100%; object-fit: cover; object-position: 66% 40%; animation: kenburns 20s ease-out both; }
  .login-mhero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 253, 249, 0) 45%, var(--surface)); }
  .login-logo { position: relative; z-index: 1; margin-top: -22px; }
  .login-main { padding: 22px 0 18px; }
  .login-kicker { margin-bottom: 12px; }
  .login h1 { font-size: 32px; }
  .login-lead { font-size: 14px; margin-top: 12px; }
  .accts { margin-top: 20px; }
  .acct { padding: 12px; border-radius: calc(18px * var(--rs)); }
  .login-foot { flex-direction: column; align-items: center; gap: 4px; text-align: center; }

  .spotlight-tip { max-width: 78vw; white-space: normal; }
  .empty { padding: 34px 16px; }

  /* notch / rounded corners in landscape */
  .page { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .tb { padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .tb-brand { left: max(18px, env(safe-area-inset-left)); }
  .tabbar { padding-left: max(4px, env(safe-area-inset-left)); padding-right: max(4px, env(safe-area-inset-right)); }
  .drawer { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
}

/* phone in landscape: little height, so keep chrome compact */
@media (max-height: 500px) and (pointer: coarse) {
  .dr-foot { flex-wrap: nowrap; }
  .dr-foot .btn, .dr-foot .btn-primary { flex: 1 1 0; height: 42px; order: 0; }
  .dr-foot .btn-ghost { flex: 0 0 auto; }
  .modal, .sheet { max-width: 620px !important; margin: 0 auto; }
  .ov-modal { justify-items: center; }
  .login-mhero { min-height: 0; height: 36vh; }
}

/* touch devices: no sticky hover states, press feedback instead */
@media (hover: none) {
  .spot::before, .spot::after, .btn-primary::after { display: none; }
  .cmdk-item .ci-r, .cmdk-item.on::before { display: none; }
  .cmdk-item.on { background: transparent; }
  .btn:hover:not(:disabled), .icon-btn:hover, a.kpi[href]:hover, .kb-card:hover, .proj-card:hover, .qa:hover, .file:hover, .supplier-card:hover, .acct:hover, .glass-chip:hover, .tb-search:hover, .guide-card:hover, .cal-ev:hover, .cw-ev:hover, .gt-bar:hover { transform: none; }
  .btn-primary:hover:not(:disabled) { filter: none; }
  .kb-card:hover { box-shadow: var(--sh-1); border-color: var(--line); }
  .proj-card:hover .pc-cover img, .file:hover .file-thumb img, .ph-tile:hover img, .qa:hover .ico-tile { transform: none; }
  .qa:hover .ico-tile { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
  a.li:hover, button.li:hover, .li.click:hover { padding-left: 4px; padding-right: 4px; background: transparent; border-color: var(--line); }
  a.li:active, button.li:active, .li.click:active { background: var(--surface-2); }
  .btn:active:not(:disabled) { transform: scale(.96); }
  .kb-card:active, .proj-card:active, .file:active, .qa:active, a.kpi[href]:active, .supplier-card:active, .acct:active, .ib-item:active { transform: scale(.98); transition-duration: .15s; }
}

/* ---------------- print (quotes / invoices → PDF) ---------------- */
#print-root { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  #print-root .paper { box-shadow: none; max-width: none; padding: 0; border-radius: 0; }
  #print-root .paper::before { display: none; }
}


/* =====================================================================
   VORNIO — značka firmy, ilustrácia, moduly vo vývoji, náhľad
   ===================================================================== */
.brand-mark { flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: calc(11px * var(--rs)); background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 14.5px; letter-spacing: -.02em; line-height: 1; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 16px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.brand-mark.has-logo { background: #fff; box-shadow: inset 0 0 0 1px var(--line-2); overflow: hidden; }
.brand-mark.has-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.brand-lockup { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; gap: 2px; }
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -.02em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 168px; }
.brand-sub { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.sb-logo { height: auto; display: flex; min-width: 0; }
.tb-brand .brand-sub { display: none; }
.tb-brand .brand-mark { width: 30px; height: 30px; font-size: 12px; }
.login-logo .brand-mark { width: 46px; height: 46px; font-size: 17px; border-radius: calc(13px * var(--rs)); }
.login-logo .brand-name { font-size: 18px; max-width: 320px; }
.splash .brand-mark.splash-mark { width: 84px; height: 84px; font-size: 30px; border-radius: calc(24px * var(--rs)); animation: pop .7s var(--spring) both; }
.splash-word { max-width: 90vw; flex-wrap: wrap; justify-content: center; }
.pp-logo-text { font-size: 22px; font-weight: 700; letter-spacing: -.03em; color: #16130f; }
.set-logo.brand-mark { width: 64px; height: 64px; font-size: 22px; border-radius: calc(16px * var(--rs)); }

.art-bg { position: absolute; inset: 0; overflow: hidden; color: var(--text-3); background: radial-gradient(90% 80% at 88% 8%, var(--accent-soft-2), transparent 62%), var(--surface-3); }
.art-bg .c-art, .hero-art .c-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-visual { background: var(--surface-3); }
.login-visual .art-bg { animation: kenburns 22s ease-out both; }
.login-mhero .art-bg { border-radius: inherit; }
.hero { background: var(--surface-2); }
.hero-art { color: var(--text-3); }
.hero-art .c-art { opacity: .95; }

.setup-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; text-align: center; }
.setup-mark.brand-mark { width: 72px; height: 72px; font-size: 26px; border-radius: calc(20px * var(--rs)); animation: pop .7s var(--spring) both; }
.setup-title { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.setup-bar { width: 220px; height: 4px; border-radius: 99px; background: var(--track); overflow: hidden; }
.setup-bar i { display: block; height: 100%; width: 40%; background: var(--accent); border-radius: 99px; animation: setupSlide 1.1s var(--ease-io) infinite; }
@keyframes setupSlide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

.soon-card .card-body { padding: 28px; }
.soon-badge { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12.5px; font-weight: 600; border: 1px solid var(--accent-line); }
.soon-h { margin-top: 18px; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.soon-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.soon-list li { display: flex; gap: 10px; align-items: center; font-size: 14.5px; }
.soon-list .i { color: var(--accent); }

/* živý náhľad v konfigurátore – bez rušivých animácií pozadia */
html.is-preview .ambient { display: none; }

/* =====================================================================
   ŠABLÓNY — rovnaký systém, iný vzhľad.  html[data-template="…"]
   Nezávislé od režimu: písmo, zaoblenie, akcent.  Svetlý/tmavý: neutrálne farby.
   ===================================================================== */

/* ---------- Terra (pôvodný vzhľad) – len predvolené tokeny ---------- */
html[data-template="terra"] { --accent: #e16010; }

/* ---------- Betón: chladná šedá, grafitový panel, jantárový akcent ---------- */
html[data-template="beton"] { --font: 'Inter', ui-sans-serif, system-ui, sans-serif; --serif: 'Inter', ui-sans-serif, sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace; --rs: .8; --accent: #d97706; --accent-3: #64748b; }
html[data-template="beton"]:not([data-theme="dark"]) {
  --bg: #eceef1; --surface: #ffffff; --surface-2: #f6f7f9; --surface-3: #eceef2;
  --line: rgba(17, 24, 39, .08); --line-2: rgba(17, 24, 39, .13); --line-3: rgba(17, 24, 39, .22);
  --text: #111418; --text-2: #4b5360; --text-3: #8a919c; --track: rgba(17, 24, 39, .07); --gray-soft: rgba(17, 24, 39, .05);
  --sh-1: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 1px 2px rgba(17, 24, 39, .05), 0 3px 10px -4px rgba(17, 24, 39, .07);
  --sh-2: 0 1px 2px rgba(17, 24, 39, .06), 0 12px 28px -10px rgba(17, 24, 39, .18);
  --sh-3: 0 2px 6px rgba(17, 24, 39, .07), 0 30px 70px -18px rgba(17, 24, 39, .32);
  --glass: rgba(255, 255, 255, .7); --glass-strong: rgba(255, 255, 255, .9); --scrim: rgba(10, 12, 16, .35);
}
html[data-template="beton"][data-theme="dark"] {
  --bg: #0f1114; --surface: #171a1e; --surface-2: #1c2025; --surface-3: #23272d;
  --line: rgba(230, 236, 245, .07); --line-2: rgba(230, 236, 245, .11); --line-3: rgba(230, 236, 245, .19);
  --text: #eef1f5; --text-2: #aab1bc; --text-3: #737b87; --track: rgba(230, 236, 245, .08); --gray-soft: rgba(230, 236, 245, .07);
  --glass: rgba(23, 26, 30, .66); --glass-strong: rgba(28, 32, 37, .9);
}

/* ---------- Plán: technický výkres, námornícky panel, ostré hrany ---------- */
html[data-template="plan"] { --font: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif; --serif: 'IBM Plex Serif', Georgia, serif; --mono: 'IBM Plex Mono', ui-monospace, monospace; --rs: .5; --accent: #0284c7; --accent-3: #1e3a5f; }
html[data-template="plan"]:not([data-theme="dark"]) {
  --bg: #eef3f8; --surface: #ffffff; --surface-2: #f5f8fb; --surface-3: #e9eff6;
  --line: rgba(15, 42, 74, .1); --line-2: rgba(15, 42, 74, .16); --line-3: rgba(15, 42, 74, .26);
  --text: #0b1f33; --text-2: #3f5873; --text-3: #7b8ea3; --track: rgba(15, 42, 74, .08); --gray-soft: rgba(15, 42, 74, .05);
  --sh-1: 0 1px 2px rgba(15, 42, 74, .05); --sh-2: 0 1px 2px rgba(15, 42, 74, .06), 0 10px 24px -12px rgba(15, 42, 74, .2); --sh-3: 0 2px 6px rgba(15, 42, 74, .08), 0 28px 60px -20px rgba(15, 42, 74, .32);
  --glass: rgba(255, 255, 255, .72); --glass-strong: rgba(255, 255, 255, .92); --scrim: rgba(8, 20, 36, .35);
}
html[data-template="plan"][data-theme="dark"] {
  --bg: #081627; --surface: #0e2036; --surface-2: #12273f; --surface-3: #183049;
  --line: rgba(190, 220, 255, .08); --line-2: rgba(190, 220, 255, .13); --line-3: rgba(190, 220, 255, .22);
  --text: #e8f1fb; --text-2: #9fb6cf; --text-3: #6a829c; --track: rgba(190, 220, 255, .08); --gray-soft: rgba(190, 220, 255, .07);
  --glass: rgba(14, 32, 54, .7); --glass-strong: rgba(18, 39, 63, .92);
}
html[data-template="plan"] body { background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 32px 32px; background-attachment: fixed; }
html[data-template="plan"] .ambient { display: none; }

/* ---------- Mach: prírodná šalviová, mäkké tvary ---------- */
html[data-template="mach"] { --font: 'Manrope', ui-sans-serif, system-ui, sans-serif; --serif: 'Fraunces', Georgia, serif; --mono: 'JetBrains Mono', ui-monospace, monospace; --rs: 1.25; --accent: #3f7d4e; --accent-3: #a3a36b; }
html[data-template="mach"]:not([data-theme="dark"]) {
  --bg: #eef0e8; --surface: #fbfcf7; --surface-2: #f5f7f0; --surface-3: #eaede2;
  --line: rgba(36, 48, 30, .08); --line-2: rgba(36, 48, 30, .13); --line-3: rgba(36, 48, 30, .22);
  --text: #18200f; --text-2: #4f5a45; --text-3: #8b9480; --track: rgba(36, 48, 30, .07); --gray-soft: rgba(36, 48, 30, .05);
  --glass: rgba(251, 252, 247, .7); --glass-strong: rgba(251, 252, 247, .9);
}
html[data-template="mach"][data-theme="dark"] {
  --bg: #0d110c; --surface: #151a13; --surface-2: #1a2018; --surface-3: #21281e;
  --line: rgba(230, 240, 220, .07); --line-2: rgba(230, 240, 220, .11); --line-3: rgba(230, 240, 220, .19);
  --text: #eef3e8; --text-2: #aeb8a4; --text-3: #788270; --track: rgba(230, 240, 220, .08); --gray-soft: rgba(230, 240, 220, .07);
  --glass: rgba(21, 26, 19, .66); --glass-strong: rgba(26, 32, 24, .9);
}

/* ---------- Tehla: výrazný panel vo farbe značky ---------- */
html[data-template="tehla"] { --font: 'DM Sans', ui-sans-serif, system-ui, sans-serif; --serif: 'DM Serif Display', Georgia, serif; --mono: 'DM Mono', ui-monospace, monospace; --rs: 1.05; --accent: #b5432a; --accent-3: #c89b6d; }
html[data-template="tehla"]:not([data-theme="dark"]) {
  --bg: #f4f1ee; --surface: #ffffff; --surface-2: #faf8f6; --surface-3: #f1ece7;
  --line: rgba(40, 24, 18, .08); --line-2: rgba(40, 24, 18, .13); --line-3: rgba(40, 24, 18, .22);
  --text: #1d1410; --text-2: #5f4f47; --text-3: #9a8a81; --track: rgba(40, 24, 18, .07); --gray-soft: rgba(40, 24, 18, .05);
}

/* ---------- Oceľ: tmavý grafit, elektrická modrá ---------- */
html[data-template="ocel"] { --font: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif; --serif: 'Space Grotesk', ui-sans-serif, sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace; --rs: .85; --accent: #3b82f6; --accent-3: #64748b; }
html[data-template="ocel"][data-theme="dark"] {
  --bg: #0a0d12; --surface: #111620; --surface-2: #151b26; --surface-3: #1b2230;
  --line: rgba(200, 215, 240, .07); --line-2: rgba(200, 215, 240, .11); --line-3: rgba(200, 215, 240, .19);
  --text: #eaf0fa; --text-2: #a3afc3; --text-3: #6c7890; --track: rgba(200, 215, 240, .08); --gray-soft: rgba(200, 215, 240, .07);
  --glass: rgba(17, 22, 32, .68); --glass-strong: rgba(21, 27, 38, .92);
}
html[data-template="ocel"]:not([data-theme="dark"]) {
  --bg: #eef1f6; --surface: #ffffff; --surface-2: #f6f8fb; --surface-3: #eaeef5;
  --line: rgba(15, 23, 42, .08); --line-2: rgba(15, 23, 42, .13); --line-3: rgba(15, 23, 42, .22);
  --text: #0c1220; --text-2: #4a5568; --text-3: #8792a6; --track: rgba(15, 23, 42, .07); --gray-soft: rgba(15, 23, 42, .05);
}

/* ---------- Asfalt: tmavý asfalt, bezpečnostná žltá ---------- */
html[data-template="asfalt"] { --font: 'Archivo', ui-sans-serif, system-ui, sans-serif; --serif: 'Archivo', ui-sans-serif, sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace; --rs: .7; --accent: #facc15; --accent-3: #a8a29e; }
html[data-template="asfalt"][data-theme="dark"] {
  --bg: #0c0c0d; --surface: #151516; --surface-2: #1a1a1c; --surface-3: #222224;
  --line: rgba(255, 255, 240, .07); --line-2: rgba(255, 255, 240, .11); --line-3: rgba(255, 255, 240, .2);
  --text: #f5f5f0; --text-2: #b0b0a8; --text-3: #77776f; --track: rgba(255, 255, 240, .08); --gray-soft: rgba(255, 255, 240, .07);
  --accent-ink: color-mix(in oklab, var(--accent) 88%, white);
  --glass: rgba(21, 21, 22, .68); --glass-strong: rgba(26, 26, 28, .92);
}
html[data-template="asfalt"]:not([data-theme="dark"]) {
  --bg: #efefec; --surface: #ffffff; --surface-2: #f7f7f5; --surface-3: #ececea;
  --line: rgba(20, 20, 18, .09); --line-2: rgba(20, 20, 18, .14); --line-3: rgba(20, 20, 18, .24);
  --text: #121211; --text-2: #4f4f4a; --text-3: #8c8c85; --track: rgba(20, 20, 18, .07); --gray-soft: rgba(20, 20, 18, .05);
  --accent-ink: color-mix(in oklab, var(--accent) 55%, black);
}
html[data-template="asfalt"] .sb-item.on .i, html[data-template="asfalt"] .hero h1 em { color: var(--accent-ink); }
html[data-template="asfalt"] .ambient .amb-grain { opacity: .08; }

/* ---------- tmavý bočný panel (Betón, Plán – vo svetlom režime) ---------- */
html[data-template="beton"]:not([data-theme="dark"]) .sb,
html[data-template="plan"]:not([data-theme="dark"]) .sb {
  --text: #eef0f3; --text-2: #b4bac4; --text-3: #7f8792; --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .12); --line-3: rgba(255, 255, 255, .2);
  --gray-soft: rgba(255, 255, 255, .07); --surface: #2a2e35; --surface-2: #30353d; --surface-3: #383d46;
  background: #1b1e23; border-right-color: #121418; color: var(--text); backdrop-filter: none; -webkit-backdrop-filter: none;
}
html[data-template="plan"]:not([data-theme="dark"]) .sb {
  --text: #e8f1fb; --text-2: #a9c0d8; --text-3: #6f8aa6; --surface: #16365a; --surface-2: #1a3d64; --surface-3: #21486f;
  background: #0f2a4a; border-right-color: #0a1f37;
}
html[data-template="beton"]:not([data-theme="dark"]) .sb-ind,
html[data-template="plan"]:not([data-theme="dark"]) .sb-ind {
  background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 26%, transparent), color-mix(in srgb, var(--accent) 6%, transparent) 70%), var(--surface);
  box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--accent) 60%, transparent);
}

/* ---------- panel vo farbe značky (Tehla – svetlý režim) ---------- */
html[data-template="tehla"]:not([data-theme="dark"]) .sb {
  --text: var(--on-accent); --text-2: color-mix(in srgb, var(--on-accent) 82%, transparent); --text-3: color-mix(in srgb, var(--on-accent) 62%, transparent);
  --line: color-mix(in srgb, var(--on-accent) 16%, transparent); --line-2: color-mix(in srgb, var(--on-accent) 24%, transparent);
  --gray-soft: color-mix(in srgb, var(--on-accent) 10%, transparent); --surface: color-mix(in srgb, var(--on-accent) 14%, transparent); --surface-3: color-mix(in srgb, var(--on-accent) 14%, transparent);
  background: var(--accent); border-right-color: transparent; color: var(--text); backdrop-filter: none; -webkit-backdrop-filter: none;
}
html[data-template="tehla"]:not([data-theme="dark"]) .sb-ind { background: color-mix(in srgb, var(--on-accent) 16%, transparent); border-color: color-mix(in srgb, var(--on-accent) 30%, transparent); box-shadow: none; }
html[data-template="tehla"]:not([data-theme="dark"]) .sb-ind::before { background: var(--on-accent); }
html[data-template="tehla"]:not([data-theme="dark"]) .sb-item.on .i { color: var(--on-accent); }
html[data-template="tehla"]:not([data-theme="dark"]) .sb .btn-primary { background: var(--on-accent); color: var(--accent); border-color: transparent; text-shadow: none; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .4); }
html[data-template="tehla"]:not([data-theme="dark"]) .sb-count.hot { background: var(--on-accent); color: var(--accent); }
html[data-template="tehla"]:not([data-theme="dark"]) .sb .brand-mark { background: var(--on-accent); color: var(--accent); }

/* značka v bočnom paneli: celé logo, v zbalenom paneli len značka */
.sb-head .sb-mark.brand-mark { display: none; }
body.sb-collapsed .sb-head .sb-mark.brand-mark { display: inline-grid; }

/* po skrytí widgetu vypnutého modulu sa zvyšná karta roztiahne na celú šírku */
.grid > .card:only-child { grid-column: 1 / -1; }

/* stav ukladania na server */
.save-state { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.save-state[data-state="saving"], .save-state[data-state="dirty"] { color: var(--accent-ink); }
.save-state[data-state="error"] { color: var(--red); }
@media (max-width: 1100px) { .save-state span { display: none; } }
