/*
 * HQ: the same design system as the GeekSquad ISMS. Ink-dark by default,
 * paper when you pick light. Inter Tight for text, JetBrains Mono for what you
 * scan (labels, counts, dates). One blue for action; project colors only as
 * small marks.
 * House rule: never space-y / space-x; use gap and margins.
 */
:root {
  --c-bg: #07080A;
  --c-panel: #0E1013;
  --c-panel2: #161920;
  --c-raise: #1C2028;
  --c-line: #20242B;
  --c-line2: #2D323B;
  --c-text: #F3F4F6;
  --c-dim: #A6ACB8;
  --c-faint: #6E7581;
  --c-blue: #7690FF;
  --c-blue-solid: #4169E1;
  --c-ok: #43D693;
  --c-warn: #F5B83D;
  --c-bad: #FF6B8A;
  --c-glow: rgba(65, 105, 225, .22);

  --font-sans: 'Inter Tight', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --fs-xs: 12px;
  --fs-s: 13px;
  --fs-m: 15px;
  --fs-l: 17px;
  --fs-xl: 22px;
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --side-w: 264px;
  color-scheme: dark;
}

html[data-theme='light'] {
  --c-bg: #F3F2EE;
  --c-panel: #FFFFFF;
  --c-panel2: #F0EFEA;
  --c-raise: #E9E7E1;
  --c-line: #E3E1DA;
  --c-line2: #D2CFC6;
  --c-text: #0B0C0F;
  --c-dim: #4D5360;
  --c-faint: #7C818C;
  --c-blue: #2F55D4;
  --c-blue-solid: #3459DC;
  --c-ok: #0F7A49;
  --c-warn: #8A5F00;
  --c-bad: #C21F4D;
  --c-glow: rgba(52, 89, 220, .14);
  color-scheme: light;
}

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { font-family: var(--font-sans); font-size: var(--fs-m); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { margin: 0; background: var(--c-bg); color: var(--c-text); font-family: var(--font-sans); font-size: var(--fs-m); line-height: 1.55; font-feature-settings: 'ss01', 'cv11'; }
::selection { background: var(--c-blue-solid); color: #fff; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.02em; }
h2 { font-size: var(--fs-l); font-weight: 700; }
h3 { font-size: var(--fs-m); font-weight: 650; }
p { margin: 0; }
[hidden] { display: none !important; }
.mono { font-family: var(--font-mono); font-feature-settings: 'zero'; }
.muted { color: var(--c-dim); }
.small { font-size: var(--fs-s); }
.center { text-align: center; }
.empty { padding: 6px 0; color: var(--c-faint); }
.ic { width: 18px; height: 18px; flex-shrink: 0; }

/* ── App shell ────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; padding: 22px 14px 18px; border-right: 1px solid var(--c-line); background: radial-gradient(120% 40% at 0% 0%, var(--c-glow), transparent 70%), var(--c-panel); scrollbar-width: thin; }
.side-brand { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(140deg, #5B7CFF, #2D47C2); color: #fff; box-shadow: 0 6px 20px -6px rgba(65, 105, 225, .7), inset 0 1px 0 rgba(255, 255, 255, .25); flex-shrink: 0; }
.brand-mark .ic { width: 17px; height: 17px; }
.brand-mark.big { width: 46px; height: 46px; border-radius: 13px; }
.brand-mark.big .ic { width: 24px; height: 24px; }
.brand-name { display: block; font-weight: 800; font-size: var(--fs-m); letter-spacing: -.02em; line-height: 1.1; }
.brand-io { color: var(--c-blue); }
.brand-sub { display: block; font-family: var(--font-mono); color: var(--c-faint); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; margin-top: 3px; }
.side-org { padding: 14px; border: 1px solid var(--c-line); border-radius: var(--r-m); background: var(--c-bg); }
.side-org .label { margin: 0 0 6px; }
.side-org-name { font-size: var(--fs-l); font-weight: 700; letter-spacing: -.015em; line-height: 1.2; }
.side-org-meta { display: flex; align-items: baseline; justify-content: space-between; margin-top: 12px; font-size: var(--fs-xs); color: var(--c-dim); }
.side-org-meta b { font-family: var(--font-mono); color: var(--c-text); font-size: var(--fs-s); }
.nav-wrap { display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--c-faint); padding: 14px 10px 6px; }
.nav-group:first-child { padding-top: 0; }
.nav-btn { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 10px; border-radius: var(--r-s); color: var(--c-dim); font-size: 14.5px; font-weight: 500; text-decoration: none; transition: background .18s var(--ease), color .18s var(--ease); }
.nav-btn:hover { background: var(--c-panel2); color: var(--c-text); }
.nav-btn--active { background: var(--c-raise); color: var(--c-text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--c-line2); }
.nav-btn--active::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c-blue); box-shadow: 0 0 14px var(--c-blue); }
.nav-icon { display: inline-flex; width: 18px; height: 18px; color: var(--c-faint); flex-shrink: 0; transition: color .18s var(--ease); }
.nav-btn:hover .nav-icon, .nav-btn--active .nav-icon { color: var(--c-blue); }
.nav-dot { width: 8px; height: 8px; margin: 0 5px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); flex-shrink: 0; }
.nav-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-btn--add { color: var(--c-faint); font-size: var(--fs-s); }
.nav-count { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--c-blue); background: color-mix(in srgb, var(--c-blue) 14%, transparent); padding: 1px 7px; border-radius: 999px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-m); border: 1px solid var(--c-line); }
.side-user-line { min-width: 0; flex: 1; font-size: var(--fs-s); line-height: 1.3; }
.side-user-line span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.side-user-line small { display: block; color: var(--c-faint); font-size: var(--fs-xs); text-transform: capitalize; }
.side-stats { font-family: var(--font-mono); color: var(--c-faint); font-size: 11px; padding: 0 10px; letter-spacing: .02em; }
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: var(--r-s); border: 1px solid var(--c-line); background: transparent; color: var(--c-dim); cursor: pointer; flex-shrink: 0; text-decoration: none; transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease); }
.icon-btn:hover { color: var(--c-text); border-color: var(--c-line2); background: var(--c-panel2); }
.icon-btn .ic { width: 16px; height: 16px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 40px; border-bottom: 1px solid var(--c-line); background: color-mix(in srgb, var(--c-bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: var(--fs-s); color: var(--c-faint); min-width: 0; }
.crumbs b { color: var(--c-text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 10px; }

.page { width: 100%; max-width: 980px; padding: 44px 40px 96px; display: flex; flex-direction: column; gap: 22px; }
.page.wide { max-width: 1280px; }
.page.narrow { max-width: 620px; margin: 0 auto; }
.page > * { animation: rise .6s var(--ease) both; }
.page > *:nth-child(2) { animation-delay: .04s; }
.page > *:nth-child(3) { animation-delay: .08s; }
.page > *:nth-child(n+4) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

#live { display: flex; flex-direction: column; gap: 22px; }
.todolist > a.muted { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--c-faint); text-decoration: none; }
.todolist > a.muted:hover { color: var(--c-blue); }

/* ── Page head ────────────────────────────────────────────── */
.page-head { display: flex; flex-direction: column; max-width: 820px; margin-bottom: 14px; }
.page-head.row { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 20px; max-width: none; flex-wrap: wrap; }
.eyebrow, .trail { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--c-blue); }
.eyebrow::before { content: ''; width: 18px; height: 1px; background: currentColor; }
.trail a { text-decoration: none; color: var(--c-dim); }
.trail a:hover { color: var(--c-text); }
.trail-project { display: inline-flex; align-items: center; gap: 8px; color: var(--c-blue) !important; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: inline-block; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.h1, .page-head h1 { margin: 14px 0 0; font-size: clamp(34px, 4.4vw, 54px); line-height: 1.02; font-weight: 800; letter-spacing: -.035em; text-wrap: balance; }
.page-head.row h1 { margin-top: 0; }
.page-head.row .h1 { margin-top: 14px; }
.sub { margin: 14px 0 0; max-width: 64ch; color: var(--c-dim); font-size: var(--fs-l); line-height: 1.55; text-wrap: pretty; }
.label { display: block; font-family: var(--font-mono); color: var(--c-dim); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .12em; }

/* ── Panels and controls ──────────────────────────────────── */
.card { background: var(--c-panel); border: 1px solid var(--c-line); border-radius: var(--r-l); padding: 22px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { font-size: var(--fs-l); }
.card-head a { text-decoration: none; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--c-faint); }
.card-head a:hover { color: var(--c-blue); }
.card-head h2 a { font-family: var(--font-sans); font-size: var(--fs-l); letter-spacing: -.02em; text-transform: none; color: var(--c-text); }
.narrow-card { max-width: 640px; width: 100%; }
.empty-state { text-align: center; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: var(--c-blue); background: color-mix(in srgb, var(--c-blue) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-blue) 25%, transparent); margin-bottom: 4px; }
.empty-icon .ic { width: 24px; height: 24px; }
details.card > summary { cursor: pointer; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; }

label { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-mono); color: var(--c-dim); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .12em; }
label small { text-transform: none; letter-spacing: 0; font-family: var(--font-sans); font-size: var(--fs-xs); }
label.row { flex-direction: row; align-items: center; }
input:not([type=checkbox]):not([type=radio]), select, textarea { width: 100%; min-height: 40px; padding: 9px 12px; border: 1px solid var(--c-line2); border-radius: var(--r-s); background: var(--c-bg); color: var(--c-text); font-family: var(--font-sans); font-size: var(--fs-m); text-transform: none; letter-spacing: 0; line-height: 1.45; transition: border-color .18s var(--ease), box-shadow .18s var(--ease); }
input::placeholder, textarea::placeholder { color: var(--c-faint); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--c-blue) 40%, var(--c-line2)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--c-blue); box-shadow: 0 0 0 4px var(--c-glow); }
select { 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' fill='none' stroke='%238A90A0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
textarea { resize: vertical; line-height: 1.6; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
legend { font-family: var(--font-mono); color: var(--c-dim); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; padding: 0; margin-bottom: 8px; }
legend small { text-transform: none; letter-spacing: 0; font-family: var(--font-sans); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 18px; border: 0; border-radius: 999px; background: var(--c-blue-solid); color: #fff; font-size: var(--fs-m); font-weight: 650; letter-spacing: -.005em; text-decoration: none; white-space: nowrap; cursor: pointer; box-shadow: 0 8px 24px -10px rgba(65, 105, 225, .9), inset 0 1px 0 rgba(255, 255, 255, .18); transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s var(--ease); }
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 12px 28px -10px rgba(65, 105, 225, 1), inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn:active { transform: translateY(0) scale(.98); }
.btn .ic { width: 16px; height: 16px; }
.btn-sm { min-height: 34px; padding: 6px 14px; font-size: var(--fs-s); }
.btn-block { width: 100%; }
.btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 14px; border: 1px solid var(--c-line2); border-radius: 999px; background: transparent; color: var(--c-text); font-size: var(--fs-s); font-weight: 550; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .18s var(--ease), border-color .18s var(--ease); box-shadow: none; }
.btn-ghost:hover { background: var(--c-panel2); border-color: var(--c-faint); transform: none; filter: none; box-shadow: none; }
.btn-ghost .ic { width: 15px; height: 15px; }
.btn.btn-ghost { min-height: 40px; font-size: var(--fs-m); }
.btn-danger { background: transparent; color: var(--c-bad); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-bad) 45%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--c-bad) 10%, transparent); box-shadow: inset 0 0 0 1px var(--c-bad); }
.link-btn { background: none; border: 0; padding: 0; color: var(--c-faint); font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; text-decoration: none; }
.link-btn:hover { color: var(--c-text); }
.danger, .link-btn.danger { color: var(--c-bad); }
:is(.btn, .btn-ghost, .nav-btn, .icon-btn, .link-btn, .check):focus-visible { outline: 2px solid var(--c-blue); outline-offset: 2px; }
.inline { display: inline; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.error { background: color-mix(in srgb, var(--c-bad) 12%, transparent); color: var(--c-bad); padding: 10px 14px; border-radius: var(--r-s); font-weight: 600; font-size: var(--fs-s); }
.flash { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: var(--c-raise); color: var(--c-text); border: 1px solid var(--c-line2); padding: 10px 18px; border-radius: 999px; font-weight: 600; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .5); transition: opacity .4s, transform .4s; }
.flash.gone { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }
.copy { font-family: var(--font-mono) !important; font-size: var(--fs-s) !important; cursor: pointer; }
.copy.big { font-size: var(--fs-m) !important; padding: 14px !important; margin: 12px 0; }
.copy.copied { border-color: var(--c-ok) !important; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-ok) 20%, transparent) !important; }
.picker { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { flex-direction: row; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border: 1px solid var(--c-line2); border-radius: 999px; font-family: var(--font-sans); font-size: var(--fs-s); font-weight: 550; text-transform: none; letter-spacing: 0; color: var(--c-text); cursor: pointer; transition: border-color .18s var(--ease), background .18s var(--ease); }
.pick:has(input:checked) { border-color: var(--c-blue); background: color-mix(in srgb, var(--c-blue) 12%, transparent); }
.pick input { accent-color: var(--c-blue-solid); }

/* ── Chips and meters ─────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip--ok { color: var(--c-ok); background: color-mix(in srgb, var(--c-ok) 13%, transparent); }
.chip--warn { color: var(--c-warn); background: color-mix(in srgb, var(--c-warn) 14%, transparent); }
.chip--bad { color: var(--c-bad); background: color-mix(in srgb, var(--c-bad) 13%, transparent); }
.chip--blue { color: var(--c-blue); background: color-mix(in srgb, var(--c-blue) 14%, transparent); }
.pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; margin-top: 6px; color: var(--c-warn); background: color-mix(in srgb, var(--c-warn) 14%, transparent); }
.pill.ok { color: var(--c-ok); background: color-mix(in srgb, var(--c-ok) 13%, transparent); }
.due { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; padding: 2px 9px; border-radius: 999px; color: var(--c-dim); background: var(--c-panel2); white-space: nowrap; align-self: flex-start; }
.due.late { color: var(--c-bad); background: color-mix(in srgb, var(--c-bad) 13%, transparent); }
.bar { height: 6px; background: var(--c-raise); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--c-blue-solid), var(--c-blue)); border-radius: 999px; transition: width .4s var(--ease); }
.role { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; color: var(--c-dim); background: var(--c-panel2); }
.role-owner { color: var(--c-blue); background: color-mix(in srgb, var(--c-blue) 14%, transparent); }
.badge { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--c-warn); }

/* ── Avatars ──────────────────────────────────────────────── */
.av { display: inline-grid; place-items: center; border-radius: 50%; background: linear-gradient(140deg, color-mix(in srgb, var(--c) 75%, #fff), var(--c)); color: #fff; font-weight: 700; flex-shrink: 0; letter-spacing: .02em; }
.av-xs { width: 22px; height: 22px; font-size: 9.5px; }
.av-sm { width: 30px; height: 30px; font-size: 11.5px; }
.av-md { width: 38px; height: 38px; font-size: 13.5px; }
.av-xl { width: 68px; height: 68px; font-size: 24px; }
.avs { display: inline-flex; }
.avs .av { box-shadow: 0 0 0 2px var(--c-panel); }
.avs .av + .av { margin-left: -8px; }
.av-more { background: var(--c-raise); color: var(--c-dim); }

/* ── Sign in ──────────────────────────────────────────────── */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(60% 50% at 50% 0%, var(--c-glow), transparent 70%), var(--c-bg); }
.auth-card { width: 100%; max-width: 440px; background: var(--c-panel); border: 1px solid var(--c-line); border-radius: var(--r-l); padding: 34px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .6); }
.auth-card h1 { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }

/* ── Home ─────────────────────────────────────────────────── */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.project-card { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 168px; padding: 20px; background: var(--c-panel); border: 1px solid var(--c-line); border-radius: var(--r-l); text-decoration: none; overflow: hidden; transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease); }
.project-card::before { content: ''; position: absolute; inset: 0; background: radial-gradient(90% 60% at 0% 0%, color-mix(in srgb, var(--c) 18%, transparent), transparent 70%); pointer-events: none; }
.project-card:hover { transform: translateY(-2px); border-color: var(--c-line2); box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .6); }
.project-stripe { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent), 0 0 16px var(--c); }
.project-name { font-size: var(--fs-xl); font-weight: 750; letter-spacing: -.025em; margin-top: 6px; }
.project-desc { color: var(--c-dim); font-size: var(--fs-s); flex: 1; }
.project-foot { margin-top: auto; }
.project-card.is-hq .project-name::after { content: 'HQ'; margin-left: 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--c-blue); vertical-align: middle; }
.project-new { align-items: center; justify-content: center; border-style: dashed; color: var(--c-faint); font-weight: 600; background: transparent; }
.project-new::before { display: none; }
.project-new:hover { color: var(--c-blue); border-color: var(--c-blue); }
.plus { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; border: 1px dashed currentColor; }
.home-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.todo-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.todo-mini li { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; border-top: 1px solid var(--c-line); }
.todo-mini li:first-child { border-top: 0; padding-top: 0; }
.todo-mini a { text-decoration: none; font-weight: 600; }

