/* Tickboard. Light and dark follow the phone (or Settings → Look). --brand / --ink-on-brand come from Settings → Branding. */
:root {
  --brand: #12a36a; --brand-ink: #fff; --accent: #12a36a; --accent-ink: #fff;
  --bg: #f3f5f7; --card: #fff; --card2: #f7f8fa; --line: #e3e7eb; --text: #17191c; --muted: #66707a; --faint: #98a1aa;
  --over: #d93a2f; --today: #c77700; --soon: #a07a00; --done: #2e9d5b; --flag: #e0471f;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --r: 14px; --top: env(safe-area-inset-top, 0px); --bot: env(safe-area-inset-bottom, 0px);
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #111315; --card: #1b1e21; --card2: #22262a; --line: #2e3338; --text: #eef1f3; --muted: #a2abb3; --faint: #6f7880;
  --over: #ff6b5e; --today: #f0a53a; --soon: #e0c050; --done: #4cc27e; --flag: #ff7a50;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Segoe UI", Helvetica, Arial, sans-serif; -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-size: 16px; } /* 16px: no zoom on iPhone */
a { color: var(--accent); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

/* ---- the top bar: the buyer's logo on their colour */
.top { position: sticky; top: 0; z-index: 20; background: var(--brand); color: var(--brand-ink); padding: calc(var(--top) + 8px) calc(var(--sr) + 12px) 10px calc(var(--sl) + 12px); box-shadow: 0 1px 0 rgba(0, 0, 0, .08); }
.top-row { display: flex; align-items: center; gap: 10px; min-height: 48px; max-width: 1100px; margin: 0 auto; }
.brandmark { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.brandmark img { max-height: 44px; max-width: min(240px, 60vw); object-fit: contain; display: block; }
.brandmark .bname { font-weight: 700; font-size: 20px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brandmark .bname.small { font-size: 15px; font-weight: 600; opacity: .9; }
.ibtn { appearance: none; border: 0; background: transparent; color: inherit; width: 44px; height: 44px; border-radius: 12px; display: inline-grid; place-items: center; cursor: pointer; }
.ibtn:active { background: rgba(127, 127, 127, .18); }
.top .ibtn.on { background: rgba(255, 255, 255, .2); }
.search { max-width: 1100px; margin: 8px auto 0; display: flex; gap: 8px; }
.search .q { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--card); color: var(--text); border-radius: 12px; padding: 0 12px; min-height: 46px; box-shadow: var(--shadow); }
.search .q svg { color: var(--faint); width: 20px; height: 20px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 10px 0; }
.search .clear { border: 0; background: var(--card2); color: var(--muted); border-radius: 50%; width: 26px; height: 26px; cursor: pointer; }
.seg { display: inline-flex; background: rgba(0, 0, 0, .14); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: transparent; color: inherit; border-radius: 9px; padding: 0 12px; min-height: 40px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 600; font-size: 14px; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* ---- the page */
.main { max-width: 1100px; margin: 0 auto; padding: 12px calc(var(--sr) + 12px) calc(var(--bot) + 96px) calc(var(--sl) + 12px); position: relative; z-index: 1; }
/* 🏞 the background picture (Settings → Branding): behind the list and the board, faded by "How much shows" */
.bgpic { position: fixed; inset: 0; z-index: 0; background: center / cover no-repeat; pointer-events: none; }
input[type="range"].rng { accent-color: var(--accent); width: 150px; max-width: 45vw; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip .n { opacity: .7; font-weight: 500; }
.chip select { border: 0; background: transparent; font-weight: 600; font-size: 14px; outline: 0; appearance: none; padding-right: 2px; cursor: pointer; }

.grp { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); margin: 0 0 12px; overflow: hidden; }
.grp > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; font-weight: 700; }
.grp > summary::-webkit-details-marker { display: none; }
.grp > summary .dot { width: 12px; height: 12px; border-radius: 4px; background: var(--accent); flex: none; }
.grp > summary .n { color: var(--muted); font-weight: 500; font-size: 14px; }
.grp > summary .chev { margin-left: auto; color: var(--faint); transition: transform .15s; }
.grp[open] > summary .chev { transform: rotate(90deg); }
.list { border-top: 1px solid var(--line); }
.flat { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }

.row { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px 11px 8px; border-bottom: 1px solid var(--line); cursor: pointer; }
.row:last-child { border-bottom: 0; }
.row:active { background: var(--card2); }
.tick { flex: none; appearance: none; border: 2px solid var(--faint); background: transparent; width: 28px; height: 28px; border-radius: 50%; margin: 2px 2px 0 4px; display: grid; place-items: center; color: transparent; cursor: pointer; padding: 0; }
.tick svg { width: 16px; height: 16px; stroke-width: 3; }
.tick.on { background: var(--done); border-color: var(--done); color: #fff; }
.tick.big { width: 36px; height: 36px; }
.tick.big svg { width: 20px; height: 20px; }
.row .body { flex: 1; min-width: 0; }
.row .t { font-weight: 600; overflow-wrap: anywhere; }
.row.done .t { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 4px; font-size: 13px; color: var(--muted); align-items: center; }
.meta .due.over { color: var(--over); font-weight: 700; }
.meta .due.today { color: var(--today); font-weight: 700; }
.meta .due.soon { color: var(--soon); font-weight: 600; }
.meta .flag { color: var(--flag); }
.meta .bd { display: inline-flex; align-items: center; gap: 5px; }
.meta .bd i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.who { display: inline-flex; }
.av { width: 22px; height: 22px; border-radius: 50%; background: var(--card2); border: 1px solid var(--line); color: var(--text); font-size: 10px; font-weight: 700; display: inline-grid; place-items: center; margin-left: -4px; }
.who .av:first-child { margin-left: 0; }
.st-doing { color: var(--accent); font-weight: 700; }
.bar { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; width: 54px; display: inline-block; vertical-align: middle; }
.bar i { display: block; height: 100%; background: var(--done); }

.empty { text-align: center; padding: 36px 18px; color: var(--muted); }
.empty .big { font-size: 44px; }
.empty h3 { color: var(--text); margin: 8px 0 6px; }
.donebox { margin-top: 4px; }
.donebox > summary { cursor: pointer; color: var(--muted); padding: 10px 4px; font-weight: 600; list-style: none; }
.donebox > summary::-webkit-details-marker { display: none; }

/* ---- ▦ the board: To do / Doing / Done */
.board { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.col { background: var(--card2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; min-height: 200px; scroll-snap-align: start; }
.col.drop { outline: 3px dashed var(--accent); outline-offset: -3px; }
.col h3 { margin: 2px 4px 10px; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.col h3 .n { color: var(--muted); font-weight: 500; }
.kc { -webkit-touch-callout: none; background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 10px 8px 12px; margin-bottom: 8px; cursor: pointer; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.kc .t { font-weight: 600; overflow-wrap: anywhere; }
.kc .mv { display: flex; justify-content: space-between; margin-top: 6px; }
.kc .mv button { border: 0; background: var(--card2); color: var(--muted); border-radius: 8px; min-width: 40px; height: 32px; cursor: pointer; font-weight: 700; }
.kc.ghost { position: fixed; z-index: 90; pointer-events: none; opacity: .92; transform: rotate(2deg); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.kc.lifted { opacity: .35; }
@media (max-width: 720px) { .board { grid-template-columns: repeat(3, 78vw); } }

/* ---- the floating ➕ */
.fab { position: fixed; right: calc(var(--sr) + 18px); bottom: calc(var(--bot) + 18px); z-index: 30; width: 62px; height: 62px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px rgba(0, 0, 0, .25); display: grid; place-items: center; cursor: pointer; }
.fab svg { width: 30px; height: 30px; stroke-width: 2.6; }
.fab:active { transform: scale(.96); }

/* ---- sheets: a task's card, new task, settings */
.sheet { position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; animation: up .18s ease-out; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sh-top { position: sticky; top: 0; z-index: 2; background: var(--brand); color: var(--brand-ink); padding: calc(var(--top) + 6px) calc(var(--sr) + 8px) 6px calc(var(--sl) + 8px); }
.sh-top .row2 { display: flex; align-items: center; gap: 6px; min-height: 48px; max-width: 900px; margin: 0 auto; }
.sh-top h2 { flex: 1; margin: 0; font-size: 18px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back { border: 0; background: transparent; color: inherit; font-size: 17px; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; padding: 8px 6px; cursor: pointer; min-width: 80px; }
.back svg { width: 24px; height: 24px; }
.sh-top .spacer { min-width: 80px; display: flex; justify-content: flex-end; }
.sh-body { max-width: 900px; margin: 0 auto; padding: 14px calc(var(--sr) + 14px) calc(var(--bot) + 40px) calc(var(--sl) + 14px); }
.box { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; margin-bottom: 14px; }
.box h4 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.box h4 .end { margin-left: auto; text-transform: none; letter-spacing: 0; }
.ttl { display: flex; gap: 10px; align-items: flex-start; }
.ttl { align-items: center; }
/* the title is a box to fill in, like the other fields (Nick: "show this in a box so that it looks like a form to fill in") */
.ttl textarea { flex: 1; border: 1px solid var(--line); outline: 0; background: var(--card2); border-radius: 10px; font-size: 20px; font-weight: 700; resize: none; padding: 9px 12px; line-height: 1.3; min-height: 48px; }
.ttl textarea:focus { border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 3px rgba(18, 163, 106, .15); }
.fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 12px; }
@media (max-width: 359px) { .fields { grid-template-columns: 1fr; } }
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fld input[type="date"], .fld input[type="datetime-local"] { min-width: 0; width: 100%; max-width: 100%; -webkit-appearance: none; appearance: none; }
.fld > span { font-size: 13px; color: var(--muted); font-weight: 600; }
.in, .fld input, .fld select, .fld textarea { width: 100%; border: 1px solid var(--line); background: var(--card2); border-radius: 10px; padding: 10px 12px; min-height: 46px; outline: 0; }
.in:focus, .fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--accent); background: var(--card); }
.fld textarea { min-height: 120px; resize: vertical; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { border: 1px solid var(--line); background: var(--card2); border-radius: 999px; padding: 7px 12px; font-size: 14px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.pill.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pill.add { border-style: dashed; color: var(--muted); }
.btn { appearance: none; border: 1px solid var(--line); background: var(--card2); color: var(--text); border-radius: 12px; padding: 10px 16px; min-height: 46px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.bad, .btn.sure { background: var(--over); border-color: var(--over); color: #fff; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.note { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.hint { color: var(--muted); font-size: 13px; }

/* ✍️ the writing box (DF's RTE: Markdown underneath) */
.rte-md { overflow-wrap: anywhere; }
.rte-md p { margin: 0 0 6px; }
.rte-md h3 { font-size: 18px; margin: 8px 0 6px; }
.rte-md h4 { font-size: 16px; margin: 8px 0 4px; }
.rte-md ul, .rte-md ol { margin: 4px 0 8px; padding-left: 22px; }
.desc { min-height: 30px; cursor: text; }
.desc.empty { color: var(--faint); }
.tools { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.tools button { border: 1px solid var(--line); background: var(--card2); border-radius: 8px; min-width: 40px; height: 36px; cursor: pointer; font-weight: 700; }
.edit { width: 100%; min-height: 160px; border: 1px solid var(--accent); border-radius: 10px; padding: 10px 12px; background: var(--card); outline: 0; resize: vertical; line-height: 1.45; }

/* ☑ checklists */
.cl { margin-bottom: 12px; }
.cl-h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.cl-h b { flex: 1; }
.cl-h .bar { width: 80px; }
.step { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.step.sub { padding-left: 30px; }
.step input[type=checkbox] { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--done); flex: none; }
.step .st { flex: 1; overflow-wrap: anywhere; cursor: text; }
.step.done .st { color: var(--muted); text-decoration: line-through; }
.step .x { border: 0; background: transparent; color: var(--faint); cursor: pointer; font-size: 15px; padding: 0 4px; min-height: 28px; }
.addrow { display: flex; gap: 6px; margin-top: 8px; }
.addrow input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--card2); border-radius: 10px; padding: 8px 10px; min-height: 42px; outline: 0; }

/* 📎 files */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.file { border: 1px solid var(--line); border-radius: 10px; background: var(--card2); overflow: hidden; cursor: pointer; position: relative; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-size: 12px; padding: 6px; }
.file img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.file .ic { font-size: 30px; }
.file .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.file .del { position: absolute; top: 4px; right: 4px; border: 0; border-radius: 50%; width: 26px; height: 26px; background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer; z-index: 1; }
.file .del.sure { background: var(--over); width: auto; border-radius: 8px; padding: 0 8px; }

/* 💬 updates + 🕘 activity */
.upd { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; margin: 10px 0; }
.upd .w { font-size: 12px; color: var(--muted); display: flex; gap: 8px; }
.upd .w button { border: 0; background: transparent; color: var(--faint); cursor: pointer; padding: 0; font-size: 12px; }
.upd .w button.sure { color: var(--over); font-weight: 700; }
.hist { font-size: 13px; color: var(--muted); }
.hist div { padding: 3px 0; }
details.fold > summary { cursor: pointer; color: var(--muted); font-weight: 600; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }

/* 🎨 branding preview + colours */
.bprev { border-radius: 14px; min-height: 96px; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px; margin-bottom: 12px; border: 1px solid var(--line); }
.bprev img { max-height: 72px; max-width: 80%; object-fit: contain; }
.bprev .bname { font-size: 22px; font-weight: 800; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; }
.sw { aspect-ratio: 1; border-radius: 12px; border: 2px solid rgba(0, 0, 0, .08); cursor: pointer; display: grid; place-items: center; }
.sw.on { outline: 3px solid var(--text); outline-offset: 2px; }
.sw.custom { background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); position: relative; overflow: hidden; }
.sw.custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.logo-pick { position: relative; overflow: hidden; }
.logo-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.srow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.srow:last-child { border-bottom: 0; }
.srow .grow { flex: 1; min-width: 0; }
.srow input.in { min-height: 40px; padding: 6px 10px; }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: .15s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: .15s; }
.switch input:checked + span { background: var(--done); }
.switch input:checked + span::after { transform: translateX(20px); }
.colourdot { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line); flex: none; position: relative; overflow: hidden; }
.colourdot input { position: absolute; inset: -6px; opacity: 0; cursor: pointer; }

/* the picture viewer */
.viewer { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .92); display: flex; align-items: center; justify-content: center; padding: calc(var(--top) + 50px) 10px calc(var(--bot) + 20px); }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .ibtn { position: absolute; top: calc(var(--top) + 8px); color: #fff; }
.viewer .close { right: 10px; }
.viewer .share { left: 10px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--bot) + 92px); transform: translateX(-50%); z-index: 99; background: #22262a; color: #fff; padding: 10px 16px; border-radius: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); max-width: 88vw; font-size: 15px; display: flex; gap: 12px; align-items: center; }
.toast button { border: 0; background: transparent; color: #7fe0a8; font-weight: 700; cursor: pointer; }

/* 🖨 the printout: only shown when printing */
.printout { display: none; }
@media print {
  body > *:not(.printout) { display: none !important; }
  .printout { display: block; color: #000; background: #fff; font-size: 12pt; }
  .printout .ph { padding: 14px 18px; border-radius: 10px; display: flex; align-items: center; gap: 14px; margin-bottom: 14px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .printout .ph img { max-height: 56px; max-width: 260px; object-fit: contain; }
  .printout table { width: 100%; border-collapse: collapse; }
  .printout th, .printout td { text-align: left; border-bottom: 1px solid #ccc; padding: 6px 4px; vertical-align: top; }
  .printout .box2 { width: 14px; height: 14px; border: 1.5px solid #333; border-radius: 3px; display: inline-block; }
}

/* 👥 Tickboard Team: members, invite code, comment authors */
.srow .av.big { width: 36px; height: 36px; font-size: 14px; flex: none; }
.upd .w .av { width: 20px; height: 20px; font-size: 10px; margin-right: 2px; }
.upd .w b { color: var(--text); font-weight: 600; }
.pill .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.invite { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--card2); border: 1px dashed var(--line); }
.invite .code { font: 700 28px/1.2 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .12em; text-align: center; padding: 8px 0; user-select: all; -webkit-user-select: all; }
.hist b { color: var(--text); font-weight: 600; }
.srow .av.big, .upd .w .av { margin-left: 0; }
/* ＋ New task at the top (Nick: "plus button at bottom add to top so you can see"); the round + stays at the bottom on phones */
.addtop { appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 10px; border-radius: 12px; background: var(--brand-ink); color: var(--brand); font-weight: 700; font-size: 15px; white-space: nowrap; flex: none; }
.addtop svg { width: 20px; height: 20px; stroke-width: 2.6; }
.addtop:active { transform: scale(.97); }
@media (max-width: 420px) { .addtop { padding: 0 10px; } .addtop span { display: none; } }
@media (min-width: 900px) { .fab { display: none; } }

/* ✉️ emails on a task */
.mailform, .mailpick { margin-top: 10px; display: grid; gap: 8px; }
.mrow { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; background: var(--card); }
.mrow:hover, .mrow:active { border-color: var(--accent); }
.mrow .w, .mail .w { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.mrow .w b, .mail .w b { color: var(--text); font-size: 14px; }
/* minmax(0,1fr) + min-width 0: a long subject or address can't make the cards wider than a phone (they ran off the right edge) */
.mails { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.mail { min-width: 0; border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: 14px; padding: 12px 14px; background: var(--card); box-shadow: var(--shadow); }
.mail.out { border-left-color: #64748b; background: var(--card2); }
.mail .mhead { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12px; color: var(--muted); padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px dashed var(--line); }
.mail .mhead .tag { font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.mail.out .mhead .tag { color: #64748b; }
.mail .mhead .num { margin-left: auto; }
.mail .who { display: block; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.mail .who b { color: var(--text); font-weight: 600; }
.mail .sub { font-weight: 700; margin: 4px 0 6px; overflow-wrap: anywhere; }
.mail .mbody { font-size: 15px; overflow-wrap: anywhere; }
.lnk { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 4px 0; font-weight: 600; }
.btn.on { border-color: var(--accent); color: var(--accent); }
.btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.mailpick { border: 2px solid var(--accent); border-radius: 14px; padding: 10px; background: var(--card2); }
.mailpick .mrow { max-height: none; }

/* ▦ boards side by side, each in its colour; one board → its To do / Doing / Done in its colour */
.board .col { border-top: 5px solid var(--bc, var(--line)); }
.board.byb { grid-auto-flow: column; }
.col.bcol h3 .dot { width: 12px; height: 12px; border-radius: 4px; background: var(--bc); flex: none; }
.kc { border-left: 4px solid var(--bc, transparent); }
.kc .kt { display: flex; gap: 8px; align-items: flex-start; }
.kc .kt .t { flex: 1; min-width: 0; padding-top: 2px; }
.tick.sm { width: 24px; height: 24px; min-width: 24px; }
.tick.sm svg { width: 14px; height: 14px; }
.bhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 800; font-size: 17px; margin: 0 0 10px; }
.bhead i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.bhead .hint { font-weight: 500; font-size: 13px; }
/* ℹ️ the work-mailbox guide (IT admin approval) */
.guide { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: var(--card2); font-size: 14px; }
.guide summary { cursor: pointer; font-weight: 600; }
.guide ol { padding-left: 20px; margin: 6px 0; }
.guide li { margin: 4px 0; }

/* ⠿ moving a board, ✎ renaming it on the main page */
.bgrip { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; color: var(--faint); font-size: 18px; line-height: 1; padding: 2px 4px 2px 0; }
.bgrip:active { cursor: grabbing; }
.cghost { position: fixed; z-index: 90; pointer-events: none; opacity: .9; transform: rotate(1.5deg); box-shadow: 0 12px 30px rgba(0, 0, 0, .25); max-height: 60vh; overflow: hidden; }
.col.lifted { opacity: .35; }
.bren { border: 0; background: none; color: var(--faint); cursor: pointer; font-size: 15px; padding: 2px 6px; border-radius: 8px; }
.bren:hover { color: var(--accent); background: var(--card2); }
.bren-in { min-height: 34px !important; padding: 4px 8px !important; font-weight: 700; width: auto; max-width: 220px; }

.bname-t.can { cursor: text; border-bottom: 1px dashed transparent; }
.bname-t.can:hover { border-bottom-color: var(--faint); }

/* ▴ a minimised email: one line (tap to open) */
.mail .mtog { border: 0; background: var(--card2); color: var(--muted); border-radius: 8px; min-width: 32px; height: 28px; cursor: pointer; font-size: 14px; }
.mail.min { padding: 8px 12px; cursor: pointer; }
.mail.min .mhead { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; flex-wrap: nowrap; }
.mail.min .msub { color: var(--text); font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail.min .num { margin-left: 0; }

/* ＋ New task under each board, ＋ New board after the last one */
.addtask { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 15px; padding: 10px 12px; cursor: pointer; border-radius: 10px; }
.addtask:hover { background: var(--card2); }
.col .addtask { padding: 8px 6px; }
.addboard { border: 2px dashed var(--line); background: none; color: var(--accent); font-weight: 700; font-size: 15px; cursor: pointer; border-radius: var(--r); }
.addboard:hover { border-color: var(--accent); }
.addboard.col { align-self: start; min-height: 64px; padding: 12px; }
.addboard.row { display: block; width: 100%; padding: 14px; margin: 0 0 12px; }

/* ▦ BDFIT (from DF): each column scrolls on its own, its name stays at the top */
.board .col { max-height: var(--colmax, calc(100dvh - 150px)); overflow-y: auto; }
.board .col h3 { position: sticky; top: -10px; z-index: 1; background: var(--card2); margin: -10px -10px 10px; padding: 12px 14px 8px; }
.board .addboard.col { max-height: none; overflow: visible; }
/* ▾ FILTBIG (from DF): bigger, easier pickers with a clear arrow */
.chip select { font-size: 16px; padding-right: 20px; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8f98' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 2px center / 13px; -webkit-appearance: none; }
.fld select { -webkit-appearance: none; appearance: none; font-size: 16px; padding-right: 38px; cursor: pointer; }
.fld select, .fld select:focus { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8f98' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
/* 📝 DESCBIG (from DF): on a laptop or tablet the description box is as big as the screen allows */
@media (min-width: 641px) { #descEd { min-height: calc(100dvh - 260px); } }

/* 🎓 the how-to guide */
.guide-in { border-left: 4px solid var(--accent); }
.guide-vid { padding: 0; overflow: hidden; background: #000; text-align: center; }
.guide-vid video { display: block; width: 100%; max-width: 380px; max-height: 72dvh; margin: 0 auto; background: #000; }
.gplay { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; border: 0; background: linear-gradient(160deg, rgba(255,255,255,.1), rgba(0,0,0,.3)), var(--accent); color: #fff; padding: 28px 16px; cursor: pointer; font-size: 17px; }
.gplay .gp { width: 58px; height: 58px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; font-size: 24px; padding-left: 4px; }
.gplay small { opacity: .8; font-size: 13px; }
.guide { padding: 0; }
.guide summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px; cursor: pointer; font-weight: 600; font-size: 16px; }
.guide summary::-webkit-details-marker { display: none; }
.guide .gi { width: 34px; height: 34px; border-radius: 10px; background: var(--card2); display: grid; place-items: center; font-size: 18px; flex: none; }
.guide .gt { flex: 1; min-width: 0; }
.guide .chev { color: var(--muted); font-size: 22px; transition: transform .15s; }
.guide[open] .chev { transform: rotate(90deg); }
.guide ol { margin: 0; padding: 0 16px 6px 42px; }
.guide li { margin: 0 0 10px; line-height: 1.45; }
.guide > .note { padding: 0 16px 14px; margin: 0; }

/* ☑ All checklists + 📋 templates (from DF's Actions) */
.lbar .srow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.lbar select.in { width: auto; min-height: 40px; padding: 6px 36px 6px 12px; }
.lbar .note { margin: 4px 0 0; }
.lchk { display: inline-flex; gap: 8px; align-items: center; font-size: 15px; }
.alc .alt { all: unset; cursor: pointer; font-weight: 700; font-size: 17px; display: block; margin-bottom: 4px; }
.alc .alt:hover { text-decoration: underline; }
.alc .cl { margin-top: 10px; }
.alc label.step { cursor: pointer; }
.sby { margin-left: auto; white-space: nowrap; font-size: 12px; }
.tplpick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; padding: 10px; border-radius: 10px; background: var(--card2); }
.tplpick .tpl { display: inline-flex; align-items: center; gap: 2px; }

/* 👤 top right: who's signed in, with Sign out */
.mebtn { appearance: none; border: 0; background: rgba(255, 255, 255, .16); color: inherit; height: 40px; border-radius: 20px; padding: 0 12px 0 4px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: 14px; max-width: 200px; flex: none; }
.mebtn .av { width: 32px; height: 32px; font-size: 12px; margin: 0; background: var(--card); color: var(--text); border: 0; }
.mebtn .mename { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .mebtn { padding: 0 4px; } .mebtn .mename { display: none; } }
.memenu { position: fixed; z-index: 60; top: calc(var(--top) + 62px); right: calc(var(--sr) + 12px); width: min(300px, calc(100vw - 24px)); background: var(--card); color: var(--text); border-radius: 14px; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); padding: 8px; }
.mm-who { display: flex; gap: 12px; align-items: center; padding: 8px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.mm-who .av { width: 40px; height: 40px; font-size: 14px; margin: 0; flex: none; }
.mm-who b { display: block; font-size: 16px; } .mm-who small { display: block; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.mm-i { display: block; width: 100%; text-align: left; border: 0; background: none; color: inherit; font-size: 16px; padding: 12px 10px; border-radius: 10px; cursor: pointer; }
.mm-i:hover { background: var(--card2); }
.mm-i.out { color: var(--over); font-weight: 600; }

/* ▦ more boards than fit: ‹ › at the edges, a scrollbar you can see, drag the empty space, the whole window width on a laptop */
body.bview .main { max-width: none; }
.bwrap { position: relative; }
.bnav { position: absolute; top: 8px; z-index: 6; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--text); box-shadow: 0 4px 14px rgba(0, 0, 0, .18); font-size: 28px; line-height: 1; cursor: pointer; display: none; place-items: center; padding: 0 0 4px; }
.bnav.l { left: -4px; } .bnav.r { right: -4px; }
.bnav:hover { border-color: var(--accent); color: var(--accent); }
.bwrap.canl .bnav.l, .bwrap.canr .bnav.r { display: grid; }
@media (hover: none) { .bwrap .bnav { display: none !important; } }
@media (hover: hover) {
  .board { scrollbar-width: auto; scrollbar-color: rgba(127, 127, 127, .55) rgba(127, 127, 127, .12); padding-bottom: 6px; }
  .board::-webkit-scrollbar { height: 12px; }
  .board::-webkit-scrollbar-track { background: rgba(127, 127, 127, .12); border-radius: 6px; }
  .board::-webkit-scrollbar-thumb { background: rgba(127, 127, 127, .55); border-radius: 6px; }
}
.board.panning { scroll-snap-type: none; cursor: grabbing; user-select: none; }
@media (hover: hover) {
  .board .col { scrollbar-width: thin; scrollbar-color: rgba(127, 127, 127, .5) transparent; }
  .board .col::-webkit-scrollbar { width: 8px; }
  .board .col::-webkit-scrollbar-thumb { background: rgba(127, 127, 127, .5); border-radius: 4px; }
}

/* 🔄 a new version is live (laptop page) */
.newver { position: fixed; z-index: 70; left: 50%; transform: translateX(-50%); bottom: calc(var(--bot) + 18px); background: var(--text); color: var(--card); padding: 10px 12px 10px 16px; border-radius: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .3); display: flex; gap: 12px; align-items: center; font-weight: 600; max-width: calc(100vw - 24px); }

/* 💷 Team plan */
.planbox { margin: 10px 0 12px; padding: 12px; border-radius: 12px; background: var(--card2); border-left: 4px solid var(--accent); }
.planbox.ok { border-left-color: #12a36a; }
.planbox.end { border-left-color: var(--over); }
.pseg { display: inline-flex; margin: 6px 0 14px; }
.pseg button { padding: 8px 14px; font-weight: 600; }
.plancards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.plancard { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--card); }
.plancard.cur { border: 2px solid var(--accent); }
.pc-h { font-weight: 700; font-size: 16px; }
.pc-p { font-size: 26px; font-weight: 800; }
.pc-p small { font-size: 14px; font-weight: 600; color: var(--muted); }
.pc-cur { color: var(--accent); font-weight: 700; }
.plancard .btn { margin-top: 6px; }

.roband { background: #fff4d6; color: #5c4400; border: 1px solid #f0d58a; border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 600; }
@media (prefers-color-scheme: dark) { .roband { background: #3d3214; color: #ffe7a3; border-color: #6b5a24; } }
/* 📥 New reply: on a task card until I open it, and on the new emails inside the task */
.newmail { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: #dbeafe; color: #1e40af; font-weight: 700; font-size: 12px; white-space: nowrap; }
:root[data-theme="dark"] .newmail { background: #1e3a8a; color: #dbeafe; }
