/* =========================================================
   WINDBORNE HUB — DESIGN SYSTEM
   Brand: Optician Sans (display) · Geist (body) · Geist Mono (labels)
   #0A0908 ink · #08B9EF accent · #F2F4F3 paper · #222222 surface
   ========================================================= */

@font-face { font-family: "Optician Sans"; src: url("../fonts/OpticianSans-Regular.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/Geist-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; src: url("../fonts/Geist-latin-ext.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/GeistMono-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --font-display: "Optician Sans", "Geist", system-ui, sans-serif;
  --font-body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --accent: var(--brand-accent, #08B9EF);
  --on-accent: var(--brand-on-accent, #fff);
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 38%, transparent);

  --r-xs: 8px; --r-sm: 12px; --r-md: 16px; --r-lg: 22px; --r-xl: 28px; --r-pill: 999px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --sb-w: 268px;
  --sb-w-collapsed: 76px;

  /* light */
  --bg: var(--brand-paper, #F2F4F3);
  --text: var(--brand-ink, #0A0908);
  --text-2: color-mix(in srgb, var(--text) 64%, transparent);
  --text-3: color-mix(in srgb, var(--text) 42%, transparent);
  --line: color-mix(in srgb, var(--text) 9%, transparent);
  --line-2: color-mix(in srgb, var(--text) 14%, transparent);
  --glass: rgba(255, 255, 255, .52);
  --glass-2: rgba(255, 255, 255, .7);
  --glass-hover: rgba(255, 255, 255, .72);
  --glass-edge: rgba(255, 255, 255, .85);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 0 0 1px rgba(255, 255, 255, .35);
  --field: rgba(255, 255, 255, .66);
  --shadow-sm: 0 1px 2px rgba(10, 9, 8, .05), 0 4px 12px -6px rgba(10, 9, 8, .1);
  --shadow: 0 1px 2px rgba(10, 9, 8, .04), 0 18px 40px -18px rgba(10, 9, 8, .18);
  --shadow-lg: 0 2px 6px rgba(10, 9, 8, .05), 0 40px 80px -30px rgba(10, 9, 8, .3);
  --sky-a: color-mix(in srgb, var(--accent) 30%, transparent);
  --sky-b: color-mix(in srgb, var(--accent) 16%, transparent);
  --cloud: rgba(255, 255, 255, .9);
  --danger: #E5484D;
  --ok: #12A594;
  --warn: #F5A524;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: var(--brand-ink, #0A0908);
  --text: var(--brand-paper, #F2F4F3);
  --glass: color-mix(in srgb, var(--brand-surface, #222) 52%, transparent);
  --glass-2: color-mix(in srgb, var(--brand-surface, #222) 78%, transparent);
  --glass-hover: color-mix(in srgb, var(--brand-surface, #222) 82%, transparent);
  --glass-edge: rgba(255, 255, 255, .09);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .08), inset 0 0 0 1px rgba(255, 255, 255, .03);
  --field: rgba(255, 255, 255, .05);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 24px 48px -20px rgba(0, 0, 0, .6);
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, .4), 0 40px 90px -30px rgba(0, 0, 0, .8);
  --sky-a: color-mix(in srgb, var(--accent) 22%, transparent);
  --sky-b: color-mix(in srgb, var(--accent) 9%, transparent);
  --cloud: rgba(255, 255, 255, .045);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh;
  font: 400 14.5px/1.55 var(--font-body);
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  transition: background-color .5s var(--ease), color .3s var(--ease);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.display { font-family: var(--font-display); font-weight: 400; letter-spacing: .02em; text-transform: uppercase; }
.mono { font-family: var(--font-mono); letter-spacing: -.01em; }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.h1 { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.04; margin: 0; }
.h2 { font: 600 22px/1.2 var(--font-body); letter-spacing: -.02em; margin: 0 0 6px; }
.h3 { font: 600 15.5px/1.3 var(--font-body); letter-spacing: -.01em; margin: 0; display: flex; align-items: center; gap: 9px; }
.h3 .ic { color: var(--accent); }
.eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin: 0 0 12px; }
.lead { font-size: 15.5px; max-width: 58ch; margin: 12px 0 0; }
.ic { flex: none; }
.hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.danger-text { color: var(--danger); }

/* ---------- Sky (background) ---------- */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sky::before {
  content: ""; position: absolute; inset: -20%;
  background:
    radial-gradient(42% 38% at 82% 6%, var(--sky-a), transparent 70%),
    radial-gradient(40% 40% at 8% 92%, var(--sky-b), transparent 70%),
    radial-gradient(30% 30% at 50% 50%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 70%);
}
.cloud { position: absolute; border-radius: 50%; background: var(--cloud); filter: blur(60px); opacity: .9; transform: translateZ(0); }
.c1 { width: 520px; height: 260px; top: -60px; left: 18%; }
.c2 { width: 420px; height: 220px; top: 38%; right: -80px; }
.c3 { width: 620px; height: 280px; bottom: -120px; left: -120px; }
.c4 { width: 300px; height: 160px; top: 12%; right: 26%; opacity: .6; }
.grain {
  position: absolute; inset: 0; opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes drift { 0% { transform: translate3d(0, 0, 0) scale(1); } 100% { transform: translate3d(80px, 30px, 0) scale(1.12); } }

/* ---------- Glass ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--glass-blur, 24px)) saturate(180%);
  backdrop-filter: blur(var(--glass-blur, 24px)) saturate(180%);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-hi), var(--shadow);
}
.glass-strong { background: var(--glass-2); box-shadow: var(--glass-hi), var(--shadow-lg); }

/* ---------- App frame ---------- */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--sb-w) 1fr; min-height: 100dvh; transition: grid-template-columns .45s var(--ease); }
.sb-collapsed .app { grid-template-columns: var(--sb-w-collapsed) 1fr; }

.sidebar {
  position: sticky; top: 12px; margin: 12px 0 12px 12px; height: calc(100dvh - 24px);
  border-radius: var(--r-xl); display: flex; flex-direction: column; padding: 14px 12px; overflow: hidden; z-index: 30;
}
.sb-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 4px 14px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.sb-brand { min-width: 0; }
.sb-collapse .ic { transition: transform .45s var(--ease); }
.sb-collapsed .sb-collapse .ic { transform: rotate(180deg); }

.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mono { flex: none; display: grid; place-items: center; }
.brand-mono img { object-fit: contain; border-radius: 8px; }
.brand-word { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.brand-word img { height: 22px; width: auto; max-width: 150px; object-fit: contain; }
.wordmark { font-family: var(--font-display); font-size: 17px; letter-spacing: .09em; white-space: nowrap; }
.wordmark-sub { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .32em; color: var(--text-3); margin-top: 5px; }
.logo-on-dark { display: none; }
[data-theme="dark"] .logo-on-light { display: none; }
[data-theme="dark"] .logo-on-dark { display: block; }

.mark .mark-back { fill: color-mix(in srgb, var(--accent) 72%, transparent); }
.mark .mark-front { fill: color-mix(in srgb, var(--accent) 80%, white 0%); opacity: .82; mix-blend-mode: multiply; }
[data-theme="dark"] .mark .mark-front { mix-blend-mode: screen; fill: #E8EAE9; opacity: .78; }
[data-theme="dark"] .mark .mark-back { fill: var(--accent); opacity: .85; }

.sb-nav { position: relative; flex: 1; overflow-y: auto; overflow-x: hidden; margin: 0 -4px; padding: 0 4px; scrollbar-width: none; }
.sb-nav::-webkit-scrollbar { display: none; }
.sb-group { margin-top: 14px; }
.sb-label { font: 500 10.5px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); padding: 6px 12px 8px; white-space: nowrap; transition: opacity .25s; }
.sb-link {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px;
  height: 40px; padding: 0 12px; border-radius: var(--r-sm); color: var(--text-2);
  font-weight: 500; white-space: nowrap; transition: color .2s, background-color .2s;
}
.sb-link:hover { color: var(--text); background: color-mix(in srgb, var(--text) 4%, transparent); }
.sb-link.is-active { color: var(--text); }
.sb-link.is-active .ic { color: var(--accent); }
.sb-link span { overflow: hidden; text-overflow: ellipsis; transition: opacity .25s; }
.sb-soon { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-line); flex: none; }
.sb-indicator {
  position: absolute; left: 4px; right: 4px; height: 40px; top: 0; border-radius: var(--r-sm); z-index: 0;
  background: var(--glass-2); border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-hi), var(--shadow-sm);
  transition: transform .5s var(--spring), opacity .3s; opacity: 0;
}
.sb-indicator::before { content: ""; position: absolute; left: -1px; top: 11px; bottom: 11px; width: 3px; border-radius: 3px; background: var(--accent); }

.sb-foot { display: flex; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.sb-user { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--r-sm); transition: background .2s; }
.sb-user:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.sb-user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sb-user-meta b { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-meta small { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* collapsed */
.sb-collapsed .brand-word, .sb-collapsed .sb-link span, .sb-collapsed .sb-user-meta, .sb-collapsed .sb-soon { opacity: 0; pointer-events: none; width: 0; }
.sb-collapsed .sb-label { opacity: 0; height: 8px; padding: 0; }
.sb-collapsed .sb-top { flex-direction: column; gap: 12px; }
.sb-collapsed .sb-foot { flex-direction: column; }
.sb-collapsed .sb-link { justify-content: center; padding: 0; gap: 0; }
.sb-collapsed .sb-user { justify-content: center; padding: 4px 0; gap: 0; }
.tip {
  position: fixed; z-index: 300; padding: 6px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 500; white-space: nowrap;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow); pointer-events: none; transform: translateY(-50%);
  animation: tip .2s var(--ease);
}
@keyframes tip { from { opacity: 0; transform: translate(-4px, -50%); } }

/* ---------- Main ---------- */
.main { min-width: 0; display: flex; flex-direction: column; padding: 12px 12px 40px 18px; }
.topbar {
  position: sticky; top: 12px; z-index: 20; height: 60px; border-radius: var(--r-lg);
  display: flex; align-items: center; gap: 14px; padding: 0 10px 0 20px;
}
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; }
.crumb-app { color: var(--text-3); white-space: nowrap; }
.crumb-sep { color: var(--text-3); }
.crumb-page { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search-pill {
  display: flex; align-items: center; gap: 8px; height: 40px; width: 300px; padding: 0 8px 0 14px;
  border-radius: var(--r-pill); background: var(--field); border: 1px solid var(--line); color: var(--text-3);
}
.search-pill input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 13.5px; }
.search-pill input:disabled { cursor: not-allowed; }
kbd { font: 500 11px var(--font-mono); padding: 3px 7px; border-radius: 7px; border: 1px solid var(--line-2); color: var(--text-3); }

.theme-switch { position: relative; display: flex; padding: 3px; border-radius: var(--r-pill); background: var(--field); border: 1px solid var(--line); }
.theme-switch button { width: 34px; height: 32px; border-radius: var(--r-pill); display: grid; place-items: center; color: var(--text-3); transition: color .2s, background .3s var(--ease), box-shadow .3s; }
.theme-switch button:hover { color: var(--text); }
.theme-switch button.is-on { color: var(--text); background: var(--glass-2); box-shadow: var(--glass-hi), var(--shadow-sm); }

.page { position: relative; padding: 34px 14px 0 6px; max-width: 1360px; width: 100%; }
.only-mobile { display: none !important; }
.sb-scrim { display: none; }

/* ---------- Buttons ---------- */
.btn {
  --h: 42px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 18px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 14px; letter-spacing: -.005em; white-space: nowrap; overflow: hidden;
  transition: transform .25s var(--spring), box-shadow .25s var(--ease), background .2s, color .2s, opacity .2s;
  user-select: none;
}
.btn:active { transform: scale(.965); }
.btn-sm { --h: 34px; padding: 0 14px; font-size: 13px; }
.btn-lg { --h: 50px; padding: 0 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-primary {
  color: var(--on-accent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white) 0%, var(--accent) 55%, color-mix(in srgb, var(--accent) 88%, black) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -1px 0 rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.08), 0 10px 24px -10px color-mix(in srgb, var(--accent) 80%, transparent);
}
.btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 1px 2px rgba(0,0,0,.08), 0 16px 32px -12px color-mix(in srgb, var(--accent) 90%, transparent); }
.btn-primary::after { /* sheen */
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.4) 50%, transparent 70%);
  transition: transform .8s var(--ease);
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-glass {
  background: var(--glass-2); border: 1px solid var(--glass-edge); color: var(--text);
  -webkit-backdrop-filter: blur(12px) saturate(160%); backdrop-filter: blur(12px) saturate(160%);
  box-shadow: var(--glass-hi), var(--shadow-sm);
}
.btn-glass:hover { background: var(--glass-hover); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: color-mix(in srgb, var(--text) 5%, transparent); }
.btn-danger { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.icon-btn { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--text-2); transition: background .2s, color .2s, transform .25s var(--spring); flex: none; }
.icon-btn:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.link-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 500; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field-label { font: 500 12.5px/1.2 var(--font-body); color: var(--text-2); display: flex; gap: 6px; align-items: center; }
.field-label i { font-style: normal; font-weight: 400; }
.field-hint { font-size: 12px; color: var(--text-3); }
.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--r-sm);
  background: var(--field); border: 1px solid var(--line-2); outline: none;
  transition: border-color .2s, box-shadow .25s var(--ease), background .2s;
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: color-mix(in srgb, var(--text) 22%, transparent); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--glass-2); }
.input:disabled { opacity: .6; cursor: not-allowed; }
.input-sm { height: 34px; font-size: 13px; padding: 0 10px; border-radius: 9px; }
.input-wrap { position: relative; display: block; }
.input-wrap .input { padding-right: 46px; }
.input-icon { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--text-3); }
.input-icon:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row-end { display: flex; justify-content: flex-end; margin-top: 18px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.row-gap { display: flex; gap: 10px; }
.range { width: 100%; accent-color: var(--accent); }

/* Segmented control (iOS style, animated thumb) */
.seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: 12px; background: color-mix(in srgb, var(--text) 6%, transparent); border: 1px solid var(--line); isolation: isolate; }
.seg > label, .seg > button { position: relative; z-index: 1; display: grid; place-items: center; cursor: pointer; }
.seg > label input { position: absolute; opacity: 0; pointer-events: none; }
.seg > label span, .seg > button { height: 34px; padding: 0 14px; display: grid; place-items: center; font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; transition: color .25s; border-radius: 9px; }
.seg > label input:checked + span, .seg > button.is-on { color: var(--text); }
.seg > label input:disabled + span { cursor: not-allowed; opacity: .55; }
.seg > label input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.seg-thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 9px; background: var(--glass-2); box-shadow: var(--glass-hi), 0 1px 2px rgba(0,0,0,.08), 0 3px 8px -2px rgba(0,0,0,.1); transition: transform .45s var(--spring), width .45s var(--spring), background .25s; pointer-events: none; }
[data-theme="dark"] .seg-thumb { background: color-mix(in srgb, var(--text) 14%, transparent); }
.seg-role, .seg-3 { width: 100%; }

/* ---------- Cards, sections ---------- */
.section { margin-top: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.card { border-radius: var(--r-lg); padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.hero-row { align-items: flex-end; }
.hero-stats { display: flex; gap: 12px; }
.stat { border-radius: var(--r-md); padding: 14px 18px; min-width: 112px; display: flex; flex-direction: column; gap: 4px; }
.stat-n { font: 400 30px/1 var(--font-display); }
.stat-l { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.hero-user-row { display: flex; align-items: center; gap: 18px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); margin-bottom: 14px; transition: color .2s, gap .3s var(--ease); }
.back-link:hover { color: var(--text); gap: 10px; }

/* Avatars */
.avatar {
  --h: 196; width: 34px; height: 34px; flex: none; border-radius: 11px; display: grid; place-items: center;
  font: 600 12.5px/1 var(--font-body); color: #fff; letter-spacing: .02em;
  background: linear-gradient(140deg, hsl(var(--h) 80% 62%), hsl(calc(var(--h) + 40) 70% 46%));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 10px -4px hsl(var(--h) 70% 40% / .6);
}
.avatar-lg { width: 44px; height: 44px; border-radius: 14px; font-size: 15px; }
.avatar-xl { width: 64px; height: 64px; border-radius: 20px; font-size: 22px; }

/* Pills */
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: var(--r-pill); font-size: 11px; font-weight: 500; letter-spacing: .02em; background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text-2); }
.pill-accent { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 70%, var(--text)); }
.pill-ink { background: var(--text); color: var(--bg); }
.pill-off { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }

/* Tiles (dashboard) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tile {
  position: relative; border-radius: var(--r-lg); padding: 18px; min-height: 148px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
  transition: transform .45s var(--spring), box-shadow .35s var(--ease), background .25s;
  overflow: hidden;
}
.tile::before { /* light sweep */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%);
  opacity: 0; transition: opacity .35s;
}
.tile:hover::before { opacity: 1; }
.tile:hover { transform: translateY(-4px); background: var(--glass-hover); box-shadow: var(--glass-hi), var(--shadow-lg); }
.tile-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); flex: none; }
.tile-body { display: flex; flex-direction: column; gap: 4px; }
.tile-body b { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.tile-body small { color: var(--text-3); font-size: 12px; }
.tile-tag { position: absolute; top: 18px; right: 18px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.tile-arrow { position: absolute; right: 16px; bottom: 18px; color: var(--text-3); transition: transform .35s var(--spring), color .2s; }
.tile:hover .tile-arrow { transform: translateX(4px); color: var(--accent); }
.tile.is-locked { opacity: .55; pointer-events: none; }
.tile.is-locked .tile-icon { color: var(--text-3); background: color-mix(in srgb, var(--text) 5%, transparent); border-color: var(--line); }

/* Timeline / roadmap / lists */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.timeline li { display: flex; gap: 12px; font-size: 13.5px; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 7px; flex: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.roadmap { list-style: none; margin: 0; padding: 0; counter-reset: r; display: flex; flex-direction: column; gap: 4px; }
.roadmap li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 10px 34px; border-radius: var(--r-sm); position: relative; font-size: 13.5px; }
.roadmap li::before { content: ""; position: absolute; left: 12px; top: 15px; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line-2); }
.roadmap li.done { background: var(--accent-soft); }
.roadmap li.done::before { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--bg); }
.roadmap li span { font-size: 12.5px; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist .ic { color: var(--accent); margin-top: 3px; }
.access-list { list-style: none; margin: 0; padding: 0; }
.access-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.access-list li:last-child { border-bottom: 0; }

/* Permission level colours */
.lvl { font-size: 11px; padding: 3px 9px; border-radius: var(--r-pill); white-space: nowrap; }
.lvl-0 { --lc: var(--text-3); }
.lvl-1 { --lc: #7C8CF8; }
.lvl-2 { --lc: var(--warn); }
.lvl-3 { --lc: var(--ok); }
.lvl.lvl-0 { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text-3); }
.lvl:not(.lvl-0) { background: color-mix(in srgb, var(--lc) 14%, transparent); color: color-mix(in srgb, var(--lc) 75%, var(--text)); }
.lvl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lc); flex: none; }

/* ---------- Users ---------- */
.user-list { display: flex; flex-direction: column; gap: 10px; }
.user-row {
  display: grid; grid-template-columns: auto minmax(0, 1.6fr) minmax(140px, 1fr) 120px auto; align-items: center; gap: 18px;
  padding: 14px 16px; border-radius: var(--r-lg); transition: transform .4s var(--spring), background .25s, box-shadow .3s;
}
.user-row:hover { background: var(--glass-hover); transform: translateY(-2px); box-shadow: var(--glass-hi), var(--shadow-lg); }
.user-row.is-off { opacity: .6; }
.ur-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ur-name b { font-weight: 600; font-size: 14.5px; }
.ur-access { display: flex; flex-direction: column; gap: 6px; color: var(--text-2); }
.ur-seen { display: flex; align-items: center; gap: 6px; }
.meter { display: block; height: 5px; border-radius: 5px; background: color-mix(in srgb, var(--text) 8%, transparent); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, white), var(--accent)); transform-origin: left; animation: grow 1s var(--ease) both .2s; }
@keyframes grow { from { transform: scaleX(0); } }

.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r-md); cursor: pointer; transition: border-color .2s, box-shadow .25s; box-shadow: var(--glass-hi); }
.choice input { position: absolute; opacity: 0; }
.choice b { display: block; font-weight: 600; }
.choice small { display: block; margin-top: 2px; line-height: 1.4; }
.choice-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text-2); flex: none; transition: all .25s; }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--glass-hi); }
.choice:has(input:checked) .choice-ic { background: var(--accent); color: var(--on-accent); }

