/* Corkboard styles */
:root {
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg: #f7f8f9;
  --surface: #ffffff;
  --surface-2: #f1f2f4;
  --surface-3: #e4e6ea;
  --hover: rgba(9, 30, 66, 0.08);
  --text: #172b4d;
  --text-2: #44546f;
  --muted: #626f86;
  --border: #dcdfe4;
  --accent: #0c66e4;
  --accent-hover: #0055cc;
  --accent-ink: #ffffff;
  --danger: #c9372c;
  --danger-bg: #ffeceb;
  --card-shadow: 0 1px 1px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31);
  --pop-shadow: 0 8px 12px rgba(9, 30, 66, 0.15), 0 0 1px rgba(9, 30, 66, 0.31);
  --list-bg: #f1f2f4;
  --overlay: rgba(9, 30, 66, 0.55);
  --logo-ink: #ffffff;
  --ok: #1f845a;
  --warn-bg: #f8e6a0;
  --warn-ink: #533f04;
  --bad-bg: #ffd5d2;
  --bad-ink: #ae2e24;
  --ok-bg: #baf3db;
  --ok-ink: #164b35;
  --radius: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d2125;
    --surface: #22272b;
    --surface-2: #2c333a;
    --surface-3: #38414a;
    --hover: rgba(255, 255, 255, 0.08);
    --text: #dee4ea;
    --text-2: #b6c2cf;
    --muted: #8c9bab;
    --border: #38414a;
    --accent: #579dff;
    --accent-hover: #85b8ff;
    --accent-ink: #1d2125;
    --danger: #f87168;
    --danger-bg: #42221f;
    --card-shadow: 0 1px 1px rgba(3, 4, 4, 0.5), 0 0 1px rgba(3, 4, 4, 0.5);
    --pop-shadow: 0 8px 12px rgba(3, 4, 4, 0.36), 0 0 1px rgba(3, 4, 4, 0.5);
    --list-bg: #101204;
    --overlay: rgba(3, 4, 4, 0.65);
    --logo-ink: #1d2125;
    --ok: #4bce97;
    --warn-bg: #7f5f01;
    --warn-ink: #fff7d6;
    --bad-bg: #ae2e24;
    --bad-ink: #ffeceb;
    --ok-bg: #216e4e;
    --ok-ink: #dcfff1;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 14px/1.43 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }
#app { min-height: 100%; display: flex; flex-direction: column; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
hr { border: 0; border-top: 1px solid var(--border); margin: 8px 0; }
h1, h2, h3, h4 { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ic { display: inline-flex; width: 16px; height: 16px; flex: none; }
.ic svg { width: 100%; height: 100%; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- buttons & fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 6px 12px; border: 0; border-radius: 4px;
  background: var(--surface-3); color: var(--text); font-weight: 500;
}
.btn:hover { filter: brightness(0.96); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); filter: none; }
.btn.subtle { background: transparent; }
.btn.subtle:hover { background: var(--hover); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { min-height: 26px; padding: 3px 10px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn.big { min-height: 40px; font-size: 15px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none;
  border: 0; border-radius: 6px; background: transparent; color: var(--text-2);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.small { width: 26px; height: 26px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--muted); text-decoration: underline; text-align: left; }
.link-btn:hover { color: var(--text); }
.field {
  width: 100%; min-height: 36px; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: 4px; background: var(--surface);
  resize: vertical;
}
.field:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
textarea.field { line-height: 1.45; }

/* ---------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 12px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
body.on-board .topbar { background: rgba(0, 0, 0, 0.28); border-bottom-color: rgba(255, 255, 255, 0.12); color: #fff; backdrop-filter: blur(6px); }
.brand { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-weight: 700; font-size: 17px; padding: 4px 6px; border-radius: 4px; }
.brand .logo { width: 22px; height: 22px; color: var(--accent); }
body.on-board .brand .logo { color: #fff; --logo-ink: #1d2125; }
.brand:hover, .top-link:hover { background: var(--hover); }
body.on-board .brand:hover, body.on-board .top-link:hover { background: rgba(255, 255, 255, 0.16); }
.top-link { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 4px; color: inherit; text-decoration: none; font-weight: 500; }
.avatar-btn { border: 0; background: none; padding: 2px; border-radius: 50%; }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  user-select: none;
}
.avatar.sm { width: 22px; height: 22px; font-size: 9px; }
.avatar.lg { width: 40px; height: 40px; font-size: 15px; }
.avatar.more { background: var(--surface-3); color: var(--text); }

/* ---------- auth */
.auth { flex: 1; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.auth-card {
  width: 100%; max-width: 380px; padding: 32px 32px 24px;
  background: var(--surface); border-radius: 10px; box-shadow: var(--pop-shadow);
  display: flex; flex-direction: column; gap: 14px;
}
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 24px; font-weight: 800; }
.auth-brand .logo { width: 32px; height: 32px; color: var(--accent); }
.auth-card h1 { font-size: 16px; font-weight: 600; text-align: center; color: var(--text-2); margin-bottom: 4px; }
.auth-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.form-error { color: var(--danger); font-size: 13px; min-height: 0; }
.form-error:empty { display: none; }
.auth-switch { text-align: center; margin: 4px 0 0; font-size: 13px; }

/* ---------- home */
.home { width: 100%; max-width: 1100px; margin: 0 auto; padding: 32px 16px 48px; }
.home section + section { margin-top: 32px; }
.home h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 12px; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.board-tile {
  position: relative; height: 100px; border-radius: var(--radius); overflow: hidden;
  border: 0; color: #fff; box-shadow: var(--card-shadow);
}
.board-tile::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0); transition: background 0.12s; pointer-events: none; }
.board-tile:hover::after { background: rgba(0, 0, 0, 0.15); }
.tile-link { position: absolute; inset: 0; padding: 10px 12px; color: inherit; text-decoration: none; z-index: 1; }
.tile-title { font-weight: 700; font-size: 15px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); word-break: break-word; }
.tile-star {
  position: absolute; right: 8px; bottom: 8px; z-index: 2;
  display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 4px;
  background: transparent; color: #fff; opacity: 0; transition: opacity 0.12s, transform 0.12s;
}
.board-tile:hover .tile-star, .tile-star:focus-visible, .tile-star.on { opacity: 1; }
.tile-star:hover { transform: scale(1.15); }
.tile-star.on { color: #f5cd47; }
.tile-star.on svg, .bar-btn.on svg { fill: currentColor; }
.board-tile.new {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--surface-2); color: var(--text-2); font-weight: 500; box-shadow: none;
}
.board-tile.new:hover { background: var(--surface-3); }
.empty-hint { margin-top: 24px; }
.board-preview {
  height: 96px; border-radius: 6px; margin-bottom: 12px;
  display: flex; gap: 6px; padding: 10px 12px; justify-content: center; align-items: flex-start;
}
.board-preview div { width: 32px; height: 52px; border-radius: 3px; background: rgba(255, 255, 255, 0.75); }
.board-preview div:nth-child(2) { height: 34px; }
.board-preview div:nth-child(3) { height: 44px; }
.loading { flex: 1; display: grid; place-items: center; color: var(--muted); }
body.on-board .loading { color: #fff; }

/* ---------- board */
.board-view { flex: 1; display: flex; flex-direction: column; min-height: 0; height: calc(100vh - 48px); height: calc(100dvh - 48px); }
.board-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 12px; background: rgba(0, 0, 0, 0.18); color: #fff;
}
.board-title {
  font-size: 18px; font-weight: 700; padding: 4px 10px; border-radius: 4px; cursor: pointer;
  max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.board-title:hover { background: rgba(255, 255, 255, 0.2); }
.board-title-input { font-size: 18px; font-weight: 700; padding: 3px 9px; border: 0; border-radius: 4px; width: min(420px, 70vw); color: var(--text); background: var(--surface); }
.bar-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 0; border-radius: 4px; background: rgba(255, 255, 255, 0.2); color: #fff; font-weight: 500;
}
.bar-btn.icon-only { width: 32px; padding: 0; justify-content: center; background: transparent; }
.bar-btn:hover { background: rgba(255, 255, 255, 0.3); }
.bar-btn.on { color: #f5cd47; }
.filter {
  display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
  border-radius: 4px; background: rgba(255, 255, 255, 0.2);
}
.filter:focus-within { background: var(--surface); color: var(--text); }
.filter input { border: 0; background: transparent; outline: none; width: 150px; color: inherit; }
.filter input::placeholder { color: rgba(255, 255, 255, 0.8); }
.filter:focus-within input::placeholder { color: var(--muted); }
.member-stack { display: flex; padding: 0 4px; }
.member-stack .avatar { margin-left: -6px; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25); }
.member-stack .avatar:first-child { margin-left: 0; }

