/* Mission Control — dark ops console. System fonts, no external assets. */

:root {
  color-scheme: dark;
  --bg: #050912;
  --bg2: #08101f;
  --panel: rgba(14, 24, 46, 0.66);
  --panel-2: rgba(20, 33, 62, 0.72);
  --panel-solid: #0c1529;
  --raise: rgba(255, 255, 255, 0.035);
  --line: rgba(94, 231, 255, 0.13);
  --line-2: rgba(255, 255, 255, 0.07);
  --text: #dbe6ff;
  --text-2: #aab8d6;
  --muted: #7d8db0;
  --dim: #55627f;
  --cyan: #5ee7ff;
  --amber: #ffb547;
  --magenta: #ff5ea8;
  --green: #4cf2a0;
  --violet: #a68bff;
  --blue: #6f9bff;
  --cyan-a: rgba(94, 231, 255, 0.14);
  --amber-a: rgba(255, 181, 71, 0.14);
  --magenta-a: rgba(255, 94, 168, 0.14);
  --green-a: rgba(76, 242, 160, 0.13);
  --violet-a: rgba(166, 139, 255, 0.14);
  --r: 14px;
  --r-sm: 9px;
  --shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--line-2);
  --glow: 0 0 0 1px rgba(94, 231, 255, 0.35), 0 0 24px -4px rgba(94, 231, 255, 0.35);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'JetBrains Mono', Menlo, Consolas, monospace;
  --side-w: 236px;
  --tab-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  font: 14px/1.45 var(--font);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(94, 231, 255, 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(255, 94, 168, 0.06), transparent 60%),
    linear-gradient(rgba(94, 231, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 231, 255, 0.035) 1px, transparent 1px);
  background-size: auto, auto, 32px 32px, 32px 32px;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

::selection {
  background: rgba(94, 231, 255, 0.3);
}

a {
  color: var(--cyan);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

code,
pre,
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}

.num,
.tab-num {
  font-variant-numeric: tabular-nums;
}

