/* Agency Hub. Tokens from VVX (new-main-site/app/globals.css). */

:root {
  color-scheme: dark;
  --bg: #08090d;
  --side: #0b0c11;
  --s1: #0f1117;
  --s2: #151821;
  --s3: #1b1f2a;
  --line: rgba(255, 255, 255, 0.06);
  --line2: rgba(255, 255, 255, 0.10);
  --line3: rgba(255, 255, 255, 0.16);
  --text: #e8eaf0;
  --muted: #8b90a0;
  --dim: #5c6172;
  --accent: rgb(56, 189, 248);
  --accent-rgb: 56, 189, 248;
  --on-accent: #07080b;
  --green: #4ade80;
  --green-rgb: 74, 222, 128;
  --amber: #fbbf24;
  --amber-rgb: 251, 191, 36;
  --red: #ff3d67;
  --red-rgb: 255, 61, 103;
  --r1: 8px;
  --r2: 12px;
  --r3: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 160ms;
  --base: 220ms;
  --font: 'Poppins', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 70% -120px, rgba(var(--accent-rgb), 0.07), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid rgba(var(--accent-rgb), 0.7); outline-offset: 2px; }
svg { display: block; }
.noscript { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- brand ---------- */

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand .mark {
  width: 28px; height: 28px; border-radius: var(--r1);
  display: grid; place-items: center;
  background: linear-gradient(135deg, #7dd3fc, #0ea5e9);
  color: var(--on-accent);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 6px 18px rgba(var(--accent-rgb), 0.28);
}
.brand .mark svg { width: 18px; height: 18px; }
.brand .word { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.brand.sm .mark { width: 26px; height: 26px; }
.brand.sm .word { font-size: 17px; }
.brand.lg .mark { width: 40px; height: 40px; border-radius: var(--r2); }
.brand.lg .mark svg { width: 24px; height: 24px; }
.brand.lg .word { font-size: 28px; }
.brand.xl { gap: 16px; }
.brand.xl .mark { width: 64px; height: 64px; border-radius: var(--r3); box-shadow: 0 0 0 1px rgba(255,255,255,.14) inset, 0 18px 50px rgba(var(--accent-rgb), 0.38); }
.brand.xl .mark svg { width: 38px; height: 38px; }
.brand.xl .word { font-size: 52px; letter-spacing: -0.035em; }

/* ---------- app frame ---------- */

.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.topbar, .scrim { display: none; }

.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 14px 16px;
  background: var(--side);
  border-right: 1px solid var(--line);
}
.side > .brand-link { padding: 0 8px; margin-bottom: 28px; align-self: flex-start; border-radius: var(--r1); }
.nav { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 22px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group.owner { padding-top: 16px; border-top: 1px solid var(--line); }
.nav-head {
  padding: 0 10px 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--dim);
}
.nav-item {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  height: 40px; padding: 0 10px 0 12px;
  border-radius: var(--r1);
  color: var(--muted); font-size: 14px; font-weight: 500;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.nav-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.nav-item.active { background: rgba(var(--accent-rgb), 0.10); color: var(--text); }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.7);
}
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { font-size: 12px; font-weight: 600; color: var(--dim); font-variant-numeric: tabular-nums; }
.nav-item.active .nav-count { color: var(--muted); }
.nav-count.full, .nav-item.active .nav-count.full { color: var(--accent); }
.nav-dot { flex: none; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(var(--green-rgb), 0.8); }
.nav-dot.stale { background: var(--red); box-shadow: 0 0 8px rgba(var(--red-rgb), 0.8); }
.nav-item.small { height: 34px; font-size: 13px; }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--on-accent); background: var(--accent);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.5);
}

.side-foot {
  display: flex; align-items: center; gap: 10px;
  margin-top: 16px; padding: 12px 8px 0;
  border-top: 1px solid var(--line);
}
.user-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout {
  height: 30px; padding: 0 10px; border-radius: var(--r1);
  font-size: 12px; font-weight: 500; color: var(--muted);
  transition: background var(--fast), color var(--fast);
}
.logout:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }

.main { min-width: 0; padding: 44px 48px 96px; }
.view { max-width: 760px; margin: 0 auto; transition: opacity var(--base) var(--ease); }
.view.is-stale .hero, .view.is-stale .list-wrap, .view.is-stale .plist { opacity: 0.45; transition: opacity var(--fast); }