/* ---------- Permission matrix ---------- */
.perm-head { align-items: flex-start; flex-wrap: wrap; }
.perm-summary { margin: 4px 0 0; }
.perm-presets { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 12px 14px; border-radius: var(--r-md); background: color-mix(in srgb, var(--text) 3%, transparent); border: 1px solid var(--line); margin-bottom: 14px; font-size: 12.5px; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-item b { font-weight: 500; font-size: 12px; }
.matrix { display: flex; flex-direction: column; gap: 10px; }
.mx-module { border-radius: var(--r-md); border: 1px solid var(--line); background: color-mix(in srgb, var(--field) 70%, transparent); overflow: hidden; transition: border-color .3s; }
.mx-module:hover { border-color: var(--line-2); }
.mx-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px 10px 14px; }
.mx-parent { background: color-mix(in srgb, var(--text) 2.5%, transparent); }
.mx-child { border-top: 1px solid var(--line); }
.mx-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mx-name b { font-weight: 600; }
.mx-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); flex: none; }
.mx-branch { width: 32px; height: 18px; flex: none; position: relative; }
.mx-branch::before { content: ""; position: absolute; left: 15px; top: -12px; width: 10px; height: 20px; border-left: 1.5px solid var(--line-2); border-bottom: 1.5px solid var(--line-2); border-bottom-left-radius: 8px; }
.seg-lvl { min-width: 400px; }
.seg-lvl > label span, .seg-lvl > button { height: 30px; font-size: 12.5px; padding: 0 10px; }
.seg-lvl .seg-thumb { background: color-mix(in srgb, var(--lc, var(--text)) 18%, var(--glass-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lc, transparent) 40%, transparent), 0 2px 6px -2px rgba(0,0,0,.12); }
.seg-lvl > label:has(input:checked) span, .seg-lvl > button.is-on { color: color-mix(in srgb, var(--lc) 80%, var(--text)); font-weight: 600; }
.seg-lvl > label.lvl-0:has(input:checked) span, .seg-lvl > button.lvl-0.is-on { color: var(--text-2); }
.seg-parent.is-mixed .seg-thumb { opacity: 0; }
.seg-parent.is-mixed::after { content: "Mixed"; position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%); font: 500 11px var(--font-mono); color: var(--text-3); }

.admin-note { display: none; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-md); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.admin-note p { margin: 2px 0 0; }
.perm-card[data-admin] .admin-note { display: flex; }
.perm-card[data-admin] .legend, .perm-card[data-admin] .matrix, .perm-card[data-admin] .perm-presets, .perm-card[data-admin] .perm-summary { display: none; }

/* Save bar */
#user-form { display: flex; flex-direction: column; gap: 18px; }
.savebar {
  position: fixed; bottom: 22px; z-index: 40; width: min(520px, calc(100vw - 32px));
  left: calc(var(--sb-w) + 12px + (100vw - var(--sb-w) - 12px) / 2);
  border-radius: var(--r-pill);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 8px 8px 20px;
  transform: translate(-50%, 160%); opacity: 0; pointer-events: none; transition: transform .5s var(--spring), opacity .3s;
}
.sb-collapsed .savebar { left: calc(var(--sb-w-collapsed) + 12px + (100vw - var(--sb-w-collapsed) - 12px) / 2); }
.savebar.is-dirty { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.savebar > div { display: flex; gap: 6px; }
.savebar-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); margin-right: 6px; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.danger-card .row-gap .input { height: 42px; }

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.settings-main { display: flex; flex-direction: column; gap: 18px; }
.settings-side { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 14px; }
.logo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.logo-slot { display: flex; flex-direction: column; gap: 10px; }
.logo-meta { display: flex; flex-direction: column; gap: 3px; }
.logo-meta b { font-size: 13.5px; font-weight: 600; }
.logo-meta .link-btn { align-self: flex-start; margin-top: 4px; }
.dropzone {
  position: relative; height: 120px; border-radius: var(--r-md); cursor: pointer; display: grid; place-items: center;
  background: repeating-linear-gradient(45deg, transparent 0 10px, color-mix(in srgb, var(--text) 2.5%, transparent) 10px 20px), #F7F8F7;
  border: 1.5px dashed var(--line-2); transition: border-color .25s, transform .3s var(--spring), box-shadow .3s; overflow: hidden;
}
.dropzone.dz-dark { background: repeating-linear-gradient(45deg, transparent 0 10px, rgba(255,255,255,.03) 10px 20px), #0A0908; }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); transform: translateY(-2px); }
.dz-preview { display: grid; place-items: center; padding: 18px; max-width: 100%; }
.dz-preview img { max-height: 64px; width: auto; max-width: 100%; object-fit: contain; }
.dz-square .dz-preview img { max-height: 70px; }
.dz-cta { position: absolute; bottom: 8px; right: 8px; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 4px 9px; border-radius: var(--r-pill); background: rgba(255,255,255,.85); color: #0A0908; box-shadow: var(--shadow-sm); opacity: 0; transform: translateY(4px); transition: all .25s var(--ease); }
.dropzone:hover .dz-cta, .dropzone.has-new .dz-cta { opacity: 1; transform: none; }
.wm-dark { color: #0A0908; font-size: 18px; }
.wm-light { color: #F2F4F3; font-size: 18px; }
.dz-dark .mark .mark-front { mix-blend-mode: screen; fill: #E8EAE9; }

.swatches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.swatch { display: flex; gap: 14px; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: color-mix(in srgb, var(--field) 60%, transparent); }
.swatch-chip { position: relative; width: 64px; height: 64px; border-radius: 16px; flex: none; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.4), var(--shadow-sm); transition: transform .3s var(--spring); }
.swatch-chip:hover { transform: scale(1.05) rotate(-2deg); }
.swatch-chip input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.swatch-meta { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.swatch-meta b { font-weight: 600; font-size: 13.5px; }
.swatch-meta .input { max-width: 120px; text-transform: uppercase; }

.preview { border-radius: var(--r-lg); padding: 16px; }
.pv-head { margin-bottom: 12px; text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; }
.pv-app { display: flex; height: 190px; border-radius: 14px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); position: relative; }
.pv-app::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 50% at 90% 0%, var(--sky-a), transparent 70%); }
.pv-side { position: relative; width: 52px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; background: var(--glass); border-right: 1px solid var(--glass-edge); }
.pv-mark { margin-bottom: 6px; }
.pv-nav { width: 26px; height: 7px; border-radius: 4px; background: color-mix(in srgb, var(--text) 12%, transparent); }
.pv-nav.is-on { background: var(--accent); }
.pv-main { position: relative; flex: 1; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.pv-title { font: 400 13px var(--font-display); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-card { padding: 10px; border-radius: 10px; background: var(--glass-2); border: 1px solid var(--glass-edge); display: flex; flex-direction: column; gap: 6px; }
.pv-card i { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--text) 12%, transparent); }
.pv-card i.short { width: 55%; }
.pv-row { display: flex; gap: 6px; }
.pv-btn { font-size: 10.5px; font-weight: 600; padding: 5px 10px; border-radius: 99px; background: var(--accent); color: var(--on-accent); }
.pv-btn.ghost { background: var(--glass-2); color: var(--text); border: 1px solid var(--glass-edge); }
.pv-bar { height: 5px; border-radius: 4px; background: color-mix(in srgb, var(--text) 8%, transparent); overflow: hidden; margin-top: auto; }
.pv-bar span { display: block; width: 64%; height: 100%; background: var(--accent); border-radius: inherit; }
.font-note { padding: 16px 18px; }
.font-note p { margin: 6px 0 0; line-height: 1.55; }
.font-note .display { font-size: 12px; }

/* ---------- Auth ---------- */
.bare { display: block; }
.auth { position: relative; z-index: 1; min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 22px; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; border-radius: var(--r-xl); padding: 34px 32px 26px; }
.auth-brand { margin-bottom: 30px; }
.auth-brand .wordmark { font-size: 20px; }
.auth-title { font-size: 34px; margin: 0; }
.auth-sub { margin: 8px 0 26px; }
.auth-foot { margin: 20px 0 0; font-size: 12px; color: var(--text-3); text-align: center; }
.auth-legal { font-size: 11.5px; color: var(--text-3); margin: 0; }
.error-wrap { display: grid; place-items: center; min-height: 60vh; }
.error-card { max-width: 440px; text-align: center; padding: 36px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.error-card .btn { margin-top: 14px; }
.error-code { font-size: 72px; line-height: 1; color: var(--accent); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal-scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--brand-ink, #000) 30%, transparent); animation: fade .18s var(--ease); }
.modal-card { position: relative; width: 100%; max-width: 560px; max-height: calc(100dvh - 32px); overflow-y: auto; border-radius: var(--r-xl); padding: 24px; animation: pop .28s var(--spring); }
.modal.is-closing .modal-card { animation: popout .14s var(--ease) forwards; }
.modal.is-closing .modal-scrim { animation: fade .14s var(--ease) reverse forwards; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes popout { to { opacity: 0; transform: translateY(8px) scale(.97); } }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 200; top: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 460px); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: var(--r-pill);
  background: var(--glass-2); border: 1px solid var(--glass-edge); box-shadow: var(--glass-hi), var(--shadow-lg);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  font-size: 13.5px; font-weight: 500; animation: toastIn .3s var(--spring) both;
}
.toast > .ic { width: 22px; height: 22px; padding: 4px; border-radius: 50%; color: #fff; background: var(--ok); }
.toast-error > .ic { background: var(--danger); }
.toast-x { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); margin-left: auto; }
.toast-x:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.toast.is-out { animation: toastOut .35s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-24px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-16px) scale(.95); } }

/* ---------- Entrance motion ---------- */
.rise { animation: rise .32s var(--ease) both; animation-delay: calc(min(var(--d, 0), 6) * 22ms); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.page { animation: pageIn .16s ease-out backwards; }
@keyframes pageIn { from { opacity: 0; } }

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

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .settings-grid { grid-template-columns: 1fr; }
  .settings-side { position: static; }
  .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-row { grid-template-columns: auto minmax(0, 1fr) minmax(130px, .7fr) auto; }
  .ur-seen { display: none; }
}
@media (max-width: 980px) {
  .search-pill { width: 200px; }
  .grid-2 { grid-template-columns: 1fr; }
  .logo-grid { grid-template-columns: 1fr 1fr; }
  .mx-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .seg-lvl { min-width: 0; width: 100%; }
  .seg-parent.is-mixed::after { display: none; }
}
@media (max-width: 860px) {
  .app, .sb-collapsed .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 10px; left: 10px; bottom: 10px; height: auto; margin: 0; width: min(290px, 84vw); transform: translateX(calc(-100% - 24px)); transition: transform .5s var(--spring); }
  .sb-open .sidebar { transform: none; }
  .sidebar { background: var(--glass-2); box-shadow: var(--glass-hi), var(--shadow-lg); }
  .sb-collapse { display: none !important; }
  .sb-collapsed .brand-word, .sb-collapsed .sb-link span, .sb-collapsed .sb-user-meta, .sb-collapsed .sb-soon { opacity: 1; width: auto; pointer-events: auto; }
  .sb-collapsed .sb-label { opacity: 1; height: auto; padding: 6px 12px 8px; }
  .sb-collapsed .sb-top, .sb-collapsed .sb-foot { flex-direction: row; }
  .sb-collapsed .sb-link { justify-content: flex-start; padding: 0 12px; gap: 12px; }
  .sb-collapsed .sb-user { justify-content: flex-start; gap: 10px; padding: 6px; }
  .sb-scrim { display: block; position: fixed; inset: 0; z-index: 25; background: color-mix(in srgb, #000 25%, transparent); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .35s; }
  .sb-open .sb-scrim { opacity: 1; pointer-events: auto; }
  .main { padding: 10px 10px 32px; }
  .topbar { top: 10px; padding: 0 8px; }
  .only-mobile { display: grid !important; }
  .search-pill { display: none; }
  .crumb-app, .crumb-sep { display: none; }
  .page { padding: 26px 6px 0; }
  .savebar, .sb-collapsed .savebar { left: 50%; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .form-grid, .form-grid.cols-4, .swatches, .logo-grid, .choice-cards { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .hero-stats { width: 100%; }
  .stat { flex: 1; min-width: 0; }
  .user-row { grid-template-columns: auto minmax(0, 1fr); gap: 12px; }
  .ur-access { grid-column: 1 / -1; }
  .ur-actions { grid-column: 1 / -1; }
  .ur-actions .btn { width: 100%; }
  .card { padding: 18px; }
  .auth-card { padding: 28px 22px 22px; }
  .seg-lvl > label span, .seg-lvl > button { padding: 0 4px; font-size: 11.5px; }
  .row-gap { flex-direction: column; }
  .savebar { bottom: 10px; }
  .avatar-xl { width: 52px; height: 52px; border-radius: 16px; font-size: 18px; }
  .hero-user-row { gap: 14px; }
}

/* =========================================================
   SCREEN 02 — LEAD MANAGEMENT
   ========================================================= */
.avatar-xs { width: 24px; height: 24px; border-radius: 8px; font-size: 10px; }
.avatar.is-empty { background: none; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn-xs { --h: 28px; padding: 0 10px; font-size: 12px; gap: 5px; }
.icon-btn-sm { width: 30px; height: 30px; border-radius: 9px; }
.icon-btn.is-ghost { opacity: .4; cursor: default; }

/* Tabs */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--glass-hi), var(--shadow-sm); -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur)); margin-top: 26px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: var(--r-pill); color: var(--text-2); font-weight: 500; font-size: 13.5px; white-space: nowrap; transition: color .2s, background .3s var(--ease), box-shadow .3s; }
.tab:hover { color: var(--text); }
.tab.is-on { color: var(--text); background: var(--glass-2); box-shadow: var(--glass-hi), 0 1px 2px rgba(0,0,0,.06), 0 4px 10px -4px rgba(0,0,0,.12); }
.tab.is-on .ic { color: var(--accent); }
.tabs-lg .tab { height: 40px; padding: 0 18px; }
.tab-count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 11px; background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text-2); }
.tab.is-on .tab-count { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 70%, var(--text)); }
.tabs + .section { margin-top: 16px; }

/* Sync chip */
.sync-chip { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 14px; border-radius: var(--r-md); transition: transform .3s var(--spring); }
.sync-chip:hover { transform: translateY(-2px); }
.sync-chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 20%, transparent); }
.sync-chip.is-on i { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); animation: pulse 2s infinite; }
.sync-chip span { display: flex; flex-direction: column; line-height: 1.3; }
.sync-chip b { font-weight: 600; font-size: 13.5px; }
.sync-chip small { font-size: 11.5px; color: var(--text-3); }

/* Sheet card */
.sheet-card { border-radius: var(--r-lg); padding: 0; overflow: hidden; }
.sheet-toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.sheet-search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px; background: var(--field); border: 1px solid var(--line-2); color: var(--text-3); width: 280px; transition: border-color .2s, box-shadow .25s; }
.sheet-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.sheet-search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 13.5px; color: var(--text); }
.sheet-filter { width: auto; min-width: 140px; height: 36px; border-radius: 10px; cursor: pointer; }
.sheet-count { padding-left: 4px; }
.sheet-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.sheet-note { display: flex; align-items: center; gap: 7px; padding: 8px 16px; background: color-mix(in srgb, var(--warn) 9%, transparent); color: color-mix(in srgb, var(--warn) 60%, var(--text)); border-bottom: 1px solid var(--line); }

.sheet-scroll { position: relative; overflow: auto; max-height: calc(100dvh - 300px); overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text) 22%, transparent) transparent; }
.sheet { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13.5px; }
.sheet th { position: sticky; top: 0; z-index: 3; height: 38px; padding: 0 12px; text-align: left; white-space: nowrap;
  font: 500 11px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--text-3);
  background: var(--sheet-head); border-bottom: 1px solid var(--line-2); user-select: none; }
.sheet th[data-sort] { cursor: pointer; transition: color .2s; }
.sheet th[data-sort]:hover { color: var(--text); }
.sheet th[data-sort]::after { content: "↕"; margin-left: 6px; opacity: 0; transition: opacity .2s; }
.sheet th[data-sort]:hover::after { opacity: .5; }
.sheet th.is-sorted { color: var(--accent); }
.sheet th.is-sorted::after { opacity: 1; content: "↑"; }
.sheet th.is-sorted[data-dir="desc"]::after { content: "↓"; }
.sheet td { height: 52px; padding: 0; border-bottom: 1px solid var(--line); vertical-align: middle; background: transparent; transition: background .2s, box-shadow .2s; position: relative; }
.sheet td + td, .sheet th + th { border-left: 1px solid color-mix(in srgb, var(--text) 5%, transparent); }
.sheet tbody tr { animation: rowIn .18s ease-out backwards; }
.sheet tbody tr:hover td { background: color-mix(in srgb, var(--text) 2.5%, transparent); }
.sheet tbody tr.is-selected td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.sheet tbody tr.is-new td { animation: newRow 2s var(--ease); }
.sheet tbody tr.is-leaving { animation: rowOut .38s var(--ease) forwards; }
@keyframes rowIn { from { opacity: 0; } }
@keyframes rowOut { to { opacity: 0; transform: translateX(28px); } }
@keyframes newRow { 0%, 40% { background: var(--accent-soft); } }

/* sticky first columns */
.sheet .c-check, .sheet .c-num, .sheet .c-client { position: sticky; z-index: 2; }
.sheet-card { --sheet-row: color-mix(in srgb, var(--bg) 35%, white); --sheet-head: color-mix(in srgb, var(--bg) 70%, white); }
[data-theme="dark"] .sheet-card { --sheet-row: color-mix(in srgb, var(--brand-surface, #222) 62%, var(--bg)); --sheet-head: color-mix(in srgb, var(--brand-surface, #222) 75%, var(--bg)); }
.sheet td.c-check, .sheet td.c-num, .sheet td.c-client { background: var(--sheet-row); }
.sheet tbody tr:hover td.c-check, .sheet tbody tr:hover td.c-num, .sheet tbody tr:hover td.c-client { background: color-mix(in srgb, var(--text) 2.5%, var(--sheet-row)); }
.sheet tbody tr.is-selected td.c-check, .sheet tbody tr.is-selected td.c-num, .sheet tbody tr.is-selected td.c-client { background: color-mix(in srgb, var(--accent) 7%, var(--sheet-row)); }
.sheet th.c-check, .sheet th.c-num, .sheet th.c-client { z-index: 4; }
.sheet td.c-client { z-index: 2; }
.sheet td.is-editing { z-index: 6; }
.c-check { left: 0; width: 40px; min-width: 40px; text-align: center !important; }
.c-num { left: 40px; width: 46px; min-width: 46px; text-align: center !important; color: var(--text-3); font-size: 11.5px; }
.c-client { left: 86px; box-shadow: 6px 0 12px -10px rgba(0,0,0,.25); }
/* Fixed widths live on the inner elements; the actions column soaks up spare width */
.c-client .cell { width: 210px; } .c-brand .cell { width: 180px; }
.c-exec .cell-select-wrap { width: 190px; } .c-source .cell-select-wrap { width: 156px; }
.c-phone .cell { width: 168px; } .c-email .cell { width: 224px; } .c-req .cell { width: 300px; }
.remark-btn { width: 290px; }
.c-added { min-width: 100px; padding: 0 12px !important; white-space: nowrap; }
.c-actions { width: 100%; min-width: 150px; }
.c-check input, [data-check-all] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

.cell { min-height: 51px; max-height: 51px; padding: 15px 12px; outline: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: text; line-height: 1.45; }
.cell[contenteditable]:hover { background: color-mix(in srgb, var(--text) 3%, transparent); }
.cell-strong { font-weight: 600; }
.cell[contenteditable]:empty::before { content: "—"; color: var(--text-3); opacity: .5; }
.cell[contenteditable]:focus:empty::before { content: ""; }
td.is-editing { z-index: 5; }
td.is-editing .cell { position: relative; white-space: pre-wrap; overflow: auto; text-overflow: clip; max-height: 220px; background: var(--glass-2); box-shadow: inset 0 0 0 2px var(--accent), 0 10px 30px -10px rgba(0,0,0,.25); border-radius: 4px; }
td.is-editing .cell-multi { position: absolute; left: 0; top: 0; min-height: 120px; }
.cell-multi { white-space: nowrap; }
td.is-saving::after, td.is-saved::after, td.is-error::after { content: ""; position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; }
td.is-saving::after { background: var(--warn); animation: pulse .8s infinite; }
td.is-saved::after { background: var(--ok); animation: fadeDot 1.4s forwards; }
td.is-error::after { background: var(--danger); }
td.is-saved { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 40%, transparent); }
@keyframes fadeDot { 60% { opacity: 1; } to { opacity: 0; } }

.cell-select-wrap { display: flex; align-items: center; gap: 8px; padding: 0 8px 0 12px; height: 51px; }
.cell-select { flex: 1; min-width: 0; height: 32px; padding: 0 26px 0 8px; margin-left: -8px; border-radius: 8px; border: 1px solid transparent; background: transparent; font-size: 13.5px; cursor: pointer; outline: none; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; transition: border-color .2s, background-color .2s; }
.cell-select:hover:not(:disabled) { background-color: color-mix(in srgb, var(--text) 4%, transparent); border-color: var(--line-2); }
.cell-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cell-select:disabled { cursor: default; background-image: none; opacity: 1; color: var(--text); }
.cell-select option { background: var(--bg); color: var(--text); }

.remark-btn { display: flex; flex-direction: column; gap: 3px; height: 51px; padding: 7px 12px; text-align: left; justify-content: center; transition: background .2s; }
.remark-btn:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.remark-text { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.remark-meta { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-3); }
.remark-meta .ic { width: 12px; height: 12px; color: var(--accent); }
.remark-btn.is-empty { flex-direction: row; align-items: center; justify-content: flex-start; gap: 7px; color: var(--text-3); font-size: 12.5px; }
.remark-btn.is-empty:hover { color: var(--accent); }

.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: 0 8px; opacity: .55; transition: opacity .2s; }
tr:hover .row-actions, tr:focus-within .row-actions { opacity: 1; }
.row-actions .btn-xs .ic { width: 13px; height: 13px; }

.sheet-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 56px 20px 64px; text-align: center; }
.sheet-empty b { font-size: 15px; margin-top: 6px; }
.sheet-addrow { display: flex; align-items: center; gap: 8px; width: 100%; height: 44px; padding: 0 18px; color: var(--text-3); font-weight: 500; border-top: 1px solid var(--line); transition: color .2s, background .2s; }
.sheet-addrow:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, transparent); }