.label,
.caps {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.muted {
  color: var(--muted);
}
.dim {
  color: var(--dim);
}
.grow {
  flex: 1;
  min-width: 0;
}
.row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.row.wrap {
  flex-wrap: wrap;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.spacer {
  flex: 1;
}
.hidden {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.ico {
  flex: none;
  display: block;
}
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------- buttons & inputs ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--raise);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
  text-decoration: none;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn-primary {
  background: linear-gradient(180deg, #73ecff, #3fd3f0);
  color: #03141d;
  border-color: transparent;
  box-shadow: 0 6px 24px -10px rgba(94, 231, 255, 0.8);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #8ff1ff, #52dbf5);
  border-color: transparent;
}
.btn-danger {
  background: var(--magenta-a);
  color: #ff8cc0;
  border-color: rgba(255, 94, 168, 0.35);
}
.btn-danger:hover {
  background: rgba(255, 94, 168, 0.24);
  border-color: rgba(255, 94, 168, 0.55);
}
.btn-ok {
  background: var(--green-a);
  color: var(--green);
  border-color: rgba(76, 242, 160, 0.35);
}
.btn-ok:hover {
  background: rgba(76, 242, 160, 0.22);
}
.btn-amber {
  background: var(--amber-a);
  color: var(--amber);
  border-color: rgba(255, 181, 71, 0.35);
}
.btn-ghost {
  background: transparent;
}
.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 8px;
}
.btn-lg {
  height: 46px;
  padding: 0 20px;
  font-size: 15px;
  border-radius: 12px;
}
.btn-block {
  width: 100%;
}
.btn.busy {
  position: relative;
  color: transparent !important;
}
.btn.busy::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: currentColor;
  border-top-color: var(--text);
  animation: spin 0.7s linear infinite;
}
.btn-primary.busy::after {
  border-color: rgba(0, 0, 0, 0.2);
  border-top-color: #03141d;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover {
  background: var(--raise);
  color: var(--text);
  border-color: var(--line-2);
}
.icon-btn.sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.input,
select.input,
textarea.input {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: rgba(3, 8, 18, 0.6);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
  border-color: rgba(94, 231, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(94, 231, 255, 0.12);
}
.input::placeholder {
  color: var(--dim);
}
textarea.input {
  resize: vertical;
  line-height: 1.5;
}
select.input {
  appearance: none;
  padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
select.input option {
  background: var(--panel-solid);
}
.input.sm {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12.5px;
  border-radius: 8px;
}
.input.mono,
.secret-input {
  font-family: var(--mono);
  font-size: 13px;
}
.masked {
  -webkit-text-security: disc;
  text-security: disc;
}
input[type='color'].input {
  padding: 3px;
  width: 46px;
  min-height: 34px;
  cursor: pointer;
}
input[type='checkbox'] {
  accent-color: var(--cyan);
  width: 16px;
  height: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.field .hint {
  font-size: 12px;
  color: var(--muted);
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
  color: var(--text-2);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0 12px;
}

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 10px;
  background: rgba(3, 8, 18, 0.6);
  border: 1px solid var(--line-2);
  flex-wrap: wrap;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.seg button:hover {
  color: var(--text);
}
.seg button.on {
  background: var(--cyan-a);
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px rgba(94, 231, 255, 0.3);
}
.seg.full {
  display: flex;
}
.seg.full button {
  flex: 1;
}

/* ---------------- chips & badges ---------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--raise);
  color: var(--text-2);
  border: 1px solid var(--line-2);
  white-space: nowrap;
  max-width: 100%;
}
.chip.dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.chip.hot,
.chip.urgent,
.chip.denied,
.chip.blocker,
.chip.overdue {
  color: var(--magenta);
  background: var(--magenta-a);
  border-color: rgba(255, 94, 168, 0.3);
}
.chip.warm,
.chip.high,
.chip.pending,
.chip.question,
.chip.soon,
.chip.paused {
  color: var(--amber);
  background: var(--amber-a);
  border-color: rgba(255, 181, 71, 0.3);
}
.chip.cool,
.chip.med,
.chip.active,
.chip.progress,
.chip.later {
  color: var(--cyan);
  background: var(--cyan-a);
  border-color: rgba(94, 231, 255, 0.28);
}
.chip.approved,
.chip.shipped,
.chip.done,
.chip.ok,
.chip.decision {
  color: var(--green);
  background: var(--green-a);
  border-color: rgba(76, 242, 160, 0.28);
}
.chip.cold,
.chip.low,
.chip.archived,
.chip.expired,
.chip.revoked,
.chip.note {
  color: var(--muted);
}
.chip.idea,
.chip.handoff,
.chip.session {
  color: var(--violet);
  background: var(--violet-a);
  border-color: rgba(166, 139, 255, 0.3);
}
.chip.hot.dot::before {
  box-shadow: 0 0 8px var(--magenta);
}
.chip.clickable {
  cursor: pointer;
}
.chip.clickable.on {
  box-shadow: inset 0 0 0 1px currentColor;
}

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--magenta);
  color: #1b0010;
  font-variant-numeric: tabular-nums;
}
.badge.amber {
  background: var(--amber);
  color: #241500;
}
.badge.cyan {
  background: var(--cyan);
  color: #03141d;
}
.pulse {
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 94, 168, 0.65);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(255, 94, 168, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 94, 168, 0);
  }
}

/* ---------------- panels ---------------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
}
.panel-pad {
  padding: 16px;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
}
.panel-head h3,
.section-title {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.panel-body {
  padding: 14px 16px;
}

/* ---------------- shell ---------------- */

#app {
  min-height: 100dvh;
}

.shell {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px 12px;
  border-right: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(8, 15, 31, 0.92), rgba(5, 9, 18, 0.92));
  backdrop-filter: blur(12px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 14px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.02em;
}
.brand:hover {
  text-decoration: none;
}
.brand img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.brand small {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--text-2);
  font-weight: 550;
  position: relative;
}
.nav-item:hover {
  background: var(--raise);
  color: var(--text);
  text-decoration: none;
}
.nav-item.on {
  background: linear-gradient(90deg, rgba(94, 231, 255, 0.14), rgba(94, 231, 255, 0.02));
  color: var(--cyan);
}
.nav-item.on::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}
.nav-item .badge {
  margin-left: auto;
}
.nav-item kbd {
  margin-left: auto;
}

.side-section {
  margin: 14px 10px 6px;
}
.side-projects {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.side-project {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 13px;
}
.side-project:hover {
  background: var(--raise);
  text-decoration: none;
  color: var(--text);
}
.side-project.on {
  color: var(--text);
  background: var(--raise);
}
.side-project .swatch {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  flex: none;
}
.side-project .cnt {
  margin-left: auto;
  font-size: 11px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.side-foot {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.side-foot .row {
  padding: 0 4px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--raise);
  border: 1px solid var(--line-2);
  color: var(--muted);
  white-space: nowrap;
}
.status-pill.sync {
  color: var(--cyan);
}
.status-pill.sync .spinner {
  width: 10px;
  height: 10px;
  border-width: 1.5px;
}
.status-pill.offline {
  color: var(--amber);
  border-color: rgba(255, 181, 71, 0.35);
}
.status-pill.mode::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 5px;
  font: 600 10.5px var(--mono);
  color: var(--muted);
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.25);
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: none;
}
.view {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 28px 48px;
  animation: viewIn 0.25s var(--ease);
}
@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

.view-head {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.view-head h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.01em;
  font-weight: 750;
}
.view-head .sub {
  color: var(--muted);
  margin-top: 3px;
}
.view-head .actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tabbar {
  display: none;
}

/* ---------------- dashboard ---------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.stat {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  position: relative;
  overflow: hidden;
  color: var(--text);
}
a.stat:hover {
  text-decoration: none;
  border-color: var(--line);
}
.stat::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: var(--accent, var(--cyan));
  opacity: 0.7;
}
.stat .v {
  font-size: 26px;
  font-weight: 750;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat .v small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.stat .k {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}
.stat .s {
  font-size: 12px;
  color: var(--text-2);
}
.stat .live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--magenta);
}

.capture {
  display: flex;
  gap: 8px;
  padding: 8px;
  margin-bottom: 16px;
  align-items: center;
}
.capture .input {
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 14.5px;
}
.capture select.input {
  width: auto;
  max-width: 180px;
  background-color: rgba(3, 8, 18, 0.6);
}
.capture .ico {
  color: var(--cyan);
  margin-left: 6px;
}

.dash {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}
.filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.filters .input {
  width: auto;
}
.filters .search {
  flex: 1;
  min-width: 160px;
}

.pgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.pcard {
  --c: var(--cyan);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 12px 16px;
  border-radius: var(--r);
  background: var(--panel);
  border: 1px solid var(--line-2);
  color: var(--text);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  min-width: 0;
}
.pcard::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--c);
  box-shadow: 0 0 14px var(--c);
}
.pcard::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(400px 120px at 0 0, color-mix(in srgb, var(--c) 9%, transparent), transparent 70%);
  pointer-events: none;
}
.pcard:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--c) 40%, transparent);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px -16px color-mix(in srgb, var(--c) 60%, transparent);
}
.pcard .top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.pcard h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}
.pcard .tagline {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pcard .chips {
  margin-left: auto;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pcard .counts {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
}
.pcard .counts b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  margin-right: 3px;
}
.pcard .next {
  font-size: 12.5px;
  color: var(--text-2);
  display: flex;
  gap: 6px;
  align-items: baseline;
}
.pcard .next .label {
  flex: none;
}
.pcard .handoff {
  font-size: 12px;
  color: var(--text-2);
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pcard .foot {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11.5px;
  color: var(--dim);
  margin-top: auto;
}
.git {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  min-width: 0;
}
.git .dirty {
  color: var(--amber);
}
.git .clean {
  color: var(--green);
}
.git .ab {
  color: var(--muted);
}

.feed {
  display: flex;
  flex-direction: column;
}
.feed-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-2);
  font-size: 12.5px;
}
.feed-item:last-child {
  border-bottom: 0;
}
.feed-item .k {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--raise);
  color: var(--muted);
}
.feed-item .meta {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 11.5px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}
.feed-item .meta a {
  color: var(--text-2);
  font-weight: 600;
}
.feed-item .t {
  color: var(--text-2);
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feed-scroll {
  max-height: calc(100dvh - 300px);
  min-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.kind-progress {
  --k: var(--cyan);
}
.kind-decision {
  --k: var(--green);
}
.kind-blocker {
  --k: var(--magenta);
}
.kind-handoff {
  --k: var(--violet);
}
.kind-question {
  --k: var(--amber);
}
.kind-note {
  --k: var(--text-2);
}
.kind-session {
  --k: var(--blue);
}
.kind-audit {
  --k: var(--muted);
}
[class*='kind-'] .k {
  color: var(--k);
  background: color-mix(in srgb, var(--k) 14%, transparent);
}

/* ---------------- project ---------------- */

.phead {
  --c: var(--cyan);
  position: relative;
  padding: 18px 20px;
  margin-bottom: 14px;
  overflow: hidden;
}
.phead::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(700px 160px at 0 0, color-mix(in srgb, var(--c) 14%, transparent), transparent 70%);
  pointer-events: none;
}
.phead .title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
}
.phead h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 780;
  letter-spacing: -0.01em;
}
.phead .swatch-lg {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--c);
  box-shadow: 0 0 14px var(--c);
}
.phead .tagline {
  color: var(--text-2);
  margin: 6px 0 0;
  position: relative;
}
.phead .meta {
  display: flex;
  gap: 8px 16px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  position: relative;
  align-items: center;
}
.phead .meta .item {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}
.phead .actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}
.phead select.input {
  width: auto;
  min-height: 30px;
  padding: 4px 30px 4px 10px;
  font-size: 12.5px;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line-2);
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs a,
.tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  color: var(--muted);
  font-weight: 600;
  border: 0;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  white-space: nowrap;
}
.tabs a:hover,
.tabs button:hover {
  color: var(--text);
  text-decoration: none;
}
.tabs .on {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}
.tabs .badge {
  height: 16px;
  min-width: 16px;
  font-size: 10px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: start;
  scrollbar-width: thin;
}
.kcol {
  display: flex;
  flex-direction: column;
  border-radius: var(--r);
  background: rgba(10, 18, 36, 0.55);
  border: 1px solid var(--line-2);
  min-height: 140px;
  transition: border-color 0.12s, background 0.12s;
}
.kcol.drop {
  border-color: rgba(94, 231, 255, 0.55);
  background: rgba(94, 231, 255, 0.06);
}
.kcol-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 8px;
}
.kcol-head .n {
  font-size: 11px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.kcol-head .bar {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.kcol-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 0 8px 8px;
  min-height: 40px;
}
.kcol-add {
  padding: 0 8px 8px;
}
.kcol-add .btn {
  width: 100%;
  justify-content: flex-start;
  color: var(--muted);
}

.task {
  position: relative;
  padding: 9px 10px 9px 12px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: border-color 0.12s, box-shadow 0.12s, opacity 0.12s;
}
.task:hover {
  border-color: rgba(255, 255, 255, 0.16);
}
.task::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: var(--p, var(--dim));
}
.task.p-urgent {
  --p: var(--magenta);
}
.task.p-high {
  --p: var(--amber);
}
.task.p-med {
  --p: var(--cyan);
}
.task.p-low {
  --p: var(--dim);
}
.task .tt {
  font-size: 13px;
  font-weight: 550;
  line-height: 1.35;
  word-break: break-word;
}
.task .tm {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-top: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--dim);
}
.task .tn {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.task.dragging {
  opacity: 0.35;
}
.task.done .tt {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--dim);
}
.task-ghost {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  transform: rotate(2deg);
  box-shadow: var(--glow), 0 20px 40px -10px rgba(0, 0, 0, 0.8);
  opacity: 0.95;
}

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
}
.tl-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  position: relative;
  padding-bottom: 16px;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 30px;
  bottom: 0;
  width: 1px;
  background: var(--line-2);
}
.tl-item:last-child::before {
  display: none;
}
.tl-item .k {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--k) 30%, transparent);
}
.tl-body {
  min-width: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line-2);
}
.tl-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.tl-meta .who {
  color: var(--text-2);
  font-weight: 650;
}
.tl-files {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.tl-files code {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-2);
}
.day-sep {
  margin: 4px 0 12px 42px;
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  margin-bottom: 16px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}
.rules {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: r;
}
.rules li {
  counter-increment: r;
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-2);
}
.rules li:last-child {
  border-bottom: 0;
}
.rules li::before {
  content: counter(r, decimal-leading-zero);
  font: 600 11px var(--mono);
  color: var(--cyan);
  padding-top: 2px;
}
.links-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.links-list a {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  word-break: break-all;
}