/* ---------- avatars ---------- */

.av {
  position: relative; flex: none;
  display: inline-grid; place-items: center;
  border-radius: 50%; overflow: hidden;
  background: rgba(var(--av), 0.16);
  color: rgb(var(--av));
  font-weight: 700; line-height: 1;
  box-shadow: 0 0 0 1px rgba(var(--av), 0.22) inset;
  user-select: none;
}
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.av.blank { background: var(--s2); color: var(--dim); box-shadow: 0 0 0 1px var(--line2) inset; }
.av.blank svg { width: 56%; height: 56%; }
.team-av { width: 36px; height: 36px; --av: var(--accent-rgb); }
.team-av svg { width: 20px; height: 20px; color: var(--accent); }
.team-chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px;
  border-radius: var(--r1);
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--text); background: var(--s3);
  box-shadow: 0 0 0 1px var(--line2) inset;
}

/* ---------- view header + date ---------- */

.view-head {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 12px 16px; margin-bottom: 20px;
}
.view-head h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; min-width: 0; }
.datenav { display: flex; align-items: center; gap: 8px; }
.datenav-group {
  display: flex; align-items: center; gap: 2px; padding: 3px;
  border-radius: var(--r2); background: var(--s1); border: 1px solid var(--line);
}
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--r1);
  display: grid; place-items: center; color: var(--muted);
  transition: background var(--fast), color var(--fast);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.icon-btn:active { transform: scale(0.94); }
.date { min-width: 104px; text-align: center; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.date.not-today { color: var(--amber); }
.today-btn {
  height: 42px; padding: 0 14px; border-radius: var(--r2);
  font-size: 13px; font-weight: 600; color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08); border: 1px solid rgba(var(--accent-rgb), 0.22);
  transition: background var(--fast);
}
.today-btn:hover { background: rgba(var(--accent-rgb), 0.14); }

/* ---------- hero progress ---------- */

.hero {
  position: relative; overflow: hidden;
  padding: 22px 24px 26px;
  border-radius: var(--r3);
  border: 1px solid var(--line2);
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(var(--accent-rgb), 0.11), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
    var(--s1);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px rgba(0, 0, 0, 0.35);
}
.hero-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.count { display: flex; align-items: baseline; gap: 10px; font-variant-numeric: tabular-nums; }
.count-num { font-size: 52px; font-weight: 700; line-height: 0.95; letter-spacing: -0.04em; }
.count-of { font-size: 18px; font-weight: 500; color: var(--muted); }
.hero.is-loading .count-num, .hero.is-loading .count-of { color: transparent; background: var(--s2); border-radius: var(--r1); }

.bar {
  position: relative; height: 16px; border-radius: var(--r1);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}
.fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  border-radius: var(--r1); overflow: hidden;
  background: linear-gradient(90deg, #0ea5e9 0%, #38bdf8 55%, #7dd3fc 100%);
  box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.50), 0 0 4px rgba(var(--accent-rgb), 0.80);
  transition: width 760ms var(--ease), opacity var(--base);
}
.fill.zero { opacity: 0; }
.fill::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  opacity: 0;
}
.fill.sheen::after { animation: sheen 900ms var(--ease) 260ms; }
@keyframes sheen { 0% { left: -40%; opacity: 1; } 100% { left: 110%; opacity: 0; } }
.hero.is-done .fill { box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.70), 0 0 6px rgba(var(--accent-rgb), 0.9); }
.marker {
  position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px;
  border-radius: 2px; background: rgba(232, 234, 240, 0.55);
  transition: left 760ms var(--ease);
}

/* ---------- status pill ---------- */

