/* PyroPlay admin (partners and cards). Same design language as pyroplay.io:
   tonal surfaces, no borders, gradient edges, pills, one fire accent. */
:root {
  color-scheme: dark;
  --surface: #0a0806;
  --surface-container: #14110b;
  --surface-high: #1b160f;
  --surface-higher: #231c13;
  --fill: rgba(253, 249, 244, 0.05);
  --fill-hover: rgba(253, 249, 244, 0.09);
  --on-surface: #fdf9f4;
  --on-surface-variant: #a39a90;
  --on-surface-muted: #6f675f;
  --accent: #ff5a1a;
  --accent-hover: #ff6f33;
  --accent-bright: #ff9d3d;
  --ink: #190a02;
  --danger: #ff4d4d;
  --live: #5fd08a;
  --live-rgb: 95, 208, 138;
  --fire-rgb: 255, 90, 26;
  --white-rgb: 253, 249, 244;
  --grad-fire: linear-gradient(135deg, #ff9d3d 0%, #ff5a1a 52%, #ff3d00 100%);
  --grad-edge: linear-gradient(135deg, rgba(255, 90, 26, 0.16), rgba(253, 249, 244, 0.05) 42%, transparent 74%);
  --grad-edge-lit: linear-gradient(135deg, rgba(255, 90, 26, 0.62), rgba(253, 249, 244, 0.07) 44%, transparent 76%);
  --glass: rgba(12, 10, 8, 0.56);
  --glass-light: rgba(12, 10, 8, 0.42);
  --r-sm: 10px;
  --r-md: 16px;
  --r-card: 24px;
  --r-panel: 32px;
  --r-pill: 999px;
  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.165, 0.84, 0.44, 1);
  --gutter: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  min-height: 100svh;
  background: var(--surface);
  color: var(--on-surface);
  font: 400 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
[hidden] { display: none !important; }
code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
h1 { font: 700 clamp(26px, 4vw, 34px)/1.1 var(--font-display); letter-spacing: -0.025em; }
h2 { font: 600 18px/1.2 var(--font-display); letter-spacing: -0.01em; }
.muted { color: var(--on-surface-variant); }
small.muted { color: var(--on-surface-muted); font-size: 12.5px; }

.bloom {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(880px 520px at 12% 0%, rgba(255, 90, 26, 0.1), transparent 62%),
    radial-gradient(720px 640px at 92% 100%, rgba(255, 61, 0, 0.06), transparent 60%);
}

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 68px; padding: 0 var(--gutter);
  background: linear-gradient(to bottom, rgba(10, 8, 6, 0.9), rgba(10, 8, 6, 0.6));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.logo { display: flex; align-items: center; gap: 9px; }
.logo__tag {
  margin-left: 4px; padding: 3px 10px; border-radius: var(--r-pill);
  background: rgba(255, 90, 26, 0.14); color: var(--accent-bright);
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
}
.bar__user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bar__user { gap: 6px; }
.bar__name { margin: 0 8px 0 10px; color: var(--on-surface-variant); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 18ch; }

.shell { max-width: 1280px; margin: 0 auto; padding: 32px var(--gutter) 80px; }
.view { animation: rise 0.4s var(--ease-out) both; }

/* ---------- panels ---------- */
.panel {
  position: relative; isolation: isolate;
  padding: 28px;
  border-radius: var(--r-panel);
  background: var(--surface-container);
}
.panel::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: inherit; padding: 1px;
  background: var(--grad-edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.panel--narrow { max-width: 440px; margin: 8vh auto 0; }
.panel--narrow h1 + .muted { margin-top: 10px; }
.panel--narrow form, .stack--form { margin-top: 24px; }
.panel--narrow { text-align: left; }
.fine { margin-top: 18px; color: var(--on-surface-muted); font-size: 13px; }
.key {
  display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 20px;
  border-radius: 18px; background: rgba(255, 90, 26, 0.12); color: var(--accent-bright);
}
.key svg { width: 28px; height: 28px; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack--tight { gap: 6px; align-items: flex-start; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--on-surface-variant); }
.field em { font-style: normal; color: var(--on-surface-muted); font-weight: 400; margin-left: 4px; }
.field input, .field select, .field textarea, .input, .select {
  width: 100%; min-height: 48px; padding: 12px 16px;
  border: 0; border-radius: var(--r-md);
  background: var(--fill);
  outline: none;
  transition: background 0.12s ease-out, box-shadow 0.12s ease-out;
}
.field input:hover, .field select:hover, .field textarea:hover, .input:hover, .select:hover { background: var(--fill-hover); }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus, .select:focus { background: var(--surface-high); box-shadow: 0 0 0 2px rgba(255, 90, 26, 0.55); }
.field input::placeholder, .field textarea::placeholder, .input::placeholder { color: var(--on-surface-muted); }
.field input[readonly] { color: var(--on-surface-variant); box-shadow: none; background: transparent; padding-left: 0; }
input.code { font: 600 22px/1 var(--font-display); letter-spacing: 0.3em; text-align: center; }

.slug { display: flex; flex-wrap: wrap; align-items: baseline; min-height: 28px; font-size: 15px; overflow-wrap: anywhere; }
.slug__base { color: var(--on-surface-muted); }
.slug__value { color: var(--on-surface); }

.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; width: fit-content; font-weight: 500; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle__track {
  position: relative; width: 44px; height: 26px; border-radius: var(--r-pill);
  background: var(--fill-hover); transition: background 0.15s ease-out;
}
.toggle__track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--on-surface); transition: transform 0.2s var(--ease-out);
}
.toggle input:checked + .toggle__track { background: var(--accent); }
.toggle input:checked + .toggle__track::after { transform: translateX(18px); background: var(--ink); }
.toggle input:focus-visible + .toggle__track { box-shadow: 0 0 0 2px rgba(255, 90, 26, 0.55); }