/* ---------------- markdown ---------------- */

.md {
  line-height: 1.6;
  color: var(--text);
  word-break: break-word;
}
.md > :first-child {
  margin-top: 0;
}
.md > :last-child {
  margin-bottom: 0;
}
.md p {
  margin: 0 0 0.7em;
}
.md h3,
.md h4,
.md h5,
.md h6 {
  margin: 1em 0 0.4em;
  font-size: 1.05em;
  color: var(--cyan);
}
.md ul,
.md ol {
  margin: 0 0 0.7em;
  padding-left: 1.4em;
}
.md li {
  margin: 0.15em 0;
}
.md li.task-li {
  list-style: none;
  margin-left: -1.3em;
  display: flex;
  gap: 8px;
}
.md .cb {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 1px solid var(--dim);
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  flex: none;
  margin-top: 4px;
}
.md .cb.on {
  background: var(--green-a);
  border-color: var(--green);
  color: var(--green);
}
.md code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(94, 231, 255, 0.08);
  color: #b8f4ff;
}
.md pre {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line-2);
  overflow-x: auto;
}
.md pre code {
  padding: 0;
  background: none;
  color: var(--text-2);
}
.md blockquote {
  margin: 0 0 0.7em;
  padding: 2px 12px;
  border-left: 2px solid var(--violet);
  color: var(--text-2);
}
.md hr {
  border: 0;
  border-top: 1px solid var(--line-2);
  margin: 1em 0;
}
.md strong {
  color: #fff;
}

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