.pill {
  --pc: 139, 144, 160;
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  height: 32px; padding: 0 14px; border-radius: var(--r3);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  color: rgb(var(--pc));
  background: rgba(var(--pc), 0.12);
  box-shadow: 0 0 0 1px rgba(var(--pc), 0.24) inset;
  transition: color var(--base), background var(--base), box-shadow var(--base);
}
.pill::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: rgb(var(--pc)); box-shadow: 0 0 8px rgba(var(--pc), 0.9);
}
.pill.s-on_track { --pc: var(--green-rgb); }
.pill.s-on_track::before { animation: pulse 2.2s ease-in-out infinite; }
.pill.s-behind { --pc: var(--amber-rgb); }
.pill.s-done { --pc: var(--accent-rgb); }
.pill.s-missed { --pc: var(--red-rgb); }
.pill.s-not_started, .pill.s-upcoming { --pc: 139, 144, 160; }
.pill.s-not_started::before, .pill.s-upcoming::before { box-shadow: none; }
.pill.sm { height: 26px; padding: 0 10px; font-size: 12px; gap: 6px; }
.pill.sm::before { width: 6px; height: 6px; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- rows ---------- */

.list-wrap { margin-top: 14px; }
.rows {
  border-radius: var(--r3);
  border: 1px solid var(--line);
  background: var(--s1);
  overflow: hidden;
}
.rows.flat { border: 0; border-radius: 0; background: transparent; }
.row {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  min-height: 60px; padding: 12px 12px 12px 16px;
  cursor: pointer; user-select: none;
  transition: background var(--fast) var(--ease), opacity var(--fast);
  animation: row-in var(--base) var(--ease);
}
.row + .row { border-top: 1px solid var(--line); }
.row:hover { background: rgba(255, 255, 255, 0.025); }
.row:active .check { transform: scale(0.92); }
@keyframes row-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.check {
  position: relative; flex: none;
  width: 28px; height: 28px; border-radius: var(--r1);
  display: grid; place-items: center;
  border: 2px solid var(--line3);
  background: rgba(255, 255, 255, 0.02);
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), box-shadow var(--base) var(--ease), transform var(--fast) var(--ease);
}
.row:hover .check { border-color: rgba(var(--accent-rgb), 0.6); }
.check svg {
  width: 18px; height: 18px;
  fill: none; stroke: var(--on-accent); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 20; stroke-dashoffset: 20;
  transition: stroke-dashoffset 260ms var(--ease) 50ms;
}
.check::after {
  content: ''; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.55); opacity: 0;
}
.row.is-done .check {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.40);
}
.row.is-done .check svg { stroke-dashoffset: 0; }
.check.bounce { animation: bounce 300ms var(--ease); }
.check.bounce::after { animation: ring 520ms var(--ease); }
.check.unbounce { animation: unbounce 200ms var(--ease); }
@keyframes bounce { 0% { transform: scale(1); } 30% { transform: scale(0.8); } 65% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes unbounce { 0% { transform: scale(1); } 50% { transform: scale(0.88); } 100% { transform: scale(1); } }
@keyframes ring { 0% { opacity: 1; box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.55); } 100% { opacity: 0; box-shadow: 0 0 0 12px rgba(var(--accent-rgb), 0); } }

.row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.row-title {
  flex: 1; min-width: 0;
  font-size: 15px; font-weight: 500; color: var(--text);
  overflow-wrap: anywhere;
  transition: color var(--base) var(--ease);
}
.row.is-done .row-title { color: var(--dim); }
.row-meta { display: flex; align-items: center; gap: 10px; flex: none; }
.row-who { display: inline-flex; align-items: center; }
.row-who:empty { display: none; }