/* ── Events ───────────────────────────────────────────────── */
.events-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.event-row { display: flex; align-items: center; gap: 12px; }
.event-row a { text-decoration: none; font-weight: 600; }
.event-row a:hover { color: var(--c-blue); }
.event-text { display: flex; flex-direction: column; min-width: 0; }
.event-text .small { font-family: var(--font-mono); font-size: 11.5px; color: var(--c-faint); }
.cal { display: inline-flex; flex-direction: column; align-items: center; width: 44px; border-radius: 10px; overflow: hidden; border: 1px solid var(--c-line2); background: var(--c-bg); flex-shrink: 0; }
.cal-m { width: 100%; text-align: center; background: color-mix(in srgb, var(--c-blue) 18%, transparent); color: var(--c-blue); font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; letter-spacing: .12em; padding: 2px 0; }
.cal-d { font-size: 18px; font-weight: 800; padding: 2px 0 4px; letter-spacing: -.02em; }
.cal.big { width: 64px; }
.cal.big .cal-d { font-size: 28px; }
.event-head { display: flex; align-items: center; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--c-line); }
.event-head h1 { font-size: 34px; font-weight: 800; letter-spacing: -.03em; }

/* ── Activity ─────────────────────────────────────────────── */
.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.activity li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--c-line); }
.activity li:first-child { border-top: 0; padding-top: 0; }
.activity a { font-weight: 600; text-decoration: none; color: var(--c-text); }
.activity a:hover { color: var(--c-blue); }
.activity .muted.small { font-family: var(--font-mono); font-size: 11.5px; color: var(--c-faint); margin-top: 2px; }
.activity .muted.small a { font-weight: 500; color: var(--c-faint); }
.activity .excerpt { font-family: var(--font-sans); font-size: var(--fs-s); color: var(--c-dim); }

/* ── People ───────────────────────────────────────────────── */
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.people li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--c-line); }
.people li:first-child { border-top: 0; padding-top: 0; }
.person-main { flex: 1; display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.person-main .small { font-family: var(--font-mono); font-size: 11.5px; color: var(--c-faint); }
.people select { width: auto; min-height: 32px; padding: 4px 30px 4px 10px; font-size: var(--fs-s); }
.me-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }

/* ── Project page ─────────────────────────────────────────── */
.project-head { position: relative; display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.project-head::before { content: ''; position: absolute; left: -40px; top: -44px; width: 420px; height: 220px; background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 22%, transparent), transparent); pointer-events: none; z-index: -1; }
.project-head-main { display: flex; flex-direction: column; max-width: 820px; }
.project-head-side { display: flex; align-items: center; gap: 12px; }
.people-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--c-dim); }
.people-link:hover { color: var(--c-text); }
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 14px; min-height: 220px; padding: 20px; background: var(--c-panel); border: 1px solid var(--c-line); border-radius: var(--r-l); overflow: hidden; transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease); }
.tile:hover { transform: translateY(-2px); border-color: var(--c-line2); box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .6); }
.tile h2 { font-size: var(--fs-l); }
.tile-link { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.tile-link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.tile:focus-within { outline: 2px solid var(--c-blue); outline-offset: 2px; }
.tile-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--c-blue); background: color-mix(in srgb, var(--c-blue) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-blue) 22%, transparent); transition: background .18s var(--ease), color .18s var(--ease); }
.tile:hover .tile-icon { background: var(--c-blue-solid); color: #fff; }
.tile-body { display: flex; flex-direction: column; gap: 10px; font-size: var(--fs-s); }
.tile-row { display: flex; gap: 10px; align-items: flex-start; }
.tile-row > span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--c-dim); }
.tile-row b { color: var(--c-text); font-weight: 600; }
.tile-empty { color: var(--c-faint); font-size: var(--fs-s); }
.pie { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; margin-top: 1px; background: conic-gradient(var(--c-blue) var(--p), var(--c-raise) 0); }
.doc-stack { display: flex; gap: 8px; }
.doc-thumb { width: 86px; height: 108px; border: 1px solid var(--c-line2); border-radius: 6px; background: var(--c-bg); padding: 9px; font-size: 9.5px; display: flex; flex-direction: column; gap: 5px; overflow: hidden; color: var(--c-faint); line-height: 1.4; }
.doc-thumb b { color: var(--c-text); font-size: 11px; line-height: 1.25; }
.mini-board { display: flex; gap: 8px; }
.mini-col { flex: 1; display: flex; flex-direction: column; gap: 2px; background: var(--c-bg); border: 1px solid var(--c-line); border-radius: 10px; padding: 12px; min-width: 0; }
.mini-col .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--c-faint); }
.mini-count { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }

/* ── To-dos ───────────────────────────────────────────────── */
.todolist { display: flex; flex-direction: column; gap: 14px; }
.todolist h2 a { text-decoration: none; }
.todolist h2 a:hover { color: var(--c-blue); }
.todolist .card-head .small { font-family: var(--font-mono); font-size: 11.5px; color: var(--c-faint); }
.todos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.todo { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-top: 1px solid var(--c-line); }
.todos .todo:first-child { border-top: 0; }
.check { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--c-line2); background: var(--c-bg); cursor: pointer; flex-shrink: 0; margin-top: 1px; display: grid; place-items: center; font-weight: 800; font-size: 12px; padding: 0; color: #fff; transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease); }
.check:hover { border-color: var(--c-blue); box-shadow: 0 0 0 4px var(--c-glow); }
.check.checked { background: linear-gradient(140deg, #5B7CFF, #2D47C2); border-color: transparent; color: #fff; box-shadow: 0 4px 12px -4px rgba(65, 105, 225, .8); }
.todo-main { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.todo-text { font-weight: 550; text-decoration: none; }
.is-done .todo-text { color: var(--c-faint); text-decoration: line-through; text-decoration-color: var(--c-line2); }
.todo-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.todo-meta:empty { display: none; }
.todo-meta .muted.small { font-family: var(--font-mono); font-size: 11px; color: var(--c-faint); }
.assignee { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-s); font-weight: 550; color: var(--c-dim); }
.todo-notes { font-size: var(--fs-s); color: var(--c-dim); }
.todo-tools { display: flex; gap: 12px; opacity: 0; transition: opacity .15s; }
.todo:hover .todo-tools, .todo:focus-within .todo-tools { opacity: 1; }
.done-list summary { cursor: pointer; padding: 8px 0 4px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--c-faint); }
.add-todo { border-style: dashed; background: transparent; }

/* ── Menus ────────────────────────────────────────────────── */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; min-width: 220px; background: var(--c-panel); border: 1px solid var(--c-line2); border-radius: var(--r-m); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .7); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.menu-pop a { text-decoration: none; font-weight: 600; font-size: var(--fs-s); }
.menu-pop a:hover { color: var(--c-blue); }

/* ── Message board and docs ───────────────────────────────── */
.list-card { padding: 6px; }
.post-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-m); text-decoration: none; transition: background .15s var(--ease); }
.post-row + .post-row { border-top: 1px solid var(--c-line); }
.post-row:hover { background: var(--c-panel2); }
.post-main { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.post-main .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--c-faint); }
.post-title { font-weight: 650; font-size: var(--fs-l); letter-spacing: -.015em; }
.cat { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--c-blue); margin-right: 8px; }
.cat::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.bubble { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: color-mix(in srgb, var(--c-blue) 16%, transparent); color: var(--c-blue); display: grid; place-items: center; font-family: var(--font-mono); font-weight: 600; font-size: 12px; }
.editor { gap: 14px; }
.cat-select { width: auto !important; align-self: flex-start; }
.title-input { font-size: 30px !important; font-weight: 800 !important; letter-spacing: -.03em !important; border: 0 !important; background: transparent !important; padding: 4px 0 !important; box-shadow: none !important; min-height: 0 !important; }
.post { display: flex; flex-direction: column; gap: 20px; padding: 34px 38px; }
.post-head { display: flex; flex-direction: column; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--c-line); }
.post-head h1 { font-size: clamp(28px, 3vw, 40px); font-weight: 800; letter-spacing: -.03em; line-height: 1.08; }
.byline { display: flex; align-items: center; gap: 10px; color: var(--c-dim); font-size: var(--fs-s); }
.post-tools { display: flex; gap: 16px; align-items: center; }
.prose { display: flex; flex-direction: column; gap: 14px; font-size: 16.5px; line-height: 1.7; overflow-wrap: anywhere; color: var(--c-text); }
.doc .prose { font-size: 17px; max-width: 68ch; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.doc-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; }
.doc-card > .muted.small { font-family: var(--font-mono); font-size: 11px; color: var(--c-faint); }
.doc-page { aspect-ratio: 3 / 4; background: var(--c-panel); border: 1px solid var(--c-line); border-radius: 10px; padding: 18px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; font-size: 12px; color: var(--c-faint); line-height: 1.5; transition: transform .18s var(--ease), border-color .18s var(--ease); }
.doc-card:hover .doc-page { transform: translateY(-3px); border-color: var(--c-blue); }
.doc-page b { color: var(--c-text); font-size: var(--fs-m); line-height: 1.25; }

/* ── Comments ─────────────────────────────────────────────── */
.comments { display: flex; flex-direction: column; gap: 20px; padding-top: 20px; border-top: 1px solid var(--c-line); }
.comments:empty { display: none; }
.comment { display: flex; gap: 12px; }
.comment-body { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.comment-meta { display: flex; gap: 10px; align-items: baseline; font-size: var(--fs-s); }
.comment-meta .muted { font-family: var(--font-mono); font-size: 11px; color: var(--c-faint); }
.comment .prose { font-size: 15.5px; }
.new-comment { background: var(--c-panel); border: 1px solid var(--c-line); border-radius: var(--r-l); padding: 20px 22px; }
.new-comment .btn { align-self: flex-start; }

/* ── Campfire ─────────────────────────────────────────────── */
.chat { display: flex; flex-direction: column; padding-bottom: 96px; }
.line { display: flex; gap: 12px; padding: 6px 10px; border-radius: var(--r-m); align-items: flex-start; transition: background .15s var(--ease); }
.line:not(.cont) { margin-top: 12px; }
.line:hover { background: var(--c-panel); }
.av-gap { width: 38px; flex-shrink: 0; }
.line-body { flex: 1; min-width: 0; }
.line-meta { font-size: var(--fs-s); }
.line-meta .muted { font-family: var(--font-mono); font-size: 11px; color: var(--c-faint); margin-left: 6px; }
.line-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.line-del { opacity: 0; font-size: 16px; }
.line:hover .line-del { opacity: 1; }
.chat-input { position: fixed; left: calc(var(--side-w) + (100vw - var(--side-w)) / 2); bottom: 0; transform: translateX(-50%); width: min(900px, calc(100vw - var(--side-w) - 40px)); padding: 16px 0 22px; display: flex; gap: 10px; background: linear-gradient(transparent, var(--c-bg) 35%); }
.chat-input input { background: var(--c-panel) !important; min-height: 46px !important; border-radius: 999px !important; padding-left: 18px !important; }

/* ── Card table ───────────────────────────────────────────── */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; }
.column { flex: 0 0 290px; background: var(--c-panel); border: 1px solid var(--c-line); border-radius: var(--r-l); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.column-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 6px; }
.column-head h2 { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--c-dim); display: flex; gap: 8px; align-items: center; }
.column-head h2 .muted { color: var(--c-blue); }
.column-cards { display: flex; flex-direction: column; gap: 8px; min-height: 44px; border-radius: var(--r-m); transition: background .15s var(--ease), box-shadow .15s var(--ease); }
.column-cards.drop-here { background: color-mix(in srgb, var(--c-blue) 8%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-blue) 40%, transparent); }
.kcard { display: flex; flex-direction: column; gap: 10px; padding: 13px 14px; background: var(--c-bg); border: 1px solid var(--c-line2); border-radius: var(--r-m); text-decoration: none; cursor: grab; transition: border-color .15s var(--ease), transform .15s var(--ease); }
.kcard:hover { border-color: var(--c-blue); transform: translateY(-1px); }
.kcard.dragging { opacity: .45; }
.kcard-title { font-weight: 600; font-size: var(--fs-m); }
.kcard-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kcard-meta:empty { display: none; }
.quick-card input { background: transparent !important; border-style: dashed !important; font-size: var(--fs-s) !important; min-height: 38px !important; }
.facts { display: flex; flex-direction: column; gap: 10px; font-size: var(--fs-s); }
.facts > span { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.facts b { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--c-faint); }
.move-form select { width: auto; min-height: 34px; font-size: var(--fs-s); }