.list {
  display: flex;
  flex-direction: column;
}
.item-row {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
  align-items: flex-start;
}
.item-row:last-child {
  border-bottom: 0;
}
.item-row .main-col {
  flex: 1;
  min-width: 0;
}
.item-row .title {
  font-weight: 650;
}
.item-row .meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.item-row .acts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.req {
  padding: 16px;
  margin-bottom: 12px;
  border-left: 3px solid var(--amber);
}
.req.secret {
  border-left-color: var(--magenta);
}
.req .req-head {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.req .req-head h3 {
  margin: 0;
  font-size: 15px;
}
.req .reason {
  margin: 10px 0;
  color: var(--text-2);
}
.secret-names {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
}
.secret-name {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line-2);
  font-size: 12.5px;
  flex-wrap: wrap;
}
.secret-name code {
  color: #fff;
  font-weight: 600;
}

.secret-row .val {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-2);
  padding: 5px 9px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line-2);
  word-break: break-all;
  max-width: 100%;
  margin-top: 6px;
  display: inline-block;
}
.secret-row .val.revealed {
  color: var(--amber);
  border-color: rgba(255, 181, 71, 0.35);
}

.radar-row .days {
  min-width: 64px;
  text-align: center;
  padding: 8px 6px;
  border-radius: 10px;
  background: var(--raise);
  border: 1px solid var(--line-2);
  font-variant-numeric: tabular-nums;
}
.radar-row .days b {
  display: block;
  font-size: 20px;
  line-height: 1.1;
}
.radar-row .days span {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.d-over {
  color: var(--magenta);
}
.d-hot {
  color: var(--magenta);
}
.d-soon {
  color: var(--amber);
}
.d-mid {
  color: var(--cyan);
}
.d-far {
  color: var(--green);
}

.vault-lock {
  max-width: 440px;
  margin: 40px auto;
  text-align: center;
  padding: 30px 26px;
}
.vault-lock .big-ico {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--magenta-a);
  color: var(--magenta);
  box-shadow: 0 0 40px -6px rgba(255, 94, 168, 0.5);
}
.vault-timer {
  font-variant-numeric: tabular-nums;
}

