/* ───────────────────────── Duoboard ───────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --topbar: 64px;
}

/* Two-tone palettes: one base, one accent. Everything else is derived. */
[data-palette="acid"] {
  --bg: #0D0D10; --surface: #15151A; --surface-2: #1D1D24; --line: #2A2A33;
  --text: #F2F2EE; --muted: #8C8C98;
  --accent: #C8FF2E; --on-accent: #0D0D10; --accent-soft: rgba(200, 255, 46, .13);
  color-scheme: dark;
}
[data-palette="ember"] {
  --bg: #110D0B; --surface: #1A1411; --surface-2: #231B17; --line: #34291F;
  --text: #F7EFE8; --muted: #9C8D82;
  --accent: #FF6A3D; --on-accent: #110D0B; --accent-soft: rgba(255, 106, 61, .15);
  color-scheme: dark;
}
[data-palette="cobalt"] {
  --bg: #0A1240; --surface: #0F1A52; --surface-2: #162263; --line: #24317A;
  --text: #F4EFE3; --muted: #9BA4D2;
  --accent: #F4EFE3; --on-accent: #0A1240; --accent-soft: rgba(244, 239, 227, .12);
  color-scheme: dark;
}
[data-palette="paper"] {
  --bg: #EEE9DD; --surface: #F7F4EC; --surface-2: #E6E0D2; --line: #D4CDBD;
  --text: #141414; --muted: #6F6B61;
  --accent: #141414; --on-accent: #EEE9DD; --accent-soft: rgba(20, 20, 20, .08);
  color-scheme: light;
}

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font-body);
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s var(--ease), color .35s var(--ease);
  overflow: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--line) 1px, transparent 1.2px);
  background-size: 22px 22px;
  opacity: .6;
}

[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--on-accent); }

.icon { display: inline-grid; place-items: center; flex: none; }
.icon svg { width: 18px; height: 18px; display: block; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; letter-spacing: .01em;
  white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .2s, border-color .2s, background-color .2s, color .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:not(:disabled):hover { box-shadow: 0 0 0 5px var(--accent-soft); }
.btn-ghost { border: 1px solid var(--line); }
.btn-ghost:not(:disabled):hover { border-color: var(--text); }
.btn-ghost.danger { color: var(--muted); }
.btn-ghost.danger:hover { color: var(--text); }
.btn-lg { height: 52px; padding: 0 24px; font-size: 16px; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn .icon svg { width: 16px; height: 16px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  color: var(--muted);
  transition: background-color .15s, color .15s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 8px; }
.icon-btn.sm svg { width: 15px; height: 15px; }

.g-badge {
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23EA4335' d='M24 9.5c3.5 0 6.6 1.2 9.1 3.6l6.8-6.8C35.8 2.4 30.3 0 24 0 14.6 0 6.6 5.4 2.6 13.2l7.9 6.2C12.4 13.7 17.7 9.5 24 9.5z'/%3E%3Cpath fill='%234285F4' d='M46.1 24.5c0-1.6-.1-3.1-.4-4.5H24v9h12.4c-.5 2.9-2.2 5.3-4.6 7l7.5 5.8c4.3-4 6.8-10 6.8-17.3z'/%3E%3Cpath fill='%23FBBC05' d='M10.5 28.6A14.5 14.5 0 0 1 9.5 24c0-1.6.3-3.2.8-4.6l-7.9-6.2A24 24 0 0 0 0 24c0 3.9.9 7.5 2.6 10.8l7.9-6.2z'/%3E%3Cpath fill='%2334A853' d='M24 48c6.5 0 11.9-2.1 15.9-5.8l-7.5-5.8c-2.1 1.4-4.8 2.3-8.4 2.3-6.3 0-11.6-4.2-13.5-10l-7.9 6.2C6.6 42.6 14.6 48 24 48z'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.btn.sm .g-badge { width: 18px; height: 18px; background-size: 12px; }

/* ── Brand ── */
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -.01em;
}
.brand-mark {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: linear-gradient(90deg, var(--text) 50%, var(--accent) 50%);
  box-shadow: 0 0 0 1px var(--line);
}
.brand.small { font-size: 16px; }
.brand.small .brand-mark { width: 18px; height: 18px; }

.side-label {
  font-family: var(--font-display); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted);
  padding: 0 10px 6px;
}
.side-label.flush { padding: 8px 0 0; }

/* ── Palette swatches ── */
.palettes { display: flex; gap: 8px; }
.swatch {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--a) 50%, var(--b) 50%);
  box-shadow: 0 0 0 1px var(--line);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.swatch:hover { transform: scale(1.12) rotate(-8deg); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }

/* ───────────────────────── Splash ───────────────────────── */
.splash {
  position: relative;
  height: 100vh; height: 100dvh;
  display: grid; grid-template-columns: 1.1fr 1fr;
  overflow: auto;
}
.splash-left {
  padding: 48px clamp(24px, 6vw, 96px);
  display: flex; flex-direction: column; justify-content: center; gap: 28px;
  animation: rise .7s var(--ease) both;
}
.hero {
  margin: 0;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(48px, 7vw, 112px); line-height: .9; letter-spacing: -.045em;
}
.hero-flip {
  display: inline-block;
  margin-top: .08em; padding: 0 .14em .04em;
  background: var(--accent); color: var(--on-accent);
  border-radius: .1em;
  white-space: nowrap;
  transform: rotate(-2deg);
}
.lede { margin: 0; max-width: 46ch; color: var(--muted); font-size: 17px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.note { margin: -12px 0 0; min-height: 1em; font-size: 13px; color: var(--muted); max-width: 52ch; }
.note code { font-size: 12px; padding: 1px 5px; border-radius: 4px; background: var(--surface-2); }
.splash-foot { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.splash-foot .side-label { padding: 0; }

.splash-right {
  position: relative; overflow: hidden;
  display: grid; place-items: center;
  padding: 48px;
  background: var(--accent); color: var(--on-accent);
  transition: background-color .35s var(--ease);
}
.splash-right::before {
  content: 'DUO';
  position: absolute; right: -.06em; bottom: -.22em;
  font: 700 clamp(160px, 26vw, 420px)/1 var(--font-display); letter-spacing: -.06em;
  color: transparent; -webkit-text-stroke: 2px var(--on-accent);
  opacity: .14;
}
.mock {
  position: relative;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  width: min(540px, 100%);
  transform: rotate(-6deg);
}
.mock-col { display: flex; flex-direction: column; gap: 10px; }
.mock-col h4 {
  margin: 0 0 2px;
  font: 700 11px var(--font-display); text-transform: uppercase; letter-spacing: .16em;
  opacity: .7;
}
.mock-card {
  padding: 14px; border-radius: 12px;
  background: var(--bg); color: var(--text);
  font-size: 13px; font-weight: 500;
  box-shadow: 0 24px 40px -22px rgba(0, 0, 0, .55);
  animation: float 6s ease-in-out infinite;
}
.mock-col:nth-child(2) .mock-card { animation-delay: -2s; }
.mock-col:nth-child(3) .mock-card { animation-delay: -4s; }
.mock-card.inv { background: transparent; color: var(--on-accent); box-shadow: inset 0 0 0 2px var(--on-accent); }
.mock-card .bar { height: 6px; width: 72%; margin-top: 10px; border-radius: 3px; background: var(--line); }
.mock-card .bar.short { width: 44%; }
.mock-card .bar.acc { background: var(--accent); }

@keyframes float { 50% { transform: translateY(-7px); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ───────────────────────── App shell ───────────────────────── */
.app {
  position: relative;
  height: 100vh; height: 100dvh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  grid-template-rows: var(--topbar) minmax(0, 1fr);
  grid-template-areas: "top top" "side main";
}

.topbar {
  grid-area: top;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  z-index: 30;
}
.divider { width: 1px; height: 24px; background: var(--line); }
.board-title {
  min-width: 0; width: 28ch; max-width: 100%;
  padding: 5px 8px;
  border: 1px solid transparent; border-radius: 8px;
  background: transparent;
  font: 700 20px var(--font-display); letter-spacing: -.02em;
  text-overflow: ellipsis;
}
.board-title:hover { border-color: var(--line); }
.board-title:focus { border-color: var(--accent); outline: none; }
.spacer { flex: 1; }

.search {
  display: flex; align-items: center; gap: 8px;
  width: 240px; height: 38px; padding: 0 8px 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--muted);
  transition: border-color .15s;
}
.search:focus-within { border-color: var(--accent); }
.search .icon svg { width: 16px; height: 16px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd {
  font: 600 11px var(--font-display);
  padding: 1px 7px; border-radius: 6px;
  border: 1px solid var(--line);
}

.user { display: flex; align-items: center; gap: 6px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
  font: 700 14px var(--font-display);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--accent);
}
.chip {
  font-size: 12px; font-weight: 500;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}

/* ── Sidebar ── */
.sidebar {
  grid-area: side;
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 12px 16px;
  border-right: 1px solid var(--line);
  background: var(--bg);
  overflow-y: auto;
  transition: background-color .35s var(--ease);
}
.board-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.board-link {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
  color: var(--muted); font-weight: 500; text-align: left;
  transition: background-color .15s, color .15s;
}
.board-link:hover { background: var(--surface); color: var(--text); }
.board-link.active { background: var(--accent); color: var(--on-accent); }
.board-link .dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid currentColor; flex: none; }
.board-link.active .dot { background: currentColor; }
.board-link-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-link-count { font-size: 12px; opacity: .7; font-variant-numeric: tabular-nums; }
.board-link.new { margin-top: 4px; }
.trash-link { margin-top: 2px; }
.trash-link .icon svg, .board-link-count .icon svg { width: 15px; height: 15px; }
.board-link.new .icon svg { width: 15px; height: 15px; }

.side-foot {
  margin-top: auto;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 14px 10px 0;
  border-top: 1px solid var(--line);
}
.sync-note { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.sync-note::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.text-btn { font-size: 13px; color: var(--muted); }
.text-btn:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* ── Board ── */
.board {
  grid-area: main;
  display: flex; align-items: flex-start; gap: 16px;
  padding: 24px;
  overflow: auto hidden;
  overscroll-behavior-x: contain;
}
.columns { display: flex; align-items: flex-start; gap: 16px; height: 100%; }

.column {
  flex: 0 0 300px;
  max-height: 100%;
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface);
  animation: rise .45s var(--ease) both;
  transition: background-color .35s var(--ease), border-color .35s;
}
.columns > .column:nth-child(2) { animation-delay: .04s; }
.columns > .column:nth-child(3) { animation-delay: .08s; }
.columns > .column:nth-child(4) { animation-delay: .12s; }
.columns > .column:nth-child(n+5) { animation-delay: .16s; }
.board.no-anim .column { animation: none; }

.col-head { display: flex; align-items: center; gap: 6px; padding: 12px 10px 8px 12px; }
.col-grip {
  padding: 3px 7px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent);
  font: 700 12px var(--font-display); letter-spacing: .06em;
  cursor: grab; user-select: none; touch-action: none;
}
.col-name {
  flex: 1; min-width: 0;
  padding: 3px 6px;
  border: 1px solid transparent; border-radius: 7px;
  background: transparent;
  font: 600 15px var(--font-display); letter-spacing: -.01em;
  text-overflow: ellipsis;
}
.col-name:hover { border-color: var(--line); }
.col-name:focus { border-color: var(--accent); outline: none; }
.count {
  min-width: 24px; padding: 1px 7px; border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums;
}
@media (hover: hover) {
  .col-head .icon-btn { opacity: 0; }
  .column:hover .col-head .icon-btn, .col-head .icon-btn:focus-visible { opacity: 1; }
}

.cards {
  flex: 1; min-height: 28px;
  display: flex; flex-direction: column; gap: 8px;
  padding: 4px 10px 8px;
  overflow-y: auto;
}

.card {
  padding: 12px;
  border: 1px solid transparent; border-radius: 12px;
  background: var(--surface-2);
  cursor: grab; user-select: none;
  transition: border-color .15s, transform .18s var(--ease), box-shadow .18s, background-color .35s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 12px 24px -16px rgba(0, 0, 0, .6); }
.card.is-hidden { display: none; }
.card-top { display: flex; align-items: flex-start; gap: 6px; }
.card-title { flex: 1; margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.card-open { margin: -4px -6px -4px 0; flex: none; }
@media (hover: hover) {
  .card-open { opacity: 0; }
  .card:hover .card-open, .card:focus-within .card-open { opacity: 1; }
}
.card-desc {
  margin: 6px 0 0; color: var(--muted); font-size: 13px; white-space: pre-line; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card.is-editing {
  cursor: default; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
  display: flex; flex-direction: column; gap: 6px; transform: none;
}
.inline-title, .inline-desc, .composer-input, .composer-desc {
  width: 100%; resize: none; outline: 0; border: 0; background: transparent; padding: 0; overflow: hidden;
}
.inline-title, .composer-input { font-weight: 600; }
.inline-desc, .composer-desc { font-size: 13px; min-height: 2.6em; }
.inline-title::placeholder, .inline-desc::placeholder, .composer-input::placeholder, .composer-desc::placeholder { color: var(--muted); }
.inline-actions { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.mini-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
  font: 700 10.5px var(--font-display); letter-spacing: .02em;
}
.mini-avatar.sm { width: 20px; height: 20px; font-size: 9px; }
.mini-avatar.push { margin-left: auto; }
.mini-avatar.more { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 10px; }
.tag { font-size: 12px; color: var(--muted); }
.pri {
  padding: 2px 7px; border-radius: 5px;
  font: 700 10.5px var(--font-display); text-transform: uppercase; letter-spacing: .08em;
}
.pri-high { background: var(--accent); color: var(--on-accent); }
.pri-med { color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.pri-low { color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.due { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.due .icon svg { width: 13px; height: 13px; }
.due.overdue { color: var(--accent); font-weight: 600; }
.has-desc { margin-left: auto; color: var(--muted); }
.has-desc svg { width: 14px; height: 14px; }

/* Drag states (SortableJS) */
.card-ghost { background: transparent !important; border: 1.5px dashed var(--accent) !important; box-shadow: none !important; }
.card-ghost > * { visibility: hidden; }
.card-fallback { opacity: 1 !important; transform: rotate(3deg) !important; border-color: var(--accent) !important; box-shadow: 0 24px 48px -16px rgba(0, 0, 0, .6) !important; cursor: grabbing; }
.col-ghost { opacity: .35; }
.col-fallback { opacity: .95 !important; transform: rotate(2deg); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6); }
body.dragging, body.dragging * { cursor: grabbing !important; }

.add-card {
  display: flex; align-items: center; gap: 6px;
  margin: 0 10px 10px; padding: 9px 10px; border-radius: 10px;
  color: var(--muted); font-weight: 500;
  transition: background-color .15s, color .15s;
}
.add-card:hover { background: var(--surface-2); color: var(--text); }
.add-card .icon svg { width: 15px; height: 15px; }

.composer { display: flex; flex-direction: column; gap: 8px; padding: 0 10px 10px; }
.composer-box {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--accent); background: var(--surface-2);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.composer-actions { display: flex; align-items: center; gap: 8px; }

.add-col {
  flex: 0 0 260px; height: 56px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px dashed var(--line); border-radius: 18px;
  color: var(--muted); font: 600 14px var(--font-display);
  transition: border-color .15s, color .15s;
}
.add-col:hover { border-color: var(--accent); color: var(--accent); }

.empty { margin: auto; flex-direction: column; text-align: center; color: var(--muted); font-family: var(--font-display); font-size: 16px; display: flex; align-items: center; gap: 10px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Dialog ── */
.dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line); border-radius: 22px;
  background: var(--surface); color: var(--text);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .7);
}
.dialog[open] { animation: pop .22s var(--ease); }
.dialog::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.dialog form { display: flex; flex-direction: column; gap: 16px; padding: 22px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.eyebrow {
  max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 3px 10px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font: 700 11px var(--font-display); text-transform: uppercase; letter-spacing: .14em;
}
.dlg-title {
  padding: 4px 0 10px;
  border: 0; border-bottom: 1.5px solid var(--line);
  background: transparent; outline: 0;
  font: 700 24px var(--font-display); letter-spacing: -.02em;
}
.dlg-title:focus { border-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > span, .field > legend { padding: 0; margin-bottom: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.field > span { margin-bottom: 0; }
.field em { font-style: normal; opacity: .7; }
.field input, .field textarea {
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2);
  outline: 0; resize: vertical;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.row > .field:last-child { flex: 1; min-width: 150px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; transition: background-color .15s, color .15s; }
.seg span:hover { color: var(--text); }
.seg input:checked + span { background: var(--accent); color: var(--on-accent); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.dialog-foot { display: flex; align-items: center; gap: 8px; padding-top: 4px; }

/* ── Toast ── */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100;
  max-width: calc(100vw - 32px);
  padding: 10px 18px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 600;
  opacity: 0; transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }


/* ── Topbar extras ── */
.member-stack { display: flex; }
.member-stack .mini-avatar { box-shadow: 0 0 0 2px var(--bg); margin-left: -6px; }
.member-stack .mini-avatar:first-child { margin-left: 0; }
#historyBtn.on { background: var(--accent); color: var(--on-accent); }
.icon-btn:disabled { opacity: .35; pointer-events: none; }
.muted-note { color: var(--muted); font-size: 13px; padding: 8px 10px; margin: 0; list-style: none; }

/* ── History panel ── */
.panel {
  position: fixed; z-index: 28;
  top: calc(var(--topbar) + 10px); right: 10px; bottom: 10px;
  width: min(380px, calc(100vw - 20px));
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7);
  animation: slide-in .28s var(--ease);
}
@keyframes slide-in { from { opacity: 0; transform: translateX(24px); } }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 18px 12px; border-bottom: 1px solid var(--line); }
.panel-title { margin: 8px 0 0; font: 700 18px var(--font-display); letter-spacing: -.01em; overflow-wrap: anywhere; }
.feed { flex: 1; overflow-y: auto; padding: 0 18px 18px; }
.feed-day h3 {
  position: sticky; top: 0; margin: 0; padding: 14px 0 8px;
  background: var(--surface);
  font: 600 11px var(--font-display); text-transform: uppercase; letter-spacing: .14em; color: var(--muted);
}
.feed ol, .activity-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.entry { display: flex; gap: 10px; align-items: flex-start; }
.entry-body { min-width: 0; }
.entry-body p { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.entry-body b { font-weight: 600; }
.entry-body time { font-size: 11.5px; color: var(--muted); }

/* ── Card dialog activity ── */
.activity { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.activity:empty { display: none; }
.activity h4 { margin: 0; font: 600 11px var(--font-display); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.activity-meta { margin: 0; font-size: 12.5px; color: var(--muted); }
.activity-list { max-height: 180px; overflow-y: auto; gap: 10px; }
.activity-list .mini-avatar { width: 22px; height: 22px; font-size: 9px; }

/* ── Share dialog ── */
.dlg-heading { margin: 0; font: 700 24px var(--font-display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.dlg-sub { margin: -6px 0 0; color: var(--muted); font-size: 13.5px; }
.invite-row { display: flex; gap: 8px; }
.invite-row input {
  flex: 1; min-width: 0; height: 38px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); outline: 0;
}
.invite-row input:focus { border-color: var(--accent); }
.member-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.member { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: 0; }
.member-email { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .you { color: var(--muted); }

/* ── Trash view ── */
.board.is-trash { display: block; overflow: hidden auto; }
.trash { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; animation: rise .4s var(--ease) both; }
.trash-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.back-btn { align-self: flex-start; margin-bottom: -12px; }
.trash-heading { flex: 1; min-width: 220px; }
.trash-heading h2 { margin: 0; font: 700 clamp(36px, 5vw, 56px)/1 var(--font-display); letter-spacing: -.04em; }
.trash-heading p { margin: 8px 0 0; color: var(--muted); }
.trash-section h3 {
  display: flex; align-items: center; gap: 10px; margin: 0 0 10px;
  font: 600 12px var(--font-display); text-transform: uppercase; letter-spacing: .14em; color: var(--muted);
}
.trash-section ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.trash-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface);
}
.trash-kind { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.trash-text { flex: 1; min-width: 0; }
.trash-title { margin: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-meta { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.trash-actions { display: flex; gap: 6px; flex: none; }
.trash-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 64px 0; color: var(--muted); }
.trash-empty .icon svg { width: 36px; height: 36px; }
.btn.danger:hover { border-color: var(--accent); color: var(--accent); }

/* ───────────────────────── Responsive ───────────────────────── */
@media (min-width: 861px) { #menuBtn { display: none; } }

@media (max-width: 860px) {
  .splash { grid-template-columns: 1fr; }
  .splash-left { padding: 40px 20px; gap: 22px; }
  .splash-right { min-height: 320px; padding: 32px 16px; }
  .mock { width: min(460px, 100%); }

  .app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; }
  .topbar { gap: 8px; padding: 0 10px; }
  .brand-text, .divider, .search kbd { display: none; }
  .board-title { font-size: 17px; width: auto; flex: 1 1 0; min-width: 72px; padding: 5px 4px; }
  .topbar { gap: 4px; }
  .brand.small .brand-mark { display: none; }
  .spacer { display: none; }
  .search { width: 40px; padding: 0; justify-content: center; flex: none; }
  .search input { display: none; }
  .search.open { position: absolute; left: 10px; right: 10px; width: auto; padding: 0 12px; z-index: 2; justify-content: flex-start; }
  .search.open input { display: block; }
  .hide-sm { display: none; }
  #shareBtn { width: 36px; padding: 0; border: 0; }
  #shareBtn .icon svg { width: 18px; height: 18px; }

  .sidebar {
    position: fixed; z-index: 25;
    top: var(--topbar); bottom: 0; left: 0;
    width: min(290px, 85vw);
    transform: translateX(-105%);
    transition: transform .28s var(--ease);
  }
  .app.side-open .sidebar { transform: none; box-shadow: 20px 0 60px -20px rgba(0, 0, 0, .6); }
  .app.side-open::after { content: ''; position: fixed; inset: var(--topbar) 0 0; z-index: 20; background: rgba(0, 0, 0, .45); }

  .trash-row { flex-wrap: wrap; }
  .trash-actions { width: 100%; justify-content: flex-end; }
  .panel { top: calc(var(--topbar) + 6px); right: 6px; bottom: 6px; width: calc(100vw - 12px); }
  .member-stack { display: none; }
  .board { padding: 16px; gap: 12px; scroll-snap-type: x mandatory; scroll-padding: 16px; }
  .columns { gap: 12px; }
  .column { flex-basis: calc(100vw - 48px); scroll-snap-align: start; }
  .add-col { flex-basis: calc(100vw - 48px); scroll-snap-align: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