/* Bulk bar */
.bulkbar { position: fixed; z-index: 45; bottom: 22px; left: calc(var(--sb-w) + 12px + (100vw - var(--sb-w) - 12px) / 2); border-radius: var(--r-pill);
  display: flex; align-items: center; gap: 16px; padding: 7px 7px 7px 20px; transform: translate(-50%, 160%); opacity: 0; pointer-events: none; transition: transform .5s var(--spring), opacity .3s; }
.sb-collapsed .bulkbar { left: calc(var(--sb-w-collapsed) + 12px + (100vw - var(--sb-w-collapsed) - 12px) / 2); }
.bulkbar.is-on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.bulk-actions { display: flex; gap: 6px; align-items: center; }

/* Popover menu */
.menu { position: fixed; z-index: 150; min-width: 230px; padding: 6px; border-radius: 14px; }
.menu.is-in { animation: menuIn .14s var(--ease); }
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border-radius: 9px; font-size: 13.5px; font-weight: 500; text-align: left; transition: background .15s; }
.menu-item:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.menu-item .ic { color: var(--text-3); }
.menu-item.is-danger { color: var(--danger); }
.menu-item.is-danger .ic { color: var(--danger); }

/* Drawer */
.drawer-wrap { position: fixed; inset: 0; z-index: 90; }
.drawer-scrim { position: absolute; inset: 0; background: color-mix(in srgb, #000 18%, transparent); animation: fade .3s var(--ease); }
.drawer { position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(480px, calc(100vw - 24px)); border-radius: var(--r-xl); display: flex; flex-direction: column; overflow: hidden; animation: drawerIn .3s var(--spring); }
.drawer-wrap.is-closing .drawer { animation: drawerOut .18s var(--ease) forwards; }
.drawer-wrap.is-closing .drawer-scrim { animation: fade .18s var(--ease) reverse forwards; }
@keyframes drawerIn { from { transform: translateX(105%); } }
@keyframes drawerOut { to { transform: translateX(105%); } }
.drawer-head { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 12px; }
.drawer-title-wrap .pill { margin-bottom: 10px; }
.drawer-title-wrap .h2 { margin: 0; word-break: break-word; }
.drawer-title-wrap p { margin: 4px 0 0; }
.drawer-facts { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 14px; border-bottom: 1px solid var(--line); }
.fact { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12.5px; background: color-mix(in srgb, var(--text) 5%, transparent); max-width: 100%; }
.fact span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fact .ic { color: var(--text-3); width: 14px; height: 14px; }
a.fact { transition: background .2s, color .2s; }
a.fact:hover { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 70%, var(--text)); }
a.fact:hover .ic { color: var(--accent); }
.fact-req { width: 100%; margin: 8px 0 0; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--text) 3%, transparent); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); max-height: 110px; overflow: auto; }
.drawer-meta { margin: 0; border-bottom: 1px solid var(--line); }
.drawer-meta summary { display: flex; align-items: center; gap: 6px; padding: 10px 20px; cursor: pointer; color: var(--text-2); list-style: none; }
.drawer-meta summary::-webkit-details-marker { display: none; }
.drawer-meta summary .ic { color: var(--accent); }
.drawer-meta dl { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; margin: 0; padding: 0 20px 14px; font-size: 12.5px; max-height: 200px; overflow: auto; }
.drawer-meta dt { color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.drawer-meta dd { margin: 0; word-break: break-word; }

.chat { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: auto; }
.chat-day { display: flex; align-items: center; gap: 10px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin: 8px 0 2px; }
.chat-day::before, .chat-day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.chat-event { align-self: center; font-size: 11px; color: var(--text-3); padding: 4px 10px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--text) 4%, transparent); text-align: center; max-width: 92%; }
.bubble-row { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.bubble-row.is-mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble-row.is-new { animation: bubbleIn .25s var(--spring); }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.bubble { padding: 9px 13px 10px; border-radius: 16px 16px 16px 5px; background: var(--glass-2); border: 1px solid var(--glass-edge); box-shadow: var(--glass-hi), var(--shadow-sm); min-width: 0; }
.bubble-row.is-mine .bubble { border-radius: 16px 16px 5px 16px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 90%, white), var(--accent)); color: var(--on-accent); border-color: transparent; box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.bubble-head { display: flex; align-items: baseline; gap: 8px; font-size: 11.5px; margin-bottom: 2px; }
.bubble-head span { opacity: .6; font-size: 10.5px; }
.bubble-row.is-mine .bubble-head b { display: none; }
.bubble-body { font-size: 13.5px; line-height: 1.5; word-wrap: break-word; }
.chat-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; max-width: 300px; }
.chat-loading { margin: auto; display: flex; gap: 6px; }
.chat-loading i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: bounce 1s infinite; }
.chat-loading i:nth-child(2) { animation-delay: .15s; } .chat-loading i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 40% { transform: translateY(-6px); opacity: .5; } }
.composer { display: flex; align-items: flex-end; gap: 8px; margin: 0 14px 14px; padding: 8px 8px 8px 14px; border-radius: 20px; background: var(--field); border: 1px solid var(--line-2); transition: border-color .2s, box-shadow .25s; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.composer textarea { flex: 1; resize: none; border: 0; outline: none; background: none; font-size: 13.5px; line-height: 1.5; padding: 6px 0; max-height: 180px; }
.composer-send { width: 36px; height: 36px; padding: 0; flex: none; }
.composer-ro { display: flex; align-items: center; gap: 6px; justify-content: center; padding: 14px; margin: 0; border-top: 1px solid var(--line); }
.drawer-open body { overflow: hidden; }

/* Import modal bits */
.dz-file { height: 130px; background: color-mix(in srgb, var(--text) 2%, transparent); }
[data-theme="dark"] .dropzone.dz-file { background: rgba(255,255,255,.03); }
.dz-file-label { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.dz-file-label .ic { color: var(--accent); margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.check-row { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 13.5px; cursor: pointer; }
.check-row input { width: 16px; height: 16px; accent-color: var(--accent); }

/* Super Admin: sources + ads sync */
.tabs + .settings-grid, .tabs + .adsync { margin-top: 18px; }
.source-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.source-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) 80px auto 36px; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in srgb, var(--field) 60%, transparent); transition: box-shadow .2s, opacity .2s; }
.source-row.is-dragging { opacity: .5; box-shadow: 0 0 0 2px var(--accent); }
.drag-handle { cursor: grab; color: var(--text-3); letter-spacing: -2px; text-align: center; user-select: none; }
.source-uses { text-align: right; }
.source-add { display: flex; gap: 10px; margin-top: 16px; }
.switch { position: relative; width: 40px; height: 24px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 12px; background: color-mix(in srgb, var(--text) 15%, transparent); transition: background .25s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .35s var(--spring); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.adsync { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.adsync-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.adsync-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 92px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px; border-radius: var(--r-pill); font-size: 11.5px; background: color-mix(in srgb, var(--warn) 14%, transparent); color: color-mix(in srgb, var(--warn) 65%, var(--text)); }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill.is-on { background: color-mix(in srgb, var(--ok) 14%, transparent); color: color-mix(in srgb, var(--ok) 70%, var(--text)); }
.status-pill.is-on i { animation: pulse 2s infinite; }
.steps { margin: 0 0 18px; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.steps li { padding-left: 4px; line-height: 1.55; }
.steps li::marker { font-family: var(--font-mono); color: var(--accent); font-weight: 500; }
.code-box { border-radius: 14px; overflow: hidden; border: 1px solid var(--line-2); background: #0D0E10; }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.code-head .muted { color: rgba(255,255,255,.5); }
.code-box pre { margin: 0; padding: 14px 16px; max-height: 300px; overflow: auto; font-size: 12px; line-height: 1.6; color: #D7E3EA; white-space: pre; }
.btn.is-done { background: var(--ok); color: #fff; border-color: transparent; }
.map-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.input-sm.sheet-filter { padding-right: 30px; background-position: right 10px center; }
.token { display: block; padding: 10px 12px; margin: 10px 0 14px; border-radius: 10px; background: color-mix(in srgb, var(--text) 5%, transparent); font-size: 12.5px; word-break: break-all; }

@media (max-width: 1180px) {
  .adsync { grid-template-columns: 1fr; }
  .adsync-side { position: static; }
}
@media (max-width: 860px) {
  .bulkbar, .sb-collapsed .bulkbar { left: 50%; }
  .sheet-search { width: 100%; order: -1; }
  .sheet-actions { margin-left: 0; width: 100%; }
  .sheet-actions .btn-primary { margin-left: auto; }
  .sheet-scroll { max-height: calc(100dvh - 240px); }
  .c-client { width: 160px; min-width: 160px; }
  .c-num { display: none; }
  .c-client { left: 40px; }
  .drawer { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 88dvh; animation-name: sheetUp; }
  .drawer-wrap.is-closing .drawer { animation-name: sheetDown; }
  @keyframes sheetUp { from { transform: translateY(105%); } }
  @keyframes sheetDown { to { transform: translateY(105%); } }
  .map-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .source-row { grid-template-columns: 16px minmax(0, 1fr) auto 32px; }
  .source-uses { display: none; }
  .source-add { flex-direction: column; }
}

/* Form answers + ad columns (Meta leads) */
.sheet.no-ads .c-ans, .sheet.no-ads .c-ad { display: none; }
.ans-cell { display: flex; flex-direction: column; justify-content: center; gap: 3px; width: 260px; height: 51px; padding: 6px 12px; text-align: left; position: relative; transition: background .2s; }
button.ans-cell:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.ans-cell.is-empty { color: var(--text-3); opacity: .5; }
.ans-line { display: flex; align-items: baseline; gap: 7px; min-width: 0; font-size: 12.5px; line-height: 1.3; }
.ans-q { flex: none; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); min-width: 46px; }
.ans-a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ans-more { position: absolute; right: 8px; top: 6px; font-size: 10px; color: var(--accent); }
.ad-cell { display: flex; flex-direction: column; justify-content: center; gap: 2px; width: 230px; height: 51px; padding: 0 12px; }
.ad-name { display: flex; align-items: center; gap: 6px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-set { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plat { flex: none; font-style: normal; font: 600 9px/16px var(--font-mono); width: 20px; text-align: center; border-radius: 5px; color: #fff; background: #1877F2; }
.plat-ig { background: linear-gradient(135deg, #F58529, #DD2A7B 55%, #8134AF); }
.plat-ms { background: #0084FF; } .plat-an { background: #6B7280; }

.drawer-meta dl { display: flex; flex-direction: column; gap: 8px; max-height: 260px; }
.qa { padding: 9px 12px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 6%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); }
.qa dt { font-size: 11.5px; color: var(--text-2); margin-bottom: 2px; text-transform: none; letter-spacing: 0; font-family: var(--font-body); }
.qa dd { font-weight: 600; font-size: 13.5px; }
.qa-ad { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 4px 2px 0; font-size: 12.5px; }
.qa-ad span { display: inline-flex; gap: 6px; align-items: baseline; }
.qa-ad i { font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }

/* =========================================================
   SCREEN 03 — CLIENTS & SCOPE OF WORK
   ========================================================= */
.textarea { height: auto; padding: 10px 14px; resize: vertical; line-height: 1.5; min-height: 80px; }
.seg-sm > label span, .seg-sm > button { height: 30px; padding: 0 12px; font-size: 12.5px; }
.check-inline { margin-top: 0; font-size: 13px; color: var(--text-2); }
.empty-big { border-radius: var(--r-lg); padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; margin-top: 18px; }
.empty-big b { font-size: 16px; margin-top: 6px; }
.empty-big p { max-width: 380px; margin: 0 0 8px; }
.is-overdue { color: var(--danger) !important; }
.is-soon { color: color-mix(in srgb, var(--warn) 75%, var(--text)) !important; }

/* Tiles */
.tiles-toolbar { display: flex; align-items: center; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.client-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; margin-top: 16px; }
.client-tile { position: relative; border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 14px; overflow: hidden;
  transition: transform .45s var(--spring), box-shadow .35s var(--ease), background .25s; }
.client-tile::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%), hsl(var(--h) 80% 60% / .16), transparent 60%); }
.client-tile:hover { transform: translateY(-4px); background: var(--glass-hover); box-shadow: var(--glass-hi), var(--shadow-lg); }
.client-tile:hover::before { opacity: 1; }
.client-tile.is-archived { filter: saturate(.4); opacity: .85; }
.ct-top { display: flex; align-items: flex-start; justify-content: space-between; }
.ct-mono { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex: none;
  font: 400 18px/1 var(--font-display); letter-spacing: .04em; color: #fff;
  background: linear-gradient(140deg, hsl(var(--h) 78% 62%), hsl(calc(var(--h) + 35) 70% 44%));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 8px 18px -8px hsl(var(--h) 70% 40% / .7); }
.ct-mono-lg { width: 76px; height: 76px; border-radius: 22px; font-size: 26px; }
.ct-ring { position: relative; width: 48px; height: 48px; }
.ct-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 500; }
.ring { width: 48px; height: 48px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring-bg { stroke: color-mix(in srgb, var(--text) 8%, transparent); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease); animation: ringIn 1.2s var(--ease) both .2s; }
@keyframes ringIn { from { stroke-dashoffset: 119.38; } }
.ct-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ct-title { font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-sub { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; color: var(--text-2); }
.ct-meta span { display: inline-flex; align-items: center; gap: 5px; }
.ct-foot { display: flex; align-items: center; gap: 12px; margin-top: auto; min-height: 24px; }
.avatar-stack { display: flex; flex: none; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--glass-2); }
.avatar-stack .avatar + .avatar { margin-left: -7px; }
.ct-bar { flex: 1; display: block; height: 5px; border-radius: 5px; background: color-mix(in srgb, var(--text) 8%, transparent); overflow: hidden; }
.ct-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 65%, white), var(--accent)); transform-origin: left; animation: grow 1s var(--ease) both .25s; transition: width .6s var(--ease); }
.ct-bar-lg { flex: none; width: 100%; height: 8px; border-radius: 8px; }

/* Client page */
.client-hero, .project-hero { position: relative; border-radius: var(--r-xl); padding: 22px 24px 24px; overflow: hidden; }
.client-hero::before, .project-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 120% at 100% 0%, hsl(var(--h) 80% 60% / .14), transparent 70%); }
.client-hero .back-link, .project-hero .back-link { position: relative; }
.ch-row { position: relative; display: flex; gap: 20px; align-items: flex-start; }
.ch-main { flex: 1; min-width: 0; }
.ch-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ch-facts { padding: 14px 0 0; border: 0; }
.ch-notes { margin: 12px 0 0; font-size: 13.5px; max-width: 72ch; }
.ch-actions { display: flex; gap: 6px; flex: none; }
.ch-actions form { margin: 0; }

.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.project-card { border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 12px; transition: transform .45s var(--spring), box-shadow .35s, background .25s; }
.project-card:hover { transform: translateY(-3px); background: var(--glass-hover); box-shadow: var(--glass-hi), var(--shadow-lg); }
.pc-head, .pc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pc-title { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.pc-progress { display: flex; flex-direction: column; gap: 6px; }
.pm { display: inline-flex; align-items: center; gap: 8px; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.status-dot i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.status-on_hold i { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 18%, transparent); }
.status-completed i { background: var(--text-3); box-shadow: none; }
.section-head .h3 .tab-count { margin-left: 2px; }
.choice-3 { grid-template-columns: repeat(3, 1fr); }
.date-pair .input { min-width: 0; }

/* Project page */
.ph-row { position: relative; display: flex; gap: 28px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.ph-main { flex: 1; min-width: 280px; }
.ph-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin-top: 12px; }
.ph-meta .mono { display: inline-flex; align-items: center; gap: 6px; }
.ph-progress { width: 300px; display: flex; flex-direction: column; gap: 8px; }
.ph-pct { display: flex; align-items: baseline; gap: 4px; }
.ph-pct .display { font-size: 44px; line-height: 1; color: var(--accent); }
.ph-pct .mono { color: var(--text-3); }
.ph-progress .btn { align-self: flex-start; margin-top: 6px; }

.board-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.board-add { margin-left: auto; }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; align-items: stretch; margin-top: 16px; }

/* Notepad phase cards */
.phase { --tint: var(--text); position: relative; border-radius: 18px; display: flex; flex-direction: column; min-height: 120px;
  background: color-mix(in srgb, var(--tint) 7%, var(--glass-2)); border: 1px solid color-mix(in srgb, var(--tint) 16%, var(--glass-edge));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%); backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  box-shadow: var(--glass-hi), 0 1px 2px rgba(0,0,0,.04), 0 14px 32px -20px color-mix(in srgb, var(--tint) 60%, rgba(0,0,0,.4));
  animation: rise .3s var(--ease) both; transition: transform .2s var(--spring), box-shadow .2s, opacity .2s; }
.phase::before { /* tape */ content: ""; position: absolute; top: -7px; left: 50%; width: 64px; height: 14px; transform: translateX(-50%) rotate(-1.5deg);
  border-radius: 3px; background: color-mix(in srgb, var(--tint) 30%, rgba(255,255,255,.55)); box-shadow: 0 1px 2px rgba(0,0,0,.08); opacity: .9; }
.phase-plain { --tint: #8A8F98; } .phase-sky { --tint: #08B9EF; } .phase-mint { --tint: #12A594; } .phase-sand { --tint: #E2A336; }
.phase-lilac { --tint: #8B6CF6; } .phase-rose { --tint: #E5587A; } .phase-slate { --tint: #3E4A5C; }
.phase.is-dragging { opacity: .45; transform: scale(.98); }
.phase.is-leaving { opacity: 0; transform: scale(.94); }
.phase-head { display: flex; align-items: center; gap: 8px; padding: 18px 12px 8px 16px; }
.phase-title { flex: 1; margin: 0; font-size: 14px; line-height: 1.3; letter-spacing: .06em; outline: none; border-radius: 6px; padding: 2px 4px; margin-left: -4px; overflow-wrap: anywhere; }
.phase-title[contenteditable]:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.phase-title[contenteditable]:focus { background: var(--field); box-shadow: 0 0 0 2px var(--accent); }
.phase-count { font-size: 11px; color: var(--text-3); padding: 3px 8px; border-radius: 99px; background: color-mix(in srgb, var(--tint) 12%, transparent); }
.p-grip, .t-grip { color: var(--text-3); cursor: grab; display: grid; place-items: center; opacity: 0; transition: opacity .2s; touch-action: none; }
.phase-head:hover .p-grip, .task:hover .t-grip { opacity: .8; }
.t-grip.is-off { cursor: default; }
.phase-bar { height: 3px; margin: 0 16px 6px; border-radius: 3px; background: color-mix(in srgb, var(--tint) 14%, transparent); overflow: hidden; }
.phase-bar span { display: block; height: 100%; background: var(--tint); border-radius: inherit; transition: width .6s var(--ease); }
.phase-sky .phase-bar span, .phase-plain .phase-bar span { background: var(--accent); }

.tasks { list-style: none; margin: 0; padding: 2px 8px; min-height: 18px; flex: 1 1 auto; }
.tasks-empty { padding: 10px 10px 4px; }
.task { position: relative; display: grid; grid-template-columns: 14px 22px minmax(0, 1fr) auto; align-items: center; gap: 6px;
  min-height: 40px; padding: 5px 6px 5px 2px; border-radius: 10px; cursor: pointer;
  border-bottom: 1px dashed color-mix(in srgb, var(--tint) 18%, transparent); transition: background .15s, opacity .3s; }
.task:last-child { border-bottom-color: transparent; }
.task:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.task.is-dragging { opacity: .4; background: var(--accent-soft); }
.task.is-new { animation: newRow 1.6s var(--ease); }
.t-check { width: 20px; height: 20px; border-radius: 7px; border: 1.6px solid color-mix(in srgb, var(--text) 28%, transparent); display: grid; place-items: center; color: transparent; transition: all .25s var(--spring); }
.t-check:not(:disabled):hover { border-color: var(--ok); color: color-mix(in srgb, var(--ok) 50%, transparent); }
.t-check .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.st-doing .t-check { border-color: var(--warn); background: linear-gradient(90deg, color-mix(in srgb, var(--warn) 35%, transparent) 50%, transparent 50%); }
.st-done .t-check, .task.is-ticking .t-check { background: var(--ok); border-color: var(--ok); color: #fff; transform: scale(1.06); }
.t-title { font-size: 13.5px; line-height: 1.4; overflow-wrap: anywhere; }
.st-done .t-title { color: var(--text-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text) 30%, transparent); }
.t-chips { display: flex; align-items: center; gap: 4px; }
.t-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-3); padding: 0 3px; }
.t-chip .ic { width: 13px; height: 13px; }
.t-due { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 7px; border-radius: 7px; font-size: 11px; color: var(--text-2); background: color-mix(in srgb, var(--text) 5%, transparent); transition: background .2s; }
.t-due .ic { width: 12px; height: 12px; }
.t-due.is-empty { opacity: 0; padding: 0 5px; }
@media (hover: hover) { .task:hover .t-due.is-empty { opacity: .7; } }
/* touch screens: no hover, so keep the empty date button faintly visible — otherwise the first tap only "hovers" it and a second tap is needed */
@media (hover: none) { .t-due.is-empty { opacity: .45; } }
.t-due:not(:disabled):hover { background: color-mix(in srgb, var(--text) 10%, transparent); }
.t-due.is-overdue { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.t-due.is-soon { background: color-mix(in srgb, var(--warn) 14%, transparent); }
.t-who { border-radius: 9px; transition: transform .25s var(--spring); }
.t-who:not(:disabled):hover { transform: scale(1.1); }
.t-who .avatar.is-empty { opacity: .45; }
.task:hover .t-who .avatar.is-empty { opacity: .9; }

.add-task { display: flex; align-items: flex-start; gap: 8px; margin: 2px 8px 10px; padding: 8px 10px; border-radius: 10px; color: var(--text-3); transition: background .2s; }
.add-task:focus-within { background: var(--field); box-shadow: 0 0 0 2px var(--accent-soft); }
.add-plus { display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; }
.add-task textarea { flex: 1; border: 0; outline: none; background: none; resize: none; font-size: 13.5px; line-height: 1.45; color: var(--text); padding: 1px 0; }
.add-task textarea::placeholder { color: var(--text-3); }
.phase-ghost { min-height: 140px; align-items: center; justify-content: center; flex-direction: row; gap: 8px; color: var(--text-3); font-weight: 500;
  background: transparent; border: 1.5px dashed var(--line-2); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; cursor: pointer; }
.phase-ghost::before { display: none; }
.phase-ghost:hover { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, transparent); }