table.preview {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
table.preview td,
table.preview th {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line-2);
  text-align: left;
}
table.preview th {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------------- deck ---------------- */

.deck-wrap {
  position: relative;
  height: calc(100dvh - 140px);
  min-height: 380px;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line-2);
  background: #000;
}
.deck-wrap iframe {
  border: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #fff;
}
.deck-wrap.full {
  position: fixed;
  inset: 0;
  z-index: 900;
  height: auto;
  border-radius: 0;
}

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

.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px calc(24px + var(--safe-b));
}
.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 28px 26px;
  animation: viewIn 0.35s var(--ease);
}
.auth-card.wide {
  max-width: 560px;
}
.auth-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.auth-mark img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 0 30px -6px rgba(94, 231, 255, 0.6);
}
.auth-mark h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 780;
}
.auth-mark p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}
.auth-card .lead {
  color: var(--text-2);
  margin: 0 0 16px;
}
.auth-alt {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  font-size: 12.5px;
}
.auth-alt button {
  border: 0;
  background: none;
  color: var(--cyan);
  cursor: pointer;
  padding: 0;
}
.auth-err {
  color: var(--magenta);
  font-size: 13px;
  min-height: 18px;
  margin: 2px 0 10px;
}
.unlocking {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cyan);
  font-size: 13px;
}
.recovery-code {
  font: 700 clamp(18px, 5vw, 26px) / 1.4 var(--mono);
  letter-spacing: 0.08em;
  text-align: center;
  padding: 22px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed rgba(255, 181, 71, 0.5);
  color: var(--amber);
  margin: 16px 0;
  word-break: break-all;
  user-select: all;
}
.note-box {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(94, 231, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 13px;
  margin: 12px 0;
}
.note-box.warn {
  background: var(--amber-a);
  border-color: rgba(255, 181, 71, 0.3);
}
.note-box ol,
.note-box ul {
  margin: 6px 0 0;
  padding-left: 1.3em;
}
.note-box li {
  margin: 3px 0;
}
details.note-box summary {
  cursor: pointer;
  color: var(--cyan);
  font-weight: 600;
}

.meter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: -4px;
  margin-bottom: 12px;
}
.meter-track {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.meter-bar {
  height: 100%;
  width: 0;
  background: var(--magenta);
  transition: width 0.2s, background 0.2s;
}
.meter[data-score='2'] .meter-bar {
  background: var(--amber);
}
.meter[data-score='3'] .meter-bar {
  background: var(--cyan);
}
.meter[data-score='4'] .meter-bar {
  background: var(--green);
}
.meter-label {
  font-size: 11px;
  color: var(--muted);
  min-width: 110px;
  text-align: right;
}

.boot {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  gap: 16px;
  color: var(--muted);
}
.boot-mark {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(94, 231, 255, 0.2);
  border-top-color: var(--cyan);
  animation: spin 1s linear infinite;
}

/* ---------------- modal ---------------- */

.modal-back {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 5, 12, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.18s;
}
.modal-back.in {
  opacity: 1;
}
.modal {
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(18, 30, 58, 0.97), rgba(10, 18, 36, 0.98));
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.5);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.22s var(--ease);
}
.modal-wide {
  max-width: 760px;
}
.modal-back.in .modal {
  transform: none;
}
.modal-grab {
  display: none;
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 10px;
}
.modal-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 720;
  flex: 1;
}
.modal-body {
  padding: 6px 18px 14px;
  overflow-y: auto;
}
.modal-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line-2);
  flex-wrap: wrap;
}
.confirm-msg {
  margin: 0;
  color: var(--text-2);
  white-space: pre-wrap;
}