/* ── Check-ins ────────────────────────────────────────────── */
.checkin-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; transition: border-color .18s var(--ease); }
.checkin-card:hover { border-color: var(--c-blue); }
.checkin-card .small { font-family: var(--font-mono); font-size: 11.5px; color: var(--c-faint); }
.answer-day { display: flex; flex-direction: column; gap: 16px; }
.day-label { font-family: var(--font-mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .14em; color: var(--c-blue); padding-bottom: 8px; border-bottom: 1px solid var(--c-line); }

/* ── Narrow (< 900px): the sidebar becomes a top bar with a scroll strip ── */
@media (max-width: 899px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; z-index: 30; height: auto; overflow: visible; gap: 10px; padding: 12px 0 0; border-right: 0; border-bottom: 1px solid var(--c-line); background: color-mix(in srgb, var(--c-panel) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  .side-brand { padding: 0 16px; }
  .side-org, .side-foot, .nav-group, .nav-btn--add { display: none; }
  .nav-wrap { flex-direction: row; overflow-x: auto; gap: 4px; padding: 0 12px 10px; scrollbar-width: none; }
  .nav-btn { width: auto; flex-shrink: 0; white-space: nowrap; padding: 7px 12px; font-size: var(--fs-s); }
  .nav-btn--active::before { display: none; }
  .topbar { position: static; padding: 12px 16px; }
  .page { padding: 28px 16px 72px; }
  .tools { grid-template-columns: 1fr 1fr; }
  .chat-input { left: 50%; width: calc(100vw - 32px); }
  .card { padding: 16px; border-radius: var(--r-m); }
  .post { padding: 22px 18px; }
}
@media (max-width: 640px) {
  .tools, .home-cols, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .tile { min-height: 0; }
  .todo-tools { opacity: 1; }
  .project-head::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Composers: big borderless input, a tool bar underneath ── */
.composer { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; background: var(--c-panel); border: 1px solid var(--c-line); border-radius: var(--r-l); transition: border-color .18s var(--ease), box-shadow .18s var(--ease); }
.composer:focus-within { border-color: color-mix(in srgb, var(--c-blue) 55%, var(--c-line2)); box-shadow: 0 0 0 4px var(--c-glow); }
.composer h2 { margin-bottom: 4px; }
.composer :is(input, textarea).composer-title,
.composer :is(input, textarea).composer-notes { width: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.composer :is(input, textarea).composer-title:focus,
.composer :is(input, textarea).composer-notes:focus { box-shadow: none; }
.composer-title { font-size: var(--fs-xl) !important; font-weight: 700; letter-spacing: -.02em; }
.composer-title.small-title { font-size: var(--fs-l) !important; font-weight: 600; letter-spacing: -.01em; }
.composer-title.huge { font-size: clamp(28px, 3vw, 38px) !important; font-weight: 800; letter-spacing: -.03em; }
.composer-notes { font-size: var(--fs-m) !important; color: var(--c-dim) !important; resize: none; line-height: 1.6 !important; overflow: hidden; }
.composer-notes.big { color: var(--c-text) !important; font-size: var(--fs-l) !important; }
.composer-notes.indent, .composer-bar.indent { padding-left: 34px !important; }
.composer-row { display: flex; align-items: center; gap: 12px; }
.composer-row textarea { flex: 1; min-height: 0 !important; padding: 8px 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; resize: none; overflow: hidden; }
.composer-comment .composer-row { align-items: flex-start; }
.composer-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 12px; margin-top: 2px; border-top: 1px solid var(--c-line); }
.composer-section { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--c-line); }
.composer-inline { flex-direction: row; align-items: center; gap: 10px; }
.composer-inline .composer-title { flex: 1; }
.composer-big { padding: 26px 28px; }
.grow { flex: 1; }
.bar-hint { font-family: var(--font-mono); font-size: 11px; color: var(--c-faint); letter-spacing: .04em; text-decoration: none; }
a.bar-hint:hover { color: var(--c-blue); }
.bar-chip { display: inline-flex; flex-direction: row; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 1px solid var(--c-line2); border-radius: 999px; color: var(--c-dim); font-family: var(--font-sans); font-size: var(--fs-s); font-weight: 550; text-transform: none; letter-spacing: 0; cursor: pointer; list-style: none; transition: border-color .18s var(--ease), color .18s var(--ease), background .18s var(--ease); }
.bar-chip::-webkit-details-marker { display: none; }
.bar-chip:hover, .pop[open] > .bar-chip { border-color: var(--c-blue); color: var(--c-text); }
.bar-chip .ic { width: 15px; height: 15px; color: var(--c-faint); }
.bar-chip input { width: auto !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; font-family: var(--font-mono) !important; font-size: 12px !important; color: var(--c-text) !important; }
.pop { position: relative; }
.pop-panel { position: absolute; left: 0; top: calc(100% + 8px); z-index: 15; min-width: 280px; max-width: 420px; padding: 12px; background: var(--c-panel); border: 1px solid var(--c-line2); border-radius: var(--r-m); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .7); }
.check.ghost { pointer-events: none; opacity: .6; }
.field { display: flex; flex-direction: column; gap: 7px; font-family: var(--font-sans); text-transform: none; letter-spacing: 0; font-size: var(--fs-s); }
.field-label { font-family: var(--font-sans); font-size: var(--fs-s); font-weight: 600; color: var(--c-dim); text-transform: none; letter-spacing: 0; }
.field-label em { font-style: normal; font-weight: 450; color: var(--c-faint); margin-left: 6px; }
.form-error { margin: 0; padding: 9px 12px; border-radius: var(--r-s); background: color-mix(in srgb, var(--c-bad) 12%, transparent); color: var(--c-bad); font-size: var(--fs-s); font-weight: 600; }

/* Radio pills (message categories, how often). */
.cat-pills, .seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg { gap: 4px; padding: 4px; border: 1px solid var(--c-line); border-radius: 999px; background: var(--c-bg); }
.cat-pill, .seg label { position: relative; flex-direction: row; font-family: var(--font-sans); text-transform: none; letter-spacing: 0; cursor: pointer; }
.cat-pill input, .seg input { position: absolute; opacity: 0; pointer-events: none; }
.cat-pill span { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border: 1px solid var(--c-line2); border-radius: 999px; font-size: var(--fs-s); font-weight: 550; color: var(--c-dim); transition: all .18s var(--ease); }
.cat-pill input:checked + span { border-color: var(--c-blue); color: var(--c-blue); background: color-mix(in srgb, var(--c-blue) 12%, transparent); }
.cat-pill input:focus-visible + span, .seg input:focus-visible + span { outline: 2px solid var(--c-blue); outline-offset: 2px; }
.seg span { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; font-size: var(--fs-s); font-weight: 550; color: var(--c-dim); }
.seg input:checked + span { background: var(--c-raise); color: var(--c-text); box-shadow: inset 0 0 0 1px var(--c-line2); }

/* The writing surface for messages and docs. */
.writer { display: flex; flex-direction: column; gap: 18px; padding: 30px 36px; background: var(--c-panel); border: 1px solid var(--c-line); border-radius: var(--r-l); }
.writer :is(input, textarea):is(.writer-title, .writer-body) { width: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none !important; min-height: 0; }
.writer-title { font-size: clamp(30px, 3.4vw, 44px) !important; font-weight: 800; letter-spacing: -.035em; line-height: 1.1 !important; }
.writer-body { font-size: 17px !important; line-height: 1.75 !important; resize: none; min-height: 260px !important; overflow: hidden; }
.writer-bar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding-top: 16px; border-top: 1px solid var(--c-line); position: sticky; bottom: 0; background: var(--c-panel); }
@media (max-width: 640px) {
  .writer { padding: 20px 18px; }
  .composer-notes.indent, .composer-bar.indent { padding-left: 0 !important; }
}

/* ── Schedule: month grid + agenda ────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cal-head { margin-bottom: 4px; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.cal-card { background: var(--c-panel); border: 1px solid var(--c-line); border-radius: var(--r-l); overflow: hidden; }
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--c-line); }
.cal-title { font-size: var(--fs-xl); font-weight: 750; letter-spacing: -.025em; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav .icon-btn { font-size: 18px; line-height: 1; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-wd { padding: 10px 12px 8px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--c-faint); border-bottom: 1px solid var(--c-line); }
.cal-day { position: relative; min-height: 118px; padding: 8px 6px 8px; border-right: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); display: flex; flex-direction: column; gap: 4px; transition: background .15s var(--ease); }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.weekend { background: color-mix(in srgb, var(--c-bg) 45%, var(--c-panel)); }
.cal-day.out { background: var(--c-bg); }
.cal-day.out .cal-num { color: var(--c-line2); }
.cal-day[data-day] { cursor: copy; }
.cal-day[data-day]:hover { background: color-mix(in srgb, var(--c-blue) 6%, var(--c-panel)); }
.cal-day[data-day]:hover::after { content: '+'; position: absolute; right: 10px; top: 6px; font-size: 16px; color: var(--c-blue); }
.cal-day.picked { background: color-mix(in srgb, var(--c-blue) 10%, var(--c-panel)); box-shadow: inset 0 0 0 1px var(--c-blue); }
.cal-num { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: 2px; border-radius: 50%; font-family: var(--font-mono); font-size: 12px; color: var(--c-dim); }
.cal-day.past:not(.today) .cal-num { color: var(--c-faint); }
.cal-day.today .cal-num { background: var(--c-blue-solid); color: #fff; font-weight: 700; box-shadow: 0 0 0 4px var(--c-glow); }
.cal-events { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-ev { display: block; min-height: 22px; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 16px; color: var(--c-text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: color-mix(in srgb, var(--c) 22%, var(--c-panel)); box-shadow: inset 3px 0 0 var(--c); transition: background .15s var(--ease), transform .15s var(--ease); }
.cal-ev b { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; color: color-mix(in srgb, var(--c) 70%, var(--c-text)); margin-right: 5px; }
.cal-ev:hover { background: color-mix(in srgb, var(--c) 34%, var(--c-panel)); }
.cal-ev.cont { margin-left: -7px; border-top-left-radius: 0; border-bottom-left-radius: 0; box-shadow: none; }
.cal-ev.open-end { margin-right: -7px; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-day:nth-child(7n + 1) .cal-ev.cont { margin-left: 0; }
.cal-more { font-family: var(--font-mono); font-size: 10.5px; color: var(--c-faint); padding-left: 6px; }
.past .cal-ev { opacity: .55; }

.agenda { background: var(--c-panel); border: 1px solid var(--c-line); border-radius: var(--r-l); padding: 18px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow-y: auto; scrollbar-width: thin; }
.agenda-title { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--c-blue); margin-bottom: 8px; }
.agenda-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 0; text-align: center; }
.agenda-day { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--c-line); }
.agenda-day:first-of-type { border-top: 0; }
.agenda-date { display: flex; flex-direction: column; align-items: center; width: 38px; flex-shrink: 0; }
.agenda-wd { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--c-faint); }
.agenda-dn { font-size: 24px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.agenda-items { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.agenda-rel { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--c-blue); margin-top: 2px; }
.agenda-ev { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-s); background: var(--c-bg); border: 1px solid var(--c-line); text-decoration: none; transition: border-color .15s var(--ease); }
.agenda-ev:hover { border-color: var(--c); }
.agenda-bar { width: 3px; align-self: stretch; border-radius: 3px; background: var(--c); box-shadow: 0 0 10px var(--c); }
.agenda-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.agenda-main b { font-size: var(--fs-s); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-meta { font-family: var(--font-mono); font-size: 11px; color: var(--c-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* One event, as a ticket. */
.event-ticket { display: grid; grid-template-columns: 170px minmax(0, 1fr); background: var(--c-panel); border: 1px solid var(--c-line); border-radius: var(--r-l); overflow: hidden; }
.ticket-date { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 28px 16px; background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%), var(--c-bg); border-right: 1px dashed var(--c-line2); position: relative; }
.ticket-date::before, .ticket-date::after { content: ''; position: absolute; right: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--c-bg); border: 1px solid var(--c-line); }
.ticket-date::before { top: -10px; }
.ticket-date::after { bottom: -10px; }
.ticket-month { font-family: var(--font-mono); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--c); }
.ticket-day { font-size: 72px; font-weight: 800; letter-spacing: -.05em; line-height: 1; }
.ticket-wd { font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--c-dim); }
.ticket-span { margin-top: 10px; font-family: var(--font-mono); font-size: 11px; padding: 2px 9px; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.ticket-body { display: flex; flex-direction: column; gap: 16px; padding: 28px 30px 22px; }
.ticket-title { font-size: clamp(28px, 3vw, 42px); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; }
.ticket-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 0; }
.ticket-facts dt { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--c-faint); margin-bottom: 4px; }
.ticket-facts dd { margin: 0; font-weight: 600; }
.ticket-facts a { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.ticket-facts a:hover { color: var(--c-blue); }
.ticket-people { display: flex; flex-wrap: wrap; gap: 12px; }
.ticket-notes { padding-top: 14px; border-top: 1px solid var(--c-line); }

@media (max-width: 1100px) {
  .cal-layout { grid-template-columns: 1fr; }
  .agenda { position: static; max-height: none; }
}
@media (max-width: 640px) {
  .cal-day { min-height: 64px; padding: 4px 2px; }
  .cal-ev { font-size: 0; min-height: 6px; padding: 0; border-radius: 3px; }
  .cal-ev b { display: none; }
  .cal-wd { padding: 8px 4px; font-size: 9px; letter-spacing: .06em; text-align: center; }
  .cal-num { width: 22px; height: 22px; font-size: 11px; }
  .event-ticket { grid-template-columns: 1fr; }
  .ticket-date { border-right: 0; border-bottom: 1px dashed var(--c-line2); flex-direction: row; gap: 12px; padding: 18px; }
  .ticket-date::before, .ticket-date::after { display: none; }
  .ticket-day { font-size: 44px; }
}

/* ── Rendered text (light Markdown) ───────────────────────── */
.prose :is(.md-h1, .md-h2, .md-h3) { margin: 18px 0 0; letter-spacing: -.025em; line-height: 1.2; }
.prose .md-h1 { font-size: 28px; font-weight: 800; }
.prose .md-h2 { font-size: 22px; font-weight: 750; padding-top: 18px; border-top: 1px solid var(--c-line); }
.prose .md-h3 { font-size: 17px; font-weight: 700; }
.prose > :first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose strong { font-weight: 700; color: var(--c-text); }
.prose a { color: var(--c-blue); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--c-blue) 40%, transparent); }
.prose a:hover { border-bottom-color: var(--c-blue); }
.md-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.md-list li::marker { color: var(--c-blue); }
ol.md-list li::marker { font-family: var(--font-mono); font-size: .85em; }
.md-table-wrap { overflow-x: auto; border: 1px solid var(--c-line); border-radius: var(--r-m); }
.md-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.md-table th { text-align: left; padding: 10px 14px; background: var(--c-panel2); font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--c-dim); border-bottom: 1px solid var(--c-line2); white-space: nowrap; }
.md-table td { padding: 10px 14px; border-bottom: 1px solid var(--c-line); vertical-align: top; }
.md-table tr:last-child td { border-bottom: 0; }
.md-table tr:hover td { background: color-mix(in srgb, var(--c-panel2) 60%, transparent); }
.md-table td:first-child { font-weight: 600; }