.swatch-row { display: flex; gap: 6px; padding: 6px 6px 4px; }
.sw { width: 24px; height: 24px; border-radius: 8px; --tint: #8A8F98; background: color-mix(in srgb, var(--tint) 30%, var(--glass-2)); border: 1.5px solid color-mix(in srgb, var(--tint) 45%, transparent); transition: transform .25s var(--spring); }
.sw:hover { transform: scale(1.12); }
.sw.is-on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--tint); }
.sw-sky { --tint: #08B9EF; } .sw-mint { --tint: #12A594; } .sw-sand { --tint: #E2A336; } .sw-lilac { --tint: #8B6CF6; } .sw-rose { --tint: #E5587A; } .sw-slate { --tint: #3E4A5C; }
.menu-users { max-height: 320px; overflow-y: auto; }
.menu-item.is-on { background: var(--accent-soft); }
.menu-check { margin-left: auto; color: var(--accent); }
.ghost-picker { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }

/* Task drawer */
.drawer-task { width: min(540px, calc(100vw - 24px)); }
.td-head-actions { display: flex; gap: 2px; flex: none; }
.td-title { width: 100%; border: 0; outline: none; background: none; resize: none; padding: 4px 6px; margin: 0 0 0 -6px; border-radius: 8px; font-family: var(--font-body); overflow: hidden; }
.td-title:not([readonly]):hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.td-title:focus { background: var(--field); box-shadow: 0 0 0 2px var(--accent-soft); }
.drawer-task.is-done .td-title { text-decoration: line-through; color: var(--text-2); }
.td-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.td-props { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; align-items: center; padding: 4px 20px 14px; }
.td-prop { display: contents; }
.seg-status .st-todo:has(input:checked) span { color: var(--text); }
.seg-status .st-doing:has(input:checked) span { color: color-mix(in srgb, var(--warn) 75%, var(--text)); }
.seg-status .st-done:has(input:checked) span { color: color-mix(in srgb, var(--ok) 75%, var(--text)); }
.td-assign { height: 34px; padding: 0 0 0 2px; width: 240px; }
.td-assign .cell-select { margin-left: 0; border-color: var(--line-2); background-color: var(--field); }
.td-date { width: 180px; }
.td-date.is-overdue { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.td-desc-wrap { display: flex; flex-direction: column; gap: 6px; padding: 12px 20px; border-top: 1px solid var(--line); }
.td-desc { border: 1px solid transparent; outline: none; background: color-mix(in srgb, var(--text) 3%, transparent); border-radius: 12px; padding: 10px 12px; resize: none; font-size: 13.5px; line-height: 1.55; min-height: 64px; overflow: hidden; transition: border-color .2s, background .2s; }
.td-desc:focus { border-color: var(--accent); background: var(--field); }
.td-section { position: relative; padding: 12px 20px; border-top: 1px solid var(--line); }
.td-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.td-section-head > span { display: inline-flex; align-items: center; gap: 6px; }
.td-asset-actions { display: flex; gap: 6px; }
.td-asset-actions label { cursor: pointer; }
.td-linkform { display: grid; grid-template-columns: 1fr 140px auto; gap: 6px; margin-bottom: 10px; }
.td-assets { display: flex; flex-direction: column; gap: 6px; }
.td-none { margin: 0; }
.asset { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in srgb, var(--field) 70%, transparent); animation: bubbleIn .4s var(--spring); }
.as-thumb { width: 44px; height: 44px; border-radius: 9px; overflow: hidden; flex: none; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.as-thumb img { width: 100%; height: 100%; object-fit: cover; }
.as-ext { font-size: 10px; text-transform: uppercase; color: color-mix(in srgb, var(--accent) 70%, var(--text)); font-weight: 600; }
.as-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.as-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.as-name:hover { color: var(--accent); }
.as-progress { display: block; height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--text) 8%, transparent); overflow: hidden; }
.as-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.td-drop { position: absolute; inset: 6px 12px; z-index: 3; border-radius: 14px; border: 2px dashed var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--glass-2)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--accent); pointer-events: none; }
.td-chat-section { flex: 1; display: flex; flex-direction: column; min-height: 160px; }
.td-chat { padding: 0; overflow: visible; flex: none; }
.td-chat .chat-empty { margin: 8px 0; text-align: left; max-width: none; align-items: flex-start; }

@media (max-width: 860px) {
  .ch-row { flex-wrap: wrap; }
  .ch-actions { width: 100%; }
  .ph-progress { width: 100%; }
  .board { grid-template-columns: 1fr; }
  .board-add { margin-left: 0; }
  .choice-3 { grid-template-columns: 1fr; }
  .t-grip, .p-grip { display: none; }
  .task { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .td-props { grid-template-columns: 1fr; }
  .td-prop { display: flex; flex-direction: column; gap: 6px; }
  .td-assign, .td-date { width: 100%; }
  .td-linkform { grid-template-columns: 1fr; }
}

/* =========================================================
   SCREEN 04 — SCOPE TEMPLATES
   ========================================================= */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.tpl-card { position: relative; border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 14px; transition: transform .45s var(--spring), box-shadow .35s, background .25s; }
.tpl-card:hover { transform: translateY(-4px); background: var(--glass-hover); box-shadow: var(--glass-hi), var(--shadow-lg); }
.tpl-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.tpl-stack { position: relative; height: 108px; margin: 4px 6px 0; }
.tpl-sheet { position: absolute; left: calc(var(--k) * 22px); right: calc((2 - var(--k)) * 22px); top: calc(var(--k) * 12px); height: 82px;
  border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px;
  background: color-mix(in srgb, var(--tint) 10%, var(--glass-2)); border: 1px solid color-mix(in srgb, var(--tint) 22%, var(--glass-edge));
  box-shadow: 0 8px 20px -14px rgba(0,0,0,.35); transform: rotate(calc((var(--k) - 1) * -1.6deg)); transition: transform .5s var(--spring); }
.tpl-card:hover .tpl-sheet { transform: rotate(calc((var(--k) - 1) * -3deg)) translateY(calc(var(--k) * -2px)); }
.tpl-sheet .display { font-size: 10.5px; letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpl-sheet i { display: block; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--tint) 22%, transparent); }
.tpl-sheet i.short { width: 55%; }
.tpl-body { display: flex; flex-direction: column; gap: 6px; }
.tpl-name { font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; }
.tpl-desc { margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tpl-chips .pill { font-size: 11px; }
.tpl-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 4px; border-top: 1px solid var(--line); padding-top: 12px; }
.tpl-actions { position: relative; z-index: 2; display: flex; gap: 2px; }
.tpl-actions form { margin: 0; }

.csv-guide { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; margin-bottom: 16px; }
.csv-guide p { margin: 0; }
.mini-sheet { border-collapse: collapse; font-size: 11px; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px var(--line-2); }
.mini-sheet th { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text-3); font-weight: 500; padding: 4px 8px; }
.mini-sheet td { padding: 5px 9px; border: 1px solid var(--line); white-space: nowrap; background: var(--field); }
.mini-sheet td.is-head { font-weight: 600; background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 70%, var(--text)); }

.tpl-title { width: 100%; border: 0; outline: none; background: none; color: var(--text); padding: 2px 6px; margin-left: -6px; border-radius: 10px; }
.tpl-title:not([readonly]):hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.tpl-title:focus { background: var(--field); box-shadow: 0 0 0 2px var(--accent-soft); }
.tpl-desc-input { width: 100%; max-width: 70ch; border: 0; outline: none; background: none; resize: none; font-size: 15px; line-height: 1.5; padding: 4px 6px; margin: 8px 0 0 -6px; border-radius: 8px; overflow: hidden; }
.tpl-desc-input:focus { background: var(--field); color: var(--text); }
.tpl-hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.save-state { display: inline-flex; align-items: center; gap: 7px; color: var(--text-3); }
.save-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.save-state.is-saving::before { background: var(--warn); animation: pulse .8s infinite; }
.save-state.is-error { color: var(--danger); } .save-state.is-error::before { background: var(--danger); }
.tpl-help { margin: 16px 0 0; }
.tpl-task { grid-template-columns: 14px 10px minmax(0, 1fr) auto; cursor: default; }
.tpl-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--tint); opacity: .7; }
.tpl-task .t-title { outline: none; border-radius: 6px; padding: 2px 4px; margin-left: -4px; cursor: text; }
.tpl-task .t-title:focus { background: var(--field); box-shadow: 0 0 0 2px var(--accent); }
.t-del { opacity: 0; transition: opacity .2s; }
.tpl-task:hover .t-del { opacity: .7; }
.task.is-leaving { opacity: 0; transform: translateX(16px); transition: all .18s; }

.tpl-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; max-height: 240px; overflow-y: auto; padding: 2px; }
.tpl-pick .choice { padding: 12px; }

@media (max-width: 860px) {
  .tpl-hero-side { align-items: flex-start; width: 100%; }
  .csv-guide { grid-template-columns: 1fr; }
  .t-del { opacity: .6; }
}

/* =========================================================
   SCREEN 05 — TO-DO
   ========================================================= */
.todo-stats { display: flex; gap: 10px; }
.todo-stats .stat { min-width: 104px; }
.stat.is-danger .stat-n { color: var(--danger); }
.stat.is-warn .stat-n { color: color-mix(in srgb, var(--warn) 80%, var(--text)); }
.todo-board .todo-bucket { min-height: 140px; }
.bucket-ic { display: grid; place-items: center; color: var(--tint); }
.todo-item { grid-template-columns: 14px 22px minmax(0, 1fr) auto; align-items: start; padding-top: 8px; padding-bottom: 8px; cursor: default; }
.todo-item .t-check { margin-top: 1px; }
.todo-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.todo-item .t-title[tabindex] { cursor: text; }
.todo-item .t-title[contenteditable] { outline: none; background: var(--field); box-shadow: 0 0 0 2px var(--accent); border-radius: 6px; padding: 1px 4px; margin-left: -4px; }
.todo-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.todo-proj { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; font-size: 11.5px; color: var(--text-2); }
.todo-proj span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-proj .ic { flex: none; width: 12px; height: 12px; color: hsl(var(--h) 65% 50%); }
.todo-proj:hover { color: var(--accent); }
.todo-from { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-3); }
.todo-from .ic { width: 12px; height: 12px; }
.todo-item .t-chips { padding-top: 0; }
.todo-item:hover .t-del { opacity: .7; }
.todo-item.is-leaving { opacity: 0; transform: translateX(16px); transition: all .2s var(--ease); }
.bucket-done { align-self: flex-start; margin: 0 18px 4px; color: var(--text-3); padding: 2px 0; }
.bucket-done:hover { color: var(--accent); }

.my-tasks { margin-top: 26px; }
.mt-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.mt-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mt-stat { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 14px; background: color-mix(in srgb, var(--text) 4%, transparent); border: 1px solid var(--line); transition: transform .3s var(--spring), background .2s; }
.mt-stat:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--text) 6%, transparent); }
.mt-stat b { font: 600 26px/1 var(--font-body); letter-spacing: -.02em; }
.mt-stat span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.mt-stat.is-danger b { color: var(--danger); }
.mt-stat.is-warn b { color: color-mix(in srgb, var(--warn) 80%, var(--text)); }
.mt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mt-item { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 10px; transition: background .15s; }
.mt-item:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.mt-list li + li .mt-item { border-top: 1px dashed var(--line); }
.mt-dot { width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--h) 70% 55%); }
.mt-dot.is-personal { background: none; box-shadow: inset 0 0 0 2px var(--text-3); }
.mt-title { display: flex; flex-direction: column; min-width: 0; font-size: 13.5px; font-weight: 500; }
.mt-title small { font-size: 11.5px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 980px) {
  .mt-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .todo-stats { width: 100%; }
  .todo-stats .stat { flex: 1; min-width: 0; }
}

@media (max-width: 860px) {
  .todo-item { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .tpl-task { grid-template-columns: 10px minmax(0, 1fr) auto; }
}

/* =========================================================
   GLOBAL SEARCH (command palette)
   ========================================================= */
button.search-pill { cursor: pointer; text-align: left; transition: border-color .2s, box-shadow .25s, background .2s; }
button.search-pill:hover { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); color: var(--text-2); }
button.search-pill span { flex: 1; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette { position: fixed; inset: 0; z-index: 180; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.palette-scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--brand-ink, #000) 28%, transparent); animation: fade .14s var(--ease); }
.palette-card { position: relative; width: min(640px, 100%); max-height: 70vh; border-radius: 22px; display: flex; flex-direction: column; overflow: hidden; animation: pop .22s var(--spring); }
.palette.is-closing .palette-card { animation: popout .18s var(--ease) forwards; }
.palette.is-closing .palette-scrim { animation: fade .18s var(--ease) reverse forwards; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--text-3); }
.palette-input input { flex: 1; border: 0; outline: none; background: none; font-size: 17px; color: var(--text); }
.palette-body { flex: 1; overflow-y: auto; padding: 8px; transition: opacity .2s; }
.palette-body.is-loading { opacity: .6; }
.pal-group + .pal-group { margin-top: 6px; }
.pal-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 8px 10px 6px; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; }
.pal-item.is-active { background: var(--accent-soft); }
.pal-ic { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); background: color-mix(in srgb, var(--text) 5%, transparent); }
.pal-ic[style] { color: #fff; background: linear-gradient(140deg, hsl(var(--h) 78% 62%), hsl(calc(var(--h) + 35) 70% 44%)); }
.pal-item.is-active .pal-ic:not([style]) { color: var(--accent); background: var(--glass-2); }
.pal-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pal-text b { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-text small { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-item.is-done .pal-text b { text-decoration: line-through; color: var(--text-3); }
.pal-go { opacity: 0; color: var(--accent); font-size: 13px; }
.pal-item.is-active .pal-go { opacity: 1; }
.pal-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 36px 16px; text-align: center; }
.palette-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--text-3); }
.palette-foot kbd { margin-right: 3px; }
@media (max-width: 640px) {
  .palette { padding: 10px; }
  .palette-card { max-height: 80vh; }
  .palette-foot { display: none; }
}

/* =========================================================
   v6 — FOLLOW-UPS · STAGES · DUPES · MENTIONS · BELL · WORKLOAD · ACTIVITY
   ========================================================= */
/* Stages */
.stage-new { --sc: #08B9EF; } .stage-contacted { --sc: #8B6CF6; } .stage-proposal { --sc: #E2A336; } .stage-negotiation { --sc: #12A594; } .stage-none { --sc: var(--text-3); }
.c-stage .cell-select-wrap { width: 168px; }
.stage-select { font-weight: 500; color: color-mix(in srgb, var(--sc) 75%, var(--text)); background-color: color-mix(in srgb, var(--sc) 12%, transparent); border-color: color-mix(in srgb, var(--sc) 22%, transparent); margin-left: -4px; }
.stage-select.stage-none { background-color: transparent; border-color: transparent; color: var(--text-3); }
.stage-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.stage-pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 99px; font-size: 12.5px; font-weight: 500; color: var(--text-2);
  background: color-mix(in srgb, var(--text) 4%, transparent); border: 1px solid transparent; transition: all .2s; }
.stage-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--sc); }
.stage-pill b { font: 500 11px var(--font-mono); color: var(--text-3); }
.stage-pill:hover { color: var(--text); }
.stage-pill.is-on { color: var(--text); background: var(--glass-2); border-color: color-mix(in srgb, var(--sc, var(--accent)) 40%, var(--line)); box-shadow: var(--glass-hi), var(--shadow-sm); }

/* Follow-ups */
.c-fu .fu-cell { display: flex; align-items: center; gap: 4px; width: 172px; height: 51px; padding: 0 10px; }
.fu-set { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 8px; font-size: 12px; color: var(--text-3); opacity: .55; transition: all .2s; }
tr:hover .fu-set { opacity: 1; }
.fu-set:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.fu-set .ic, .fu-date .ic { width: 13px; height: 13px; }
.fu-date { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 9px; font-size: 11.5px; color: var(--text-2); background: color-mix(in srgb, var(--text) 5%, transparent); }
.fu-date:not(:disabled):hover { background: color-mix(in srgb, var(--text) 9%, transparent); }
.fu-date.is-today { color: color-mix(in srgb, var(--warn) 75%, var(--text)); background: color-mix(in srgb, var(--warn) 15%, transparent); }
.fu-date.is-overdue { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.fu-date.is-soon { color: color-mix(in srgb, var(--accent) 70%, var(--text)); }
.fu-done { width: 26px; height: 26px; border-radius: 8px; font-size: 13px; color: var(--ok); opacity: 0; transition: all .2s; }
tr:hover .fu-done { opacity: .8; }
.fu-done:hover { opacity: 1; background: color-mix(in srgb, var(--ok) 14%, transparent); }
.fu-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; font-size: 11.5px;
  color: color-mix(in srgb, var(--warn) 70%, var(--text)); background: color-mix(in srgb, var(--warn) 13%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); transition: all .2s; }