/* ---------------- palette ---------------- */

.palette-back {
  align-items: start;
  padding-top: 12vh;
}
.palette {
  width: 100%;
  max-width: 600px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(18, 30, 58, 0.98), rgba(10, 18, 36, 0.98));
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9), var(--glow);
}
.palette-in {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
}
.palette-in input {
  flex: 1;
  border: 0;
  background: none;
  outline: none;
  font-size: 16px;
  color: var(--text);
}
.palette-mode {
  font-size: 11px;
  color: var(--amber);
  font-weight: 700;
  white-space: nowrap;
}
.palette-list {
  max-height: 50vh;
  overflow-y: auto;
  padding: 6px;
}
.palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  color: var(--text-2);
}
.palette-item .hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--dim);
}
.palette-item.on {
  background: var(--cyan-a);
  color: var(--text);
}
.palette-item .swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.help-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  align-items: center;
}

/* ---------------- toasts ---------------- */

.toasts {
  position: fixed;
  z-index: 1100;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(440px, calc(100vw - 32px));
  padding: 10px 10px 10px 14px;
  border-radius: 12px;
  background: rgba(14, 24, 46, 0.97);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.8);
  font-size: 13px;
  transform: translateY(8px);
  opacity: 0;
  transition: transform 0.2s var(--ease), opacity 0.2s;
}
.toast.in {
  transform: none;
  opacity: 1;
}
.toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  flex: none;
}
.toast-ok .toast-dot {
  background: var(--green);
}
.toast-warn .toast-dot {
  background: var(--amber);
}
.toast-error {
  border-color: rgba(255, 94, 168, 0.45);
}
.toast-error .toast-dot {
  background: var(--magenta);
}
.toast-msg {
  flex: 1;
  word-break: break-word;
}
.toast-x {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  display: grid;
}

/* ---------------- misc ---------------- */

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(94, 231, 255, 0.2);
  border-top-color: var(--cyan);
  animation: spin 0.7s linear infinite;
  flex: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
}
.empty .ico {
  color: var(--dim);
  margin-bottom: 4px;
}
.empty-title {
  color: var(--text-2);
  font-weight: 650;
}
.empty-sub {
  font-size: 12.5px;
  max-width: 420px;
}