.row.no-tick { cursor: default; }
.row.no-tick:hover { background: transparent; }
.row.no-tick .check, .row.no-tick:hover .check { border-style: dashed; border-color: rgba(255, 255, 255, 0.12); background: transparent; }
.row.no-tick.is-done .check { border-style: solid; background: rgba(var(--accent-rgb), 0.45); border-color: transparent; box-shadow: none; }
.row.nope .check { animation: nope 280ms var(--ease); }
@keyframes nope { 0%, 100% { transform: none; } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.row.is-temp { opacity: 0.6; }
.row.leaving { opacity: 0; transform: translateX(8px); transition: opacity var(--fast), transform var(--fast); }

.row.skel { cursor: default; animation: none; }
.row.skel .check { border-color: var(--line); }
.skel-line { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--s2), var(--s3), var(--s2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: var(--r1);
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap;
  color: var(--muted); background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 1px var(--line) inset;
}
.tag.oneoff { color: #7dd3fc; background: rgba(var(--accent-rgb), 0.08); box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.16) inset; }
.tag.biz { color: var(--text); }
.tag.os.t-overdue { color: var(--red); background: rgba(var(--red-rgb), 0.10); box-shadow: 0 0 0 1px rgba(var(--red-rgb), 0.24) inset; }
.tag.os.t-buffer { color: var(--amber); background: rgba(var(--amber-rgb), 0.10); box-shadow: 0 0 0 1px rgba(var(--amber-rgb), 0.22) inset; }
.tag.role { color: var(--accent); background: rgba(var(--accent-rgb), 0.08); box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.18) inset; }

.more {
  width: 30px; height: 30px; border-radius: var(--r1);
  display: grid; place-items: center; color: var(--dim);
  opacity: 0; transition: opacity var(--fast), background var(--fast), color var(--fast);
}
.more svg { width: 18px; height: 18px; }
.row:hover .more, .more:focus-visible, .more[aria-expanded='true'] { opacity: 1; }
.more:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.more.off { visibility: hidden; pointer-events: none; }
@media (hover: none) { .more { opacity: 0.7; } }

.rename {
  width: 100%; height: 34px; padding: 0 10px; margin: -4px 0;
  border-radius: var(--r1); border: 1px solid rgba(var(--accent-rgb), 0.5);
  background: var(--bg); color: var(--text); font-size: 15px; font-weight: 500;
  outline: none; box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.none {
  display: flex; align-items: center; min-height: 52px; padding: 0 18px;
  border-radius: var(--r3); border: 1px dashed var(--line2);
  color: var(--dim); font-size: 14px; font-weight: 500;
}
.none.flat { border: 0; border-radius: 0; min-height: 48px; padding: 0 20px; }

/* ---------- title row: name + quiet "+" ---------- */

.title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.title-row h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view > .adder .add { padding-top: 0; }

.add-btn {
  flex: none; width: 32px; height: 32px; border-radius: var(--r1);
  display: grid; place-items: center; color: var(--muted);
  transition: background var(--fast), color var(--fast), box-shadow var(--fast);
}
.add-btn svg { width: 18px; height: 18px; transition: transform var(--base) var(--ease); }
.add-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.add-btn:active { transform: scale(0.94); }
.add-btn.on { color: var(--accent); background: rgba(var(--accent-rgb), 0.10); box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.30) inset; }
.add-btn.on svg { transform: rotate(45deg); }

.adder { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 240ms var(--ease); }
.adder.open { grid-template-rows: 1fr; }
.adder-inner { min-height: 0; overflow: hidden; }
.adder:not(.open) .adder-inner { visibility: hidden; transition: visibility 0s 240ms; }

/* ---------- My OS ---------- */

.myos > .oblock:first-child { margin-top: 0; }
.synced { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(var(--green-rgb), 0.8); }
.synced.stale .sync-dot { background: var(--red); box-shadow: 0 0 8px rgba(var(--red-rgb), 0.8); }
.oblock { margin-top: 10px; border-radius: var(--r3); border: 1px solid var(--line); background: var(--s1); overflow: hidden; animation: row-in var(--base) var(--ease); }
.oblock .sec-head { margin: 0; padding: 12px 16px 4px; font-size: 11px; color: var(--dim); }
.orow { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 16px; }
.orow + .orow, .og + .og { border-top: 1px solid var(--line); }
.o-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.o-name { flex: 0 1 auto; min-width: 0; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orow > .o-name { flex: 1; }
.o-pri { flex: 0 1 auto; min-width: 0; font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-days { flex: none; font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.o-pill { flex: none; min-width: 76px; display: flex; justify-content: flex-end; }
.orow.muted .o-name { color: var(--muted); }
.held { flex: none; width: 7px; height: 7px; border-radius: 50%; }
.held.on { background: var(--green); box-shadow: 0 0 8px rgba(var(--green-rgb), 0.9); animation: pulse 2.2s ease-in-out infinite; }
.opill {
  --pc: 139, 144, 160;
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  color: rgb(var(--pc)); background: rgba(var(--pc), 0.12); box-shadow: 0 0 0 1px rgba(var(--pc), 0.22) inset;
}
.opill.t-blue { --pc: var(--accent-rgb); }
.opill.t-amber { --pc: var(--amber-rgb); }
.opill.t-red { --pc: var(--red-rgb); }
.opill.t-green { --pc: var(--green-rgb); }

.og { padding: 11px 16px 13px; }
.og-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
.og-title { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 600; }
.og-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.og-amt { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.og-amt b { color: var(--text); font-weight: 700; }
.og-text { font-size: 13px; color: var(--muted); }
.og-sub { display: flex; align-items: center; gap: 12px; margin-top: 9px; }
.og-bar { position: relative; flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.06); }
.og-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 3px;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.5);
  transition: width 700ms var(--ease);
}
.og-marker { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 2px; background: rgba(232, 234, 240, 0.55); }
.og-pace { flex: none; font-size: 12px; font-weight: 600; color: var(--amber); white-space: nowrap; font-variant-numeric: tabular-nums; }
.og-pace.ahead { color: var(--green); }
.og.muted .og-title { color: var(--muted); font-weight: 500; }

/* ---------- add row ---------- */

.add { padding: 4px 4px 14px; display: flex; flex-direction: column; gap: 10px; }
.add-row { display: flex; gap: 8px; }
.add-field { position: relative; flex: 1; min-width: 0; display: block; }
.add-input {
  width: 100%; height: 44px; padding: 0 16px;
  border-radius: var(--r2); border: 1px solid var(--line2);
  background: var(--s1); color: var(--text); font-size: 15px;
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
.add-input::placeholder { color: var(--dim); }
.add-input:hover { border-color: var(--line3); }
.add-input:focus { outline: none; border-color: rgba(var(--accent-rgb), 0.55); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12); background: var(--s2); }

.toggle, .owner-btn {
  flex: none; height: 44px; padding: 0 16px;
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: var(--r2); border: 1px solid var(--line2);
  background: var(--s1); color: var(--muted);
  font-size: 14px; font-weight: 600;
  transition: background var(--fast), color var(--fast), border-color var(--fast);
}
.toggle:hover, .owner-btn:hover { border-color: var(--line3); color: var(--text); }
.toggle[aria-pressed='true'] { color: var(--accent); background: rgba(var(--accent-rgb), 0.10); border-color: rgba(var(--accent-rgb), 0.38); }
.owner-btn { padding: 0 10px 0 12px; color: var(--text); }
.owner-btn > svg { width: 16px; height: 16px; color: var(--dim); }
.owner-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 34px; min-width: 50px; padding: 0 12px;
  border-radius: var(--r1); border: 1px solid var(--line2);
  background: var(--s1); color: var(--muted);
  font-size: 13px; font-weight: 600;
  transition: background var(--fast), color var(--fast), border-color var(--fast), transform var(--fast);
}
.chip:hover:not(:disabled) { border-color: var(--line3); color: var(--text); }
.chip:active:not(:disabled) { transform: scale(0.95); }
.chip[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.28); }
.chip:disabled { opacity: 0.4; cursor: default; }
.chips.shake { animation: nope 300ms var(--ease); }