.fu-chip.is-on { background: var(--warn); color: #1d1300; }
.fu-chip .ic { width: 13px; height: 13px; }

/* Duplicate badge */
.sheet td.c-client { position: sticky; }
.dupe { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 20px; min-width: 22px; padding: 0 5px; border-radius: 6px;
  font: 600 10.5px/20px var(--font-mono); color: #8a4b00; background: color-mix(in srgb, var(--warn) 30%, var(--glass-2)); border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent); z-index: 1; }
[data-theme="dark"] .dupe { color: #ffd38a; }
.dupe:hover { background: var(--warn); color: #1d1300; }

/* Mentions */
.mention { font-weight: 600; color: color-mix(in srgb, var(--accent) 80%, var(--text)); background: var(--accent-soft); border-radius: 5px; padding: 0 3px; }
.bubble-row.is-mine .mention { color: #fff; background: rgba(255,255,255,.22); }
.mention-pop { position: fixed; z-index: 260; width: 240px; padding: 6px; border-radius: 14px; animation: menuIn .2s var(--spring); }
.mention-pop .menu-item { height: 34px; }

/* Bell */
.bell-wrap { position: relative; }
.bell { position: relative; width: 40px; height: 40px; border-radius: 12px; }
.bell-dot { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; font-size: 10px; line-height: 17px; text-align: center;
  color: #fff; background: var(--danger); box-shadow: 0 0 0 2px var(--glass-2); animation: pop .4s var(--spring); }
.bell-panel { position: absolute; right: -60px; top: calc(100% + 10px); width: 380px; max-height: 70vh; border-radius: 18px; display: flex; flex-direction: column; overflow: hidden; z-index: 60; }
.bell-panel.is-in { animation: menuIn .14s var(--ease); }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.bell-list { overflow-y: auto; padding: 6px; }
.notif { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px; border-radius: 12px; position: relative; transition: background .15s; }
.notif:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.notif.is-unread { background: var(--accent-soft); }
.notif.is-unread::before { content: ""; position: absolute; left: 3px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--accent); }
.notif-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-text b { font-weight: 500; font-size: 13px; line-height: 1.35; }
.notif-text small { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mt-dot.is-lead { background: var(--warn); }
.todo-lead .ic { color: var(--warn); }

/* Workload */
.wl-head, .wl-row summary { display: grid; grid-template-columns: minmax(200px, 1.6fr) 80px 80px minmax(200px, 1.4fr) 80px 90px 120px; align-items: center; gap: 12px; }
.wl-head { padding: 22px 18px 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; }
.wl-list { display: flex; flex-direction: column; gap: 8px; }
.wl-row { border-radius: 18px; overflow: hidden; transition: box-shadow .3s, background .2s; }
.wl-row summary { list-style: none; cursor: pointer; padding: 12px 18px; }
.wl-row summary::-webkit-details-marker { display: none; }
.wl-row:hover { background: var(--glass-hover); }
.wl-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.wl-person > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.wl-person b { font-weight: 600; }
.wl-person small { font-size: 12px; }
.wl-num { display: flex; flex-direction: column; }
.wl-num b { font: 600 20px/1 var(--font-body); }
.wl-num small { font-size: 10.5px; margin-top: 3px; }
.wl-strip { display: flex; align-items: flex-end; gap: 5px; height: 38px; }
.wl-bar { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; width: 18px; height: 100%; }
.wl-bar i { display: block; width: 100%; height: calc(4px + var(--v) * 24px); border-radius: 4px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 70%, white), var(--accent)); transform-origin: bottom; animation: barUp .8s var(--spring) both; }
.wl-bar.is-zero i { background: color-mix(in srgb, var(--text) 10%, transparent); height: 4px; }
.wl-bar em { font-style: normal; font-size: 9px; color: var(--text-3); margin-top: 3px; }
.wl-strip > b { margin-left: 8px; align-self: center; }
@keyframes barUp { from { transform: scaleY(0); } }
.wl-load { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.wl-pill { font-size: 11px; padding: 3px 9px; border-radius: 99px; }
.wl-pill.is-low { color: color-mix(in srgb, var(--ok) 70%, var(--text)); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.wl-pill.is-mid { color: color-mix(in srgb, var(--warn) 75%, var(--text)); background: color-mix(in srgb, var(--warn) 15%, transparent); }
.wl-pill.is-high { color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, transparent); }
.wl-chev { color: var(--text-3); transition: transform .3s var(--spring); }
.wl-row[open] .wl-chev { transform: rotate(90deg); }
.wl-detail { padding: 4px 18px 16px 70px; border-top: 1px dashed var(--line); animation: fade .3s; }
.wl-task { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 6px; border-radius: 10px; }
.wl-task:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.wl-task-title { display: flex; flex-direction: column; font-size: 13.5px; min-width: 0; }
.wl-task-title small { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-check-dot { width: 12px; height: 12px; border-radius: 4px; border: 1.5px solid color-mix(in srgb, var(--text) 30%, transparent); }
.t-check-dot.is-doing { border-color: var(--warn); background: linear-gradient(90deg, color-mix(in srgb, var(--warn) 40%, transparent) 50%, transparent 50%); }

/* Activity */
.act-date { width: 150px; }
.act-card { padding: 10px 22px 18px; }
.act-list { list-style: none; margin: 0; padding: 0; }
.act-day { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 16px 0 8px; position: sticky; top: 84px; background: transparent; }
.act-item { display: grid; grid-template-columns: 44px 8px 24px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.act-dot { width: 8px; height: 8px; border-radius: 50%; }
.act-text { min-width: 0; }
.act-detail { color: var(--text-2); }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }

@media (max-width: 1180px) {
  .wl-head { display: none; }
  .wl-row summary { grid-template-columns: minmax(0, 1fr) 52px 52px auto; gap: 10px; }
  .wl-row summary > :nth-child(4), .wl-row summary > :nth-child(5), .wl-row summary > :nth-child(6) { display: none; }
  .wl-row summary > :nth-child(2) small { display: none; }
  .wl-row summary > :nth-child(2)::after, .wl-row summary > :nth-child(3)::after { font: 400 10px var(--font-mono); color: var(--text-3); margin-top: 4px; }
  .wl-row summary > :nth-child(2)::after { content: "open"; }
  .wl-row summary > :nth-child(3)::after { content: "late"; }
  .wl-pill { display: none; }
  .wl-list { margin-top: 16px; }
}
@media (max-width: 640px) {
  .bell-panel { position: fixed; left: 10px; right: 10px; top: 76px; width: auto; }
  .wl-detail { padding-left: 18px; }
  .act-item { grid-template-columns: 40px 8px minmax(0, 1fr); }
  .act-item .avatar { display: none; }
}

/* ---------- Speed ---------- */
/* Taps fire instantly (no 300ms double-tap wait) */
a, button, [role="button"], label, summary, select, input[type="checkbox"], .task, .tile, .sb-link { touch-action: manipulation; }
/* Off-screen rows and cards skip layout & paint until scrolled near */
.wl-row, .act-item { content-visibility: auto; contain-intrinsic-size: auto 64px; }
/* Respect "reduce motion" — everything instant */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
/* Page was prerendered before the click — appear instantly, skip entrance animations */
html.pre .page, html.pre .rise, html.pre .phase, html.pre .sheet tbody tr, html.pre .wl-bar i, html.pre .meter span, html.pre .ct-bar span, html.pre .ring-fg { animation: none !important; }

/* ---------- Lead grid: full width, fits the screen, column & density controls ---------- */
.page:has(.sheet-card) { max-width: none; }
.sheet-scroll:has(.sheet-empty:not([hidden])) { min-height: 260px; }
.sheet-scroll::-webkit-scrollbar { height: 10px; width: 10px; }
.sheet-scroll::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text) 18%, transparent); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
.sheet-scroll::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--text) 32%, transparent); }
.sheet-scroll::-webkit-scrollbar-corner { background: transparent; }
.sheet-frame { position: relative; }
.sheet-frame::after { content: ""; position: absolute; top: 0; right: 0; bottom: 10px; width: 56px; pointer-events: none; z-index: 5;
  background: linear-gradient(to left, color-mix(in srgb, var(--sheet-row) 92%, transparent), transparent); opacity: 0; transition: opacity .2s; border-top-right-radius: 4px; }
.sheet-frame.has-more::after { opacity: 1; }
.sheet .c-client { transition: box-shadow .2s; box-shadow: none; }
.sheet-frame.is-scrolled .sheet .c-client { box-shadow: 8px 0 14px -10px rgba(0,0,0,.28); }
[data-theme="dark"] .sheet-frame.is-scrolled .sheet .c-client { box-shadow: 8px 0 14px -8px rgba(0,0,0,.7); }
/* header: clearer, slightly taller hit area; sortable columns show their arrow on hover */
.sheet th { height: 40px; }
.sheet thead th { box-shadow: inset 0 -1px 0 var(--line-2); border-bottom: 0; }
/* the action column absorbs spare width only on wide screens; it never forces extra scrolling */
.c-actions { min-width: 120px; }

/* compact rows */
.is-compact .sheet td { height: 38px; }
.is-compact .cell { min-height: 37px; max-height: 37px; padding: 8px 12px; }
.is-compact .cell-select-wrap { height: 37px; }
.is-compact .cell-select { height: 28px; }
.is-compact .remark-btn { height: 37px; padding: 3px 12px; gap: 0; }
.is-compact .remark-meta { display: none; }
.is-compact .fu-cell { height: 37px !important; }
.is-compact .ans-cell, .is-compact .ad-cell { max-height: 37px; overflow: hidden; }

/* View menu */
.cols-menu { position: fixed; z-index: 240; width: 248px; padding: 8px; border-radius: 16px; max-height: min(520px, calc(100vh - 80px)); overflow-y: auto; }
.cols-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; }
.cols-head .link-btn { text-transform: none; letter-spacing: 0; font-family: var(--font-body); }
.cols-density { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; margin: 0 4px 4px; border-radius: 11px; background: color-mix(in srgb, var(--text) 5%, transparent); }
.cols-density button { height: 30px; border-radius: 8px; font-size: 12.5px; color: var(--text-2); transition: all .15s; }
.cols-density button.is-on { background: var(--glass-2); color: var(--text); box-shadow: var(--shadow-sm); }
.cols-list { display: flex; flex-direction: column; }
.cols-item { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 8px; border-radius: 9px; font-size: 13px; cursor: pointer; }
.cols-item:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.cols-item input { width: 15px; height: 15px; accent-color: var(--accent); }
[data-cols-btn].is-on { color: var(--accent); }

/* toolbar wraps tidily on mid-size screens */
@media (max-width: 1700px) {
  .sheet-toolbar { row-gap: 8px; }
  .sheet-actions .btn-label { display: none; }     /* View / Import / Export become icon buttons so the toolbar stays on one line */
  .sheet-actions .btn-ghost { width: 36px; padding: 0; justify-content: center; }
  .sheet-search { flex: 1 1 200px; max-width: 300px; }
}
/* frozen client column: a clear divider once you scroll sideways */
.sheet-frame.is-scrolled .sheet .c-client { border-right: 1px solid var(--line-2); }
/* short laptop screens: give the rows the room instead of the page header */
@media (max-height: 860px) and (min-width: 861px) {
  .page:has(.sheet-card) { padding-top: 20px; }
  .page:has(.sheet-card) .hero .lead { display: none; }
  .page:has(.sheet-card) .hero .h1 { margin-bottom: 0; }
  .page:has(.sheet-card) .tabs { margin-top: 14px; }
}

/* ---------- Phones: each lead becomes a readable card ---------- */
@media (max-width: 640px) {
  .sheet-scroll { max-height: none !important; overflow: visible; }
  .sheet-frame::after { display: none; }
  .sheet, .sheet tbody { display: block; width: 100%; min-width: 0; }
  .sheet thead { display: none; }
  .sheet tbody tr { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; column-gap: 10px; align-items: center;
    padding: 14px 14px 10px; border-bottom: 1px solid var(--line-2); content-visibility: auto; contain-intrinsic-size: auto 330px; }
  .sheet tbody tr:hover td { background: transparent; }
  .sheet tbody tr.is-selected { background: color-mix(in srgb, var(--accent) 7%, transparent); }
  .sheet td, .sheet td + td { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; min-height: 0; height: auto;
    padding: 0; border: 0; position: static !important; left: auto !important; box-shadow: none !important; background: transparent !important; grid-column: 1 / -1; }
  .sheet td::before { content: attr(data-label); font: 500 10px/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
  .sheet td.c-num, .sheet td.c-added { display: none; }
  /* header line: checkbox · name · actions */
  .sheet td.c-check { grid-column: 1; grid-row: 1; display: block; text-align: left !important; width: auto; min-width: 0; }
  .sheet td.c-client { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: 8px; }
  .sheet td.c-actions { grid-column: 3; grid-row: 1; display: block; width: auto; min-width: 0; }
  .sheet td.c-brand { grid-column: 2 / -1; grid-row: 2; display: block; margin: -4px 0 6px; }
  .sheet td.c-check::before, .sheet td.c-client::before, .sheet td.c-actions::before, .sheet td.c-brand::before { display: none; }
  .sheet td.c-client .cell { width: auto; min-height: 0; max-height: none; padding: 2px 0; font-size: 16px; white-space: normal; }
  .sheet td.c-brand .cell { width: auto; min-height: 0; max-height: none; padding: 0; color: var(--text-2); font-size: 13.5px; }
  .sheet td.c-brand .cell[contenteditable]:empty::before { content: "Add brand"; opacity: .45; }
  .dupe { position: static; transform: none; flex: none; }
  /* field lines */
  .sheet td .cell { width: auto !important; min-height: 38px; max-height: none; padding: 10px 0; }
  .sheet td.c-req .cell { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
  .sheet .cell-select-wrap { width: auto !important; height: 40px; padding: 0; }
  .sheet .cell-select { margin-left: 0; height: 34px; font-size: 14px; }
  .sheet .stage-select { margin-left: 0; max-width: 200px; }
  .c-fu .fu-cell { width: auto; height: 40px; padding: 0; }
  .fu-set, .fu-done { opacity: 1; }
  .remark-btn { width: auto; height: auto; min-height: 40px; padding: 8px 0; }
  .remark-text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .ans-cell, .ad-cell { width: auto; height: auto; padding: 8px 0; }
  .ans-a, .ad-name, .ad-set { white-space: normal; }
  .row-actions { justify-content: flex-end; }
  .sheet-empty { position: static; }
  /* toolbar: tighter */
  .sheet-toolbar { gap: 8px; }
  .sheet-filter { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .stage-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .stage-bar::-webkit-scrollbar { display: none; }
  .stage-pill { flex: none; }
  .is-compact .sheet tbody tr { padding-top: 10px; padding-bottom: 6px; }
  .is-compact .sheet td .cell, .is-compact .sheet .cell-select-wrap, .is-compact .c-fu .fu-cell, .is-compact .remark-btn { min-height: 32px; height: auto; padding-top: 6px; padding-bottom: 6px; }
}

.phone-wrap { display: flex; align-items: center; }
.phone-wrap .cell { flex: 1; min-width: 0; }
.m-links { display: none; }
@media (max-width: 640px) {
  .m-links { display: inline-flex; gap: 6px; flex: none; }
  .m-link { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--accent); background: var(--accent-soft); }
  .m-link.is-wa { color: #1FA855; background: color-mix(in srgb, #25D366 14%, transparent); }
  .m-link .ic { width: 16px; height: 16px; }
  /* tighter field lines */
  .sheet td, .sheet td + td { grid-template-columns: 84px minmax(0, 1fr); }
  .sheet td .cell { min-height: 34px; padding: 7px 0; font-size: 14px; }
  .sheet .cell-select-wrap { height: 36px; gap: 8px; }
  .sheet .cell-select:not(.stage-select) { padding-left: 0; border-color: transparent; }
  .sheet .stage-select { height: 30px; }
  .c-fu .fu-cell { height: 36px; }
  .remark-btn { min-height: 34px; padding: 6px 0; font-size: 13.5px; }
  .sheet tbody tr { padding: 12px 14px 8px; }
}

/* Ads Leads: sync status + Sync now */
.sync-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sync-chip.is-err i { background: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 18%, transparent); animation: none; }
.sync-now .ic { transition: transform .3s; }
.sync-now.is-busy .ic { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) { .sync-group { width: 100%; } .sync-now { margin-left: auto; } }

/* =========================================================
   v10 — stages, marks, follow-up time, bulk edit, sheets, inbox sort
   ========================================================= */
.stage-no_response { --sc: #E5587A; } .stage-not_interested { --sc: #6B7280; }
.stage-select.stage-not_interested { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text) 30%, transparent); }

/* In touch / Junk */
.mark-touch { --mc: #12A594; } .mark-noreply { --mc: #E8A33D; } .mark-junk { --mc: #E5587A; } .mark-none { --mc: var(--text-3); }
.c-mark .cell-select-wrap { width: 150px; }
.mark-select { font-weight: 500; margin-left: -4px; color: color-mix(in srgb, var(--mc) 78%, var(--text)); background-color: color-mix(in srgb, var(--mc) 12%, transparent); border-color: color-mix(in srgb, var(--mc) 22%, transparent); }
.mark-select.mark-none { background-color: transparent; border-color: transparent; color: var(--text-3); font-weight: 400; }
.sheet tbody tr.is-junk td:not(.c-mark):not(.c-check):not(.c-actions) > * { opacity: .5; }
.sheet tbody tr.is-junk td.c-client .cell { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text) 35%, transparent); }

/* Pipeline header: tabs sit beside the title — no dead space */
.hero-pipeline { align-items: flex-end; }
.hero-pipeline .hero-tabs { margin: 0 0 4px; }
.page:has(.hero-pipeline) .sheet-card { margin-top: 22px; }
@media (max-width: 1100px) { .hero-pipeline .hero-tabs { width: 100%; } }

/* Follow-up picker */
.fu-pop { width: 300px; padding: 12px; z-index: 230; display: flex; flex-direction: column; gap: 10px; }
.fu-quick, .fu-times { display: flex; flex-wrap: wrap; gap: 6px; }
.fu-quick button, .fu-times button { height: 30px; padding: 0 11px; border-radius: 99px; font-size: 12.5px; color: var(--text-2);
  background: color-mix(in srgb, var(--text) 5%, transparent); border: 1px solid transparent; transition: all .15s; }
.fu-quick button:hover, .fu-times button:hover { color: var(--text); border-color: var(--line-2); background: var(--glass-2); }
.fu-inputs { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; }
.fu-inputs .input { min-width: 0; }
.fu-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 4px; border-top: 1px solid var(--line); }
.c-fu .fu-cell { width: 196px; }

/* Bulk edit */
.bulk-grid { margin-bottom: 4px; }
.bulk-fu-when { grid-column: 1 / -1; }
.bulk-fu-when .fu-inputs { grid-template-columns: 1fr 1fr; }

/* Notifications: remove one / clear all */
.bell-acts { display: flex; gap: 12px; }
.notif-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.notif-x { width: 22px; height: 22px; border-radius: 7px; font-size: 16px; line-height: 1; color: var(--text-3); opacity: 0; transition: opacity .15s, background .15s; }
.notif:hover .notif-x { opacity: 1; }
.notif-x:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.notif.is-leaving { opacity: 0; transform: translateX(14px); transition: all .18s; }
@media (hover: none) { .notif-x { opacity: .7; } }

/* To-do inbox: auto-sorted */
.inbox-sort { margin: -2px 16px 2px; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }

/* Ads sync: several sheets */
.feed-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.feed-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.feed-tab { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 99px; font-size: 13px; color: var(--text-2);
  background: var(--glass); border: 1px solid var(--glass-edge); transition: all .15s; }
.feed-tab:hover { color: var(--text); }
.feed-tab.is-on { color: var(--text); background: var(--glass-2); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--glass-hi), var(--shadow-sm); }
.feed-tab i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.feed-tab i.is-ok { background: var(--ok); } .feed-tab i.is-err { background: var(--danger); }
.feed-hint { margin: 10px 2px 0; }

@media (max-width: 640px) {
  .sheet td.c-mark .cell-select-wrap { width: auto; }
  .mark-select { max-width: 170px; margin-left: 0; }
  .fu-pop { width: calc(100vw - 24px); }
}
.page .hero-pipeline .hero-tabs { margin-top: 0; }
.fu-date { white-space: nowrap; }
.c-fu .fu-cell { width: 214px; }
.sheet-toolbar .sheet-filter { max-width: 172px; min-width: 118px; }
@media (max-width: 640px) { .sheet-toolbar .sheet-filter { max-width: none; } }
/* Glass inside the (already blurred) top bar can't blur again — keep the panel solid enough to read */
.bell-panel { background: color-mix(in srgb, var(--bg) 96%, transparent) !important; }
[data-theme="dark"] .bell-panel { background: color-mix(in srgb, var(--brand-surface, #222) 96%, #000) !important; }

/* ---------- Phones: lead cards collapse to their name; tap to expand ---------- */
.m-sum, .m-chev { display: none; }
@media (max-width: 640px) {
  .sheet tbody tr { padding: 12px 14px; row-gap: 0; transition: background .2s; }
  .sheet tbody tr:not(.is-open) td:not(.c-check):not(.c-client):not(.c-actions):not(.c-brand) { display: none !important; }
  .sheet tbody tr:not(.is-open) td.c-brand { margin: -2px 0 0; }
  .sheet tbody tr:not(.is-open) td.c-brand .cell[contenteditable]:empty::before { content: none; }
  .sheet tbody tr:not(.is-open) td.c-client .cell, .sheet tbody tr:not(.is-open) td.c-brand .cell { pointer-events: none; }
  .sheet tbody tr:not(.is-open) td.c-client, .sheet tbody tr:not(.is-open) td.c-brand { cursor: pointer; }
  .sheet td.c-client { flex-wrap: wrap; row-gap: 4px; padding-right: 26px !important; position: relative !important; }
  .sheet td.c-client .cell { flex: 1 1 auto; min-width: 0; font-size: 15.5px; }
  .m-chev { display: grid; place-items: center; position: absolute; right: -2px; top: 2px; width: 26px; height: 26px; border-radius: 8px; color: var(--text-3); cursor: pointer; transition: transform .25s var(--spring), color .2s; }
  .m-chev .ic { width: 16px; height: 16px; }
  .sheet tbody tr.is-open .m-chev { transform: rotate(180deg); color: var(--accent); }
  .m-sum { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; order: 3; }
  .m-sum i { font-style: normal; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px;
    background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text-2); }
  .m-sum .m-tag { color: color-mix(in srgb, var(--sc, var(--mc)) 80%, var(--text)); background: color-mix(in srgb, var(--sc, var(--mc)) 13%, transparent); font-weight: 500; }
  .m-sum .m-fu .ic { width: 12px; height: 12px; }
  .sheet tbody tr.is-open .m-sum { display: none; }
  .sheet tbody tr.is-open { background: color-mix(in srgb, var(--accent) 3%, transparent); }
  .sheet tbody tr.is-open td.c-brand { margin: -2px 0 8px; }
  .sheet tbody tr:not(.is-open) .row-actions .btn { display: none; }   /* keep the closed card to one clean line */
  .sheet td.c-check { align-self: start; padding-top: 3px !important; }
  .sheet td.c-actions { align-self: start; }
}
@media (max-width: 640px) {
  .sheet td.c-brand { display: flex !important; flex-direction: column; align-items: flex-start; gap: 6px; }
  .sheet tbody tr:not(.is-open) td.c-brand .cell { min-height: 0; padding: 0; }
  .sheet tbody tr:not(.is-open) td.c-brand .cell:empty { display: none; }
  .m-sum { order: 0; width: auto; }
  .sheet td.c-client { flex-wrap: nowrap; }
  .sheet td.c-client .dupe { flex: none; }
}

/* ---------- To-do: client tag, private, comments ---------- */
.todo-client .ic { color: hsl(var(--h, 200) 60% 50%); }
.todo-priv { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-3); }
.todo-priv .ic { width: 12px; height: 12px; }
.todo-item.is-private { background: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in srgb, var(--text) 2.5%, transparent) 8px 9px); }
.t-talk { display: inline-flex; align-items: center; gap: 3px; height: 26px; padding: 0 6px; border-radius: 8px; color: var(--text-3); opacity: 0; transition: opacity .15s, background .15s; }
.t-talk .ic { width: 14px; height: 14px; }
.t-talk b { font: 600 11px var(--font-mono); }
.t-talk.has { opacity: 1; color: var(--accent); }
.todo-item:hover .t-talk { opacity: 1; }
.t-talk:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
@media (hover: none) { .t-talk { opacity: .8; } }
.todo-item { cursor: pointer; }