/* ── Whiteboards ──────────────────────────────────────────── */
:root { --k1: #1B2147; --k1i: #9EB0FF; --k2: #10301F; --k2i: #7BE3A8; --k3: #33260F; --k3i: #F0C27A; --k4: #3A1520; --k4i: #FF9FB2; --k5: #2A1E47; --k5i: #C9B2FF; --k6: #22252C; --k6i: #A6ACB8; }
html[data-theme='light'] { --k1: #E6EBFF; --k1i: #2F55D4; --k2: #E3F6EA; --k2i: #0F7A49; --k3: #FFF3DC; --k3i: #8A5F00; --k4: #FBE6EB; --k4i: #C21F4D; --k5: #EFE8FF; --k5i: #5B2DB8; --k6: #ECEBE6; --k6i: #4D5360; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.board-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; }
.board-thumb { position: relative; aspect-ratio: 16 / 10; border-radius: var(--r-m); border: 1px solid var(--c-line); background-color: var(--c-panel); background-image: radial-gradient(var(--c-line2) 1px, transparent 1.2px); background-size: 16px 16px; overflow: hidden; transition: border-color .18s var(--ease), transform .18s var(--ease); }
.board-card:hover .board-thumb { border-color: var(--c-blue); transform: translateY(-2px); }
.bt { position: absolute; border: 2px solid var(--c-dim); border-radius: 6px; }
.bt-1 { left: 12%; top: 22%; width: 30%; height: 28%; background: var(--k1); border-color: var(--k1i); }
.bt-2 { left: 56%; top: 40%; width: 26%; height: 34%; border-radius: 50%; background: var(--k2); border-color: var(--k2i); }
.bt-3 { left: 40%; top: 32%; width: 18%; height: 0; border-width: 2px 0 0; border-radius: 0; transform: rotate(12deg); }
.board-meta { display: flex; flex-direction: column; gap: 2px; }
.board-head { margin-bottom: 0; }
.board-status { font-family: var(--font-mono); font-size: 11px; padding: 3px 10px; border-radius: 999px; color: var(--c-ok); background: color-mix(in srgb, var(--c-ok) 13%, transparent); }
.board-status[data-state=unsaved], .board-status[data-state=saving] { color: var(--c-warn); background: color-mix(in srgb, var(--c-warn) 14%, transparent); }
.board-status[data-state=error] { color: var(--c-bad); background: color-mix(in srgb, var(--c-bad) 13%, transparent); }
.board-status[data-state=live] { color: var(--c-blue); background: color-mix(in srgb, var(--c-blue) 14%, transparent); }
.board-keys { display: block; }
.board { position: relative; height: calc(100vh - 250px); min-height: 480px; background-color: var(--c-panel); background-image: radial-gradient(var(--c-line2) 1px, transparent 1.2px); background-size: 22px 22px; border: 1px solid var(--c-line); border-radius: var(--r-l); overflow: hidden; outline: none; touch-action: none; user-select: none; -webkit-user-select: none; animation: none !important; }
.board:focus-visible { box-shadow: 0 0 0 2px var(--c-blue); }
#bsvg { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.board[data-tool=select] #bsvg { cursor: default; }
.board[data-tool=hand] #bsvg, .board[data-pan] #bsvg { cursor: grab; }
.btools { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; padding: 5px; background: var(--c-bg); border: 1px solid var(--c-line2); border-radius: var(--r-m); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .6); max-width: calc(100% - 24px); overflow-x: auto; scrollbar-width: none; z-index: 3; }
.btools button { position: relative; width: 40px; height: 40px; border: 0; background: none; border-radius: 8px; display: grid; place-items: center; color: var(--c-dim); flex-shrink: 0; cursor: pointer; }
.btools button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btools button:hover { background: var(--c-panel2); color: var(--c-text); }
.btools button[aria-pressed=true] { background: color-mix(in srgb, var(--c-blue) 18%, transparent); color: var(--c-blue); }
.btools .kk { position: absolute; right: 3px; bottom: 1px; font-family: var(--font-mono); font-size: 8.5px; color: var(--c-faint); }
.btools .sep, .bzoom .sep { width: 1px; background: var(--c-line2); margin: 4px 3px; flex-shrink: 0; }
.bprops { position: absolute; top: 74px; left: 12px; width: 216px; max-height: calc(100% - 140px); overflow: auto; background: var(--c-bg); border: 1px solid var(--c-line2); border-radius: var(--r-m); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .6); padding: 12px; z-index: 3; }
.bprops .pl { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; color: var(--c-faint); text-transform: uppercase; margin: 10px 0 6px; }
.bprops .pl:first-child { margin-top: 0; }
.bprops .pr { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.sw { width: 26px; height: 26px; border-radius: 7px; border: 1.5px solid var(--c-line2); background: var(--c-panel); font-size: 12px; color: var(--c-faint); padding: 0; cursor: pointer; }
.sw[data-p=stroke] { border: 0; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.sw[aria-pressed=true] { outline: 2px solid var(--c-blue); outline-offset: 2px; }
.sg { border: 1px solid var(--c-line2); background: var(--c-panel); border-radius: 7px; padding: 3px 9px; font-size: 12px; min-height: 30px; color: var(--c-dim); cursor: pointer; }
.sg:hover { border-color: var(--c-faint); color: var(--c-text); }
.sg[aria-pressed=true] { border-color: var(--c-blue); background: color-mix(in srgb, var(--c-blue) 14%, transparent); color: var(--c-blue); font-weight: 650; }
.sg.danger { color: var(--c-bad); }
.sg.wide { width: 100%; font-weight: 650; }
.bhint { font-size: 12px; color: var(--c-faint); margin-top: 8px; }
.bzoom { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 2px; background: var(--c-bg); border: 1px solid var(--c-line2); border-radius: 10px; padding: 3px; z-index: 3; }
.bzoom button { border: 0; background: none; min-width: 34px; height: 32px; border-radius: 7px; font-weight: 650; font-size: 13px; color: var(--c-dim); padding: 0 8px; cursor: pointer; font-family: var(--font-sans); }
.bzoom button:hover:not(:disabled) { background: var(--c-panel2); color: var(--c-text); }
.bzoom button:disabled { opacity: .35; cursor: not-allowed; }
.btext { position: absolute; z-index: 4; border: 1.5px dashed var(--c-blue) !important; background: transparent !important; resize: none; overflow: hidden; font-family: Kalam, 'Comic Sans MS', cursive !important; line-height: 1.25 !important; padding: 3px 4px !important; min-height: 0 !important; outline: none; white-space: pre; margin: 0; box-shadow: none !important; }
.bempty { position: absolute; left: 0; right: 0; top: 42%; text-align: center; color: var(--c-faint); pointer-events: none; font-size: 14px; padding: 0 20px; }
.bempty b { display: block; color: var(--c-text); font-size: 18px; margin-bottom: 4px; }
@media (max-width: 640px) { .bprops { top: auto; bottom: 58px; left: 8px; right: 8px; width: auto; max-height: 42%; } .board { height: calc(100vh - 280px); } }

/* ── Unpack ───────────────────────────────────────────────── */
.engine { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--c-line2); border-radius: 999px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--c-faint); }
.engine-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c-faint); }
.engine--on { color: var(--c-ok); border-color: color-mix(in srgb, var(--c-ok) 35%, var(--c-line2)); }
.engine--on .engine-dot { background: var(--c-ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-ok) 18%, transparent); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--c-ok) 6%, transparent); } }
.unpack-composer { max-width: 900px; }
.unpack-composer textarea { min-height: 150px; }
.bar-chip select { width: auto !important; min-height: 0 !important; padding: 0 18px 0 0 !important; border: 0 !important; background-color: transparent !important; background-position: right 0 center !important; box-shadow: none !important; color: var(--c-text) !important; font-size: var(--fs-s) !important; font-weight: 550; max-width: 260px; text-overflow: ellipsis; }
.unpack-out { display: flex; flex-direction: column; gap: 12px; max-width: 900px; margin-top: 18px; }
.unpack-out:empty { display: none; }
#unpack-review { display: flex; flex-direction: column; gap: 12px; }
.unpack-status { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border: 1px solid var(--c-line); border-radius: var(--r-l); background: var(--c-panel); position: relative; overflow: hidden; }
.unpack-status-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.unpack-spark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(140deg, #5B7CFF, #2D47C2); color: #fff; box-shadow: 0 8px 22px -8px rgba(65, 105, 225, .9); flex-shrink: 0; }
.unpack-spark .ic { width: 20px; height: 20px; }
.unpack-status.working .unpack-spark .ic { animation: twinkle 1.4s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: scale(.82) rotate(12deg); opacity: .75; } }
.unpack-spark.done { background: linear-gradient(140deg, #43D693, #179B61); box-shadow: 0 8px 22px -8px rgba(67, 214, 147, .7); }
.unpack-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--c-line); }
.unpack-bar span { display: block; height: 100%; background: var(--c-blue); transition: width .5s var(--ease); }
.unpack-rows { display: flex; flex-direction: column; gap: 8px; }
.unpack-rows:empty { display: none; }
.unpack-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; border: 1px solid var(--c-line); border-radius: var(--r-m); background: var(--c-panel); animation: rise .35s var(--ease) both; transition: opacity .2s var(--ease), border-color .2s var(--ease); }
.unpack-item:focus-within { border-color: color-mix(in srgb, var(--c-blue) 55%, var(--c-line2)); }
.unpack-item:has(.tick:not(:checked)) { opacity: .5; }
.unpack-item:has(.tick:not(:checked)) .unpack-text { text-decoration: line-through; text-decoration-color: var(--c-faint); }
.unpack-main { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }
.unpack-line { display: flex; align-items: center; gap: 10px; }
.unpack-line .kind { width: auto; min-height: 30px; padding: 3px 28px 3px 10px; border-radius: 999px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--c-blue); background-color: color-mix(in srgb, var(--c-blue) 10%, transparent); border-color: transparent; background-position: right 9px center; }
.unpack-line input.unpack-text { flex: 1; min-height: 34px; padding: 4px 8px; margin-left: -8px; border: 1px solid transparent; background: transparent; font-size: var(--fs-l); font-weight: 600; letter-spacing: -.01em; }
.unpack-line input.unpack-text:hover { border-color: var(--c-line2); }
.unpack-line input.unpack-text:focus { border-color: var(--c-blue); background: var(--c-bg); box-shadow: 0 0 0 4px var(--c-glow); }
.unpack-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.unpack-meta .bar-chip.found { border-color: color-mix(in srgb, var(--c-blue) 45%, var(--c-line2)); background: color-mix(in srgb, var(--c-blue) 7%, transparent); }
.unpack-meta .bar-chip.found .ic { color: var(--c-blue); }
.unpack-src { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-s); color: var(--c-faint); }
.unpack-src .mono { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; }
.ai-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; padding: 1px 7px; border-radius: 999px; color: var(--c-blue); border: 1px solid color-mix(in srgb, var(--c-blue) 40%, transparent); }
.tick-wrap { padding-top: 4px; cursor: pointer; }
.tick { appearance: none; width: 22px; height: 22px; margin: 0; border-radius: 7px; border: 1.5px solid var(--c-line2); background: var(--c-bg); cursor: pointer; display: grid; place-items: center; transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease); }
.tick:hover { border-color: var(--c-blue); box-shadow: 0 0 0 4px var(--c-glow); }
.tick:checked { background: linear-gradient(140deg, #5B7CFF, #2D47C2); border-color: transparent; box-shadow: 0 4px 12px -4px rgba(65, 105, 225, .8); }
.tick:checked::after { content: ''; width: 10px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }
.tick:focus-visible { outline: 2px solid var(--c-blue); outline-offset: 2px; }
.unpack-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 4px 0; }
.unpack-foot:empty { display: none; }
.unpack-added { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.unpack-added li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--c-line); }
.unpack-added li:first-child { border-top: 0; }
.unpack-added a { color: var(--c-text); font-weight: 600; text-decoration: none; }
.unpack-added a:hover { color: var(--c-blue); }
.unpack-problems { margin: 8px 0 0; padding-left: 18px; color: var(--c-dim); font-size: var(--fs-s); }
@media (max-width: 640px) {
  .unpack-item { padding: 12px; gap: 10px; }
  .unpack-line { flex-direction: column; align-items: stretch; }
  .unpack-line .kind { align-self: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .unpack-item, .unpack-status.working .unpack-spark .ic, .engine--on .engine-dot { animation: none; }
}

/* ── Sheets ───────────────────────────────────────────────── */
.sheet-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.sheet-card { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border: 1px solid var(--c-line); border-radius: var(--r-l); background: var(--c-panel); text-decoration: none; color: var(--c-text); transition: border-color .18s var(--ease), transform .18s var(--ease); }
.sheet-card:hover { border-color: var(--c-blue); transform: translateY(-1px); }
.sheet-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sheet-ic { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px; color: var(--c-blue); background: color-mix(in srgb, var(--c-blue) 12%, transparent); font-family: var(--font-mono); font-weight: 700; font-size: 13px; }
.sheet-ic.calc { color: var(--c-ok); background: color-mix(in srgb, var(--c-ok) 12%, transparent); }
.sheet-ic .ic { width: 19px; height: 19px; }
.file-chip input[type=file] { font-size: 12px !important; color: var(--c-dim) !important; }
.sheet-app { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.sheet-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sheet-tools input.sheet-search { width: 260px; min-height: 34px; padding: 6px 12px; border-radius: 999px; font-size: var(--fs-s); }
.sheet-tools .icon-btn { font-size: 16px; }
.sheet-tools .icon-btn:disabled { opacity: .4; cursor: default; }
.fxmark { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: .04em; color: var(--c-blue); margin-right: 6px; }
.fxmark.big { font-size: 11.5px; margin-right: 2px; }
.sheet-bar { display: flex; align-items: center; gap: 12px; min-height: 36px; padding: 6px 14px; border: 1px solid var(--c-line); border-radius: var(--r-m); background: var(--c-panel); font-size: var(--fs-s); overflow: hidden; white-space: nowrap; }
.sheet-bar .sref { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--c-faint); flex-shrink: 0; }
.sheet-bar .sfx { font-family: var(--font-mono); font-size: 12.5px; color: var(--c-blue); overflow: hidden; text-overflow: ellipsis; }
.serr { color: var(--c-bad); font-size: var(--fs-s); }
.sheet-grid { overflow: auto; max-height: calc(100vh - 290px); min-height: 220px; border: 1px solid var(--c-line); border-radius: var(--r-m); background: var(--c-panel); outline: none; }
.sheet-grid:focus-visible { border-color: var(--c-blue); box-shadow: 0 0 0 4px var(--c-glow); }
table.sheet { border-collapse: separate; border-spacing: 0; font-size: var(--fs-s); min-width: 100%; }
table.sheet th, table.sheet td { border-right: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); padding: 0; height: 36px; background: var(--c-panel); }
table.sheet thead th { position: sticky; top: 0; z-index: 2; background: var(--c-panel2); min-width: 130px; text-align: left; }
table.sheet thead th.wide { min-width: 260px; }
table.sheet th.rn { position: sticky; left: 0; z-index: 1; width: 44px; min-width: 44px; text-align: center; font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--c-faint); background: var(--c-panel2); }
table.sheet thead th.rn { z-index: 3; }
table.sheet tr > :nth-child(2) { position: sticky; left: 44px; z-index: 1; box-shadow: 1px 0 0 var(--c-line2); }
table.sheet thead tr > :nth-child(2) { z-index: 3; }
table.sheet td.sel:nth-child(2) { z-index: 2; box-shadow: inset 0 0 0 2px var(--c-blue); }
.colbtn { display: flex; align-items: center; gap: 7px; width: 100%; height: 36px; padding: 0 12px; border: 0; background: none; color: var(--c-text); font-weight: 650; font-size: var(--fs-s); text-align: left; cursor: pointer; }
.colbtn:hover:not(:disabled) { background: var(--c-raise); }
.colbtn:disabled { cursor: default; }
.colbtn .cn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.colbtn .ty { font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--c-faint); min-width: 18px; }
.colbtn .ty.fx { color: var(--c-blue); }
.colbtn .srt { color: var(--c-blue); margin-left: auto; }
table.sheet th.addcol, table.sheet td.rowdel { width: 40px; min-width: 40px; text-align: center; background: var(--c-panel2); border-right: 0; }
table.sheet td.rowdel { background: var(--c-panel); }
.addcol button, .rowdel button { width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--c-faint); cursor: pointer; font-size: 15px; }
.addcol button:hover { color: var(--c-blue); background: color-mix(in srgb, var(--c-blue) 12%, transparent); }
.rowdel button { opacity: 0; font-size: 11px; }
tr:hover .rowdel button, .rowdel button:focus-visible { opacity: 1; }
.rowdel button:hover { color: var(--c-bad); background: color-mix(in srgb, var(--c-bad) 12%, transparent); }
table.sheet td { position: relative; cursor: cell; }
table.sheet td.fxc { background: color-mix(in srgb, var(--c-blue) 4%, var(--c-panel)); }
table.sheet td.err { color: var(--c-bad); }
table.sheet td.sel { box-shadow: inset 0 0 0 2px var(--c-blue); z-index: 1; }
.cell { display: flex; align-items: center; height: 36px; padding: 0 12px; max-width: 420px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cell.n { justify-content: flex-end; font-family: var(--font-mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cell a { color: var(--c-blue); text-decoration: none; }
.cell a:hover { text-decoration: underline; }
.cell.foot { font-weight: 700; gap: 8px; }
.cell.foot .lbl { font-size: 9.5px; letter-spacing: .1em; color: var(--c-faint); font-weight: 600; margin-right: auto; }
table.sheet tfoot td { position: sticky; bottom: 0; background: var(--c-panel2); border-top: 1px solid var(--c-line2); }
.ck { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--c-line2); }
.ck.on { background: linear-gradient(140deg, #5B7CFF, #2D47C2); border-color: transparent; }
.ck.on::after { content: ''; width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }
.kz { display: inline-flex; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.kz-1 { color: #7690FF; background: rgba(118, 144, 255, .15); } .kz-2 { color: #43D693; background: rgba(67, 214, 147, .14); } .kz-3 { color: #F5B83D; background: rgba(245, 184, 61, .15); }
.kz-4 { color: #FF6B8A; background: rgba(255, 107, 138, .14); } .kz-5 { color: #B48CFF; background: rgba(180, 140, 255, .15); } .kz-6 { color: #4FD1E0; background: rgba(79, 209, 224, .14); }
html[data-theme='light'] .kz-1 { color: #2F55D4; } html[data-theme='light'] .kz-2 { color: #0F7A49; } html[data-theme='light'] .kz-3 { color: #8A5F00; }
html[data-theme='light'] .kz-4 { color: #C21F4D; } html[data-theme='light'] .kz-5 { color: #6B3FD1; } html[data-theme='light'] .kz-6 { color: #0B7A88; }
.seditor { position: absolute; inset: 0; width: 100% !important; height: 100% !important; min-height: 0 !important; padding: 0 12px !important; border: 0 !important; border-radius: 0 !important; background: var(--c-bg) !important; box-shadow: inset 0 0 0 2px var(--c-blue) !important; font-size: var(--fs-s) !important; z-index: 2; }
.sempty { padding: 36px 16px; text-align: center; color: var(--c-faint); }
.sheet-keys { margin: 0; }
.sdlg { width: min(560px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--c-line2); border-radius: var(--r-l); background: var(--c-panel); color: var(--c-text); box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8); }
.sdlg::backdrop { background: rgba(4, 6, 10, .55); backdrop-filter: blur(3px); }
.sdlg-form { display: flex; flex-direction: column; gap: 14px; padding: 22px; }
.sdlg-form h2 { font-size: var(--fs-xl); }
.sdlg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sdlg-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sdlg-row .field-label { margin-right: 4px; }
.sdlg-foot { display: flex; align-items: center; gap: 8px; padding-top: 14px; border-top: 1px solid var(--c-line); }
.sdlg-preview { margin: 0; font-family: var(--font-mono); font-size: 12.5px; color: var(--c-dim); min-height: 18px; }
.sdlg textarea.mono, .composer-notes.mono { font-family: var(--font-mono) !important; font-size: 13px !important; }
.scheck { display: flex; align-items: center; gap: 10px; font-size: var(--fs-s); font-weight: 550; cursor: pointer; text-transform: none; letter-spacing: 0; }
[hidden] { display: none !important; }
@media (max-width: 640px) {
  .sdlg-grid { grid-template-columns: 1fr; }
  .sheet-tools input.sheet-search { width: 100%; }
  .sheet-grid { max-height: none; }
}

/* Folders in Docs & Files */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 22px 18px; margin: 4px 0 30px; }
.folder { --back: color-mix(in srgb, var(--fc) 46%, var(--c-panel)); --front: color-mix(in srgb, var(--fc) 30%, var(--c-panel)); --front2: color-mix(in srgb, var(--fc) 20%, var(--c-panel)); position: relative; display: block; height: 138px; min-width: 0; perspective: 700px; color: var(--c-text); text-decoration: none; outline-offset: 6px; }
html[data-theme='light'] .folder { --back: color-mix(in srgb, var(--fc) 58%, #fff); --front: color-mix(in srgb, var(--fc) 34%, #fff); --front2: color-mix(in srgb, var(--fc) 24%, #fff); }
.folder-back { position: absolute; inset: 16px 0 0; background: var(--back); border-radius: 3px 14px 14px 14px; }
.folder-back::before { content: ""; position: absolute; left: 0; top: -13px; width: 44%; height: 16px; background: var(--back); border-radius: 9px 12px 0 0; clip-path: polygon(0 0, 78% 0, 100% 100%, 0 100%); }
.folder-papers { position: absolute; inset: 24px 10px 24px; }
.paper { position: absolute; top: 0; left: 10px; right: 10px; height: 78px; padding: 7px 9px; background: #F7F6F2; border-radius: 5px; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); color: #3B3F48; font-size: 10px; line-height: 1.3; overflow: hidden; transition: transform .28s var(--ease); }
.paper i { font-style: normal; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.paper::after { content: ""; position: absolute; left: 9px; right: 22px; top: 36px; height: 22px; background: repeating-linear-gradient(#D9D7D0 0 2px, transparent 2px 7px); opacity: .8; }
.paper:nth-child(1) { transform: rotate(-4deg) translate(-4px, 2px); }
.paper:nth-child(2) { transform: rotate(3deg) translate(6px, 0); background: #FFFFFF; }
.paper:nth-child(3) { transform: rotate(-1deg) translate(0, 5px); }
.folder-front { position: absolute; left: 0; right: 0; bottom: 0; height: 84px; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; padding: 12px 16px 14px; background: linear-gradient(180deg, var(--front), var(--front2)); border-radius: 8px 14px 14px 14px; box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 22%, transparent), 0 10px 22px -14px rgba(0, 0, 0, .7); transform-origin: 50% 100%; transition: transform .3s var(--ease); }
.folder-front b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; letter-spacing: -.01em; }
.folder-count { font-family: var(--font-mono); font-size: 11px; color: var(--c-dim); }
.folder:hover .folder-front, .folder:focus-visible .folder-front { transform: rotateX(-16deg) scaleX(.97); }
.folder:hover .paper:nth-child(1) { transform: rotate(-6deg) translate(-8px, -14px); }
.folder:hover .paper:nth-child(2) { transform: rotate(5deg) translate(10px, -18px); }
.folder:hover .paper:nth-child(3) { transform: rotate(-1deg) translate(0, -10px); }
@media (prefers-reduced-motion: reduce) { .folder-front, .paper { transition: none; } }
.folder-title { display: flex; align-items: center; gap: 14px; }
.folder-title svg { width: .8em; height: .8em; color: var(--fc, var(--c-blue)); flex: none; }
.sheet-list + .doc-grid { margin-top: 22px; }
.move-form select { width: 100%; }
.menu-pop.menu-pop-left { left: 0; right: auto; }

/* ── photos & videos ─────────────────────────────────────────────── */
.upload-pick { cursor: pointer; flex-direction: row; text-transform: none; letter-spacing: normal; font-family: var(--font-sans); font-size: var(--fs-s); }
.upload-pick .ic { width: 16px; height: 16px; }
.media-sec { margin: 6px 0 34px; }
.media-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.media-head .section-title { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-l); font-weight: 750; letter-spacing: -.01em; }
.media-head .section-title svg { width: 18px; height: 18px; color: var(--c-blue); }

/* justified grid: every tile grows by its own width/height, rows stay level */
.mgrid { display: flex; flex-wrap: wrap; gap: 8px; }
.mgrid::after { content: ''; flex-grow: 1e4; }
.mtile { --r: 1.333; position: relative; flex: calc(var(--r) * 220) 1 calc(var(--r) * 200px); aspect-ratio: var(--r); max-height: 420px; border-radius: var(--r-m); overflow: hidden; background: var(--c-raise); isolation: isolate; outline-offset: 3px; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.mtile img, .mtile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), opacity .3s; }
.mtile:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -18px rgba(0,0,0,.55); }
.mtile:hover img { transform: scale(1.035); }
.mtile-blank { position: absolute; inset: 0; display: grid; place-items: center; color: var(--c-faint); background: repeating-linear-gradient(135deg, var(--c-raise) 0 12px, var(--c-panel) 12px 24px); }
.mtile-blank svg { width: 34px; height: 34px; }
.mtile-cap { position: absolute; inset: auto 0 0; z-index: 2; display: flex; flex-direction: column; gap: 2px; padding: 34px 12px 10px; color: #fff; font-size: var(--fs-xs); background: linear-gradient(transparent, rgba(5,6,9,.78)); opacity: 0; transform: translateY(6px); transition: opacity .25s var(--ease), transform .3s var(--ease); pointer-events: none; }
.mtile-cap b { font-size: var(--fs-s); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtile-cap span { opacity: .75; }
.mtile:hover .mtile-cap, .mtile:focus-visible .mtile-cap { opacity: 1; transform: none; }
.mtile-play { position: absolute; z-index: 2; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: rgba(8,9,12,.42); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); transition: opacity .3s, transform .35s var(--ease); pointer-events: none; }
.mtile-play svg { width: 20px; height: 20px; margin-left: 3px; fill: currentColor; stroke: none; }
.mtile:hover .mtile-play { transform: scale(1.08); }
.mtile.previewing .mtile-play { opacity: 0; transform: scale(.7); }
.mtile-time { position: absolute; z-index: 2; right: 8px; top: 8px; padding: 3px 7px; border-radius: 6px; font-size: 11px; color: #fff; background: rgba(8,9,12,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.mtile-vid { z-index: 1; opacity: 0; }
.mtile.previewing .mtile-vid { opacity: 1; }
.mtile.fresh { animation: mfresh 1.6s var(--ease); }
@keyframes mfresh { 0% { transform: scale(.94); box-shadow: 0 0 0 3px var(--c-blue), 0 0 40px var(--c-glow); } 60% { transform: none; box-shadow: 0 0 0 3px var(--c-blue), 0 0 40px var(--c-glow); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (max-width: 640px) { .mtile { flex-basis: calc(var(--r) * 130px); } .mtile-cap { opacity: 1; transform: none; } }

/* the upload dock, bottom right */
.updock { position: fixed; right: 20px; bottom: 20px; z-index: 80; width: min(380px, calc(100vw - 32px)); border-radius: var(--r-l); background: var(--c-panel); border: 1px solid var(--c-line); box-shadow: 0 30px 80px -30px rgba(0,0,0,.6); overflow: hidden; transform: translateY(24px) scale(.98); opacity: 0; transition: transform .45s var(--ease), opacity .3s; }
.updock.in { transform: none; opacity: 1; }
.updock-head { display: flex; align-items: center; gap: 6px; padding: 14px 12px 12px 16px; }
.updock-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.updock-titles b { font-size: var(--fs-m); }
.updock-sub { font-size: 11px; color: var(--c-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.updock-btn { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--c-dim); font-size: 18px; cursor: pointer; }
.updock-btn:hover { background: var(--c-raise); color: var(--c-text); }
.updock-bar { height: 3px; background: var(--c-raise); }
.updock-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--c-blue-solid), var(--c-blue)); transform-origin: 0 50%; transform: scaleX(0); transition: transform .3s var(--ease); }
.updock.all-done .updock-bar i { background: var(--c-ok); }
.updock-list { list-style: none; margin: 0; padding: 6px; max-height: 320px; overflow: auto; transition: max-height .4s var(--ease), padding .3s; }
.updock.folded .updock-list { max-height: 0; padding: 0 6px; }
.upitem { --p: 0; display: grid; grid-template-columns: 40px 1fr 28px 28px; gap: 10px; align-items: center; padding: 8px; border-radius: var(--r-m); animation: upin .4s var(--ease) both; }
@keyframes upin { from { opacity: 0; transform: translateY(8px); } }
.upitem:hover { background: var(--c-raise); }
.upitem-pic { width: 40px; height: 40px; border-radius: 9px; overflow: hidden; background: var(--c-raise); display: grid; place-items: center; }
.upitem-pic img { width: 100%; height: 100%; object-fit: cover; }
.upitem-pic.is-video::before, .upitem-pic.is-photo::before { content: ''; width: 16px; height: 16px; background: var(--c-dim); -webkit-mask: var(--ic) center/contain no-repeat; mask: var(--ic) center/contain no-repeat; }
.upitem-pic.is-video { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 4.5v15a1 1 0 0 0 1.5.9l12-7.5a1 1 0 0 0 0-1.8l-12-7.5A1 1 0 0 0 7 4.5Z'/%3E%3C/svg%3E"); }
.upitem-pic.is-photo { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Crect x='4' y='4' width='16' height='16' rx='2'/%3E%3Cpath d='m20 15-4.5-4.5L6 20'/%3E%3C/svg%3E"); }
.upitem-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.upitem-txt b { font-size: var(--fs-s); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upitem-txt span { font-size: 11px; color: var(--c-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upitem.bad .upitem-txt span { color: var(--c-bad); }
.upitem.done .upitem-txt span { color: var(--c-ok); }
.upitem-ring { --pc: var(--c-blue); width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(var(--pc) calc(var(--p) * 1%), var(--c-raise) 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); transition: --p .3s; }
.upitem.prep .upitem-ring { background: conic-gradient(var(--pc) 28%, var(--c-raise) 0); animation: upspin 1s linear infinite; }
@keyframes upspin { to { transform: rotate(360deg); } }
.upitem.done .upitem-ring { --pc: var(--c-ok); }
.upitem.bad .upitem-ring { --pc: var(--c-bad); background: var(--pc); }
.upitem-act { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--c-faint); font-size: 16px; cursor: pointer; }
.upitem-act:hover:not(:disabled) { background: var(--c-panel); color: var(--c-text); }
.upitem.done .upitem-act { color: var(--c-ok); cursor: default; }

/* drop anywhere: the page glows where your cursor is */
.dropveil { --x: 50%; --y: 50%; position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; pointer-events: none; opacity: 0; background: radial-gradient(520px circle at var(--x) var(--y), var(--c-glow), transparent 70%), rgba(5,6,9,.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); transition: opacity .2s; }
.dropveil::before { content: ''; position: absolute; inset: 14px; border-radius: 22px; border: 2px dashed color-mix(in srgb, var(--c-blue) 70%, transparent); animation: dropdash 12s linear infinite; }
.dropveil.on { opacity: 1; }
.dropveil-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 40px; border-radius: 22px; background: var(--c-panel); border: 1px solid var(--c-line); box-shadow: 0 30px 80px -30px rgba(0,0,0,.6); transform: scale(.94) translateY(10px); transition: transform .35s var(--ease); }
.dropveil.on .dropveil-card { transform: none; }
.dropveil-card b { font-size: var(--fs-xl); letter-spacing: -.02em; }
.dropveil-sub { color: var(--c-dim); font-size: var(--fs-s); }
.dropveil-ic { width: 54px; height: 54px; margin-bottom: 6px; border-radius: 16px; background: var(--c-blue-solid); box-shadow: 0 12px 30px -8px var(--c-blue-solid); animation: dropbob 1.4s var(--ease) infinite alternate; position: relative; }
.dropveil-ic::before { content: ''; position: absolute; inset: 14px; background: #fff; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M7 9l5-5 5 5M5 16v3a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M7 9l5-5 5 5M5 16v3a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3'/%3E%3C/svg%3E") center/contain no-repeat; }
@keyframes dropbob { to { transform: translateY(-6px); } }
@keyframes dropdash { to { border-color: var(--c-blue); } }

/* the lightbox */
html.lbox-open { overflow: hidden; }
.lbox { position: fixed; inset: 0; z-index: 100; display: grid; grid-template: auto 1fr auto auto / 72px 1fr 72px; background: rgba(4,5,7,.94); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); color: #fff; opacity: 0; visibility: hidden; transition: opacity .25s var(--ease), visibility 0s .25s; }
.lbox.on { opacity: 1; visibility: visible; transition: opacity .25s var(--ease); }
.lbox-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px 22px; }
.lbox-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lbox-title b { font-size: var(--fs-m); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbox-title span { font-size: 11px; color: rgba(255,255,255,.55); }
.lbox-count { font-size: 12px; color: rgba(255,255,255,.55); margin-right: 8px; }
.lbox-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 12px; background: rgba(255,255,255,.06); color: #fff; cursor: pointer; transition: background .2s; }
.lbox-btn:hover { background: rgba(255,255,255,.16); }
.lbox-btn svg, .lbox-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lbox-stage { grid-column: 2; min-height: 0; display: grid; place-items: center; padding: 6px 0; overflow: hidden; }
.lbox-media { max-width: 100%; max-height: 100%; border-radius: 10px; object-fit: contain; box-shadow: 0 40px 120px -40px #000; animation: lbin .45s var(--ease); }
@keyframes lbin { from { opacity: 0; transform: translateX(var(--from, 0)) scale(.985); } }
img.lbox-media { cursor: zoom-in; transition: transform .4s var(--ease), filter .4s; }
img.lbox-media.soft { filter: blur(6px); }
img.lbox-media.zoomed { transform: scale(2.2); cursor: zoom-out; border-radius: 0; }
video.lbox-media { width: min(100%, 1400px); background: #000; }
.lbox-nav { align-self: center; justify-self: center; width: 50px; height: 50px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255,255,255,.07); color: #fff; cursor: pointer; transition: background .2s, transform .25s var(--ease); }
.lbox-nav:hover { background: rgba(255,255,255,.18); transform: scale(1.06); }
.lbox-nav.prev { grid-column: 1; grid-row: 2; }
.lbox-nav.next { grid-column: 3; grid-row: 2; }
.lbox.single .lbox-nav, .lbox.single .lbox-strip { display: none; }
.lbox-cap { grid-column: 2; margin: 8px 0 0; text-align: center; color: rgba(255,255,255,.8); font-size: var(--fs-m); min-height: 1.4em; }
.lbox-cap:empty { min-height: 0; margin: 0; }
.lbox-strip { grid-column: 1 / -1; display: flex; gap: 6px; justify-content: safe center; padding: 12px 16px 18px; overflow-x: auto; scrollbar-width: none; }
.lbox-thumb { position: relative; flex: 0 0 auto; width: 54px; height: 54px; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.08); opacity: .45; cursor: pointer; transition: opacity .2s, transform .25s var(--ease), box-shadow .2s; }
.lbox-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lbox-thumb.is-video::after { content: ''; position: absolute; right: 4px; bottom: 4px; border: 5px solid transparent; border-left: 8px solid #fff; border-right: 0; filter: drop-shadow(0 1px 2px #000); }
.lbox-thumb:hover { opacity: .8; }
.lbox-thumb.on { opacity: 1; transform: translateY(-3px); box-shadow: 0 0 0 2px #fff; }
@media (max-width: 640px) { .lbox { grid-template-columns: 0 1fr 0; } .lbox-nav { display: none; } .lbox-strip { justify-content: flex-start; } }

/* a photo's own page */
.media-title { display: flex; align-items: center; gap: 12px; }
.media-title svg { width: 30px; height: 30px; color: var(--c-blue); flex-shrink: 0; }
.mstage { position: relative; display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 10px; margin-bottom: 18px; }
.mstage-fig { grid-column: 2; margin: 0; display: grid; place-items: center; min-height: 200px; max-height: 76vh; border-radius: var(--r-l); overflow: hidden; background: radial-gradient(circle at 50% 40%, var(--c-raise), var(--c-bg)); border: 1px solid var(--c-line); }
.mstage-fig img, .mstage-fig video { max-width: 100%; max-height: 76vh; display: block; }
.mstage-nav { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--c-line); color: var(--c-text); background: var(--c-panel); transition: transform .25s var(--ease), border-color .2s; }
.mstage-nav:hover { transform: scale(1.06); border-color: var(--c-blue); }
.mstage-nav.prev { grid-column: 1; }
.mstage-nav.next { grid-column: 3; }
.mstage-nav svg { width: 20px; height: 20px; }
.mmeta { display: grid; grid-template-columns: auto auto 1fr; gap: 18px 30px; align-items: start; }
.mmeta-who { display: flex; align-items: center; gap: 12px; }
.mmeta-who > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.mmeta-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; }
.mmeta-facts div { display: flex; flex-direction: column; gap: 2px; }
.mmeta-facts dt { color: var(--c-faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; }
.mmeta-facts dd { margin: 0; }
.mmeta-caption { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.mmeta-caption textarea { width: 100%; }
@media (max-width: 820px) { .mstage { grid-template-columns: 1fr; } .mstage-nav { display: none; } .mstage-fig { grid-column: 1; } .mmeta { grid-template-columns: 1fr; } }