/* ---------- popover ---------- */

.pop {
  position: fixed; z-index: 60; min-width: 168px; max-height: 320px; overflow-y: auto;
  padding: 6px; border-radius: var(--r2);
  background: var(--s2); border: 1px solid var(--line2);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.55);
  opacity: 0; transform: translateY(-4px) scale(0.98); transform-origin: top right;
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.pop.in { opacity: 1; transform: none; }
.pop-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  height: 38px; padding: 0 10px; border-radius: var(--r1);
  font-size: 14px; font-weight: 500; text-align: left; color: var(--text);
}
.pop-item:hover, .pop-item:focus-visible { background: rgba(255, 255, 255, 0.06); outline: none; }
.pop-item.danger { color: var(--red); }
.pop-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-item > svg { width: 16px; height: 16px; color: var(--accent); }
.team-av.sm { width: 24px; height: 24px; }
.team-av.sm svg { width: 15px; height: 15px; }

/* ---------- master ---------- */

.plist { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.pcard {
  border-radius: var(--r3); border: 1px solid var(--line);
  background: var(--s1); overflow: hidden;
  transition: border-color var(--base);
}
.pcard.open { border-color: var(--line2); }
.pc-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(80px, 220px) 44px 104px 20px;
  align-items: center; gap: 14px;
  width: 100%; padding: 14px 16px; text-align: left;
  transition: background var(--fast);
}
.pc-head:hover { background: rgba(255, 255, 255, 0.025); }
.pc-av { display: inline-flex; }
.pc-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pc-name { min-width: 0; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-manage { display: flex; align-items: center; gap: 10px; padding: 12px 16px 12px 20px; border-top: 1px solid var(--line); background: rgba(255, 255, 255, 0.015); }
.pc-manage .bchips { flex: 1; justify-content: flex-start; }
.pc-manage .pr-action { min-width: 0; }
.mini { position: relative; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.mini-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 4px;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.55);
  transition: width 700ms var(--ease);
}
.pc-count { font-size: 14px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.pcard.is-done .pc-count { color: var(--accent); }
.pc-head .pill { justify-self: start; }
.pc-caret { color: var(--dim); transition: transform var(--base) var(--ease); }
.pc-caret svg { width: 18px; height: 18px; }
.pcard.open .pc-caret { transform: rotate(180deg); color: var(--muted); }
.pcard.is-empty .pc-name, .pcard.is-empty .pc-count { color: var(--muted); }
.pc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 280ms var(--ease); }
.pcard.open .pc-body { grid-template-rows: 1fr; }
.pc-inner { min-height: 0; overflow: hidden; }
.pcard.open .pc-inner { border-top: 1px solid var(--line); }
.pc-inner .row { padding-left: 20px; }