.add-opts { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 10px 12px 34px; }
.add-chip { position: relative; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 11.5px; color: var(--text-3);
  background: color-mix(in srgb, var(--text) 4%, transparent); border: 1px solid transparent; cursor: pointer; max-width: 100%; transition: all .15s; }
.add-chip:hover { color: var(--text); border-color: var(--line-2); }
.add-chip .ic { width: 12px; height: 12px; }
.add-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.add-chip select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.add-chip.is-on { color: color-mix(in srgb, var(--accent) 80%, var(--text)); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.add-chip.is-lock { color: var(--text); background: color-mix(in srgb, var(--text) 9%, transparent); border-color: var(--line-2); }

.todo-drawer .td-props { display: flex; flex-direction: column; gap: 10px; padding: 0 22px 16px; border-bottom: 1px solid var(--line); flex: none; }
.td-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); align-items: center; gap: 10px; font-size: 13.5px; }
.td-row .input { height: 34px; }
.td-l { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.td-priv { grid-template-columns: 70px auto minmax(0, 1fr); cursor: pointer; }
.todo-drawer .td-props .btn { justify-self: start; align-self: flex-start; }
.todo-drawer .td-props { align-items: stretch; padding-top: 2px; }
.todo-drawer .td-row { width: 100%; justify-content: start; justify-items: start; }
.todo-drawer .td-row .input { width: 100%; max-width: 320px; }

/* ---------- Lead sheets: compact header so the table gets the room (laptops & up) ---------- */
@media (min-width: 861px) {
  .page:has(.sheet-card) { padding-top: 14px; }
  .page:has(.sheet-card) .hero { gap: 12px; align-items: center; flex-wrap: nowrap; }
  .page:has(.sheet-card) .hero .eyebrow, .page:has(.sheet-card) .hero .lead { display: none; }
  .page:has(.sheet-card) .hero .h1 { font-size: 24px; letter-spacing: .04em; white-space: nowrap; }
  .page:has(.sheet-card) .hero-tabs { margin: 0 !important; }
  .page:has(.sheet-card) .hero-tabs .tab { height: 32px; padding: 0 12px; font-size: 13px; }
  .page:has(.sheet-card) .sync-group { gap: 8px; flex-wrap: nowrap; }
  .page:has(.sheet-card) .sync-chip { padding: 5px 12px 5px 10px; gap: 8px; }
  .page:has(.sheet-card) .sync-chip b { font-size: 12.5px; }
  .page:has(.sheet-card) .sync-chip small { font-size: 10.5px; }
  .page:has(.sheet-card) .sync-now { height: 32px; }
  .page:has(.sheet-card) .sheet-card { margin-top: 12px !important; }

  /* toolbar: one tight row */
  .page:has(.sheet-card) .sheet-toolbar { flex-wrap: nowrap; gap: 6px; padding: 8px 10px; }
  .page:has(.sheet-card) .sheet-search { flex: 1 1 200px; min-width: 140px; max-width: 260px; width: auto; height: 32px; }
  .page:has(.sheet-card) .sheet-toolbar .sheet-filter { flex: 0 1 140px; min-width: 92px; max-width: 150px; height: 32px; font-size: 12.5px; padding-left: 10px; }
  .page:has(.sheet-card) .fu-chip { height: 30px; padding: 0 10px; white-space: nowrap; flex: none; }
  .page:has(.sheet-card) .sheet-count { white-space: nowrap; flex: none; }
  .page:has(.sheet-card) .sheet-actions { flex: none; gap: 2px; }
  .page:has(.sheet-card) .sheet-actions .btn-label { display: none; }
  .page:has(.sheet-card) .sheet-actions .btn-ghost { width: 32px; height: 32px; padding: 0; justify-content: center; }
  .page:has(.sheet-card) .sheet-actions .btn-primary { height: 32px; padding: 0 12px; }
  .page:has(.sheet-card) .stage-bar { padding: 6px 10px; gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .page:has(.sheet-card) .stage-pill { height: 26px; padding: 0 10px; font-size: 12px; flex: none; }
  .page:has(.sheet-card) .sheet-note { padding: 5px 12px; font-size: 11.5px; }
  .page:has(.sheet-card) .sheet th { height: 34px; }
  .page:has(.sheet-card) .sheet-addrow { padding-top: 8px; padding-bottom: 8px; }
}
/* very narrow laptops: drop the lead count text */
@media (min-width: 861px) and (max-width: 1280px) {
  .page:has(.sheet-card) .sheet-count { display: none; }
  .page:has(.sheet-card) .sync-chip small { display: none; }
}
@media (min-width: 861px) {
  .page:has(.sheet-card) .sheet-addrow { height: 36px; padding-top: 0; padding-bottom: 0; }
}
@media (min-width: 861px) and (max-height: 900px) {
  .topbar { height: 50px; top: 8px; }
}
@media (min-width: 861px) and (max-width: 1440px) {
  .page:has(.sheet-card) .sheet-count { display: none; }
  .page:has(.sheet-card) .sheet-search { min-width: 170px; }
}
.t-lock { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: var(--text-3); opacity: 0; transition: opacity .15s, background .15s, color .15s; }
.t-lock .ic { width: 13px; height: 13px; }
.todo-item:hover .t-lock { opacity: 1; }
.t-lock:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.t-lock.is-on { opacity: 1; color: var(--text); }
@media (hover: none) { .t-lock { opacity: .7; } }

/* =========================================================
   v12 — trash, automation, notifications, client links, repeats
   ========================================================= */
/* Trash */
.trash-kinds { border: 0; padding: 0; margin-top: 18px; }
.trash-card { padding: 8px 18px; }
.trash-list { list-style: none; margin: 0; padding: 0; }
.trash-item { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.trash-item:last-child { border-bottom: 0; }
.trash-label { display: flex; flex-direction: column; min-width: 0; }
.trash-label b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.trash-label small { font-size: 12px; }
.trash-kind { justify-self: start; }
.trash-lead { color: #0e7490; } .trash-client, .trash-project { color: #7c3aed; } .trash-task, .trash-phase { color: #b45309; }
@media (max-width: 640px) { .trash-item { grid-template-columns: minmax(0, 1fr) auto auto; } .trash-kind { grid-column: 1 / -1; } }

/* Automation */
.job-li { align-items: center; }
.job-li > span { display: flex; flex-direction: column; min-width: 0; }
.job-li small { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.steps.small li { font-size: 13px; }

/* Account notifications */
.notify-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.notify-row:last-of-type { border-bottom: 0; }
.push-ios { margin: 4px 0 8px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); }

/* Repeats */
.t-rep { display: inline-grid; place-items: center; min-width: 22px; height: 22px; font-size: 14px; color: var(--accent); }
.ph-ok { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11px; color: color-mix(in srgb, var(--ok) 80%, var(--text)); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.ph-ok .ic { width: 12px; height: 12px; }

/* Client link + feedback (project page) */
.share-url { display: flex; gap: 8px; }
.share-url .input { flex: 1; min-width: 0; font-size: 12.5px; }
.client-feedback { margin-top: 16px; padding: 14px 18px; }
.client-feedback summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.client-feedback summary::-webkit-details-marker { display: none; }
.client-feedback summary .h3 { display: inline-flex; align-items: center; gap: 8px; margin: 0; flex: 1; }
.is-new-pill { color: #fff !important; background: var(--accent) !important; }
.sp-feed { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sp-feed li { padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--text) 3.5%, transparent); }
.sp-feed li.is-unread { background: var(--accent-soft); }
.sp-feed p { margin: 4px 0 0; font-size: 14px; white-space: pre-wrap; }

/* Public client page */
.share-wrap { max-width: 920px; margin: 0 auto; padding: 22px 16px 60px; position: relative; z-index: 1; }
.share-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.share-hero { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: end; padding: 26px; }
.share-hero .h1 { font-size: clamp(26px, 4vw, 38px); }
.share-pct { display: flex; flex-direction: column; gap: 8px; }
.share-pct .display { font-size: 48px; line-height: 1; }
.share-pct small { font-size: 18px; margin-left: 2px; }
.share-phases { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 16px; }
.share-phase { --tint: var(--text); padding: 18px; border: 1px solid color-mix(in srgb, var(--tint) 18%, var(--glass-edge)); background: color-mix(in srgb, var(--tint) 6%, var(--glass-2)); }
.sp-head { display: flex; align-items: center; gap: 10px; }
.sp-head .h3 { flex: 1; margin: 0; font-size: 16px; }
.sp-ok { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: color-mix(in srgb, var(--ok) 80%, var(--text)); background: color-mix(in srgb, var(--ok) 15%, transparent); padding: 3px 8px; border-radius: 99px; }
.share-phase .phase-bar { margin: 10px 0; }
.sp-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-tasks li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; border-bottom: 1px dashed color-mix(in srgb, var(--tint) 16%, transparent); }
.sp-tasks li:last-child { border-bottom: 0; }
.sp-tasks i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--text) 30%, transparent); }
.sp-tasks .is-doing i { border-color: var(--warn); background: linear-gradient(90deg, var(--warn) 50%, transparent 50%); }
.sp-tasks .is-done i { border-color: var(--ok); background: var(--ok); }
.sp-tasks .is-done span { color: var(--text-3); text-decoration: line-through; }
.sp-approved { margin: 12px 0 0; padding: 8px 10px; border-radius: 10px; color: color-mix(in srgb, var(--ok) 70%, var(--text)); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.sp-approve { margin-top: 12px; }
.sp-approve summary { list-style: none; display: inline-flex; cursor: pointer; }
.sp-approve summary::-webkit-details-marker { display: none; }
.sp-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.share-comments { margin-top: 16px; padding: 22px; }
.share-comments .h3 { margin: 0 0 12px; }
.sp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-foot { text-align: center; margin-top: 22px; }
@media (max-width: 640px) { .share-hero { grid-template-columns: 1fr; padding: 20px; } .sp-row { grid-template-columns: 1fr; } }
.sp-tasks li.muted { display: block; border: 0; }
.ph-progress .row-gap { flex-wrap: wrap; justify-content: flex-end; }
.ph-progress .row-gap .btn { white-space: nowrap; }
.job-li { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.job-li .btn { white-space: nowrap; }

/* ---------- Home-screen app (iPhone notch / Dynamic Island, Android status bar) ---------- */
:root { --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px); }
@media (max-width: 860px) {
  .main { padding-top: calc(10px + var(--sat)); padding-left: calc(10px + var(--sal)); padding-right: calc(10px + var(--sar)); padding-bottom: calc(32px + var(--sab)); }
  .topbar { top: calc(8px + var(--sat)); }
  /* a solid strip behind the status bar so scrolled content never shows through the clock */
  body::before { content: ""; position: fixed; z-index: 19; left: 0; right: 0; top: 0; height: var(--sat); background: var(--bg); pointer-events: none; }
  .sidebar { top: calc(10px + var(--sat)); bottom: calc(10px + var(--sab)); left: calc(10px + var(--sal)); }
  .toasts { top: calc(12px + var(--sat)); }
  .bulkbar { bottom: calc(16px + var(--sab)); }
  .drawer { bottom: calc(8px + var(--sab)); }
  .modal-card { max-height: calc(100dvh - 32px - var(--sat) - var(--sab)); }
  .palette { padding-top: calc(12px + var(--sat)); }
}

/* ---------- Lead filters: inline on desktop, bottom sheet on phones ---------- */
.sheet-filters { display: contents; }
.sf-head, .sf-done, .m-filter-btn, .sf-scrim { display: none; }
@media (max-width: 640px) {
  .m-filter-btn { display: inline-flex; flex: none; gap: 6px; }
  .m-filter-btn.is-on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
  .m-filter-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font: 600 10.5px var(--font-mono); color: #fff; background: var(--accent); }
  .sheet-toolbar .sheet-search { flex: 1 1 auto; width: auto; order: 0; min-width: 0; }
  .sheet-toolbar { flex-wrap: wrap; }
  .sheet-toolbar > .sheet-filters { display: none; }
  .sheet-filters { position: fixed; z-index: 241; left: 8px; right: 8px; bottom: calc(8px + var(--sab, 0px)); display: flex; flex-direction: column; gap: 10px;
    padding: 16px; border-radius: 22px; background: var(--bg); border: 1px solid var(--line-2); box-shadow: 0 -10px 40px rgba(0,0,0,.25);
    transform: translateY(110%); transition: transform .3s var(--spring); max-height: 80dvh; overflow-y: auto; }
  .sheet-filters.is-open { transform: none; }
  .sheet-filters .sheet-filter { width: 100% !important; max-width: none !important; height: 44px; font-size: 15px; flex: none; }
  .sheet-filters .fu-chip { height: 40px; justify-content: center; }
  .sf-head { display: flex; align-items: center; justify-content: space-between; font-size: 16px; padding: 0 2px 2px; }
  .sf-done { display: inline-flex; justify-content: center; height: 46px; font-size: 15px; margin-top: 4px; }
  .sf-scrim { display: block; position: fixed; inset: 0; z-index: 240; background: color-mix(in srgb, #000 35%, transparent); opacity: 0; transition: opacity .25s; }
  .sf-scrim.is-open { opacity: 1; }
  .sheet-count { display: none; }
}
@media (max-width: 640px) {
  .sheet-toolbar .sheet-search { flex: 1 1 0 !important; width: auto !important; min-width: 0 !important; }
  .page:has(.sheet-card) .hero .lead, .page:has(.sheet-card) .hero .eyebrow { display: none; }
  .page:has(.sheet-card) .hero { gap: 12px; }
}

/* ---------- v13: Waiting on client ---------- */
:root { --wait: #8E4EC6; }
.st-waiting .t-check { border-color: var(--wait); border-style: dashed; background: color-mix(in srgb, var(--wait) 12%, transparent); }
.st-waiting .t-title { color: var(--text-2); }
.seg-status .st-waiting:has(input:checked) span { color: color-mix(in srgb, var(--wait) 80%, var(--text)); }
.t-chip.t-wait { color: color-mix(in srgb, var(--wait) 80%, var(--text)); background: color-mix(in srgb, var(--wait) 12%, transparent); border-radius: 6px; padding: 1px 6px; }

/* Dashboard: waiting on clients */
.waiting-card { padding: 16px 18px; margin-top: 18px; }
.waiting-card .card-head { margin-bottom: 8px; flex-wrap: wrap; gap: 4px 12px; }
.waiting-card .h3 { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.wc-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 14px; }
.wc-item { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; transition: background .2s; }
.wc-item:hover { background: var(--glass-2); }
.wc-dot { width: 9px; height: 9px; border-radius: 50%; background: hsl(var(--h) 70% 55%); box-shadow: 0 0 0 3px hsl(var(--h) 70% 55% / .18); }
.wc-main { display: flex; flex-direction: column; min-width: 0; }
.wc-main b, .wc-main small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-tags { display: flex; gap: 4px; }
.wc-tags span { padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--wait) 12%, transparent); color: color-mix(in srgb, var(--wait) 80%, var(--text)); white-space: nowrap; }

/* Project: needed from client */
.areq-list { list-style: none; margin: 10px 0 4px; padding: 0; display: flex; flex-direction: column; }
.areq { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 9px 4px; border-bottom: 1px dashed var(--line); }
.areq:last-child { border-bottom: 0; }
.areq .t-check { margin-top: 1px; border-color: var(--wait); border-style: dashed; }
.areq.is-in .t-check { background: var(--ok); border: 1.6px solid var(--ok); color: #fff; }
.areq.is-in .areq-main > b { color: var(--text-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text) 30%, transparent); }
.areq-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 13.5px; }
.areq-file { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin-top: 4px; padding: 5px 9px 5px 5px; border-radius: 10px; background: var(--field); font-size: 12.5px; color: var(--text-2); align-self: flex-start; }
.areq-file:hover { color: var(--accent); }
.areq-file img { width: 40px; height: 40px; border-radius: 7px; object-fit: cover; }
.areq-file .ic { margin-left: 4px; }
.areq-file span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.areq-add { margin: 6px 0 0; }

/* Client page */
.share-nudge { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 14px 18px; border: 1px solid color-mix(in srgb, var(--wait) 30%, var(--glass-edge)); background: color-mix(in srgb, var(--wait) 8%, var(--glass-2)); }
.share-nudge span:last-child { display: flex; flex-direction: column; gap: 2px; }
.sn-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--wait); box-shadow: 0 0 0 0 color-mix(in srgb, var(--wait) 50%, transparent); animation: snPulse 2s infinite; }
@keyframes snPulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.share-assets { margin-top: 16px; padding: 22px; }
.share-assets .h3 { margin: 0 0 6px; }
.sa-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sa-item { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.sa-item:last-child { border-bottom: 0; padding-bottom: 0; }
.sa-item p { margin: 4px 0 0 20px; }
.sa-head { display: flex; align-items: center; gap: 10px; }
.sa-head b { flex: 1; }
.sa-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; border: 2px dashed var(--wait); }
.sa-item.is-in .sa-dot { border: 0; background: var(--ok); }
.sa-item.is-in .sa-head b { color: var(--text-2); }
.sa-form { margin-left: 20px; }
.sa-drop { position: relative; display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 12px; border-radius: 12px; border: 1.5px dashed color-mix(in srgb, var(--text) 22%, transparent); background: var(--field); color: var(--text-2); font-size: 14px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.sa-drop:hover, .sa-drop:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.sa-drop span { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; overflow-wrap: anywhere; }
.sa-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.sa-form .btn { align-self: flex-start; }
.sp-tasks .is-waiting i { border: 1.5px dashed var(--wait); background: color-mix(in srgb, var(--wait) 18%, transparent); }
.sp-tasks .is-waiting em, .sp-tasks .is-waiting small { color: color-mix(in srgb, var(--wait) 80%, var(--text)); }
@media (max-width: 640px) { .sa-item p, .sa-form { margin-left: 0; } .share-assets { padding: 18px; } }

/* ---------- Shipped wall ---------- */
.ship-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.ship-stats span { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; border-radius: 14px; min-width: 110px; }
.ship-stats b { font: 400 26px/1 var(--font-display); }
.ship-stats small { color: var(--text-3); font-size: 11px; }
.ship-tabs { margin-top: 18px; }
.ship-feed { max-width: 760px; margin: 18px auto 0; display: flex; flex-direction: column; gap: 14px; }
.ship-day { margin: 10px 4px -4px; text-transform: uppercase; letter-spacing: .1em; font-size: 11px; }
.ship { --h: 196; padding: 18px 20px; scroll-margin-top: 90px; border-left: 3px solid hsl(var(--h) 70% 55%); }
.ship:target { box-shadow: 0 0 0 2px var(--accent), var(--shadow-sm); }
.ship-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ship-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 75%, var(--text)); }
.ship-badge.is-approved { background: color-mix(in srgb, var(--ok) 14%, transparent); color: color-mix(in srgb, var(--ok) 75%, var(--text)); }
.ship-title { font: 400 24px/1.15 var(--font-display); margin: 10px 0 4px; }
.ship-title a:hover { color: var(--accent); }
.ship-sub { display: flex; align-items: center; gap: 6px; margin: 0; }
.ship-dot { width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--h) 70% 55%); }
.ship-imgs { display: grid; gap: 6px; margin-top: 14px; border-radius: 14px; overflow: hidden; grid-template-columns: repeat(2, 1fr); }
.ship-imgs.n1 { grid-template-columns: 1fr; }
.ship-imgs.n3 > a:first-child { grid-row: span 2; }
.ship-imgs a { position: relative; display: block; background: var(--field); aspect-ratio: 4 / 3; overflow: hidden; }
.ship-imgs.n1 a { aspect-ratio: 16 / 9; }
.ship-imgs.n3 > a:first-child { aspect-ratio: auto; }
.ship-imgs img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.ship-imgs a:hover img { transform: scale(1.04); }
.ship-imgs em { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); color: #fff; font-size: 20px; font-style: normal; }
.ship-quote { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--ok) 8%, var(--field)); font-size: 14.5px; line-height: 1.5; }
.ship-quote cite { display: block; margin-top: 6px; color: var(--text-3); font-style: normal; }
.ship-by { margin: 12px 0 0; }
.ship-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.ship-team { display: flex; align-items: center; gap: 4px; min-width: 0; flex-wrap: wrap; }
.ship-team .avatar { width: 26px; height: 26px; border-radius: 9px; font-size: 10.5px; box-shadow: 0 0 0 2px var(--glass-2); }
.ship-team .avatar + .avatar { margin-left: -8px; }
.ship-team small { margin-left: 8px; }
.kudos { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--glass-2); font-size: 13px; color: var(--text-2); transition: all .25s var(--spring); flex: none; }
.kudos:hover { border-color: var(--warn); color: var(--text); }
.kudos-ico { font-size: 16px; transition: transform .35s var(--spring); }
.kudos b:empty { display: none; }
.kudos.is-on { background: color-mix(in srgb, var(--warn) 16%, var(--glass-2)); border-color: color-mix(in srgb, var(--warn) 50%, transparent); color: var(--text); }
.kudos.is-pop .kudos-ico { transform: scale(1.5) rotate(-12deg); }
@media (max-width: 640px) {
  .ship-stats span { min-width: 0; flex: 1; padding: 8px 12px; }
  .ship { padding: 16px; }
  .ship-title { font-size: 20px; }
  .kudos-l { display: none; }
}
.ship-imgs a, .ship-imgs.n1 a { aspect-ratio: 16 / 10; }
.ship-imgs.n1 { max-height: 380px; }
/* Workload: mixed items */
.wl-task { grid-template-columns: 24px minmax(0, 1fr) auto; }
div.wl-task:hover { background: none; }
.wl-kind { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--field); color: var(--text-3); }
.wl-k-task { color: color-mix(in srgb, var(--accent) 80%, var(--text)); background: var(--accent-soft); }
.wl-k-todo { color: color-mix(in srgb, var(--ok) 80%, var(--text)); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.wl-k-lead { color: color-mix(in srgb, var(--warn) 85%, var(--text)); background: color-mix(in srgb, var(--warn) 14%, transparent); }
@media (min-width: 1181px) { .wl-head, .wl-row summary { grid-template-columns: minmax(200px, 1.5fr) 120px 80px minmax(200px, 1.4fr) 80px 100px 110px; } }

/* ---------- v14: hand-over (delegation) ---------- */
.t-dlg { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 999px; font-size: 11px; color: var(--text-2); background: color-mix(in srgb, var(--text) 6%, transparent); white-space: nowrap; }
.t-dlg .ic { width: 12px; height: 12px; }
.t-dlg.is-review { color: #fff; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent); animation: reviewPulse 2.2s infinite; }
@keyframes reviewPulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.todo-item.is-review { background: color-mix(in srgb, var(--ok) 7%, transparent); }
.todo-hand { color: color-mix(in srgb, var(--accent) 75%, var(--text)); }
.todo-hand .ic { width: 12px; height: 12px; }
.td-hand { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); font-size: 13px; line-height: 1.45; }
.td-hand .ic { flex: none; margin-top: 2px; color: var(--accent); }
.td-dlg { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; background: color-mix(in srgb, var(--text) 5%, transparent); font-size: 13px; }
.td-dlg.is-review { background: color-mix(in srgb, var(--ok) 11%, transparent); }
.td-dlg-head { display: flex; gap: 10px; align-items: center; line-height: 1.45; }
.td-dlg textarea, .td-dlg-form textarea { width: 100%; max-width: none !important; height: auto !important; resize: vertical; }
.td-dlg-new > summary { list-style: none; cursor: pointer; display: inline-flex; }
.td-dlg-new > summary::-webkit-details-marker { display: none; }
.td-dlg-new[open] > summary { margin-bottom: 10px; }
.td-dlg-form { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; background: color-mix(in srgb, var(--text) 4%, transparent); }
.td-dlg-form .btn { align-self: flex-start; }
.td-rep { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.td-rep .ic { color: var(--accent); }

/* ---------- v14: repeating to-dos ---------- */
.recur-card { max-width: 620px; }
.recur-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rc { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--text) 4%, transparent); }
.rc.is-off { opacity: .6; }
.rc-ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.rc-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13.5px; }
.rc-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-main small { font-size: 11.5px; }
.rc-acts { display: flex; align-items: center; gap: 8px; }
.rc-empty { padding: 10px 2px; }
.recur-form { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.rf-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.rf-every { display: flex; align-items: center; gap: 8px; }
.rf-every .input { width: 72px; }
.rf-days { display: flex; gap: 6px; flex-wrap: wrap; }
.rf-days[hidden], [data-rf-monthly][hidden], [data-rf-every][hidden] { display: none; }
.rf-day input { position: absolute; opacity: 0; pointer-events: none; }
.rf-day span { display: inline-grid; place-items: center; min-width: 46px; height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); font-size: 13px; cursor: pointer; transition: all .15s; }
.rf-day input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.rf-day input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.rf-preview { margin: 0; color: var(--text-2); min-height: 18px; }
@media (max-width: 640px) { .rc { grid-template-columns: 30px minmax(0, 1fr); } .rc-acts { grid-column: 2; } }