.board-canvas { flex: 1; overflow-x: auto; overflow-y: hidden; padding: 12px 6px 8px; }
.lists { display: flex; align-items: flex-start; height: 100%; padding: 0 6px; }
.list-wrap { flex: none; width: 272px; height: 100%; padding: 0 6px; }
.list {
  display: flex; flex-direction: column; max-height: 100%;
  background: var(--list-bg); border-radius: 12px; box-shadow: var(--card-shadow);
  padding-bottom: 8px;
}
.list-head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 4px 8px; cursor: grab; }
.list-title {
  flex: 1; min-width: 0; font-size: 14px; font-weight: 600; padding: 6px 8px;
  border-radius: 4px; overflow-wrap: anywhere; cursor: pointer;
}
.list-title-input { flex: 1; min-width: 0; font-weight: 600; padding: 5px 7px; border: 0; border-radius: 4px; box-shadow: inset 0 0 0 2px var(--accent); background: var(--surface); }
.list-count { font-size: 12px; color: var(--muted); }
.cards {
  display: flex; flex-direction: column; gap: 8px;
  min-height: 4px; padding: 2px 8px 2px; margin: 0 0 2px;
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
}
.card {
  position: relative; flex: none;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--card-shadow);
  cursor: pointer; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.card:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.card-cover { height: 32px; }
.card-body { padding: 8px 12px 6px; }
.card-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.card-label {
  min-width: 40px; height: 16px; padding: 0 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600; line-height: 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%;
}
.card-label:empty { min-width: 40px; height: 8px; }
.card-title { overflow-wrap: anywhere; padding-bottom: 2px; }
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin-top: 4px; color: var(--text-2); font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 4px; min-height: 22px; padding: 0 2px; border-radius: 3px; }
.badge .ic { width: 14px; height: 14px; }
.badge.due { padding: 0 4px; }
.badge.due.done, .badge.complete { background: var(--ok-bg); color: var(--ok-ink); padding: 0 4px; }
.badge.due.soon { background: var(--warn-bg); color: var(--warn-ink); }
.badge.due.overdue { background: var(--bad-bg); color: var(--bad-ink); }
.badge-members { display: flex; gap: 2px; margin-left: auto; }
.add-card {
  display: flex; align-items: center; gap: 6px; margin: 4px 8px 0; padding: 6px 8px;
  border: 0; border-radius: 6px; background: transparent; color: var(--text-2); text-align: left; font-weight: 500;
}
.add-card:hover { background: var(--hover); color: var(--text); }
.composer { padding: 4px 8px 0; display: flex; flex-direction: column; gap: 8px; }
.composer-input {
  width: 100%; min-height: 56px; padding: 8px 12px; resize: none; overflow: hidden;
  border: 0; border-radius: var(--radius); box-shadow: var(--card-shadow); background: var(--surface);
}
.composer-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.composer-actions { display: flex; align-items: center; gap: 4px; }
.add-list-wrap { flex: none; width: 272px; padding: 0 6px; }
.add-list {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 12px;
  border: 0; border-radius: 12px; background: rgba(255, 255, 255, 0.24); color: #fff; font-weight: 500; text-align: left;
}
.add-list:hover { background: rgba(255, 255, 255, 0.34); }
.list-composer { padding: 8px; }

/* drag and drop */
.drag-placeholder { opacity: 1; }
.drag-placeholder > * { visibility: hidden; }
.card.drag-placeholder { background: rgba(9, 30, 66, 0.12); box-shadow: none; }
.list-wrap.drag-placeholder > .list { background: rgba(0, 0, 0, 0.22); box-shadow: none; }
.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; margin: 0;
  box-shadow: 0 12px 24px rgba(9, 30, 66, 0.3) !important; opacity: 0.95; will-change: transform;
}
.drag-ghost.list-wrap { padding: 0; overflow: hidden; border-radius: 12px; }
.drag-ghost.list-wrap .cards { overflow: hidden; }