/* ---------- people ---------- */

.sec { margin-top: 8px; }
.sec + .sec { margin-top: 28px; }
.sec-head {
  display: flex; align-items: center; gap: 8px; margin: 0 4px 10px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.sec-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: inline-grid; place-items: center;
  font-size: 11px; letter-spacing: 0; color: var(--muted); background: var(--s2);
}
.card-list { border-radius: var(--r3); border: 1px solid var(--line); background: var(--s1); overflow: hidden; }
.prow { display: flex; align-items: center; gap: 14px; padding: 12px 16px; min-height: 64px; animation: row-in var(--base) var(--ease); }
.prow + .prow { border-top: 1px solid var(--line); }
.pr-who { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.pr-av { display: inline-flex; }
.pr-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bchips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.bchips .chip { height: 32px; }
.pr-action { flex: none; min-width: 92px; display: flex; justify-content: flex-end; }
.prow.s-pending { background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.06), transparent 60%); }
.prow.s-removed .pr-who { opacity: 0.55; }

.btn {
  height: 36px; padding: 0 16px; border-radius: var(--r1);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background var(--fast), color var(--fast), box-shadow var(--fast), transform var(--fast), border-color var(--fast);
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 22px rgba(var(--accent-rgb), 0.28); }
.btn.primary:hover { box-shadow: 0 10px 28px rgba(var(--accent-rgb), 0.42); }
.btn.ghost { border: 1px solid var(--line2); color: var(--muted); }
.btn.ghost:hover { border-color: var(--line3); color: var(--text); }
.btn.danger { border: 1px solid rgba(var(--red-rgb), 0.4); background: rgba(var(--red-rgb), 0.12); color: var(--red); }

/* ---------- screens ---------- */

.screen {
  position: relative; min-height: 100vh;
  display: grid; place-items: center; padding: 24px 16px;
  overflow: hidden;
}
.screen::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(closest-side at 50% 50%, #000 0%, transparent 100%);
  mask-image: radial-gradient(closest-side at 50% 50%, #000 0%, transparent 100%);
}
.screen::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 560px; height: 560px; margin: -320px 0 0 -280px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--accent-rgb), 0.16), transparent);
}
.screen-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 36px; text-align: center; animation: row-in 420ms var(--ease); }
.screen-msg { font-size: 18px; font-weight: 500; color: var(--text); }
.screen-av { display: inline-flex; border-radius: 50%; box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0.08), 0 0 40px rgba(var(--accent-rgb), 0.25); }
.screen-inner:has(.screen-av) { gap: 24px; }
.btn-discord {
  height: 54px; padding: 0 26px; border-radius: var(--r2);
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--accent); color: var(--on-accent);
  font-size: 16px; font-weight: 600;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18) inset, 0 14px 36px rgba(var(--accent-rgb), 0.35);
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.btn-discord svg { width: 22px; height: 22px; }
.btn-discord:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22) inset, 0 18px 44px rgba(var(--accent-rgb), 0.5); }
.btn-discord:active { transform: scale(0.98); }