/* ---------- v14: client link — open a task ---------- */
.sp-tasks li.is-open { cursor: pointer; border-radius: 8px; margin: 0 -6px; padding-left: 6px; padding-right: 6px; transition: background .15s; }
.sp-tasks li.is-open:hover, .sp-tasks li.is-open:focus-visible { background: color-mix(in srgb, var(--tint) 10%, transparent); outline: none; }
.sp-tasks li.is-open span { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sp-badges { display: inline-flex; gap: 6px; font-style: normal; }
.sp-badges b { display: inline-flex; align-items: center; gap: 2px; font-weight: 500; font-size: 10.5px; color: var(--text-3); text-decoration: none; }
.sp-badges .ic { width: 11px; height: 11px; }
.sp-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.sp-modal[hidden] { display: none; }
.sp-scrim { position: absolute; inset: 0; background: rgba(10, 9, 8, .38); animation: fade .18s var(--ease); }
.sp-sheet { position: relative; width: 100%; max-width: 640px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; padding: 0; overflow: hidden; animation: pop .26s var(--spring); }
.spm-head { display: flex; justify-content: space-between; gap: 14px; padding: 20px 22px 12px; border-bottom: 1px solid var(--line); }
.spm-head .h3 { margin: 2px 0 6px; font-size: 20px; }
.spm-head p { margin: 0; }
.spm-st { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; background: color-mix(in srgb, var(--text) 7%, transparent); }
.spm-st.st-done { background: color-mix(in srgb, var(--ok) 15%, transparent); color: color-mix(in srgb, var(--ok) 75%, var(--text)); }
.spm-st.st-doing { background: color-mix(in srgb, var(--warn) 16%, transparent); }
.spm-st.st-waiting { background: color-mix(in srgb, var(--wait) 15%, transparent); color: color-mix(in srgb, var(--wait) 80%, var(--text)); }
.spm-body { overflow-y: auto; padding: 6px 22px 10px; display: flex; flex-direction: column; gap: 18px; }
.spm-body section { display: flex; flex-direction: column; gap: 8px; }
.spm-h { margin: 8px 0 0; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); font-weight: 500; }
.spm-desc { font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.spm-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.spm-imgs a { display: block; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--field); }
.spm-imgs img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.spm-imgs a:hover img { transform: scale(1.04); }
.spm-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.spm-files a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--field); font-size: 13.5px; }
.spm-files a:hover { color: var(--accent); }
.spm-files a span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spm-ext { font-size: 10px; text-transform: uppercase; padding: 3px 6px; border-radius: 6px; background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 75%, var(--text)); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spm-chat { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.spm-chat li { padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--text) 5%, transparent); font-size: 14px; }
.spm-chat li.is-client { background: var(--accent-soft); margin-left: 28px; }
.spm-chat li.is-team { margin-right: 28px; }
.spm-chat li div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spm-chat p { margin: 4px 0 0; line-height: 1.5; overflow-wrap: anywhere; }
.spm-team { font-size: 10px; padding: 1px 6px; border-radius: 6px; background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text-3); }
.spm-form { padding: 12px 22px 18px; margin: 0; border-top: 1px solid var(--line); }
.spm-form .sp-row { grid-template-columns: 1fr auto; }
@media (max-width: 640px) {
  .sp-modal { padding: 0; place-items: end stretch; }
  .sp-sheet { max-height: 92dvh; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .spm-form .sp-row { grid-template-columns: 1fr; }
  .spm-chat li.is-client { margin-left: 12px; } .spm-chat li.is-team { margin-right: 12px; }
}
/* team side */
.share-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.share-opt { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; cursor: pointer; }
.share-opt > span:last-child { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.share-opt.is-off { opacity: .5; }
.bubble-row.is-client .bubble { background: var(--accent-soft); }
.client-av { background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #000)); }
.client-tag { font-size: 9.5px; padding: 1px 6px; border-radius: 6px; background: var(--accent); color: #fff; }
.todo-meta .t-dlg { height: 20px; padding: 0 7px; font-size: 10.5px; }
.t-chips .t-wait { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 6px; font-size: 10.5px; color: color-mix(in srgb, var(--wait) 80%, var(--text)); background: color-mix(in srgb, var(--wait) 12%, transparent); }
.sp-sheet { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
.spm-desc a, .spm-chat a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.sp-sheet:focus { outline: none; }
@media (max-width: 640px) { .rc { grid-template-columns: minmax(0, 1fr); padding: 10px 12px; } .rc-ic { display: none; } .rc-acts { grid-column: 1; } }
.phase-ghost { align-self: start; height: 140px; min-height: 0; }

/* ---------- v15: CSV scope starter ---------- */
.starter-csv { margin-top: 10px; }
.starter-csv[hidden], [data-starter-hint][hidden], [data-tpl-name][hidden] { display: none; }
.csv-drop { position: relative; display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 12px; border-radius: 12px; border: 1.5px dashed color-mix(in srgb, var(--text) 22%, transparent); background: var(--field); color: var(--text-2); font-size: 14px; cursor: pointer; transition: border-color .2s, background .2s; text-align: center; }
.csv-drop:hover, .csv-drop:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.csv-drop.has-file { border-style: solid; border-color: var(--ok); color: var(--text); }
.csv-drop span { display: inline-flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.csv-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
/* ---------- v15: lead won ---------- */
.won-card { max-width: 680px; }
.won-sec { margin: 14px 0 8px; text-transform: uppercase; letter-spacing: .1em; font-size: 10.5px; }
.won-btn { background: color-mix(in srgb, var(--ok) 14%, var(--glass-2)); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: color-mix(in srgb, var(--ok) 70%, var(--text)); white-space: nowrap; }
.won-btn:hover { background: var(--ok); color: #fff; }

/* ---------- v15: client access vault ---------- */
.vault-note { display: flex; align-items: center; gap: 6px; margin: -6px 0 10px; }
.vault-list { padding: 6px 8px; }
.vault-empty { margin: 8px 6px; }
.vrow { display: grid; grid-template-columns: 34px minmax(160px, 1.3fr) minmax(140px, 1fr) minmax(150px, 1fr) auto; gap: 12px; align-items: center; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.vrow:last-child { border-bottom: 0; }
.v-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text-2); }
.v-shopify { background: color-mix(in srgb, #5E8E3E 16%, transparent); color: #4c7a2f; }
.v-domain { background: var(--accent-soft); color: var(--accent); }
.v-hosting { background: color-mix(in srgb, #8E4EC6 14%, transparent); color: #8E4EC6; }
.v-email, .v-social { background: color-mix(in srgb, var(--warn) 15%, transparent); color: color-mix(in srgb, var(--warn) 80%, var(--text)); }
.v-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14px; }
.v-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-url { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%; }
.v-url:hover { color: var(--accent); }
.v-field { display: flex; align-items: center; gap: 4px; min-width: 0; }
.v-user, .v-secret { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.v-secret { color: var(--text-3); letter-spacing: .08em; }
.v-secret.is-shown { color: var(--text); letter-spacing: 0; background: color-mix(in srgb, var(--warn) 14%, transparent); padding: 2px 6px; border-radius: 6px; user-select: all; }
.v-acts { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.v-notes { grid-column: 2 / -1; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 9%, transparent); white-space: pre-wrap; overflow-wrap: anywhere; }
.v-notes[hidden] { display: none; }
@media (max-width: 860px) {
  .vrow { grid-template-columns: 34px minmax(0, 1fr) auto; row-gap: 6px; }
  .vrow .v-field { grid-column: 2 / -1; }
  .vrow .v-acts { grid-column: 3; grid-row: 1; }
  .v-notes { grid-column: 1 / -1; }
}
.vault-link { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); } .vault-link:hover { color: var(--accent); }
@media (max-width: 860px) { .vrow .v-empty { display: none; } }

/* ---------- v16: client portal ---------- */
.cp-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.cp-todo { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: color-mix(in srgb, var(--wait) 10%, transparent); font-size: 13.5px; }
.cp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 16px; }
.cp-card { display: flex; flex-direction: column; gap: 10px; padding: 20px; transition: transform .25s var(--spring), box-shadow .25s; }
.cp-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md, 0 12px 30px rgba(0,0,0,.08)); }
.cp-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cp-need { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--wait) 14%, transparent); color: color-mix(in srgb, var(--wait) 80%, var(--text)); }
.cp-title { font: 400 22px/1.2 var(--font-display); margin: 2px 0 0; }
.cp-prog { display: flex; align-items: center; gap: 12px; }
.cp-prog .display { font-size: 30px; line-height: 1; }
.cp-prog .ct-bar { flex: 1; }
.cp-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.cp-open { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 500; white-space: nowrap; }
.cp-back { color: var(--accent); }
@media (max-width: 640px) { .cp-grid { grid-template-columns: 1fr; } }
.menu-note { padding: 6px 10px 2px; max-width: 260px; }
/* client page: duplicate + vault button */
.pc-wrap { position: relative; display: flex; }
.pc-wrap > .project-card { flex: 1; }
.pc-dup { position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--glass-2); color: var(--text-2); font-size: 12.5px; cursor: pointer; transition: all .2s; z-index: 2; }
.pc-dup:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.pc-wrap .pc-head { padding-right: 112px; }
.ch-quick { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.vault-btn .tab-count { margin-left: 2px; }
.vault-card { max-width: 920px; width: 100%; }
.vault-card .vault-note { margin: -8px 0 12px; }
.vault-card .vault-list { padding: 0; max-height: min(64vh, 640px); overflow-y: auto; }
.share-url .input.is-off { opacity: .5; text-decoration: line-through; }

/* ---------- v17: client vault — files & links ---------- */
.vault-card { max-width: 1080px; }
.vault-tabs { display: flex; gap: 4px; margin: -4px 0 14px; border-bottom: 1px solid var(--line); }
.vtab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border: 0; background: none; color: var(--text-2); font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.vtab.is-on { color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }
.vpane { position: relative; }
.vpane[hidden] { display: none; }
.va-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.va-filters { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.va-filters .chip { height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line-2); background: none; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.va-filters .chip.is-on { background: var(--text); color: var(--bg); border-color: var(--text); }
.va-search { width: 180px; }
.va-linkform { display: flex; gap: 8px; margin-top: 10px; }
.va-linkform[hidden] { display: none; }
.va-linkform input[name=url] { flex: 1; }
.va-hint { margin: 10px 0 12px; }
.va-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.va-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; max-height: min(58vh, 620px); overflow-y: auto; padding: 2px; align-content: start; }
.va-tile { display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass-2); text-align: left; cursor: pointer; transition: border-color .15s, transform .2s var(--spring); min-width: 0; color: var(--text); }
.va-tile:hover { border-color: var(--line-2); transform: translateY(-2px); }
.va-tile.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.va-prev { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--field); }
.va-prev img, .va-prev video { width: 100%; height: 100%; object-fit: cover; }
.va-play { position: absolute; inset: auto auto 6px 6px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.55); color: #fff; }
.va-icon { color: var(--text-3); }
.t-design .va-icon { color: #A259FF; } .t-video .va-icon { color: #E5484D; } .t-doc .va-icon { color: var(--accent); } .t-link .va-icon { color: var(--ok); }
.va-badge { position: absolute; top: 6px; right: 6px; max-width: calc(100% - 12px); padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,.88); color: #111; font-size: 9.5px; font-style: normal; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.va-name { font-size: 12.5px; font-weight: 500; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.va-meta { font-size: 10.5px; color: var(--text-3); padding: 0 2px 2px; }
.va-meta b { color: var(--accent); font-weight: 500; }
.va-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 10px; text-align: center; color: var(--text-3); }
.va-empty b { color: var(--text); }
.va-detail { width: 300px; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: color-mix(in srgb, var(--text) 4%, transparent); max-height: min(58vh, 620px); overflow-y: auto; }
.va-detail[hidden] { display: none; }
.vd-head { display: flex; justify-content: space-between; align-items: center; }
.vd-head .icon-btn { font-size: 18px; line-height: 1; }
.vd-prev { display: grid; place-items: center; border-radius: 12px; overflow: hidden; background: var(--field); min-height: 120px; }
.vd-prev img, .vd-prev video { width: 100%; max-height: 220px; object-fit: contain; display: block; }
.va-icon.big { padding: 30px; }
.vd-name { font-weight: 500; }
.vd-detail textarea, .va-detail textarea { resize: vertical; height: auto !important; }
.vd-acts { flex-wrap: wrap; }
.vd-sec { text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; margin-top: 4px; }
.vd-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.vd-tasks li { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; background: var(--glass-2); font-size: 13px; }
.vd-tasks li.muted { background: none; padding: 2px 0; }
.vd-tasks a { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vd-tasks a small { font-size: 11px; }
.vd-tasks a:hover { color: var(--accent); }
.vd-by { margin: 0; }
.va-drop { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: 16px; border: 2px dashed var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); color: var(--accent); }
.va-drop[hidden] { display: none; }
@media (max-width: 760px) {
  .va-body { grid-template-columns: 1fr; }
  .va-detail { width: auto; order: -1; max-height: none; }
  .va-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; }
  .va-search { width: 100%; }
  .vtab { padding: 9px 10px; }
}
/* task drawer: vault items + picker */
.td-vault { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.td-vault[hidden] { display: none; }
.td-vault-head { display: flex; align-items: center; gap: 5px; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }
.td-vault-head .ic { width: 11px; height: 11px; }
.asset.is-vault { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.menu-vpick { width: 340px; max-width: calc(100vw - 24px); padding: 8px; }
.vpick { display: flex; flex-direction: column; gap: 6px; }
.vpick-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.vpick-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) 20px; gap: 8px; align-items: center; padding: 5px 6px; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; color: var(--text); }
.vpick-item:hover { background: var(--glass-2); }
.vpick-item[hidden] { display: none; }
.vp-th { width: 38px; height: 30px; border-radius: 7px; overflow: hidden; display: grid; place-items: center; background: var(--field); }
.vp-th img { width: 100%; height: 100%; object-fit: cover; }
.vp-th .as-ext { font-size: 9px; }
.vp-name { display: flex; flex-direction: column; font-size: 13px; overflow: hidden; }
.vp-name, .vp-name small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp-check { opacity: 0; color: var(--accent); }
.vpick-item.is-on .vp-check { opacity: 1; }
.vpick-item.is-on { background: var(--accent-soft); }
@media (max-width: 760px) {
  .va-filters { flex: 1 0 100%; order: 3; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .va-filters::-webkit-scrollbar { display: none; }
  .va-filters .chip { flex: none; }
  .va-search { order: 4; }
}

/* Tap highlight off (per-person setting in My account) — keyboard focus rings stay for accessibility */
html.no-tap, html.no-tap * { -webkit-tap-highlight-color: transparent !important; }
html.no-tap :focus:not(:focus-visible) { outline: none !important; box-shadow: none; }
html.no-tap button:focus:not(:focus-visible), html.no-tap a:focus:not(:focus-visible), html.no-tap [tabindex]:focus:not(:focus-visible), html.no-tap summary:focus:not(:focus-visible) { outline: none !important; }
/* phase menu: set deadline for the whole phase */
.menu-pdue { width: 300px; max-width: calc(100vw - 24px); padding: 10px; }
.pdue { display: flex; flex-direction: column; gap: 8px; }
.pdue-quick { display: flex; flex-wrap: wrap; gap: 5px; }
.chip-btn { height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: none; font-size: 12px; color: var(--text-2); cursor: pointer; }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.chip-btn.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
html.no-tap select:focus, html.no-tap .cell-select:focus, html.no-tap input[type=checkbox]:focus, html.no-tap input[type=radio]:focus { box-shadow: none !important; outline: none !important; }

/* ---------- v19: add to-do at the top of each list ---------- */
.todo-bucket .add-wrap { margin: 2px 0 4px; }
.todo-bucket .add-wrap .add-task { margin: 0 8px 6px; background: color-mix(in srgb, var(--text) 3.5%, transparent); }
.todo-bucket .add-wrap .add-opts { margin: 0 10px 8px 34px; display: none; }
.todo-bucket .add-wrap:focus-within .add-opts, .todo-bucket .add-wrap.has-opts .add-opts, .todo-bucket .add-wrap:hover .add-opts { display: flex; }

/* ---------- v19: calm loading dots (comments) ---------- */
.chat-loading { margin: auto; display: flex; align-items: center; justify-content: center; gap: 7px; height: 28px; min-height: 120px; width: 100%; opacity: 0; animation: chatLoadIn .25s ease .12s forwards; contain: layout paint; }
.chat-loading i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: dotPulse 1.2s cubic-bezier(.45, 0, .55, 1) infinite both; will-change: transform, opacity; transform: translateZ(0); }
.chat-loading i:nth-child(2) { animation-delay: .16s; } .chat-loading i:nth-child(3) { animation-delay: .32s; }
@keyframes dotPulse { 0%, 80%, 100% { transform: scale(.55); opacity: .3; } 40% { transform: scale(1); opacity: 1; } }
@keyframes chatLoadIn { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .chat-loading i { animation-duration: 2.4s; } }

/* ---------- v20: In progress ---------- */
.now-dot { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 0 color-mix(in srgb, var(--warn) 55%, transparent); animation: nowPulse 2s ease-out infinite; }
.now-dot-lg { width: 10px; height: 10px; }
@keyframes nowPulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--warn) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
.t-prog { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; border: 0; font-size: 10.5px; white-space: nowrap; color: color-mix(in srgb, var(--warn) 70%, var(--text)); background: color-mix(in srgb, var(--warn) 15%, transparent); cursor: pointer; }
.t-prog[disabled] { cursor: default; }
.t-prog:not([disabled]):hover { background: color-mix(in srgb, var(--warn) 24%, transparent); }
.t-start { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-2); background: none; color: var(--text-3); cursor: pointer; opacity: 0; transition: opacity .15s, color .15s, border-color .15s; }
.t-start .ic { width: 11px; height: 11px; fill: currentColor; }
.t-start:hover { color: var(--warn); border-color: var(--warn); }
@media (hover: hover) { .task:hover .t-start { opacity: 1; } }
@media (hover: none) { .t-start { opacity: .55; } }
.task.st-doing { background: color-mix(in srgb, var(--warn) 6%, transparent); }
.task.st-doing .t-title { font-weight: 500; }
.td-prog { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.td-prog .ic { width: 11px; height: 11px; fill: currentColor; }
/* workload + overview */
.wl-now { display: flex; align-items: center; gap: 6px; color: color-mix(in srgb, var(--warn) 70%, var(--text)); font-size: 12px; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-now em { font-style: normal; color: var(--text-3); }
.now-card { padding: 16px 18px; margin-top: 18px; }
.now-card .card-head { margin-bottom: 8px; flex-wrap: wrap; gap: 4px 12px; }
.now-card .h3 { display: inline-flex; align-items: center; gap: 10px; margin: 0; }
.now-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px 16px; }
.now-person { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px; border-radius: 14px; background: color-mix(in srgb, var(--warn) 5%, transparent); }
.now-person.is-idle { background: none; opacity: .65; }
.now-person .avatar { width: 30px; height: 30px; border-radius: 10px; font-size: 11px; }
.now-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 13.5px; }
.now-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--glass-2); border-left: 3px solid hsl(var(--h) 70% 55%); }
a.now-item:hover { background: var(--accent-soft); }
.now-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.now-item small { grid-column: 1; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-item em { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; font-size: 11px; color: color-mix(in srgb, var(--warn) 70%, var(--text)); }
.todo-meta .t-prog { height: 20px; font-size: 10px; }

/* ---------- v21: to-do title + description ---------- */
.add-task { position: relative; }
.add-count { position: absolute; right: 8px; bottom: -14px; font-size: 10px; color: var(--text-3); background: var(--bg); padding: 0 4px; border-radius: 4px; }
.add-count.is-over { color: color-mix(in srgb, var(--warn) 80%, var(--text)); }
.add-count[hidden] { display: none; }
.add-desc { display: block; width: calc(100% - 16px); margin: 0 8px 8px; font-size: 13px; resize: vertical; min-height: 54px; height: auto; }
.add-desc[hidden] { display: none; }
.t-note { display: grid; place-items: center; width: 22px; height: 22px; border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 0; }
.t-note:hover { color: var(--accent); }
.td-text { display: flex; flex-direction: column; gap: 6px; }
.td-lbl { display: flex; justify-content: space-between; align-items: baseline; font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.td-cnt { text-transform: none; letter-spacing: 0; font-size: 10.5px; color: var(--text-3); }
.td-cnt.is-near { color: color-mix(in srgb, var(--warn) 80%, var(--text)); }
.td-title-in { font-weight: 500; font-size: 15px; resize: none; overflow: hidden; line-height: 1.4; height: auto; min-height: 40px; }
.td-desc-in { font-size: 13.5px; line-height: 1.55; resize: vertical; height: auto; min-height: 72px; max-width: none; }
.td-desc-ro { font-size: 13.5px; line-height: 1.55; white-space: normal; overflow-wrap: anywhere; padding: 10px 12px; border-radius: 12px; background: var(--field); }
.td-desc-ro a { color: var(--accent); text-decoration: underline; }

/* ---------- v22: readable comment bubbles ---------- */
/* your own messages: soft accent tint with dark text instead of white-on-blue */
.bubble-row.is-mine .bubble {
  background: color-mix(in srgb, var(--accent) 13%, var(--bg));
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  box-shadow: var(--shadow-sm);
}
.bubble-head span { opacity: 1; color: var(--text-3); font-size: 11px; }
.bubble-row.is-mine .bubble-head span { color: color-mix(in srgb, var(--accent) 45%, var(--text-2)); }
.bubble-row.is-mine .mention { color: color-mix(in srgb, var(--accent) 70%, var(--text)); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.bubble-row.is-mine .bubble a { color: color-mix(in srgb, var(--accent) 75%, var(--text)); }

/* ---------- v22: rows keep their title width ---------- */
/* Controls you only need on hover float over the row instead of taking space from the title */
.t-hover { display: flex; align-items: center; gap: 4px; }
.t-hover:empty { display: none; }
@media (hover: hover) {
  .task > .t-hover { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); z-index: 2; padding: 3px 4px 3px 14px; border-radius: 10px;
    background: linear-gradient(90deg, transparent, var(--bg) 14px); opacity: 0; pointer-events: none; transition: opacity .15s; }
  .todo-item > .t-hover { top: 8px; transform: none; }
  .task:hover > .t-hover, .task:focus-within > .t-hover { opacity: 1; pointer-events: auto; }
  .task:hover > .t-hover .t-due.is-empty, .task:hover > .t-hover .t-start { opacity: 1; }
}
@media (hover: none) {
  .task { grid-template-columns: 14px 22px minmax(0, 1fr) auto auto; }
  .todo-item { grid-template-columns: 14px 22px minmax(0, 1fr) auto auto; }
  .t-hover { opacity: .6; }
}
.t-hover .t-lock, .t-hover .t-talk, .t-hover .t-del, .t-hover .t-qadd { opacity: 1; }
.t-qadd { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; border: 0; background: none; color: var(--text-3); cursor: pointer; }
.t-qadd:hover { color: var(--accent); background: var(--accent-soft); }
.t-q { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 5px; border-radius: 6px; font-size: 10.5px; font-weight: 600; color: #fff; background: var(--accent); }

/* Boards use the room they have: wider page when the sidebar is collapsed, and columns never squeeze below a readable width */
.page:has(.board) { max-width: 1680px; }
.sb-collapsed .page:has(.board) { max-width: 1900px; }
.board { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.todo-board { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.phase { container-type: inline-size; }
@container (max-width: 330px) {
  .todo-item { grid-template-columns: 14px 22px minmax(0, 1fr); }
  .todo-item > .t-chips { grid-column: 3; justify-content: flex-start; flex-wrap: wrap; }
}

/* ---------- v22: Up next pipeline ---------- */
.pipe { padding: 16px 18px; margin-top: 16px; }
.pipe-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.pipe-head .h3 { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.pipe-head p { margin: 4px 0 0; }
.pipe-empty { margin: 10px 0 0; display: flex; align-items: center; gap: 6px; }
.pq-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 330px; overflow-y: auto; }
.pq { display: grid; grid-template-columns: 26px minmax(0, 1fr) 84px minmax(120px, auto) 56px; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 12px; background: var(--glass-2); border: 1px solid transparent; }
.pq[draggable="true"] { cursor: grab; }
.pq.is-drag { opacity: .5; border-style: dashed; border-color: var(--accent); }
.pq.is-doing { background: color-mix(in srgb, var(--warn) 9%, var(--glass-2)); }
.pq.is-late { border-color: color-mix(in srgb, var(--danger, #E5484D) 35%, transparent); }
.pq-pos { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 80%, var(--text)); font-size: 11.5px; font-weight: 600; }
.pq.is-doing .pq-pos { background: none; }
.pq-title { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; border: 0; background: none; padding: 0; text-align: left; font-size: 13.5px; color: var(--text); cursor: pointer; }
.pq-title, .pq-title small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pq-title:hover { color: var(--accent); }
.pq-est { height: 28px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--field); font-size: 11.5px; color: var(--text); }
.pq-est.is-guess { color: var(--text-3); border-style: dashed; }
.pq-eta { font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.pq-eta b { font-weight: 500; color: var(--danger, #E5484D); }
.pq-acts { display: flex; justify-content: flex-end; gap: 2px; }
@media (max-width: 760px) {
  .pq { grid-template-columns: 26px minmax(0, 1fr) auto; row-gap: 4px; }
  .pq-est, .pq-eta { grid-column: 2; justify-self: start; }
  .pq-eta { grid-row: 3; }
  .pq-acts { grid-column: 3; grid-row: 1; }
}
/* workload */
.wl-hours { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; margin-top: 14px; }
.wl-hours label { display: inline-flex; align-items: center; gap: 6px; }
.wl-days { display: flex; gap: 4px; flex-wrap: wrap; }
.wl-days .rf-day span { min-width: 40px; height: 30px; font-size: 12px; }
.wl-until { font-size: 10.5px; padding: 3px 7px; border-radius: 999px; background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 75%, var(--text)); margin-right: 6px; white-space: nowrap; }
.wl-pipe { margin-bottom: 4px; }
.wl-pipe-head { display: flex; justify-content: space-between; gap: 10px; text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; color: var(--text-3); margin-bottom: 6px; }
.wl-pipe-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.wl-pipe-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) 52px auto; gap: 10px; align-items: center; padding: 5px 8px; border-radius: 10px; background: var(--glass-2); font-size: 13px; }
.wl-pipe-list li.is-doing { background: color-mix(in srgb, var(--warn) 9%, var(--glass-2)); }
.wl-pipe-t { display: flex; flex-direction: column; min-width: 0; }
.wl-pipe-t, .wl-pipe-t small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-nopipe { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; }

.wl-pipe-list li { grid-template-columns: 26px minmax(0, 1fr) 44px 190px; }
.wl-pipe-list li > :nth-child(3), .wl-pipe-list li > :nth-child(4) { text-align: right; white-space: nowrap; }
@media (max-width: 700px) { .wl-pipe-list li { grid-template-columns: 26px minmax(0, 1fr) auto; } .wl-pipe-list li > :nth-child(3) { display: none; } }

/* ---------- v22.1: comments always reachable in drawers ---------- */
.todo-drawer .td-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; overscroll-behavior: contain; }
.todo-drawer .td-scroll > .chat { flex: 1 0 auto; overflow: visible; min-height: 140px; padding-bottom: 18px; }
.td-chat-head { display: flex; align-items: center; gap: 6px; padding: 14px 22px 0; text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; }
.td-chat-section { padding-bottom: 28px; }
[data-t-ccount], [data-td-ccount] { color: var(--accent); }
/* hover tools float just above the row's top-right corner, never over the title or date */
@media (hover: hover) {
  .task > .t-hover, .todo-item > .t-hover {
    top: auto; bottom: calc(100% - 10px); right: 8px; transform: translateY(4px);
    padding: 3px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line-2);
    box-shadow: var(--shadow-sm, 0 4px 14px rgba(0,0,0,.08)); z-index: 6;
    transition: opacity .15s, transform .15s;
  }
  .task:hover > .t-hover, .task:focus-within > .t-hover { transform: none; }
  .task:hover, .task:focus-within { z-index: 5; }
}

/* ---------- v22.3: images ---------- */
.composer { flex-wrap: wrap; }
.composer.is-drop { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.c-tray { order: -1; width: 100%; display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 4px; }
.c-tray-item { position: relative; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); background: var(--glass-2); }
.c-tray-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c-tray-item.is-busy img { opacity: .45; }
.c-tray-item.is-busy::after { content: ''; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--accent); border-right-color: transparent; animation: spin .7s linear infinite; }
.c-tray-item.is-err { border-color: var(--danger, #E5484D); }
.c-tray-item button, .c-img-x { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
.c-attach { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--text-3); cursor: pointer; transition: background .15s, color .15s; }
.c-attach:hover { background: var(--accent-soft); color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.c-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.c-img { position: relative; display: block; width: 120px; height: 90px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); background: var(--glass-2); }
.c-img a, .c-img img { display: block; width: 100%; height: 100%; }
.c-img img { object-fit: cover; transition: transform .2s; cursor: zoom-in; }
.c-img:hover img { transform: scale(1.03); }
.c-img.is-busy img { opacity: .45; }
.c-imgs:has(.c-img:only-child) .c-img { width: 220px; height: 150px; }
.c-img-x { opacity: 0; transition: opacity .15s; }
.c-img:hover .c-img-x { opacity: 1; }
@media (hover: none) { .c-img-x { opacity: 1; } }
.c-imgs.is-big .c-img { width: 132px; height: 96px; }
.td-imgs { padding: 12px 22px 14px; border-bottom: 1px solid var(--line); border-radius: 0; transition: background .15s; }
.td-imgs.is-drop { background: var(--accent-soft); }
.td-imgs-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.td-imgs-head .mono { display: inline-flex; align-items: center; gap: 6px; text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; }
.td-imgs-hint { margin: 6px 0 0; }
.lightbox { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: rgba(8, 12, 18, .86); backdrop-filter: blur(6px); animation: fadeIn .15s; padding: 48px 64px 64px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); background: #fff; }
.lb-bar { position: absolute; left: 0; right: 0; bottom: 16px; display: flex; justify-content: center; gap: 18px; color: rgba(255,255,255,.8); font-size: 12px; }
.lb-bar a { color: #fff; text-decoration: underline; }
.lb-x, .lb-nav { position: absolute; border: 0; cursor: pointer; color: #fff; background: rgba(255,255,255,.12); border-radius: 50%; display: grid; place-items: center; }
.lb-x { top: 16px; right: 16px; width: 38px; height: 38px; }
.lb-nav { top: 50%; width: 44px; height: 44px; margin-top: -22px; font-size: 26px; line-height: 1; }
.lb-prev { left: 14px; } .lb-next { right: 14px; }
.lb-x:hover, .lb-nav:hover { background: rgba(255,255,255,.24); }
@keyframes fadeIn { from { opacity: 0; } }

/* ---------- v22.4: no pulsing anywhere — status dots are steady, loaders are one clean spinner ---------- */
.savebar-dot, .sync-chip.is-on i, td.is-saving::after, .status-pill.is-on i, .save-state.is-saving::before,
.sn-dot, .t-dlg.is-review, .now-dot { animation: none !important; }
.now-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 22%, transparent); }
.sn-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--wait) 22%, transparent); }
.sync-chip.is-on i { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.t-dlg.is-review { box-shadow: none; }
td.is-saving::after, .save-state.is-saving::before { opacity: .8; }
/* loading: a single thin ring that fades in, then spins smoothly */
.chat-loading { position: relative; gap: 0 !important; }
.chat-loading i { display: none !important; }
.chat-loading::before { content: ''; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 18%, transparent); border-top-color: var(--accent);
  animation: spin .75s linear infinite; will-change: transform; }

/* ---------- v22.5: row actions behind a ⋯ button; the bar opens on click ---------- */
.task, .todo-item { grid-template-columns: 14px 22px minmax(0, 1fr) auto 22px; }
@media (hover: none) { .task, .todo-item { grid-template-columns: 14px 22px minmax(0, 1fr) auto 22px; } }
.t-more { width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; background: none; color: var(--text-3); cursor: pointer; opacity: 0; transition: opacity .15s, background .15s, color .15s; }
.todo-item > .t-more { align-self: start; }
.t-more:hover, .task.is-menu .t-more { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); opacity: 1; }
@media (hover: hover) { .task:hover .t-more, .task:focus-within .t-more { opacity: 1; } }
@media (hover: none) { .t-more { opacity: .75; } }
.task > .t-hover, .todo-item > .t-hover {
  position: absolute !important; display: none !important; top: auto !important; bottom: calc(100% - 6px) !important; right: 6px !important; left: auto !important;
  transform: none !important; opacity: 1 !important; pointer-events: auto !important; z-index: 20;
  align-items: center; gap: 2px; padding: 3px !important; border-radius: 11px !important;
  background: var(--bg) !important; border: 1px solid var(--line-2) !important; box-shadow: 0 8px 24px -8px rgba(0,0,0,.22) !important;
  animation: menuIn .14s var(--ease);
}
.task.is-menu > .t-hover { display: flex !important; }
.task.is-menu { z-index: 15; }
.t-hover > * { width: 28px !important; height: 28px !important; min-width: 0 !important; padding: 0 !important; margin: 0 !important;
  display: grid !important; place-items: center; border-radius: 8px !important; border: 0 !important; background: none !important;
  color: var(--text-2) !important; opacity: 1 !important; font-size: 0 !important; cursor: pointer; }
.t-hover > * svg { width: 15px !important; height: 15px !important; margin: 0 !important; }
.t-hover > *:hover { background: var(--accent-soft) !important; color: var(--accent) !important; }
.t-hover > .t-del:hover { background: color-mix(in srgb, var(--danger, #E5484D) 14%, transparent) !important; color: var(--danger, #E5484D) !important; }
@container (max-width: 330px) {
  .todo-item { grid-template-columns: 14px 22px minmax(0, 1fr) 22px; }
  .todo-item > .t-more { grid-column: 4; grid-row: 1; }
}
/* re-renders (ticking, starting, queueing) don't replay the lists' entrance */
.board.is-ready > .phase { animation: none !important; }

/* ⋯ on top, comment count right under it */
.task, .todo-item { grid-template-columns: 14px 22px minmax(0, 1fr) auto minmax(22px, auto); }
@media (hover: none) { .task, .todo-item { grid-template-columns: 14px 22px minmax(0, 1fr) auto minmax(22px, auto); } }
.t-side { display: flex; flex-direction: column; align-items: center; gap: 2px; align-self: start; min-width: 22px; }
.task > .t-side { align-self: center; }
.t-side .t-talk, .t-side .t-talk-n { opacity: 1; height: 20px; padding: 0 3px; display: inline-flex; align-items: center; gap: 3px; font-size: 11px; }
@container (max-width: 330px) {
  .todo-item { grid-template-columns: 14px 22px minmax(0, 1fr) minmax(22px, auto); }
  .todo-item > .t-side { grid-column: 4; grid-row: 1 / span 2; }
}

/* side stack, top-right: ⋯ (always shown) → comments → Up next number */
.t-side, .task > .t-side, .todo-item > .t-side { align-self: start; gap: 4px; padding-top: 1px; }
.t-side .t-more, .task:hover .t-side .t-more { opacity: 1; color: var(--text-3); }
.t-side .t-more:hover, .task.is-menu .t-side .t-more { color: var(--text); }
.t-side .t-q { min-width: 22px; height: 18px; padding: 0 5px; font-size: 10.5px; display: inline-grid; place-items: center; border-radius: 6px; }
.t-side, .task > .t-side, .todo-item > .t-side { gap: 2px; padding-top: 0; }
.t-side .t-more { height: 20px; }
.t-side .t-talk, .t-side .t-talk-n { height: 16px; }
.t-side .t-q { height: 16px; font-size: 10px; }
.t-side .t-note, .t-side .t-note-n { height: 16px; width: 20px; padding: 0; display: grid; place-items: center; opacity: 1; color: var(--text-3); background: none; border: 0; }

/* ---------- v22.9: date pickers open natively on the very first click ---------- */
.t-due { position: relative; cursor: pointer; }
.due-native { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; font-size: 16px; background: none; color: transparent; }
.due-native::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
input[type=date]:not(.due-native) { position: relative; cursor: pointer; }
input[type=date]:not(.due-native)::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
input[type=date]:not(.due-native) { padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23889' stroke-width='1.7' stroke-linecap='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='3'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