/* label colors (labels, covers, swatches) */
.lc-green { background: #4bce97; color: #164b35; }
.lc-yellow { background: #f5cd47; color: #533f04; }
.lc-orange { background: #fea362; color: #702e00; }
.lc-red { background: #f87168; color: #5d1f1a; }
.lc-purple { background: #9f8fef; color: #352c63; }
.lc-blue { background: #579dff; color: #09326c; }
.lc-sky { background: #6cc3e0; color: #164555; }
.lc-lime { background: #94c748; color: #37471f; }
.lc-pink { background: #e774bb; color: #50253f; }
.lc-black { background: #8590a2; color: #091e42; }

/* ---------- popovers */
.popover {
  position: fixed; z-index: 300; width: 304px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow: auto;
  background: var(--surface); color: var(--text); border-radius: var(--radius); box-shadow: var(--pop-shadow);
}
.popover.wide { width: 360px; }
.pop-head {
  position: sticky; top: 0; z-index: 1; background: var(--surface);
  display: grid; grid-template-columns: 26px 1fr 26px; align-items: center; padding: 8px 8px 4px;
  text-align: center; font-weight: 600; color: var(--text-2);
}
.pop-head span { grid-column: 2; }
.pop-head .icon-btn { grid-column: 3; }
.pop-body { padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.pop-section { display: flex; flex-direction: column; gap: 6px; }
.pop-label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; margin: 0 -4px; width: calc(100% + 8px);
  border: 0; border-radius: 4px; background: transparent; text-align: left;
}
.menu-item:hover { background: var(--hover); }
.menu-item.danger { color: var(--danger); }
.menu-item.on { background: var(--hover); }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.swatch { height: 32px; border: 0; border-radius: 4px; }
.swatches.bg .swatch { height: 40px; }
.swatch.selected { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.label-list { display: flex; flex-direction: column; gap: 4px; }
.label-row { display: flex; align-items: center; gap: 8px; }
.label-row input { width: 16px; height: 16px; flex: none; }
.label-chip {
  min-height: 32px; min-width: 48px; padding: 0 12px; border: 0; border-radius: 4px;
  font-weight: 600; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%;
}
.label-chip.wide { flex: 1; }
.label-chip:hover { filter: brightness(0.94); }
.preview-box { padding: 16px; margin: 0 -12px; background: var(--surface-2); display: grid; place-items: center; }
.label-preview { min-width: 48px; min-height: 32px; max-width: 100%; padding: 6px 12px; border-radius: 4px; font-weight: 600; overflow-wrap: anywhere; }
.member-list { display: flex; flex-direction: column; gap: 8px; }
.member-row { display: flex; align-items: center; gap: 8px; }
.archived-row { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.archived-row:last-child { border-bottom: 0; }
.account-head { display: flex; align-items: center; gap: 12px; padding: 4px 0 8px; }

/* ---------- card modal */
.overlay {
  position: fixed; inset: 0; z-index: 200; overflow-y: auto;
  background: var(--overlay); padding: 48px 16px;
}
.modal {
  position: relative; width: 100%; max-width: 768px; margin: 0 auto;
  background: var(--surface-2); border-radius: 12px; padding: 20px 24px 24px;
  box-shadow: var(--pop-shadow);
}
.modal-cover { height: 96px; margin: -20px -24px 16px; border-radius: 12px 12px 0 0; }
.modal-close { position: absolute; top: 10px; right: 10px; z-index: 1; }
.modal-cover + .modal-close { background: rgba(255, 255, 255, 0.5); }
.archived-banner {
  display: flex; align-items: center; gap: 8px; margin: -20px -24px 16px; padding: 12px 24px;
  background: var(--warn-bg); color: var(--warn-ink); border-radius: 12px 12px 0 0; font-weight: 500;
}
.modal-cover ~ .archived-banner { margin-top: -16px; border-radius: 0; }
.modal-header { display: flex; gap: 12px; align-items: flex-start; padding-right: 32px; margin-bottom: 16px; }
.head-ic { width: 22px; height: 22px; margin-top: 4px; color: var(--text-2); }
.modal-title { font-size: 20px; font-weight: 600; padding: 2px 6px; margin: 0 -6px; border-radius: 4px; cursor: pointer; overflow-wrap: anywhere; }
.modal-title:hover { background: var(--hover); }
.modal-title-input {
  width: calc(100% + 12px); margin: 0 -6px; padding: 2px 6px; font-size: 20px; font-weight: 600;
  border: 0; border-radius: 4px; resize: none; overflow: hidden; background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent);
}
.modal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 168px; gap: 24px; }
.modal-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; padding-left: 34px; }
.modal-side { display: flex; flex-direction: column; gap: 8px; }
.modal-side h4 { font-size: 12px; font-weight: 600; color: var(--text-2); margin-top: 8px; }
.modal-side h4:first-child { margin-top: 0; }
.side-btn {
  display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 6px 12px;
  border: 0; border-radius: 4px; background: var(--surface-3); text-align: left; font-weight: 500;
}
.side-btn:hover { filter: brightness(0.95); }
.side-btn.danger { background: var(--danger); color: #fff; }
.meta-row { display: flex; flex-wrap: wrap; gap: 16px 24px; }
.meta-row:empty { display: none; }
.meta h4 { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.meta-items { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.meta-items input[type=checkbox] { width: 16px; height: 16px; margin: 0 4px 0 0; }
.round-add { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--surface-3); }
.meta-items .label-chip + .round-add { border-radius: 4px; }
.due-tag { margin-left: 6px; padding: 0 6px; border-radius: 3px; font-size: 12px; }
.due-tag.done { background: var(--ok-bg); color: var(--ok-ink); }
.due-tag.soon { background: var(--warn-bg); color: var(--warn-ink); }
.due-tag.overdue { background: var(--bad-bg); color: var(--bad-ink); }
.section { display: flex; flex-direction: column; gap: 10px; }
.section-head { display: flex; align-items: center; gap: 12px; margin-left: -34px; }
.section-head > .ic { width: 22px; height: 22px; color: var(--text-2); }
.section-head h3 { flex: 1; font-size: 16px; font-weight: 600; }
.section-head h3.editable { cursor: pointer; padding: 2px 6px; margin: 0 -6px; border-radius: 4px; }
.section-head h3.editable:hover { background: var(--hover); }
.section-head .inline-edit { flex: 1; font-size: 15px; font-weight: 600; padding: 4px 8px; border: 0; border-radius: 4px; box-shadow: inset 0 0 0 2px var(--accent); background: var(--surface); }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; cursor: pointer; padding: 2px 0; }
.desc-empty {
  min-height: 56px; padding: 8px 12px; border: 0; border-radius: 4px; text-align: left;
  background: var(--surface-3); color: var(--text-2); font-weight: 500;
}
.desc-empty:hover { filter: brightness(0.96); }
.desc-editor { display: flex; flex-direction: column; gap: 8px; }
.progress { display: flex; align-items: center; gap: 10px; margin-left: -34px; }
.progress .pct { width: 24px; font-size: 11px; color: var(--muted); text-align: center; }
.progress .bar { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress .fill { height: 100%; background: var(--accent); transition: width 0.2s; }
.progress .fill.complete { background: var(--ok); }
.items { display: flex; flex-direction: column; margin-left: -34px; }
.check-item { display: flex; align-items: flex-start; gap: 12px; padding: 4px 0 4px 4px; border-radius: 6px; }
.check-item:hover { background: var(--hover); }
.check-item input { width: 16px; height: 16px; margin: 3px 0 0; flex: none; }
.check-item .item-text { flex: 1; min-width: 0; overflow-wrap: anywhere; cursor: pointer; padding-top: 1px; }
.check-item.done .item-text { text-decoration: line-through; color: var(--muted); }
.check-item .icon-btn { opacity: 0; }
.check-item:hover .icon-btn, .check-item .icon-btn:focus-visible { opacity: 1; }
.check-item .inline-edit { flex: 1; padding: 4px 8px; border: 0; border-radius: 4px; resize: none; overflow: hidden; background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); }
.item-composer { display: flex; flex-direction: column; gap: 8px; }
.item-composer textarea { resize: none; overflow: hidden; }
.checklist > .btn.subtle { align-self: flex-start; background: var(--surface-3); }
.comment { display: flex; gap: 12px; margin-left: -40px; }
.comment .grow { display: flex; flex-direction: column; gap: 4px; }
.comment.new textarea { resize: none; overflow: hidden; min-height: 38px; }
.comment-meta { display: flex; align-items: baseline; gap: 8px; }
.comment-body {
  padding: 8px 12px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--card-shadow);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.comment .link-btn { align-self: flex-start; }
.created { margin: 0; }

/* ---------- toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 1100; transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 6px;
  background: #172b4d; color: #fff; box-shadow: var(--pop-shadow);
  animation: toast-in 0.18s ease-out;
}
.toast.out { opacity: 0; transition: opacity 0.3s; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- responsive */
@media (max-width: 720px) {
  .modal-grid { grid-template-columns: 1fr; }
  .modal-side { display: grid; grid-template-columns: repeat(2, 1fr); }
  .modal-side h4 { grid-column: 1 / -1; }
  .overlay { padding: 16px 8px; }
  .modal { padding: 16px; }
  .modal-cover, .archived-banner { margin-left: -16px; margin-right: -16px; margin-top: -16px; }
  .hide-sm { display: none; }
  .filter input { width: 96px; }
  .board-title { max-width: 50vw; }
}
@media (max-width: 480px) {
  .modal-main { padding-left: 0; }
  .section-head, .progress, .items { margin-left: 0; }
  .section-head > .ic { display: none; }
  .comment { margin-left: 0; }
  .list-wrap, .add-list-wrap { width: 85vw; }
  .top-link span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