.error { padding: 12px 16px; border-radius: var(--r-md); background: rgba(255, 77, 77, 0.1); color: #ff9c9c; font-size: 14px; }

/* ---------- buttons (pills, as on pyroplay.io) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; padding: 12px 24px; border-radius: var(--r-pill);
  font-size: 15px; font-weight: 500; letter-spacing: 0.012em;
  transition: background 0.15s ease-out, color 0.15s ease-out, opacity 0.15s;
}
.btn__icon { width: 16px; height: 16px; flex: none; }
.btn--sm { min-height: 36px; padding: 7px 16px; font-size: 13.5px; }
.btn--primary { background: var(--accent); color: var(--ink); font-weight: 600; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--primary:active { background: var(--accent-bright); }
.btn--ghost { background: var(--fill); }
.btn--ghost:hover { background: var(--fill-hover); }
.btn--text { padding-left: 4px; padding-right: 4px; color: var(--on-surface-variant); min-height: 36px; }
.btn--text:hover { color: var(--on-surface); }
.btn--danger { background: rgba(255, 77, 77, 0.1); color: #ff9c9c; }
.btn--danger:hover { background: rgba(255, 77, 77, 0.18); }
.btn:focus-visible, .tile:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn.is-busy { position: relative; color: transparent; }
.btn.is-busy::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--ink); border-right-color: transparent; animation: spin 0.7s linear infinite;
}
.btn--ghost.is-busy::after, .btn--danger.is-busy::after { border-color: var(--on-surface); border-right-color: transparent; }
.file { position: relative; overflow: hidden; cursor: pointer; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- list ---------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.head .muted { margin-top: 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.tile {
  position: relative; isolation: isolate;
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border-radius: var(--r-card);
  background: var(--surface-container); text-align: left;
  transition: background 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.tile::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: inherit; padding: 1px;
  background: var(--grad-edge-lit); opacity: 0;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  transition: opacity 0.4s var(--ease-out);
}
.tile:hover { background: var(--surface-high); transform: translateY(-2px); }
.tile:hover::before { opacity: 1; }
.tile__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tile__text strong { font: 600 16px/1.3 var(--font-display); }
.tile__text .muted { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill {
  flex: none; padding: 4px 11px; border-radius: var(--r-pill);
  background: var(--fill); color: var(--on-surface-muted);
  font-size: 12px; font-weight: 600;
}
.pill--live { background: rgba(95, 208, 138, 0.12); color: var(--live); }
.empty { text-align: center; padding: 56px 28px; }
.empty .muted { margin-top: 8px; }

.avatar {
  flex: none; width: 52px; height: 52px; border-radius: 50%; overflow: hidden;
  object-fit: cover; background: var(--surface-higher);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar--initials {
  display: grid; place-items: center;
  background: var(--grad-fire); color: var(--ink);
  font: 700 18px/1 var(--font-display);
}

/* ---------- editor ---------- */
.back { margin: -8px 0 16px; }
.edit { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.edit form h1 { margin-bottom: 4px; }
.photo-row { display: flex; align-items: center; gap: 20px; }
.photo-row .avatar { width: 88px; height: 88px; font-size: 28px; box-shadow: 0 0 0 3px var(--surface-container), 0 0 0 4px rgba(255, 90, 26, 0.45); }
.actions { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin-top: 8px; }

.side { position: sticky; top: 88px; }
.qr { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.qr h2 { align-self: flex-start; }
.qr img { width: 220px; height: 220px; padding: 10px; border-radius: var(--r-md); background: #fff; }
.qr__dl { display: flex; gap: 8px; }
.wallpaper-btn { width: 100%; }
.device { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.device img { width: 220px; height: 220px; padding: 10px; border-radius: var(--r-md); background: #fff; }
.device details { width: 100%; text-align: left; }
.device summary { cursor: pointer; color: var(--on-surface-variant); font-size: 13.5px; margin-bottom: 8px; }
.qr--pending { align-items: flex-start; text-align: left; }
.link { color: var(--accent-bright); font-size: 14px; overflow-wrap: anywhere; }
.link:hover { color: var(--accent); }

/* ---------- team ---------- */
.team { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.team .panel h2 { margin-bottom: 14px; }
.people, .activity { list-style: none; display: flex; flex-direction: column; }
.people li { display: flex; align-items: center; gap: 14px; padding: 12px 0; }
.people li + li { box-shadow: 0 -1px 0 var(--fill); }
.people__text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.people__text strong { font: 600 15px/1.3 var(--font-display); }
.people__text .muted { font-size: 13px; }
.avatar--sm { width: 40px; height: 40px; font-size: 14px; }
.activity li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; font-size: 14px; }
.activity li + li { box-shadow: 0 -1px 0 var(--fill); }
.activity time { flex: none; font-size: 12.5px; }
.activity .muted { overflow-wrap: anywhere; }
.invite { display: flex; gap: 8px; align-items: center; }
.invite input {
  flex: 1; min-width: 0; min-height: 40px; padding: 8px 14px; border: 0; border-radius: var(--r-md);
  background: var(--fill); color: var(--accent-bright); font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; outline: none;
}

/* ---------- shared bits (as on pyroplay.io) ---------- */
.eyebrow {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--accent); flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.textarea, textarea.input { min-height: 0; resize: vertical; line-height: 1.5; }
.field textarea { resize: vertical; line-height: 1.5; }
.select, .field select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5' fill='none' stroke='%23a39a90' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
}
.select option, .field select option { background: var(--surface-high); color: var(--on-surface); }
.select--sm, .input--sm { min-height: 38px; padding-top: 7px; padding-bottom: 7px; font-size: 13.5px; border-radius: var(--r-pill); }
.select--sm { padding-left: 14px; padding-right: 34px; background-position: right 11px center; width: auto; }
.select.is-set { background-color: rgba(var(--fire-rgb), 0.14); color: var(--accent-bright); }
.input--date { min-width: 0; }
.input--sm.input--date { padding-left: 14px; padding-right: 10px; width: auto; }
.link.muted { color: var(--on-surface-variant); }
.dot { margin: 0 8px; color: var(--on-surface-muted); }
.fine a, .dupe a { color: var(--accent-bright); text-decoration: underline; text-underline-offset: 2px; }

.head__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.head__actions .btn--sm { min-height: 40px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel h2 + .compose { margin-top: 14px; }

.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%; color: var(--on-surface-variant);
  transition: background var(--dur-btn, 0.15s) ease-out, color 0.15s ease-out;
}
.icon-btn:hover { background: var(--fill-hover); color: var(--on-surface); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn--sm { width: 34px; height: 34px; }
.icon-btn--sm svg { width: 16px; height: 16px; }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--r-pill);
  background: rgba(var(--fire-rgb), 0.14); color: var(--accent-bright);
  font: 600 11px/1.6 var(--font-body); letter-spacing: 0.02em; vertical-align: 1px; white-space: nowrap;
}
.badge svg { width: 13px; height: 13px; }
.badge--quiet { background: var(--fill); color: var(--on-surface-variant); font-weight: 500; }
a.badge--quiet:hover { background: var(--fill-hover); color: var(--on-surface); }
.badge--ok { background: rgba(var(--live-rgb), 0.12); color: var(--live); }

/* header tabs */
.tabs { display: flex; gap: 2px; padding: 4px; border-radius: var(--r-pill); background: var(--fill); }
.tab {
  padding: 7px 16px; border-radius: var(--r-pill); font-size: 13.5px; font-weight: 500; color: var(--on-surface-variant);
  transition: background 0.15s ease-out, color 0.15s ease-out;
}
.tab:hover { color: var(--on-surface); }
.tab.is-active { background: var(--surface-higher); color: var(--on-surface); box-shadow: inset 0 0 0 1px rgba(var(--fire-rgb), 0.28); }

/* segmented control */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--fill); }
.seg button {
  display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 5px 14px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500; color: var(--on-surface-variant); transition: background 0.15s ease-out, color 0.15s ease-out;
}
.seg button:hover { color: var(--on-surface); }
.seg button[aria-pressed="true"] { background: var(--surface-higher); color: var(--on-surface); }
.seg--full { display: flex; min-height: 48px; align-items: stretch; }
.seg--full button { flex: 1; justify-content: center; }

/* priority: fire, ember, ash */
.prio { flex: none; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: transparent; }
.prio--hot { background: var(--grad-fire); box-shadow: 0 0 10px rgba(var(--fire-rgb), 0.7); }
.prio--warm { background: var(--accent-bright); opacity: 0.75; }
.prio--cold { background: transparent; box-shadow: inset 0 0 0 1.5px var(--on-surface-muted); }

/* stage: the further along, the hotter; won is the only green, as "Live" is on cards */
.stage {
  display: inline-flex; align-items: center; padding: 4px 11px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
  background-color: var(--fill); color: var(--on-surface-variant);
}
.stage[data-stage="contacted"] { background-color: rgba(var(--fire-rgb), 0.09); color: #e9b596; }
.stage[data-stage="responded"] { background-color: rgba(var(--fire-rgb), 0.15); color: #ffb98a; }
.stage[data-stage="in-talks"] { background-color: rgba(var(--fire-rgb), 0.22); color: var(--accent-bright); }
.stage[data-stage="proposal"] { background-color: rgba(var(--fire-rgb), 0.32); color: #ffc38a; }
.stage[data-stage="partner"] { background-color: rgba(var(--live-rgb), 0.14); color: var(--live); }
.stage[data-stage="closed"] { background-color: transparent; color: var(--on-surface-muted); box-shadow: inset 0 0 0 1px rgba(var(--white-rgb), 0.12); }
select.stage--select {
  display: inline-block; width: auto; max-width: 100%;
  appearance: none; -webkit-appearance: none; border: 0; cursor: pointer; outline: none;
  padding-right: 28px; min-height: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5' fill='none' stroke='%23a39a90' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 13px;
}
select.stage--select:focus-visible { box-shadow: 0 0 0 2px rgba(var(--fire-rgb), 0.55); }
select.stage--select option { background: var(--surface-high); color: var(--on-surface); }

/* due dates */
.due-chip {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--fill); color: var(--on-surface-variant);
}
.due-chip:empty { display: none; }
.due-chip--overdue { background: rgba(255, 77, 77, 0.13); color: #ff9c9c; }
.due-chip--today { background: rgba(var(--fire-rgb), 0.18); color: var(--accent-bright); }
.due-chip--soon { background: rgba(var(--fire-rgb), 0.08); color: #e9b596; }

.who {
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-higher); color: var(--on-surface-variant); font: 700 10.5px/1 var(--font-display); letter-spacing: 0.02em;
}

/* chip picker (products, tags) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 48px; padding: 7px; border-radius: var(--r-md); background: var(--fill); cursor: text; }
.chips:focus-within { background: var(--surface-high); box-shadow: 0 0 0 2px rgba(var(--fire-rgb), 0.55); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 500; letter-spacing: 0.015em; color: var(--on-surface-muted);
  background: transparent; box-shadow: inset 0 0 0 1px rgba(var(--white-rgb), 0.1);
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}
.chip:hover { color: var(--on-surface); box-shadow: inset 0 0 0 1px rgba(var(--fire-rgb), 0.4); }
.chip.is-on { background: rgba(var(--fire-rgb), 0.16); color: var(--accent-bright); box-shadow: none; }
.chip.is-on:hover { background: rgba(var(--fire-rgb), 0.24); }
.chip svg { width: 12px; height: 12px; opacity: 0.7; }
.chips__input { flex: 1; min-width: 90px; min-height: 30px; padding: 0 6px; border: 0; background: none; outline: none; font-size: 14px; }
.chips__input::placeholder { color: var(--on-surface-muted); }

/* quick date / reason buttons */
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button {
  padding: 5px 12px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 500; color: var(--on-surface-variant);
  background: var(--fill); transition: background 0.12s, color 0.12s;
}
.quick button:hover { background: rgba(var(--fire-rgb), 0.14); color: var(--accent-bright); }

/* ---------- partners list ---------- */
.stages { display: flex; gap: 6px; overflow-x: auto; margin: -4px -4px 18px; padding: 4px; scrollbar-width: none; }
.stages::-webkit-scrollbar { display: none; }
.stagebtn {
  flex: none; display: inline-flex; align-items: center; gap: 10px; padding: 9px 10px 9px 16px; border-radius: var(--r-pill);
  background: var(--surface-container); color: var(--on-surface-variant); font-size: 13.5px; font-weight: 500;
  transition: background 0.15s ease-out, color 0.15s ease-out;
}
.stagebtn b { min-width: 26px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--fill); font-size: 12px; font-weight: 600; text-align: center; color: var(--on-surface); }
.stagebtn:hover { background: var(--surface-high); color: var(--on-surface); }
.stagebtn[aria-pressed="true"] { background: var(--accent); color: var(--ink); font-weight: 600; }
.stagebtn[aria-pressed="true"] b { background: rgba(25, 10, 2, 0.16); color: var(--ink); }

.due {
  position: relative; isolation: isolate; margin-bottom: 18px; padding: 18px 22px; border-radius: var(--r-card);
  background: linear-gradient(135deg, rgba(var(--fire-rgb), 0.1), var(--surface-container) 55%);
}
.due::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1px;
  background: var(--grad-edge-lit);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.due__head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 8px; }
.due__head .eyebrow { margin: 0; }
.due__head .muted { font-size: 13.5px; }
.due__list { list-style: none; }
.due__list a {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; margin: 0 -10px; border-radius: var(--r-sm);
  transition: background 0.12s ease-out;
}
.due__list a:hover { background: var(--fill); }
.due__list strong { font: 600 14.5px/1.3 var(--font-display); white-space: nowrap; }
.due__what { flex: 1; min-width: 0; color: var(--on-surface-variant); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.search { position: relative; flex: 1 1 260px; display: flex; align-items: center; }
.search svg { position: absolute; left: 15px; width: 17px; height: 17px; color: var(--on-surface-muted); pointer-events: none; }
.search input {
  width: 100%; min-height: 40px; padding: 8px 16px 8px 42px; border: 0; border-radius: var(--r-pill);
  background: var(--fill); outline: none; font-size: 14px; transition: background 0.12s, box-shadow 0.12s;
}
.search input:hover { background: var(--fill-hover); }
.search input:focus { background: var(--surface-high); box-shadow: 0 0 0 2px rgba(var(--fire-rgb), 0.55); }
.search input::placeholder { color: var(--on-surface-muted); }
.toolbar .seg { margin-left: auto; }

.ptable { display: flex; flex-direction: column; gap: 6px; }
.prow {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 2.2fr) 150px minmax(0, 2fr) 110px 100px; gap: 18px; align-items: center;
  padding: 14px 20px; border-radius: var(--r-md); background: var(--surface-container); cursor: pointer;
  transition: background 0.3s var(--ease-out);
}
.prow::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1px;
  background: var(--grad-edge-lit); opacity: 0;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  transition: opacity 0.4s var(--ease-out); pointer-events: none;
}
.prow:hover { background: var(--surface-high); }
.prow:hover::before { opacity: 1; }
.prow--head { background: none; cursor: default; padding-top: 0; padding-bottom: 4px; font-size: 11.5px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-surface-muted); }
.prow--head:hover { background: none; }
.prow--head::before { display: none; }
.prow__co { display: flex; align-items: center; gap: 12px; min-width: 0; }
.prow__text { display: flex; flex-direction: column; min-width: 0; }
.prow__text strong { font: 600 15.5px/1.3 var(--font-display); }
.prow__text a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.prow__text .muted, .prow__action { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow__next { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.prow__next .prow__action { max-width: 100%; color: var(--on-surface); font-size: 13.5px; }
.prow__none { font-size: 13px; color: var(--on-surface-muted); }
.prow__owner { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--on-surface-variant); }
.prow__when { font-size: 12.5px; text-align: right; }

/* board */
.board { display: grid; grid-template-columns: repeat(6, minmax(168px, 1fr)) minmax(110px, 0.6fr); gap: 10px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 8px; min-height: 220px; padding: 10px; border-radius: var(--r-card); background: rgba(var(--white-rgb), 0.025); transition: background 0.15s, box-shadow 0.15s; }
.col.is-over { background: rgba(var(--fire-rgb), 0.07); box-shadow: inset 0 0 0 1px rgba(var(--fire-rgb), 0.4); }
.col__head .stage { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.col__head { gap: 8px; display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 6px; font-size: 13px; }
.col__cards { display: flex; flex-direction: column; gap: 8px; }
.col__empty { padding: 22px 8px; border-radius: var(--r-md); text-align: center; font-size: 12.5px; color: var(--on-surface-muted); border: 1px dashed rgba(var(--white-rgb), 0.1); }
.bcard {
  position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  padding: 13px 14px; border-radius: var(--r-md); background: var(--surface-container); cursor: grab;
  transition: background 0.3s var(--ease-out), transform 0.3s var(--ease-out), opacity 0.15s;
}
.bcard:hover { background: var(--surface-high); transform: translateY(-2px); }
.bcard.is-dragging { opacity: 0.4; }
.bcard__top { display: flex; align-items: center; gap: 9px; }
.bcard__top strong { font: 600 14.5px/1.3 var(--font-display); }
.bcard .muted { font-size: 12.5px; }
.bcard__next { font-size: 12.5px; color: var(--on-surface); }
.col--closed { min-height: 0; align-items: flex-start; text-align: left; color: var(--on-surface-variant); font-size: 13px; font-weight: 500; }
.col--closed b { font: 700 22px/1.1 var(--font-display); color: var(--on-surface); }
.col--closed small { font-size: 12px; color: var(--on-surface-muted); font-weight: 400; }
.col--closed:hover { background: rgba(var(--white-rgb), 0.05); }

/* ---------- one partner ---------- */
.phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.phead__main { min-width: 0; }
.phead__main h1 { overflow-wrap: anywhere; }
.phead__meta { margin-top: 10px; font-size: 14px; color: var(--on-surface-variant); }
.phead__meta .link { font-size: 14px; }
.phead__side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline-select { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--on-surface-muted); }
.saved { font-size: 12.5px; color: var(--on-surface-muted); opacity: 0; transition: opacity 0.3s; }
.saved.is-saving, .saved.is-saved { opacity: 1; }
.saved.is-saved { color: var(--live); }

/* stage rail, drawn like the roadmap on pyroplay.io: the fire has reached
   every stage up to this one; the ones ahead are a dashed track. */
.rail-panel { padding: 22px 26px 16px; margin-bottom: 20px; }
.rail { position: relative; list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.rail__step { position: relative; }
.rail__step::before {
  content: ""; position: absolute; top: 13px; left: calc(-50% + 16px); right: calc(50% + 16px); height: 2px; border-radius: 2px;
  background: repeating-linear-gradient(to right, rgba(var(--white-rgb), 0.15) 0 5px, transparent 5px 11px);
}
.rail__step:first-child::before { display: none; }
.rail__step[data-state="done"]::before, .rail__step[data-state="current"]::before { background: var(--grad-fire); }
.rail__step button { display: flex; flex-direction: column; align-items: center; gap: 9px; width: 100%; padding: 0 4px 6px; border-radius: var(--r-sm); text-align: center; }
.rail__step button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rail__node {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-container); box-shadow: inset 0 0 0 1.5px rgba(var(--white-rgb), 0.16);
  color: var(--ink); transition: transform 0.3s var(--ease-out), box-shadow 0.2s;
}
.rail__node svg { width: 15px; height: 15px; }
.rail__label { font-size: 12.5px; font-weight: 500; line-height: 1.3; color: var(--on-surface-muted); transition: color 0.15s; }
.rail__step button:hover .rail__node { box-shadow: inset 0 0 0 1.5px rgba(var(--fire-rgb), 0.7); transform: scale(1.08); }
.rail__step button:hover .rail__label { color: var(--on-surface); }
.rail__step[data-state="done"] .rail__node { background: var(--grad-fire); box-shadow: none; }
.rail__step[data-state="done"] .rail__label { color: var(--on-surface-variant); }
.rail__step[data-state="current"] .rail__node {
  background: var(--grad-fire); box-shadow: 0 0 0 5px rgba(var(--fire-rgb), 0.18), 0 0 22px rgba(var(--fire-rgb), 0.55);
}
.rail__step[data-state="current"] .rail__node::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.rail__step[data-state="current"] .rail__label { color: var(--on-surface); font-weight: 600; }
.rail__step[data-won][data-state="current"] .rail__node { background: var(--live); box-shadow: 0 0 0 5px rgba(var(--live-rgb), 0.16), 0 0 22px rgba(var(--live-rgb), 0.45); }
.rail--closed .rail__label { color: var(--on-surface-muted); }
.closer { display: flex; justify-content: flex-end; margin-top: 6px; }
.closer:has(.closed-note), .closer:has(form) { justify-content: stretch; }
.closed-note { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; width: 100%; margin-top: 10px; font-size: 14px; }
.closer__form { display: flex; flex-direction: column; gap: 12px; width: 100%; margin-top: 12px; padding-top: 16px; box-shadow: 0 -1px 0 var(--fill); }
.closer__actions { display: flex; justify-content: flex-end; gap: 8px; }

.pgrid { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 20px; align-items: start; }
.pgrid__main, .pgrid__side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* next step */
.next { padding: 22px 24px; }
.next.next--hot::before { background: var(--grad-edge-lit); }
.next__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.next__head .eyebrow { margin: 0; }
.next__row { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 10px; }
.next__row .input { font-size: 15.5px; }
.next--empty .next__row .input:first-child::placeholder { color: var(--on-surface-variant); }
.next__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.next__actions { display: flex; gap: 8px; margin-left: auto; }

/* timeline composer */
.compose { display: flex; flex-direction: column; gap: 10px; padding: 14px; margin-bottom: 8px; border-radius: var(--r-card); background: rgba(var(--white-rgb), 0.025); }
.kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.kinds button {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 10px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 500; color: var(--on-surface-variant); background: var(--fill); transition: background 0.12s, color 0.12s;
}
.kinds button svg { width: 14px; height: 14px; }
.kinds button:hover { color: var(--on-surface); background: var(--fill-hover); }
.kinds button[aria-checked="true"] { background: rgba(var(--fire-rgb), 0.18); color: var(--accent-bright); }
.compose textarea { background: var(--surface-container); }
.compose__foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.compose__foot .select--sm { max-width: 220px; }
.compose__hint { margin-left: auto; font-size: 12px; color: var(--on-surface-muted); }
.compose__foot .btn { margin-left: 4px; }

/* timeline */
.tl { list-style: none; position: relative; margin-top: 18px; }
.tl__item { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; padding-bottom: 22px; }
.tl__item::before { content: ""; position: absolute; left: 16px; top: 36px; bottom: 4px; width: 2px; border-radius: 2px; background: var(--fill); }
.tl__item:last-child::before { display: none; }
.tl__node {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface-higher); color: var(--on-surface-variant);
}
.tl__node svg { width: 16px; height: 16px; }
.tl__item[data-type="met"] .tl__node, .tl__item[data-type="meeting"] .tl__node, .tl__item[data-type="demo"] .tl__node, .tl__item[data-type="proposal"] .tl__node {
  background: rgba(var(--fire-rgb), 0.16); color: var(--accent-bright);
}
.tl__item[data-type="email-in"] .tl__node, .tl__item[data-type="call"] .tl__node { background: rgba(var(--fire-rgb), 0.08); color: #e9b596; }
.tl__item--auto { padding-bottom: 14px; }
.tl__item--auto .tl__node { width: 22px; height: 22px; margin: 6px; background: none; color: var(--accent); }
.tl__item[data-type="done"] .tl__node { color: var(--live); }
.tl__item--auto::before { top: 32px; }
.tl__body { min-width: 0; padding-top: 6px; }
.tl__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; font-size: 14px; }
.tl__head strong { font-weight: 600; }
.tl__head time { margin-left: auto; font-size: 12.5px; white-space: nowrap; }
.tl__inline { color: var(--on-surface-variant); }
.tl__text { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.6; }
.tl__foot { display: flex; gap: 12px; margin-top: 6px; font-size: 12px; color: var(--on-surface-muted); }
.tl__foot button { color: var(--on-surface-muted); font-size: 12px; opacity: 0; transition: opacity 0.15s, color 0.12s; }
.tl__item:hover .tl__foot button, .tl__foot button:focus-visible, .tl__foot button.is-armed { opacity: 1; }
.tl__foot button:hover { color: var(--on-surface); }
.tl__foot button.is-armed { color: #ff9c9c; }
.tl__item--auto .tl__foot { display: none; }
.tl__item--auto:hover .tl__foot { display: flex; }
.tl__empty { padding: 10px 0 4px; font-size: 14px; }
.tl__edit { display: flex; flex-direction: column; gap: 10px; }
@media (hover: none) { .tl__foot button { opacity: 1; } }

/* people */
.contacts { list-style: none; display: flex; flex-direction: column; }
.contact { display: flex; gap: 12px; padding: 14px 0; }
.contact + .contact { box-shadow: 0 -1px 0 var(--fill); }
.contact:first-child { padding-top: 0; }
.contact__text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.contact__text strong { font: 600 15px/1.35 var(--font-display); }
.contact__text .muted, .contact__line { font-size: 13px; overflow-wrap: anywhere; }
.contact__line { color: var(--on-surface-variant); }
.contact__flags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.contact__flags:empty { display: none; }
.contact__notes { margin-top: 6px; font-size: 13px; color: var(--on-surface-variant); white-space: pre-wrap; }
.contact__actions { display: flex; align-items: flex-start; gap: 0; margin: -4px -8px 0 0; }
.contact--form { display: block; }
.contacts__empty { font-size: 14px; }
.person-form { padding: 16px; border-radius: var(--r-card); background: rgba(var(--white-rgb), 0.03); }
.person-form .row { grid-template-columns: 1fr 1fr; gap: 10px; }
.person-form .toggle { font-size: 14px; }
.person-form .actions { align-items: center; margin-top: 0; }
.actions__right { display: flex; gap: 6px; margin-left: auto; }
.bizcard { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bizcard img { display: block; max-width: 100%; max-height: 150px; border-radius: var(--r-sm); }
.bizcard > a { flex-basis: 100%; }
.bizcard .file svg { width: 16px; height: 16px; }
.bizcard small { flex-basis: 100%; }
.bizcard small:empty { display: none; }

.details .row { grid-template-columns: 1fr 1fr; gap: 10px; }
.details .panel__head { margin-bottom: 0; }
.danger-zone { gap: 10px; align-items: flex-start; padding: 20px 24px; }
.danger-zone .btn.is-armed { background: var(--danger); color: var(--ink); }

/* small inline form (new event) */
.mini { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r-md); background: rgba(var(--fire-rgb), 0.06); box-shadow: inset 0 0 0 1px rgba(var(--fire-rgb), 0.25); }
.mini__title { font: 600 14px/1.2 var(--font-display); }
.mini .row { grid-template-columns: 1fr 1fr; gap: 10px; }
.mini__actions { display: flex; justify-content: flex-end; gap: 6px; }

/* ---------- sheets (add partner, import) ---------- */
.sheet {
  margin: auto; padding: 0; border: 0; width: min(640px, calc(100vw - 24px)); max-height: min(900px, calc(100dvh - 24px));
  border-radius: var(--r-panel); background: var(--surface-container); color: var(--on-surface);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(var(--fire-rgb), 0.18);
  overflow: hidden;
}
.sheet[open] { display: flex; animation: sheet-in 0.35s var(--ease-out) both; }
.sheet::backdrop { background: rgba(6, 5, 4, 0.66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet--wide { width: min(1040px, calc(100vw - 24px)); }
.sheet__body { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 26px 28px 8px; }
.sheet__head h2 { font: 700 26px/1.1 var(--font-display); letter-spacing: -0.02em; }
.sheet__head .eyebrow { margin-bottom: 8px; }
.sheet__scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 28px 20px; overscroll-behavior: contain; }
.sheet__foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 16px 28px calc(16px + env(safe-area-inset-bottom)); background: var(--surface-high);
}
.sheet__sticky { margin-right: auto; max-width: 30ch; }
.group { border: 0; display: flex; flex-direction: column; gap: 14px; padding: 18px 0; }
.group + .group { box-shadow: 0 -1px 0 var(--fill); }
.group legend { float: left; width: 100%; margin-bottom: 2px; font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-bright); }
.group legend + * { clear: both; }
.dupe { padding: 10px 14px; border-radius: var(--r-md); background: rgba(var(--fire-rgb), 0.1); color: var(--on-surface); font-size: 13.5px; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } }

/* import */
.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 24px; text-align: center;
  border-radius: var(--r-card); border: 1.5px dashed rgba(var(--white-rgb), 0.16); cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.drop:hover, .drop.is-over { border-color: rgba(var(--fire-rgb), 0.6); background: rgba(var(--fire-rgb), 0.05); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop svg { width: 34px; height: 34px; color: var(--accent); }
.drop strong { font: 600 17px/1.3 var(--font-display); }
.drop .muted { max-width: 52ch; font-size: 13.5px; }
.import__file { margin-bottom: 16px; }
.import__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.maps { display: flex; flex-direction: column; }
.map { display: grid; grid-template-columns: 140px 170px minmax(0, 1fr); gap: 12px; align-items: center; padding: 7px 0; }
.map + .map { box-shadow: 0 -1px 0 var(--fill); }
.map__label { font-size: 13.5px; font-weight: 500; }
.map__label em { font-style: normal; font-weight: 400; color: var(--accent-bright); font-size: 12px; margin-left: 4px; }
.map__label small { display: block; font-size: 11.5px; font-weight: 400; color: var(--on-surface-muted); }
.map .select--sm { width: 100%; }
.map__sample { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview table { width: 100%; border-collapse: collapse; font-size: 13px; }
.preview th { text-align: left; padding: 6px 8px; font-weight: 500; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-surface-muted); }
.preview td { padding: 8px; vertical-align: top; box-shadow: 0 -1px 0 var(--fill); overflow-wrap: anywhere; }
.preview td small { display: block; color: var(--on-surface-muted); }
.result__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 24px; }
.result__stats div { display: flex; flex-direction: column; padding: 18px; border-radius: var(--r-card); background: var(--fill); }
.result__stats b { font: 700 34px/1 var(--font-display); background: var(--grad-fire); -webkit-background-clip: text; background-clip: text; color: transparent; }
.result__stats span { margin-top: 6px; font-size: 13px; color: var(--on-surface-variant); }
.skipped { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.skipped b { margin-right: 8px; }

@media (max-width: 1100px) {
  .prow { grid-template-columns: minmax(0, 2fr) 140px minmax(0, 1.6fr) 90px; }
  .prow__when { display: none; }
  .pgrid { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 900px) {
  /* one column, in the order you use it: next step, people, timeline, details */
  .pgrid { display: flex; flex-direction: column; }
  .pgrid__main, .pgrid__side { display: contents; }
  .pgrid__main > :nth-child(1) { order: 1; }
  .pgrid__side > :nth-child(1) { order: 2; }
  .pgrid__main > :nth-child(2) { order: 3; }
  .pgrid__side > :nth-child(2) { order: 4; }
  .pgrid__side > :nth-child(3) { order: 5; }
  .import__grid { grid-template-columns: 1fr; }
  .rail__label { font-size: 11.5px; }
  .prow { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "co co owner" "stage next next"; gap: 10px 12px; padding: 14px 16px; }
  .prow--head { display: none; }
  .prow__co { grid-area: co; }
  .prow__stage { grid-area: stage; }
  .prow__next { grid-area: next; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .prow__owner { grid-area: owner; justify-content: flex-end; }
  .prow__ownername { display: none; }
}
@media (max-width: 640px) {
  .bar { height: 60px; }
  .tabs { padding: 3px; }
  .tab { padding: 6px 11px; font-size: 13px; }
  .bar__user .btn--ghost { padding: 6px 12px; }
  .head__actions { width: 100%; }
  .head__actions .btn--primary { flex: 1; }
  .toolbar .select--sm { flex: 1 1 calc(50% - 4px); }
  .toolbar .seg { margin-left: 0; flex: 1 1 calc(50% - 4px); }
  .toolbar .seg button { flex: 1; justify-content: center; }
  .rail-panel { padding: 18px 0 12px; }
  .rail { grid-template-columns: repeat(6, 92px); overflow-x: auto; padding: 0 12px 4px; scrollbar-width: none; }
  .rail::-webkit-scrollbar { display: none; }
  .closer { padding: 0 16px; }
  .logo__tag { display: none; }
  .bar__user .btn--ghost { white-space: nowrap; }
  .due__list a { flex-wrap: wrap; row-gap: 2px; }
  .due__list strong { flex: 1; }
  .due__what { order: 5; flex-basis: 100%; padding-left: 22px; white-space: normal; }
  .next__row { grid-template-columns: 1fr; }
  .compose__hint { display: none; }
  .compose__foot .btn { margin-left: auto; }
  .sheet { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .sheet__head { padding: 20px 18px 6px; }
  .sheet__scroll { padding: 6px 18px 18px; }
  .sheet__foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); }
  .sheet__sticky { display: none; }
  .sheet__foot .btn { flex: 1; }
  .map { grid-template-columns: 1fr 1fr; }
  .map__sample { grid-column: 1 / -1; margin-top: -4px; }
  .result__stats { grid-template-columns: 1fr; }
  .phead__side { width: 100%; }
}

/* ---------- misc ---------- */
.spinner {
  width: 28px; height: 28px; margin: 20vh auto; border-radius: 50%;
  border: 2px solid var(--fill-hover); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 50;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 12px 20px; border-radius: var(--r-pill);
  background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  font-size: 14px; animation: rise 0.3s var(--ease-out) both;
}

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.toast { animation-name: toast-in; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .edit, .team { grid-template-columns: 1fr; }
  .side { position: static; }
}
@media (max-width: 560px) {
  .row { grid-template-columns: 1fr; }
  .panel { padding: 22px 18px; border-radius: var(--r-card); }
  .head { flex-direction: column; align-items: stretch; }
  .grid { grid-template-columns: 1fr; }
  .logo__word { display: none; }
  .bar__name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
