:root {
  --bg: #F5F3EE;
  --surface: #FFFFFF;
  --ink: #1D2125;
  --ink-2: #5B6168;
  --line: #E3DED4;
  --accent: #1F6F5C;
  --accent-dark: #185A4A;
  --danger: #B42318;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(29, 33, 37, .06), 0 4px 12px rgba(29, 33, 37, .05);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 24px; background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand {
  display: flex; align-items: center; gap: 8px; flex: none;
  font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -.01em;
}
.logo {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg, #FFD66B 0 50%, #7FD1B0 50% 100%);
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .08);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-email { color: var(--ink-2); font-size: 14px; }

/* ---------- Buttons and tags ---------- */
.btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 14px;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, border-color .15s;
}
.btn:hover { border-color: #CFC8BB; background: #FAF8F4; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: rgba(0, 0, 0, .04); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.tag { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #E6F2EE; color: var(--accent); white-space: nowrap; }
.tag.muted { background: #EFECE6; color: var(--ink-2); }
.tag.warn { background: #FDEBD3; color: #8A4B08; }

.icon-btn {
  width: 32px; height: 32px; flex: none; display: inline-grid; place-items: center;
  border: 0; background: transparent; border-radius: 8px; color: var(--ink-2);
}
.icon-btn:hover:not(:disabled) { background: rgba(0, 0, 0, .06); color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.ic { display: inline-grid; place-items: center; }
.ic svg { width: 16px; height: 16px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--ink-2); font-size: 12px; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
  background: #fff; outline: none; width: 100%;
}
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 111, 92, .15); }
.form-error { color: var(--danger); font-size: 13px; min-height: 1.2em; margin: 0 0 10px; }
.link-btn { border: 0; background: none; color: var(--accent); padding: 0; font-size: 13px; font-weight: 600; }
.hint { color: var(--ink-2); font-size: 13px; margin: 0 0 8px; }

/* ---------- Dashboard ---------- */
.page-dash main { max-width: 1100px; margin: 0 auto; padding: 32px 24px 64px; }
.loading { color: var(--ink-2); padding: 48px 0; text-align: center; }

.auth-card {
  max-width: 400px; margin: 40px auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow);
}
.auth-card h1 { margin: 0 0 4px; font-size: 22px; }
.auth-card .sub { color: var(--ink-2); margin: 0 0 20px; font-size: 14px; }
.auth-card .btn.primary { width: 100%; justify-content: center; padding: 10px; }
.forgot { text-align: center; margin: 14px 0 0; }
.tabs { display: flex; background: #F1EEE8; border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 8px; font-weight: 600; color: var(--ink-2); }
.tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 14px; }
.section-head h1 { font-size: 20px; margin: 0; letter-spacing: -.01em; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 40px; }
.tpl-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow);
}
.tpl-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.tpl-card h3 { margin: 0; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; align-content: flex-start; }
.chip { font-size: 12px; padding: 3px 8px; border-radius: 6px; background: var(--c, #eee); color: #2A2A2A; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.chip.empty { background: #F1EEE8; color: var(--ink-2); }
.tpl-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.board-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 40px; }
.board-row {
  display: flex; align-items: center; gap: 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px;
}
.board-info { flex: 1; min-width: 0; }
.board-name { font-weight: 600; color: var(--ink); text-decoration: none; }
.board-name:hover { text-decoration: underline; }
.meta { color: var(--ink-2); font-size: 13px; display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { color: var(--ink-2); padding: 28px; text-align: center; border: 1px dashed #D5CFC3; border-radius: var(--radius); margin: 0; }

/* ---------- Dialog ---------- */
.modal {
  position: fixed; border: 0; border-radius: 16px; padding: 0;
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
}
.modal::backdrop { background: rgba(29, 33, 37, .4); }
.modal form { padding: 24px; }
.modal h2 { margin: 0 0 18px; font-size: 19px; }
.col-editor { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.col-row { display: flex; gap: 6px; align-items: center; }
.swatch { width: 34px; height: 34px; flex: none; border-radius: 8px; border: 1px solid rgba(0, 0, 0, .1); background: var(--c); }
.col-row { position: relative; }
.palette {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 10;
  display: grid; grid-template-columns: repeat(6, 32px); gap: 6px; padding: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .16);
}
.palette-swatch {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, .12);
  background: var(--c); display: grid; place-items: center; padding: 0;
}
.palette-swatch:hover { transform: scale(1.08); }
.palette-swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.palette-swatch.selected::after { content: "✓"; font-weight: 800; font-size: 15px; color: #1D2125; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.modal-actions .btn { white-space: nowrap; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px);
  background: #1D2125; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Board page ---------- */
.page-board { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.board-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.board-title h1 { font-size: 17px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.votes-left { font-size: 13px; font-weight: 600; color: var(--ink-2); background: #F1EEE8; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.owner-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.banner { background: #FDF3E1; color: #7A4A0A; padding: 8px 24px; font-size: 14px; border-bottom: 1px solid #F2DEB8; }

.board { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 20px 24px; min-height: 0; overflow: hidden; }
.columns { flex: 1; display: flex; gap: 16px; overflow-x: auto; overflow-y: hidden; min-height: 0; padding-bottom: 2px; }
.column {
  flex: 1 1 0; min-width: 240px; position: relative; display: flex; flex-direction: column; min-height: 0;
  background: color-mix(in srgb, var(--c) 22%, #fff);
  border: 1px solid color-mix(in srgb, var(--c) 65%, #fff);
  border-radius: 14px; transition: box-shadow .15s;
}
.column.drop-target { box-shadow: 0 0 0 3px var(--accent); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; }
.col-head::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); filter: saturate(1.6) brightness(.85); }
.col-head h2 { font-size: 15px; margin: 0; flex: 1; }
.count { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.notes { flex: 1; overflow-y: auto; padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 10px; min-height: 60px; }
.col-empty { color: var(--ink-2); font-size: 13px; text-align: center; margin: 18px 0; }

.note {
  background: var(--c); border-radius: 8px; padding: 10px 12px 6px; position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 2px 6px rgba(0, 0, 0, .05);
  cursor: grab;
}
.note.mine::after {
  content: ""; position: absolute; top: 9px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%; background: rgba(0, 0, 0, .3);
}
.note-text { margin: 0 0 6px; padding-right: 10px; white-space: pre-wrap; word-break: break-word; }
.note-edit { background: rgba(255, 255, 255, .7); margin-bottom: 6px; resize: vertical; }
.note-foot { display: flex; align-items: center; gap: 2px; }
.spacer { flex: 1; }
.note .icon-btn { width: 28px; height: 28px; color: rgba(0, 0, 0, .5); }
.vote {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid rgba(0, 0, 0, .12); background: rgba(255, 255, 255, .55);
  border-radius: 999px; padding: 2px 10px 2px 8px; font-size: 13px; font-weight: 600; color: #333;
}
.vote .ic svg { width: 11px; height: 11px; }
.vote:hover:not(:disabled) { background: rgba(255, 255, 255, .9); }
.vote.voted { background: var(--ink); color: #fff; border-color: var(--ink); }
.vote.voted:hover:not(:disabled) { background: #33393F; color: #fff; }
.vote:disabled { cursor: default; opacity: .8; }
.my-votes {
  display: inline-flex; align-items: center; gap: 2px; margin-left: 6px;
  font-size: 12px; font-weight: 600; color: #333; background: rgba(255, 255, 255, .55);
  border-radius: 999px; padding: 1px 2px 1px 8px; border: 1px solid rgba(0, 0, 0, .1);
}
.unvote {
  width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent;
  font-size: 15px; line-height: 1; font-weight: 700; color: #333; display: inline-grid; place-items: center;
}
.unvote:hover { background: rgba(0, 0, 0, .1); }
.inline-field { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.inline-field input { width: 90px; }
.grip { display: none; width: 28px; height: 28px; place-items: center; color: rgba(0, 0, 0, .45); touch-action: none; }

.note.dragging { opacity: .35; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; box-shadow: 0 14px 32px rgba(0, 0, 0, .22); }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }

.composer {
  padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px;
  border-top: 1px solid color-mix(in srgb, var(--c) 55%, #fff);
}
.composer textarea { resize: none; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.composer-foot small { color: var(--ink-2); font-size: 11px; }

.empty-state { margin: auto; text-align: center; color: var(--ink-2); max-width: 420px; }
.empty-state h2 { color: var(--ink); }

/* ---------- Records lane ---------- */
.lane {
  --c: #E9E4DA;
  flex: none; height: 210px; min-height: 150px; max-height: 70vh; position: relative;
  display: flex; flex-direction: column;
  background: #FBFAF7; border: 1.5px dashed #CFC8BB; border-radius: 14px; transition: box-shadow .15s;
}
/* Drag the top edge to make the lane taller or shorter */
.lane-resize { position: absolute; left: 24px; right: 24px; top: -11px; height: 10px; cursor: row-resize; z-index: 3; touch-action: none; }
.lane-resize::after {
  content: ""; position: absolute; left: 50%; top: 3px; width: 44px; height: 4px; margin-left: -22px;
  border-radius: 4px; background: #D9D3C8; transition: background .15s;
}
.lane-resize:hover::after, body.is-resizing-lane .lane-resize::after { background: #B5AC9C; }
body.is-resizing-lane, body.is-resizing-lane * { cursor: row-resize !important; user-select: none; }
.lane.drop-target { box-shadow: 0 0 0 3px var(--accent); }
.lane-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px 6px; }
.lane-head h2 { font-size: 15px; margin: 0; }
.lane-head .count { margin-left: auto; }
.lane-body { flex: 1; display: flex; gap: 12px; padding: 4px 12px 12px; min-height: 0; }
/* One row that scrolls sideways; when the lane is made taller, cards wrap into more rows */
.lane-notes {
  flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: row; flex-wrap: nowrap;
  align-items: flex-start; align-content: flex-start; gap: 10px;
  overflow-x: auto; overflow-y: hidden; padding: 2px 2px 8px;
}
.lane.multi-row .lane-notes { flex-wrap: wrap; overflow-x: hidden; overflow-y: auto; }
.lane-notes > .note { flex: 0 0 240px; max-height: 100%; overflow: hidden; }
.lane.multi-row .lane-notes > .note { max-height: none; }
.lane-notes .col-empty { margin: 10px 0; }
.lane .composer { width: 280px; flex: none; border-top: 0; border-left: 1px solid var(--line); padding: 0 0 0 12px; }
.chip.lane-chip { background: #F1EEE8; color: var(--ink-2); border: 1px dashed #CFC8BB; }

/* ---------- Groups ---------- */
.group {
  background: #fff; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--c) 75%, #000 6%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 0 -1px #fff, 0 4px 0 0 color-mix(in srgb, var(--c) 80%, #000 8%);
  margin-bottom: 4px;
}
.group.open { box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .05); margin-bottom: 0; }
.group-head { display: flex; align-items: center; gap: 2px; padding: 4px 4px 4px 2px; }
.group-toggle {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  border: 0; background: none; padding: 6px 8px; border-radius: 8px; text-align: left; color: var(--ink);
}
.group-toggle:hover { background: rgba(0, 0, 0, .04); }
.group.draggable .group-toggle { cursor: grab; }
.group-icon { color: color-mix(in srgb, var(--c) 55%, #000 35%); display: inline-grid; }
.group-icon svg { width: 18px; height: 18px; }
.group-icon.small svg { width: 14px; height: 14px; }
.group-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-meta { color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.chev { margin-left: auto; color: var(--ink-2); display: inline-grid; }
.vote-total {
  display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700;
  padding: 2px 10px 2px 8px; border-radius: 999px; background: var(--c); color: #333; margin: 0 4px;
}
.vote-total .ic svg { width: 11px; height: 11px; }
.group .icon-btn { width: 28px; height: 28px; }
.group-body { display: flex; flex-direction: column; gap: 8px; padding: 2px 10px 10px 22px; position: relative; }
.group-body::before { content: ""; position: absolute; left: 12px; top: 2px; bottom: 12px; width: 2px; border-radius: 2px; background: var(--c); }
.note.group-target, .group.group-target { outline: 3px solid var(--accent); outline-offset: 2px; }
.note.group-target::before {
  content: "Drop to group"; position: absolute; right: 8px; bottom: -11px; z-index: 2;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
}

/* ---------- Timer and menus ---------- */
.timer-box { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.page-board .topbar-right { margin-left: 12px; }
.timer {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px;
  background: #E6F2EE; color: var(--accent); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums;
}
.timer.expired { background: var(--danger); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .7; } }
@media (prefers-reduced-motion: reduce) { .timer.expired { animation: none; } }

.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 180px;
  display: flex; flex-direction: column; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}
.menu.left { left: 0; right: auto; }
.menu button { border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 6px; font-size: 14px; color: var(--ink); }
.menu button:hover { background: #F3F0EA; }
.btn.toggled { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.toggled:hover { background: #33393F; }
.btn.danger.primary, .modal .btn.danger { background: #fff; border-color: #F0C5C0; }

.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--ink); margin-bottom: 4px; }
.check input { margin-top: 3px; }
.field input:disabled { background: #F5F3EE; color: var(--ink-2); }
.modal-inner { padding: 24px; }

/* ---------- Report ---------- */
.page-report .report { max-width: 860px; margin: 0 auto; padding: 32px 24px 64px; }
.report-head .eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 700; color: var(--accent); margin: 0 0 4px; }
.report-head h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -.02em; }
.report-head .meta { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 24px 0 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.stat strong { font-size: 26px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-2); font-size: 13px; }
.report-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-top: 16px; break-inside: avoid; }
.report-section h2 { font-size: 17px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.swatch-dot { width: 12px; height: 12px; border-radius: 4px; background: var(--c); filter: saturate(1.5) brightness(.9); }
.muted { color: var(--ink-2); }
.small { font-size: 13px; font-weight: 500; }
.top-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.top-list li { padding-left: 4px; }
.top-list li > * { vertical-align: middle; }
.top-list .top-text { margin-right: 8px; }
.top-list .chip { margin-right: 8px; }
.card-list { list-style: none; margin: 0; padding: 0; }
.card-list > li { border-top: 1px solid #EFEBE4; padding: 8px 0; }
.card-list > li:first-child { border-top: 0; }
.card-list.nested { margin: 6px 0 0 20px; border-left: 2px solid #EFEBE4; padding-left: 12px; }
.card-list.nested > li { padding: 5px 0; border-top: 0; }
.row-line { display: flex; align-items: baseline; gap: 12px; }
.row-text { flex: 1; white-space: pre-wrap; word-break: break-word; display: inline-flex; gap: 6px; align-items: baseline; }
.row-votes { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.strong { font-weight: 650; color: var(--ink); }
.action-list .row-line { align-items: center; }
.row-meta { color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.status { flex: none; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.status.todo { background: #FDEBD3; color: #8A4B08; }
.status.done { background: #E6F2EE; color: var(--accent); }
.action-list li.is-done .row-text { text-decoration: line-through; color: var(--ink-2); }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .page-report .report { padding: 0; max-width: none; }
  .report-section, .stat { border-color: #ddd; }
}

/* ---------- Column resizing ---------- */
.col-resize { position: absolute; top: 12px; bottom: 12px; right: -12px; width: 8px; cursor: col-resize; z-index: 3; border-radius: 4px; touch-action: none; }
.col-resize::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; border-radius: 2px; background: transparent; transition: background .15s; }
.col-resize:hover::after, body.is-resizing .col-resize::after { background: #CFC8BB; }
body.is-resizing, body.is-resizing * { cursor: col-resize !important; user-select: none; }
.small-tag { font-size: 11px; padding: 1px 7px; }

/* ---------- Phase bar ---------- */
.phase-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 8px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.phase-steps { display: flex; align-items: center; gap: 4px; background: #F1EEE8; padding: 3px; border-radius: 10px; }
.phase {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent;
  padding: 5px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2);
}
button.phase:hover { background: rgba(255, 255, 255, .7); color: var(--ink); }
.phase.current { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.phase-num {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  font-size: 11px; background: rgba(0, 0, 0, .08);
}
.phase.current .phase-num { background: rgba(255, 255, 255, .25); }
.phase-open { margin-right: 6px; position: relative; }
.phase-open::after { content: ""; position: absolute; right: -6px; top: 6px; bottom: 6px; width: 1px; background: #D9D3C8; }
.phase-hint { margin: 0; color: var(--ink-2); font-size: 14px; flex: 1; min-width: 200px; }

/* ---------- Action items ---------- */
.action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; font-size: 12px; }
.done-label { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: #333; cursor: pointer; }
.done-tick { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.done-tick:disabled { cursor: default; }
.owner-chip, .due-chip {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .65); border: 1px solid rgba(0, 0, 0, .08); font-weight: 600; color: #333; white-space: nowrap;
}
.owner-chip.empty { color: rgba(0, 0, 0, .45); font-weight: 500; }
.due-chip.overdue { background: #FDE2DF; border-color: #F3B7B0; color: var(--danger); }
.small-link { font-size: 12px; }
.note.is-done .note-text { text-decoration: line-through; color: rgba(0, 0, 0, .5); }
.action-toggle {
  flex: none; border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  padding: 0 10px; height: 34px; border-radius: 8px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.action-toggle.on { background: #E6F2EE; border-color: #B9DACF; color: var(--accent); }

/* ---------- Previous actions panel ---------- */
#prevActions:empty { display: none; }
.prev-actions { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; flex: none; }
.prev-head {
  width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: none;
  padding: 10px 14px; text-align: left; color: var(--ink); border-radius: 12px;
}
.prev-head:hover { background: #FAF8F4; }
.prev-head .chev { margin-left: auto; }
.prev-list { list-style: none; margin: 0; padding: 0 14px 10px; max-height: 22vh; overflow-y: auto; }
.prev-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid #F1EEE8; font-size: 14px; }
.prev-list .prev-text { flex: 1; min-width: 160px; }
.prev-list li.is-done .prev-text { text-decoration: line-through; color: var(--ink-2); }

/* ---------- Discussion panel ---------- */
.focus-layer {
  position: fixed; left: 50%; top: 118px; transform: translateX(-50%); z-index: 40;
  width: min(760px, calc(100vw - 32px));
}
.focus-panel {
  background: #fff; border-radius: 18px; padding: 20px 24px;
  box-shadow: 0 24px 60px rgba(29, 33, 37, .28), 0 0 0 1px rgba(0, 0, 0, .04);
  max-height: calc(100vh - 150px); overflow-y: auto;
}
.focus-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.focus-count { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.focus-head .btn { margin-left: auto; }
.focus-text { font-size: 26px; line-height: 1.3; margin: 0 0 8px; white-space: pre-wrap; word-break: break-word; letter-spacing: -.01em; }
.focus-title { font-size: 26px; font-weight: 700; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.focus-title .group-icon svg { width: 24px; height: 24px; }
.focus-meta { color: var(--ink-2); margin: 0 0 10px; font-weight: 600; }
.focus-members { list-style: none; margin: 0; padding: 0; }
.focus-members li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid #F1EEE8; font-size: 16px; }
.focus-add { display: flex; gap: 8px; margin-top: 16px; }
.focus-add .btn { white-space: nowrap; }
.focus-nav { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.focus-nav #focusEnd { margin: 0 auto; }

/* ---------- QR code screen ---------- */
.qr-layer { position: fixed; inset: 0; z-index: 90; background: rgba(29, 33, 37, .55); display: grid; place-items: center; padding: 16px; }
.qr-panel { background: #fff; border-radius: 20px; padding: 28px 32px; text-align: center; width: min(560px, 100%); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
.qr-panel .eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 13px; font-weight: 700; color: var(--accent); margin: 0 0 4px; }
.qr-panel h2 { margin: 0 0 16px; font-size: 24px; }
.qr-code { width: min(70vh, 420px, 100%); aspect-ratio: 1; margin: 0 auto; }
.qr-code svg { width: 100%; height: 100%; display: block; }
.qr-url { font-size: 13px; color: var(--ink-2); word-break: break-all; margin: 14px 0 18px; }
.qr-actions { display: flex; justify-content: center; gap: 8px; }

/* ---------- Question dice ---------- */
.dice-scene { --size: 170px; --half: calc(var(--size) / 2); width: var(--size); height: var(--size); perspective: 1400px; position: relative; margin: 20px auto 30px; }
.dice-scene::after {
  content: ""; position: absolute; left: 10%; right: 10%; bottom: -30px; height: 20px;
  background: radial-gradient(closest-side, rgba(29,33,37,.22), transparent); filter: blur(2px);
}
.dice-scene.rolling::after { animation: dice-shadow 1.6s cubic-bezier(.2,.7,.2,1); }
@keyframes dice-shadow { 30% { transform: scale(.6); opacity: .5; } 100% { transform: scale(1); opacity: 1; } }
.dice-bob { width: 100%; height: 100%; transform-style: preserve-3d; }
.dice-scene.rolling .dice-bob { animation: dice-hop 1.6s cubic-bezier(.2,.7,.2,1); }
@keyframes dice-hop { 0% { transform: translateY(0); } 30% { transform: translateY(-34px); } 70% { transform: translateY(0); } 82% { transform: translateY(-7px); } 100% { transform: translateY(0); } }
.dice-cube { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 1.6s cubic-bezier(.2,.7,.2,1); }
.dice-cube.idle { animation: dice-idle 9s linear infinite; transition: none; }
@keyframes dice-idle { from { transform: rotateX(-22deg) rotateY(0deg); } to { transform: rotateX(-22deg) rotateY(360deg); } }
.dice-face {
  position: absolute; inset: 0; border-radius: 18%; background: var(--fc, #fff);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.06), inset 0 -10px 24px rgba(0,0,0,.07), inset 0 10px 20px rgba(255,255,255,.6);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  backface-visibility: hidden; user-select: none;
}
.dice-icon { font-size: calc(var(--size) * .36); line-height: 1; }
.dice-name { font-weight: 700; font-size: calc(var(--size) * .085); color: rgba(29,33,37,.75); max-width: 86%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dice-pips { display: none; position: absolute; inset: 14%; grid-template: repeat(3, 1fr) / repeat(3, 1fr); }
.dice-pip { width: 58%; aspect-ratio: 1; border-radius: 50%; background: #1D2125; place-self: center; }
.dice-cube.numbers .dice-icon, .dice-cube.numbers .dice-name { display: none; }
.dice-cube.numbers .dice-pips { display: grid; }
.df1 { transform: rotateY(0deg) translateZ(var(--half)); }
.df6 { transform: rotateY(180deg) translateZ(var(--half)); }
.df2 { transform: rotateY(90deg) translateZ(var(--half)); }
.df5 { transform: rotateY(-90deg) translateZ(var(--half)); }
.df3 { transform: rotateX(90deg) translateZ(var(--half)); }
.df4 { transform: rotateX(-90deg) translateZ(var(--half)); }

/* Dice game screen */
.page-dice { min-height: 100vh; }
.dice-room {
  max-width: 1080px; margin: 0 auto; padding: 40px 24px 64px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 48px; align-items: center;
}
.dice-room-stage { display: grid; place-items: center; min-height: 360px; }
.page-dice .dice-scene { --size: min(230px, 50vw); margin: 40px auto 50px; }
.dice-room-card {
  background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 28px 30px;
  box-shadow: 0 1px 2px rgba(29,33,37,.05), 0 12px 36px rgba(29,33,37,.07);
  display: flex; flex-direction: column; gap: 16px; min-height: 300px; justify-content: center;
}
.page-dice .dice-question { font-size: clamp(24px, 3vw, 36px); }
.dice-history { margin-top: 6px; }
.dice-history summary { cursor: pointer; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.dice-history ol { margin: 10px 0 0; padding-left: 22px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.page-dice .empty-state { grid-column: 1 / -1; }
.seg { display: inline-flex; background: #F1EEE8; border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.dice-status { margin: 0; color: var(--ink-2); font-size: 16px; font-weight: 600; }
.dice-status.your-turn { color: var(--accent); font-size: 22px; font-weight: 800; }
.dice-face-label { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.dice-badge { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 26px; background: var(--fc, #F1EEE8); flex: none; }
.dice-face-label .eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.dice-cat { margin: 2px 0 0; font-weight: 700; font-size: 17px; }
.dice-question { margin: 0; font-size: clamp(22px, 2.6vw, 30px); font-weight: 750; line-height: 1.22; letter-spacing: -.015em; text-wrap: balance; }
.dice-question.fresh { animation: dice-rise .45s ease-out; }
@keyframes dice-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.dice-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dice-roll-btn { font-size: 18px; padding: 12px 26px; border-radius: 12px; }

/* Dice sets on the dashboard and in dialogs */
.dice-icons { display: flex; gap: 6px; flex-wrap: wrap; }
.dice-icon-chip { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 18px; background: #F5F3EE; border: 1px solid var(--line); }
.tpl-card .meta { margin: 0; }
.modal.wide { width: min(860px, calc(100vw - 32px)); }
.side-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.side-edit {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; grid-template-columns: 40px 1fr; gap: 8px;
  background: color-mix(in srgb, var(--fc) 18%, #fff);
}
.side-num { grid-row: span 3; width: 40px; height: 40px; border-radius: 10px; background: var(--fc); display: grid; place-items: center; font-weight: 800; }
.side-row { display: flex; gap: 6px; }
.emoji-input { width: 56px !important; flex: none; text-align: center; font-size: 18px; }
.side-edit textarea { resize: vertical; font-size: 14px; }
.side-edit small { color: var(--ink-2); font-size: 12px; }
.dice-pick-list { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; }
.dice-pick {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; text-align: left;
  border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 14px;
}
.dice-pick:hover { border-color: var(--accent); background: #F6FBF9; }
.dice-pick-icons { font-size: 18px; letter-spacing: 2px; }

@media (max-width: 700px) {
  .dice-room { grid-template-columns: 1fr; gap: 24px; padding-top: 16px; }
  .dice-room-stage { min-height: 300px; }
  .side-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .dice-cube { transition-duration: .4s; }
  .dice-cube.idle { animation: none; transform: rotateX(-22deg) rotateY(-30deg); }
  .dice-scene.rolling .dice-bob, .dice-scene.rolling::after { animation: none; }
}

/* ---------- Area menu and home screen ---------- */
.area-nav { display: flex; gap: 2px; margin-left: 12px; }
.area-nav a { padding: 6px 12px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; }
.area-nav a:hover { background: #F3F0EA; color: var(--ink); }
.area-nav a.current { background: #E6F2EE; color: var(--accent); }
.home-title { font-size: 26px; letter-spacing: -.02em; margin: 12px 0 24px; }
.home-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.home-tile {
  display: flex; flex-direction: column; gap: 8px; padding: 24px; min-height: 230px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.home-tile:hover { transform: translateY(-3px); border-color: #CFC8BB; box-shadow: 0 6px 24px rgba(29,33,37,.1); }
.home-tile strong { font-size: 19px; letter-spacing: -.01em; margin-top: auto; }
.home-tile > span:last-child { color: var(--ink-2); font-size: 14px; }
.tile-art { height: 90px; display: flex; align-items: center; gap: 8px; font-size: 64px; line-height: 1; }
.tile-retro .tile-art span { width: 38px; height: 46px; border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.tile-retro .tile-art span:nth-child(1) { background: #B5E8C8; transform: rotate(-6deg); }
.tile-retro .tile-art span:nth-child(2) { background: #FFC1B6; transform: rotate(3deg); }
.tile-retro .tile-art span:nth-child(3) { background: #BFD7FF; transform: rotate(-2deg); }
.tile-cards .tile-art span { width: 52px; height: 72px; border-radius: 8px; box-shadow: 0 3px 8px rgba(0,0,0,.12); }
.tile-cards .tile-art span:nth-child(1) { background: repeating-linear-gradient(45deg, #2F4A44 0 6px, #36564F 6px 12px); transform: rotate(-8deg); }
.tile-cards .tile-art span:nth-child(2) { background: #FFE38A; transform: rotate(6deg) translateX(-14px); }

/* ---------- Question bank and board setup ---------- */
.cat-dot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; background: var(--c); margin-right: 8px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.08); }
.cat-card { border-top: 6px solid var(--c); }
.cat-sample { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink); display: flex; flex-direction: column; gap: 4px; flex: 1; }
.palette-inline { display: flex; flex-wrap: wrap; gap: 6px; }
.mix-list { display: flex; flex-direction: column; gap: 6px; }
.mix-row { display: grid; grid-template-columns: auto 1fr auto 80px; align-items: center; gap: 10px; font-size: 14px; }
.mix-row .cat-dot { margin: 0; }
.mix-name { font-weight: 600; }
.mix-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.card-rows { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; padding-right: 4px; }
.card-row { display: grid; grid-template-columns: 30px 140px 1fr 32px; gap: 6px; align-items: center; border-left: 5px solid var(--c); padding-left: 6px; border-radius: 4px; }
.card-num { font-size: 12px; color: var(--ink-2); font-weight: 700; text-align: right; }
select { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; color: var(--ink); }

/* ---------- Game pages ---------- */
.page-game { min-height: 100vh; }
.pick-game { max-width: 1100px; margin: 0 auto; padding: 24px 24px 64px; display: flex; flex-direction: column; gap: 18px; }
.pick-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 18px; box-shadow: var(--shadow);
}
.pick-status { margin: 0; flex: 1; font-weight: 600; color: var(--ink-2); font-size: 16px; }
.pick-status.your-turn { color: var(--accent); font-size: 22px; font-weight: 800; }
.pick-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.spotlight {
  background: #fff; border-radius: 18px; padding: 22px 26px; border: 1px solid var(--line);
  border-left: 10px solid var(--c); box-shadow: 0 10px 30px rgba(29,33,37,.08);
}
.spotlight.fresh { animation: dice-rise .5s ease-out; }
.spot-text { margin: 10px 0 0; font-size: clamp(22px, 3vw, 32px); font-weight: 750; line-height: 1.25; letter-spacing: -.015em; text-wrap: balance; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.pcard { border: 0; padding: 0; background: none; aspect-ratio: 3 / 4; perspective: 900px; cursor: default; }
.pcard-inner { display: block; position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.pcard.flipped .pcard-inner { transform: rotateY(180deg); }
.pcard-back, .pcard-front {
  position: absolute; inset: 0; border-radius: 12px; backface-visibility: hidden; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 10px; box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.pcard-back { background: repeating-linear-gradient(45deg, #2F4A44 0 8px, #36564F 8px 16px); border: 4px solid #fff; }
.pcard-back.by-cat { background: var(--back); background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.25) 0 8px, transparent 8px 16px); }
.pcard-mark { font-size: 34px; font-weight: 800; color: rgba(255,255,255,.85); }
.pcard-back.by-cat .pcard-mark { color: rgba(29,33,37,.45); }
.pcard-front { background: var(--c); transform: rotateY(180deg); gap: 6px; text-align: center; }
.pcard-cat { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: rgba(29,33,37,.6); }
.pcard-text { font-size: 12.5px; font-weight: 600; color: #1D2125; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; }
.pcard.used .pcard-front { filter: grayscale(.85); opacity: .5; }
.pcard.clickable { cursor: pointer; }
.pcard.clickable .pcard-inner { transition: transform .8s cubic-bezier(.2,.7,.2,1), translate .15s; }
.pcard.clickable:hover .pcard-inner, .pcard.clickable:focus-visible .pcard-inner { translate: 0 -6px; }
.pcard.clickable .pcard-back { box-shadow: 0 0 0 3px var(--accent), 0 6px 14px rgba(0,0,0,.18); }
.pcard:disabled { opacity: 1; }

/* Two Truths and a Lie */
.truths-game { max-width: 820px; margin: 0 auto; padding: 32px 24px 64px; }
.truths-panel { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 28px 30px; box-shadow: 0 12px 36px rgba(29,33,37,.07); display: flex; flex-direction: column; gap: 14px; }
.truths-panel .eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.truths-panel h2 { margin: 0; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.015em; }
.big-count { font-size: 34px !important; }
.card-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.card-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 12px; border: 1.5px dashed #CFC8BB; color: var(--ink-2); font-size: 13px; }
.card-tile.ready { border: 1.5px solid #B9DACF; background: #E6F2EE; color: var(--accent); }
.card-tile strong { color: var(--ink); }
.truth-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; margin-bottom: 10px; }
.truth-num { width: 28px; height: 28px; border-radius: 50%; background: #F1EEE8; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.truth-row textarea { resize: vertical; }
.truth-pick { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; cursor: pointer; }
.truth-pick input { accent-color: var(--accent); width: 18px; height: 18px; }
.banner-inline { margin: 0; background: #FDF3E1; color: #7A4A0A; padding: 8px 12px; border-radius: 10px; font-size: 14px; }
.statements { display: flex; flex-direction: column; gap: 10px; }
.statement {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; text-align: left;
  border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 16px 18px; font-size: 19px; font-weight: 650; color: var(--ink);
}
.statement:not(:disabled):hover { border-color: var(--accent); background: #F6FBF9; cursor: pointer; }
.statement:disabled { cursor: default; opacity: 1; }
.statement.chosen { border-color: var(--accent); background: #E6F2EE; }
.statement.is-true { border-color: var(--status-good, #2E8B57); background: #E5F5EC; }
.statement.is-lie { border-color: #C0392B; background: #FDECEA; }
.statement.is-lie .statement-badge, .truths-summary .is-lie .statement-badge { background: #C0392B; color: #fff; }
.statement-badge { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 3px 10px; border-radius: 999px; background: #F1EEE8; color: var(--ink-2); }
.statement.is-true .statement-badge, .truths-summary .is-true .statement-badge { background: #2E8B57; color: #fff; }
.statement-votes { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.truths-meta { margin: 0; color: var(--ink-2); font-weight: 600; }
.truths-note { margin: 0; font-size: 17px; font-weight: 700; color: var(--accent); }
.truths-note.mine { color: #8A4B08; }
.truths-summary { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 14px; }
.truths-summary ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.truths-summary li.is-true, .truths-summary li.is-lie { font-weight: 700; }
.truths-summary .statement-badge { margin-left: 8px; }
.small-check { font-size: 13px; color: var(--ink-2); margin: 0; align-items: center; }

/* Touch screens: drag from the grip so the page still scrolls */
@media (pointer: coarse) {
  .grip { display: inline-grid; }
  .note { cursor: default; }
  .composer-foot small { display: none; }
}

@media (max-width: 860px) {
  .home-tiles { grid-template-columns: 1fr; }
  .home-tile { min-height: 0; }
  .area-nav { order: 3; width: 100%; margin: 0; overflow-x: auto; }
}
@media (max-width: 700px) {
  .card-row { grid-template-columns: 24px 1fr 32px; }
  .card-row select { grid-column: 2; }
  .card-row input { grid-column: 2; }
  .pick-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
  .phase-bar { padding: 8px 14px; }
  .phase-steps { overflow-x: auto; max-width: 100%; }
  .focus-layer { top: 70px; }
  .focus-text, .focus-title { font-size: 20px; }
  .col-resize { display: none; }
  .timer-box { margin-left: 0; order: 3; }
  .lane { height: 260px; }
  .lane-body { flex-direction: column; }
  .lane .composer { width: auto; border-left: 0; padding: 0; }
  .topbar { padding: 10px 14px; flex-wrap: wrap; gap: 10px; }
  .board { padding: 14px; gap: 12px; }
  .column { flex-basis: 84vw; }
  .board-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-dash main { padding: 20px 14px 48px; }
}

.board-list .show-all { align-self: center; margin-top: 4px; }

/* ---------- Picture retros ---------- */
.board.picture-mode { overflow: auto; }
.pic-board { display: flex; gap: 16px; align-items: flex-start; }
.pic-wrap { flex: 1; min-width: 0; overflow-x: auto; border-radius: 12px; }
.pic-wrap .pic-stage { min-width: 760px; } /* small screens scroll sideways instead of squashing the cards */
.pic-stage {
  position: relative; border-radius: 12px; overflow: hidden; background: #DDE7EE;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 20px rgba(0, 0, 0, .06); cursor: copy;
  user-select: none;
}
.pic-img { display: block; width: 100%; height: auto; min-height: 200px; pointer-events: none; }
.pic-missing { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted, #666); }
.pic-labels, .pic-notes { position: absolute; inset: 0; pointer-events: none; }
.pic-labels { z-index: 2; } /* labels stay readable; a hovered card comes to the front */
.note.pnote:hover, .note.pnote:focus-within { z-index: 4; }
.pic-label {
  position: absolute; transform: translate(-50%, -50%); pointer-events: auto;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 6px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; line-height: 1.2;
  background: #fff; color: #222; border: 3px solid var(--c);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18); cursor: default;
}
.pic-label .count:not(:empty) { background: var(--c); border-radius: 999px; padding: 1px 7px; font-size: 12px; }
.pic-label.movable { cursor: grab; }
.pic-label.moving { cursor: grabbing; box-shadow: 0 6px 18px rgba(0, 0, 0, .28); z-index: 5; }
.pic-label.near { outline: 3px solid var(--accent); outline-offset: 2px; }
.note.pnote {
  position: absolute; pointer-events: auto; width: clamp(130px, 13vw, 190px); font-size: 13px;
  padding: 8px 10px 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); cursor: default;
}
.note.pnote.draggable { cursor: grab; }
.note.pnote .note-text { margin-bottom: 4px; }
.note.pnote .icon-btn { width: 24px; height: 24px; }
.pic-side {
  flex: none; width: 260px; position: sticky; top: 0; background: #fff; border-radius: 12px;
  padding: 14px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 20px rgba(0, 0, 0, .06);
}
.pic-side h2 { font-size: 16px; margin: 0 0 10px; }
.pic-side select, .pic-pop select { width: 100%; }
.pic-side textarea { width: 100%; margin-top: 6px; }
.pic-side .hint { margin: 10px 0 0; font-size: 13px; }
.pic-pop {
  position: absolute; z-index: 6; width: 240px; background: #fff; border-radius: 10px; padding: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .28); display: flex; flex-direction: column; gap: 8px; cursor: default;
}
.pic-pop textarea { width: 100%; }
.pic-pop-actions { display: flex; justify-content: flex-end; gap: 6px; }
@media (max-width: 900px) {
  .pic-board { flex-direction: column; }
  .pic-side { width: 100%; position: static; }
}

/* Picture chooser in the setup dialog */
.pic-chooser .pic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 6px; }
.pic-tile { position: relative; }
.pic-pick, .pic-upload {
  width: 100%; display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: 10px;
  border: 2px solid transparent; background: #F4F2EE; cursor: pointer; font: inherit; font-size: 12px; text-align: center;
}
.pic-pick img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 7px; display: block; }
.pic-pick span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pic-tile.selected .pic-pick { border-color: var(--accent); background: #fff; }
.pic-upload { justify-content: center; align-items: center; min-height: 100px; border: 2px dashed #CFC9BF; color: #555; }
.pic-plus { font-size: 26px; line-height: 1; }
.pic-remove {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; font-size: 16px; line-height: 1;
}
.tpl-thumb { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; margin: 4px 0 8px; background: #E9EEF2; }
.tpl-thumb-blank { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 2px dashed #CFC9BF; background: #F7F5F1; color: #666; font-size: 13px; }
.tpl-thumb-blank span:first-child { font-size: 26px; line-height: 1; }

/* ---------- Main tiles: own colour, centred, lift on hover ---------- */
.page-dash .tpl-card {
  --tile: #FFFFFF;
  background: color-mix(in srgb, var(--tile) 38%, #FFFFFF);
  border-color: color-mix(in srgb, var(--tile) 70%, #FFFFFF);
  text-align: center; align-items: center;
  transition: transform .15s, box-shadow .15s;
}
.page-dash .tpl-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(29, 33, 37, .12); }
.page-dash .tpl-card .tpl-top { flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.page-dash .tpl-card .chips, .page-dash .tpl-card .tpl-actions, .page-dash .tpl-card .dice-icons { justify-content: center; }
.page-dash .tpl-card .chips { flex: 0 1 auto; }
.page-dash .tpl-card .tpl-actions { margin-top: auto; }
.page-dash .tpl-card .tpl-thumb { align-self: stretch; }
.page-dash .tpl-card .cat-sample { text-align: left; align-self: stretch; }
.page-dash .tpl-card .tag.muted { background: rgba(255, 255, 255, .7); }
.page-dash .cat-card { border-top-width: 1px; }
.home-tile { align-items: center; text-align: center; }
.home-tile .tile-art { justify-content: center; }
.home-tile strong { margin-top: 8px; }
.tile-retro { background: color-mix(in srgb, #B5E8C8 40%, #FFFFFF); border-color: #B5E8C8; }
.tile-dice { background: color-mix(in srgb, #BFD7FF 40%, #FFFFFF); border-color: #BFD7FF; }
.tile-cards { background: color-mix(in srgb, #FFE38A 40%, #FFFFFF); border-color: #FFE38A; }
.truths-art { height: 56px; gap: 10px; font-size: 22px; font-weight: 700; }
.truths-art span { width: 40px; height: 48px; display: grid; place-items: center; border-radius: 8px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.1); color: #2E8B57; }
.truths-art span:last-child { color: #C0392B; transform: rotate(6deg); }

/* ---------- Backgrounds ---------- */
body.has-bg { background: var(--page-bg); background-attachment: fixed; min-height: 100vh; }
.bg-chooser { display: flex; flex-direction: column; gap: 10px; }
.bg-tabs { display: inline-flex; gap: 4px; background: #EFECE6; padding: 3px; border-radius: 9px; align-self: flex-start; }
.bg-tabs button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.bg-tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.bg-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.bg-swatch { display: flex; flex-direction: column; gap: 4px; padding: 3px; border: 2px solid transparent; border-radius: 10px; background: none; cursor: pointer; font: inherit; font-size: 11px; color: var(--ink-2); }
.bg-swatch-fill { display: block; height: 40px; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.bg-swatch.selected { border-color: var(--accent); color: var(--ink); }
.bg-custom { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.bg-colour { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.bg-colour input { width: 44px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }
.bg-overlay { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); margin-top: 6px; flex-wrap: wrap; }
.bg-preview-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.bg-preview { flex: 1; height: 44px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); background-size: cover !important; background-position: center !important; }

/* Dice question mix */
.mix-rows { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 6px; }
.mix-row { display: grid; grid-template-columns: 36px 1fr 90px auto; align-items: center; gap: 10px; }
.mix-icon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-size: 20px; }
.mix-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mix-pct { display: inline-flex; align-items: center; gap: 4px; }
.mix-pct input { width: 64px; }
.mix-total { font-size: 13px; color: var(--ink-2); margin: 4px 0 0; }
.modal-actions .spacer { flex: 1; }
@media (max-width: 520px) { .mix-row { grid-template-columns: 32px 1fr 80px; } .mix-row .btn { grid-column: 2 / -1; justify-self: start; } }

/* Nicknames */
.nick-badge { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.nick-badge strong { color: var(--ink); }
.nick-badge:hover { border-color: #CFC8BB; }
.nick-edit { color: var(--accent); }
.people-chip { cursor: pointer; position: relative; }
.people-chip:hover { filter: brightness(.96); }
.people-pop { position: absolute; top: 52px; z-index: 50; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: 0 8px 28px rgba(0,0,0,.15); min-width: 180px; max-height: 60vh; overflow: auto; font-size: 14px; }
.people-pop ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.turn-name { color: var(--accent); }

/* Invites (owner only) */
.invite-new { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 36px; }
.fresh-invite:not([hidden]) { margin-top: -20px; }
.invite-new .field { flex: 1; min-width: 240px; margin: 0; }
.fresh-invite { background: #E6F2EE; border: 1px solid #B9DACF; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 40px; display: flex; flex-direction: column; gap: 8px; }
.fresh-invite .eyebrow { margin: 0; }
.invite-code { font: 700 26px/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; margin: 0; }
.invite-link { font-size: 13px; color: var(--ink-2); word-break: break-all; margin: 0; }
.invite-code-small { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; }
.access-choices { display: flex; flex-direction: column; gap: 10px; }
.access-until { display: flex; align-items: center; gap: 10px; }
.small { font-size: 13px; }
.forgot .dot { color: var(--ink-2); margin: 0 6px; }

/* Votes: up = total (add one), down = mine (take one back) */
.note-foot { gap: 6px; }
.vote.unvote-btn { background: rgba(255, 255, 255, .55); color: var(--ink); border-color: rgba(0, 0, 0, .18); }
.vote.unvote-btn:hover:not(:disabled) { background: #fff; }
.vote.voted { background: rgba(255, 255, 255, .55); color: var(--ink); border-color: rgba(0, 0, 0, .12); }
.vote.voted:hover:not(:disabled) { background: rgba(255, 255, 255, .9); color: var(--ink); }

/* Main tiles: slightly larger text */
.page-dash .tpl-card h3 { font-size: 18px; }
.page-dash .tpl-card .chip { font-size: 13.5px; }
.page-dash .tpl-card .meta, .page-dash .tpl-card .tag, .page-dash .tpl-card .cat-sample, .page-dash .tpl-card .tpl-thumb-blank { font-size: 14px; }
.home-tile strong { font-size: 21px; }
.home-tile > span:last-child { font-size: 15px; }

/* Account type */
.account-type { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #EEF1F4; color: #46525E; white-space: nowrap; }
.account-type.owner { background: #FFF1C9; color: #7A5A00; }
.account-line { margin: -6px 0 22px; color: var(--ink-2); font-size: 14px; }

/* Pop-ups: close button and confirm boxes */
.dialog-close {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: transparent; color: var(--ink-2); font-size: 16px; line-height: 1; cursor: pointer;
}
.dialog-close:hover { background: #F1EEE8; color: var(--ink); }
.modal h2 { padding-right: 36px; }
.modal.confirm { width: min(420px, calc(100vw - 32px)); }
.confirm-text { margin: -8px 0 16px; color: var(--ink-2); line-height: 1.5; }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-solid:hover { filter: brightness(.94); }

/* Discussion comments */
.focus-comments { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px; max-height: 180px; overflow: auto; }
.focus-comment { display: flex; align-items: flex-start; gap: 8px; background: #F6F4EF; border-radius: 10px; padding: 7px 10px; font-size: 14px; }
.focus-comment span { flex: 1; white-space: pre-wrap; overflow-wrap: anywhere; }
.focus-comment.is-action { background: #E6F2EE; box-shadow: inset 3px 0 0 var(--accent); }
.focus-comment .icon-btn { width: 24px; height: 24px; flex: none; }
.from-chip { flex-basis: 100%; font-size: 11.5px; color: var(--ink-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment-list { list-style: none; margin: 4px 0 2px 14px; padding: 0 0 0 10px; border-left: 2px solid #E4E0D8; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; color: var(--ink-2); }

/* Moving columns */
.col-head.col-movable { cursor: grab; }
.col-head.col-movable:active { cursor: grabbing; }
.column.col-dragging { opacity: .35; }
.col-ghost { position: fixed; z-index: 60; pointer-events: none; border-radius: var(--radius); background: color-mix(in srgb, var(--c) 45%, #fff); box-shadow: 0 16px 40px rgba(0,0,0,.22); padding: 14px; font-weight: 700; transform: rotate(1.5deg); opacity: .95; }
.col-drop-marker { position: fixed; z-index: 59; width: 4px; border-radius: 2px; background: var(--accent); pointer-events: none; }
body.moving-column { cursor: grabbing; user-select: none; }

/* Dice set editor: colours and mix */
button.side-num { border: 2px solid rgba(0,0,0,.08); cursor: pointer; font: inherit; font-weight: 800; color: var(--ink); }
button.side-num:hover { border-color: rgba(0,0,0,.25); }
.field-hint { display: block; color: var(--ink-2); font-size: 12.5px; margin: -2px 0 6px; }
.mix-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mix-foot .mix-total { margin: 0; }
.dice-icon-chip { border-radius: 8px; }
.mix-meta { color: var(--accent) !important; font-weight: 600; }

/* Choose who goes next */
.person-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; margin-bottom: 10px; }
.person { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font: inherit; cursor: pointer; text-align: left; }
.person:hover { border-color: var(--accent); background: #F3F9F7; }
.person-name { font-weight: 700; }
.person-goes { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.person.had-go { background: #F4F2EE; color: #8A8F94; }
.person.had-go .person-name { font-weight: 600; }
.person.current { box-shadow: inset 3px 0 0 var(--accent); }

/* Facilitator navigation on boards and games */
.game-nav { display: flex; align-items: center; gap: 10px; margin-left: 4px; }
.back-link { font-size: 13.5px; font-weight: 600; color: var(--accent); text-decoration: none; padding: 5px 10px; border-radius: 8px; white-space: nowrap; }
.back-link:hover { background: #E6F2EE; }
.game-nav-links { display: none; }
.game-nav-small { position: relative; }
.game-nav-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 160px; display: flex; flex-direction: column; }
.game-nav-menu[hidden] { display: none; }
.game-nav-menu a { padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 14px; }
.game-nav-menu a:hover, .game-nav-menu a.current { background: #F1EEE8; }
@media (min-width: 1500px) {
  .game-nav-links { display: flex; }
  .game-nav-small { display: none; }
}
.mix-editor { max-width: 600px; }

/* Action history */
.ah-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 18px 0 16px; }
.ah-filters .field { margin: 0; min-width: 150px; }
.ah-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 36px; }
.ah-summary .stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.ah-summary .stat strong { font-size: 26px; }
.ah-summary .stat span { color: var(--ink-2); font-size: 13px; }
.ah-summary .stat.warn strong { color: var(--danger); }
.ah-row { align-items: center; }
.ah-row.overdue { border-left: 4px solid var(--danger); }
.ah-row.stuck { background: #FFF7E8; }
.ah-tick input { width: 20px; height: 20px; cursor: pointer; }
.ah-retros { display: flex; flex-direction: column; gap: 10px; margin-bottom: 40px; }
.ah-retro { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.ah-retro-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ah-retro-head .board-name { color: var(--ink); text-decoration: none; }
.ah-retro p { margin: 0; }
.ah-bar { height: 8px; border-radius: 4px; background: #F1EEE8; overflow: hidden; }
.ah-bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.ah-filters input, .ah-filters select { height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }

/* Temporary cover */
.cover-banner { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 9px 16px; background: #FFF4D6; border-bottom: 1px solid #F0DFA8; font-size: 14px; color: #5C4A10; text-align: center; }
.cover-head { margin-top: 44px; }
.cover-intro { margin: -8px 0 14px; }
.cover-sub { font-size: 15px; margin: 10px 0 2px; color: var(--ink-2); }
.cover-items { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.cover-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.cover-item:hover { background: #F6F4EF; }
.cover-item-name { flex: 1; font-weight: 600; }