.err-panel {
  padding: 20px;
  border-left: 3px solid var(--magenta);
}
.err-panel pre {
  white-space: pre-wrap;
  color: var(--text-2);
  font-size: 12px;
}

.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 40px;
  justify-content: center;
  color: var(--muted);
}

.skeleton {
  border-radius: var(--r);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  min-height: 130px;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
  align-items: start;
}
.settings-grid .panel-body > * + * {
  margin-top: 10px;
}
.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 13px;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
  word-break: break-all;
}

.ptr {
  height: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--cyan);
  transition: height 0.15s;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

/* ---------------- responsive ---------------- */

@media (max-width: 1180px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .dash {
    grid-template-columns: 1fr;
  }
  .feed-scroll {
    max-height: 480px;
  }
}

@media (max-width: 820px) {
  body {
    font-size: 14.5px;
    background-attachment: scroll;
  }
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .topbar {
    display: flex;
    align-items: center;
    gap: 6px;
    position: sticky;
    top: 0;
    z-index: 50;
    padding: calc(8px + var(--safe-t)) 10px 8px 14px;
    background: rgba(5, 9, 18, 0.86);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line-2);
  }
  .topbar .brand {
    padding: 0;
    font-size: 15px;
  }
  .topbar .brand img {
    width: 24px;
    height: 24px;
  }
  .topbar .spacer {
    flex: 1;
  }
  .view {
    padding: 16px 14px calc(var(--tab-h) + 28px + var(--safe-b));
  }
  .view-head h1 {
    font-size: 21px;
  }
  .tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    height: calc(var(--tab-h) + var(--safe-b));
    padding-bottom: var(--safe-b);
    background: rgba(6, 11, 22, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line-2);
  }
  .tabbar a,
  .tabbar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--muted);
    border: 0;
    background: none;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar a:hover {
    text-decoration: none;
  }
  .tabbar .on {
    color: var(--cyan);
  }
  .tabbar .on .ico {
    filter: drop-shadow(0 0 6px rgba(94, 231, 255, 0.7));
  }
  .tabbar .badge {
    position: absolute;
    top: 6px;
    left: calc(50% + 6px);
    height: 16px;
    min-width: 16px;
    font-size: 10px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .stat .v {
    font-size: 22px;
  }
  .pgrid {
    grid-template-columns: 1fr;
  }
  .capture {
    flex-wrap: wrap;
  }
  .capture select.input {
    max-width: none;
    flex: 1;
  }
  .kanban {
    grid-template-columns: repeat(5, 82vw);
    scroll-snap-type: x mandatory;
    margin: 0 -14px;
    padding: 0 14px 8px;
  }
  .kcol {
    scroll-snap-align: center;
  }
  .toasts {
    left: 12px;
    right: 12px;
    bottom: calc(var(--tab-h) + 12px + var(--safe-b));
    align-items: stretch;
  }
  .toast {
    max-width: none;
  }
  .modal-back {
    padding: 0;
    place-items: end stretch;
  }
  .modal {
    max-width: none;
    border-radius: 20px 20px 0 0;
    max-height: 92dvh;
    padding-bottom: var(--safe-b);
    transform: translateY(40px);
  }
  .modal-grab {
    display: block;
    width: 38px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.18);
    margin: 8px auto 0;
  }
  .modal-foot .btn {
    flex: 1;
  }
  .palette-back {
    padding: 10px;
    padding-top: calc(10px + var(--safe-t));
    place-items: start stretch;
  }
  .phead {
    padding: 14px;
  }
  .phead h1 {
    font-size: 20px;
  }
  .phead .actions {
    margin-left: 0;
    width: 100%;
  }
  .item-row {
    flex-wrap: wrap;
    padding: 12px;
  }
  .item-row .acts {
    width: 100%;
    justify-content: flex-start;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .deck-wrap {
    height: calc(100dvh - 200px);
  }
  .hide-sm {
    display: none !important;
  }
}

@media (min-width: 821px) {
  .show-sm {
    display: none !important;
  }
}

@media (hover: none) {
  .task:hover,
  .pcard:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .spinner,
  .boot-mark,
  .btn.busy::after {
    animation-duration: 1.2s !important;
    animation-iteration-count: infinite !important;
  }
}