/* ---------- toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80;
  height: 40px; padding: 0 16px; border-radius: var(--r2);
  display: flex; align-items: center;
  font-size: 13px; font-weight: 600; color: var(--text);
  background: var(--s3); border: 1px solid var(--line2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  transition: opacity var(--base) var(--ease), transform var(--base) var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- small screens: sidebar becomes a top bar + menu ---------- */

@media (max-width: 759px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .topbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; gap: 12px;
    height: 56px; padding: 0 8px 0 16px;
    background: rgba(8, 9, 13, 0.85);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
  }
  .top-mid { flex: 1; min-width: 0; display: flex; justify-content: flex-end; }
  .menu-btn { width: 44px; height: 44px; border-radius: var(--r2); display: grid; place-items: center; color: var(--text); }
  .menu-btn svg { width: 22px; height: 22px; }
  .menu-btn:active { background: rgba(255, 255, 255, 0.06); }

  .side {
    position: fixed; top: 56px; left: 0; right: 0; z-index: 39;
    height: auto; max-height: calc(100vh - 56px);
    padding: 14px 12px 14px;
    border-right: 0; border-bottom: 1px solid var(--line2);
    border-radius: 0 0 var(--r3) var(--r3);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.55);
    opacity: 0; transform: translateY(-10px); pointer-events: none;
    transition: opacity var(--base) var(--ease), transform var(--base) var(--ease);
  }
  .side > .brand-link { display: none; }
  .nav { gap: 16px; flex: 0 1 auto; }
  .nav-item { height: 44px; }
  .nav-item.small { height: 40px; }
  .app.menu-open .side { opacity: 1; transform: none; pointer-events: auto; }
  .scrim {
    display: block; position: fixed; inset: 56px 0 0; z-index: 38;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0; pointer-events: none; transition: opacity var(--base);
  }
  .app.menu-open .scrim { opacity: 1; pointer-events: auto; }

  .main { padding: 20px 16px 72px; }
  .view-head { margin-bottom: 16px; }
  .view-head h1 { font-size: 24px; }
  .hero { padding: 18px 18px 20px; }
  .count-num { font-size: 44px; }
  .hero-top { margin-bottom: 14px; }
  .row { gap: 12px; padding: 11px 6px 11px 14px; min-height: 60px; }
  .row-main { flex-direction: column; align-items: flex-start; gap: 4px; }
  .row-main .tag { height: 18px; padding: 0 6px; font-size: 10px; }
  .row-meta { gap: 4px; }
  .more { opacity: 0.5; }
  .owner-name { display: none; }
  .toggle { padding: 0 14px; }
  .chip { min-width: 0; flex: 1 1 0; padding: 0 4px; }

  .pc-head {
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    grid-template-areas: 'av name count pill caret' 'bar bar bar bar bar';
    row-gap: 10px; column-gap: 10px; padding: 14px;
  }
  .pc-av { grid-area: av; }
  .pc-who { grid-area: name; }
  .pc-count { grid-area: count; }
  .pc-caret { grid-area: caret; }
  .mini { grid-area: bar; }
  .pc-head .pill { grid-area: pill; }
  .pc-inner .row { padding-left: 14px; }
  .pc-manage { flex-wrap: wrap; padding: 12px 14px; }
  .pc-head .tag.role { display: none; }
  .pc-manage .bchips { order: 0; flex: 1 1 auto; }
  .pc-manage .pr-action { order: 1; margin-left: auto; }
  .none.flat { padding: 0 14px; }

  .orow { padding: 8px 12px 8px 14px; }
  .o-main { flex-direction: column; align-items: flex-start; gap: 1px; }
  .o-name, .o-pri { max-width: 100%; }
  .og { padding: 11px 14px 13px; }
  .oblock .sec-head { padding: 12px 14px 4px; }

  .prow { flex-wrap: wrap; gap: 10px 12px; }
  .pr-who { flex: 1 1 100%; }
  .prow:has(.pr-action:not([hidden])) .pr-who { flex: 1 1 0; }
  .pr-action { order: 2; min-width: 0; }
  .bchips { order: 3; flex: 1 1 100%; justify-content: flex-start; }
  .bchips:empty { display: none; }
  .bchips .chip { flex: 0 0 auto; padding: 0 12px; }

  .brand.xl .word { font-size: 44px; }
}

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