/* Bature Desk. Brand tokens shared with the client portal (see DESIGN.md there). Larger type here: one reader, low vision. */
:root {
  --ground: #FAF9FC; --surface: #FFFFFF; --surface-2: #F2F0F5; --ink: #14101C; --ink-2: #322B42; --muted: #524A63; --line: #E6E3EA;
  --accent: #3B0E6A; --accent-btn: #3B0E6A; --accent-hover: #4A0E85; --accent-ink: #FFFFFF; --accent-soft: #ECE2F5; --brand-deep: #1E0438;
  --highlight: #F1C518; --highlight-ink: #1E0438; --highlight-soft: #FEF7DC; --warn: #8A6E06;
  --danger: #B5302A; --danger-soft: #FBE5E3; --success: #167A4B; --success-soft: #E1F4E9;
  --shadow-sm: 0 2px 6px rgba(30, 4, 56, 0.08); --shadow-md: 0 8px 20px rgba(30, 4, 56, 0.10); --shadow-brand: 0 16px 40px rgba(59, 14, 106, 0.30);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;
  --radius: 10px; --radius-lg: 16px; --ease: cubic-bezier(0.22, 1, 0.36, 1); --dur: 140ms;
  --font: Inter, "Segoe UI", system-ui, -apple-system, sans-serif; --font-display: Quicksand, var(--font);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #14101C; --surface: #1F1A2A; --surface-2: #322B42; --ink: #F2F0F5; --ink-2: #CAC6CF; --muted: #A39DAC; --line: #322B42;
    --accent: #A77FD0; --accent-btn: #5B14A0; --accent-hover: #7B3DB8; --accent-ink: #FFFFFF; --accent-soft: #2D0A52; --brand-deep: #0B0613;
    --highlight-soft: #3A2E12; --warn: #F5D24A; --danger: #F28B82; --danger-soft: #3B1F1D; --success: #7BD88F; --success-soft: #173A22;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3); --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4); --shadow-brand: 0 8px 24px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 19px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 3px; }
h1 { font-size: 34px; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 var(--s3); text-wrap: balance; }
h2 { font-size: 23px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; margin: 0 0 var(--s3); text-wrap: balance; }
p { margin: 0 0 var(--s3); max-width: 64ch; }
.lede { font-size: 20px; color: var(--ink-2); }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: var(--s3) var(--s4); z-index: 10; }
.skip:focus { left: var(--s4); top: var(--s4); }

/* top bar */
.strip { height: 4px; background: linear-gradient(90deg, var(--brand-deep) 0%, #3B0E6A 55%, var(--highlight) 100%); }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: var(--s3) var(--s6); padding: var(--s3) var(--s6); background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: var(--s3); text-decoration: none; color: var(--ink); }
.brand img { height: 40px; width: auto; display: block; }
.brand .logo-dark { display: none; }
.brand .tag { font-family: var(--font-display); font-weight: 600; font-size: 12px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--accent); padding-left: var(--s3); border-left: 1px solid var(--line); line-height: 1.2; }
@media (prefers-color-scheme: dark) { .brand .logo-light { display: none; } .brand .logo-dark { display: block; } }
.top nav { display: flex; gap: var(--s2) var(--s5); align-items: center; flex-wrap: wrap; }
.top nav a:not(.button) { color: var(--ink); text-decoration: none; font-weight: 500; padding: var(--s2) 0; position: relative; }
.top nav a:not(.button)::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--accent); transition: width var(--dur) var(--ease); }
.top nav a:not(.button):hover, .top nav a:not(.button)[aria-current] { color: var(--accent); }
.top nav a:not(.button):hover::after, .top nav a:not(.button)[aria-current]::after { width: 100%; }
.top nav .n { display: inline-block; min-width: 24px; text-align: center; background: var(--accent-soft); color: var(--accent); border-radius: 999px; font-size: 14px; font-weight: 700; padding: 0 7px; margin-left: 2px; vertical-align: 2px; }
main { max-width: 960px; margin: 0 auto; padding: var(--s8) var(--s6) 80px; }
@media (max-width: 480px) { main { padding: var(--s5) var(--s4) 64px; } .top { padding: var(--s3) var(--s4); } .brand img { height: 34px; } .brand .tag { display: none; } .top nav { gap: var(--s2) var(--s4); } }
footer { display: flex; justify-content: center; align-items: center; gap: var(--s2); color: var(--muted); font-size: 15px; padding: var(--s6) var(--s4) var(--s8); }
footer img { height: 18px; width: auto; opacity: .8; }
section { margin-bottom: var(--s10); }
.narrow { max-width: 620px; }
.crumb { font-size: 16px; margin-bottom: var(--s3); }
.eyebrow { font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); font-weight: 600; display: block; margin-bottom: var(--s1); }
.titlebar { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.titlebar .lede { margin: 0; }
.watched { font-size: 16px; color: var(--muted); }
.count { display: inline-block; background: var(--surface-2); color: var(--ink-2); border-radius: 999px; font-size: 15px; padding: 1px 10px; margin-left: var(--s2); vertical-align: middle; font-weight: 600; }
.flash { background: var(--accent-soft); color: var(--ink); border-left: 5px solid var(--accent); padding: var(--s3) var(--s4); border-radius: var(--radius); margin-bottom: var(--s6); font-weight: 600; }
.devbox { background: var(--highlight-soft); border-left: 5px solid var(--highlight); padding: var(--s3) var(--s4); border-radius: var(--radius); margin-top: var(--s5); word-break: break-all; font-size: 16px; }

/* forms and buttons */
.stack { display: flex; flex-direction: column; gap: var(--s4); }
.row { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; margin-top: var(--s3); }
.field label { display: block; font-weight: 600; margin-bottom: var(--s1); font-size: 17px; }
.field .req { font-weight: 400; color: var(--muted); font-size: 15px; }
.error { color: var(--danger); font-weight: 600; margin-top: var(--s1); }
.has-error input { border-color: var(--danger); }
input[type=text], input[type=email], input[type=url], input[type=date], textarea, select {
  width: 100%; min-height: 50px; font: inherit; padding: var(--s3) 14px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink);
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--highlight); outline-offset: 2px; }
button, .button { font: inherit; font-weight: 600; min-height: 50px; padding: var(--s3) var(--s6); border-radius: 999px; border: 1.5px solid var(--accent); background: transparent; color: var(--accent); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
button:hover, .button:hover { background: var(--accent); color: var(--accent-ink); }
button.primary { background: var(--accent-btn); color: var(--accent-ink); border-color: var(--accent-btn); box-shadow: var(--shadow-sm); }
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: var(--shadow-brand); transform: translateY(-2px); }
button.small, .button.small { min-height: 42px; padding: var(--s2) var(--s4); font-size: 16px; }
.button.primary-outline, button.primary-outline { border-color: var(--accent-btn); }
button.linklike { background: none; border: none; padding: var(--s2) var(--s1); min-height: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; border-radius: var(--s1); }
button.linklike:hover { background: none; color: var(--accent-hover); }
button.linklike.danger, button.linklike.danger:hover { color: var(--danger); }
.button.add { background: var(--highlight); color: var(--highlight-ink); border-color: var(--highlight); }
.button.add:hover { background: #E0B70F; border-color: #E0B70F; color: var(--highlight-ink); }
.actions { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; margin-top: var(--s5); }
.actions form { display: contents; }
.row.secondary { justify-content: space-between; margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line); }
.movefrm { display: flex; gap: var(--s2); align-items: center; }
.movefrm select { width: auto; min-width: 200px; }
.donefrm { display: flex; gap: var(--s2); flex: 1 1 340px; }
.donefrm input { flex: 1; }
@media (prefers-reduced-motion: reduce) { button, .button, .pool, .top nav a::after { transition: none; } button.primary:hover { transform: none; } }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s5) var(--s6); box-shadow: var(--shadow-sm); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
@media (max-width: 640px) { .cols { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--s2) var(--s5); margin: var(--s4) 0 0; font-size: 17px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.empty { text-align: left; }

/* chips */
.chips { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); }
.chip { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; letter-spacing: 0.02em; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.area { background: var(--accent-soft); color: var(--accent); }
.chip.by { background: var(--surface-2); color: var(--muted); font-weight: 600; }
.chip.due { background: var(--surface-2); }
.chip.due.soon { background: var(--highlight-soft); color: var(--warn); }
.chip.due.over, .over { color: var(--danger); }
.chip.due.over { background: var(--danger-soft); }
.soon { color: var(--warn); }

/* the one thing: up next */
.upnext { background: var(--surface); border: 1px solid var(--line); border-left: 8px solid var(--accent-btn); border-radius: var(--radius-lg); padding: var(--s6) var(--s8); box-shadow: var(--shadow-md); margin-bottom: var(--s8); }
.up-title { font-size: 30px; line-height: 1.2; margin: 0 0 var(--s3); }
.up-title a { color: var(--ink); text-decoration: none; }
.up-title a:hover { color: var(--accent); text-decoration: underline; }
.up-detail { font-size: 19px; color: var(--ink-2); max-width: 68ch; }
.up-source { font-size: 16px; color: var(--muted); margin: 0; }
@media (max-width: 640px) { .upnext { padding: var(--s5) var(--s5); } .up-title { font-size: 26px; } }

/* the queue */
.then { color: var(--muted); font-size: 15px; letter-spacing: 0.18em; text-transform: uppercase; margin: 0 0 var(--s3); }
.queue { list-style: none; counter-reset: q 1; margin: 0 0 var(--s10); padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.queue li { counter-increment: q; display: grid; grid-template-columns: 44px 1fr auto; gap: var(--s3) var(--s4); align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s4) var(--s5); box-shadow: var(--shadow-sm); }
.queue li::before { content: counter(q); font-size: 22px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; text-align: center; }
.q-title { font-weight: 600; font-size: 19px; color: var(--ink); text-decoration: none; }
.q-title:hover { color: var(--accent); text-decoration: underline; }
.q-meta { color: var(--muted); font-size: 15px; margin-top: 2px; }
.q-actions { display: flex; gap: var(--s2); }
@media (max-width: 600px) { .queue li { grid-template-columns: 36px 1fr; } .q-actions { grid-column: 2; } }

/* pools */
.pools { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s4); }
.pool { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s4) var(--s5); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
.pool:hover, .pool:focus-visible { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.pool-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); margin-bottom: var(--s2); }
.pool-label { font-weight: 700; font-size: 18px; color: var(--accent); }
.pool-count { font-size: 26px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1; }
.pool-top { list-style: none; margin: 0; padding: 0; font-size: 16px; color: var(--ink-2); }
.pool-top li { padding: 3px 0; border-top: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pool-top li.more { color: var(--muted); font-style: italic; }
.pool-empty { margin: 0; font-size: 16px; }

/* lane page item cards */
.group { margin-bottom: var(--s8); }
.group-title { font-size: 19px; color: var(--ink-2); margin-bottom: var(--s3); }
.items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.itemcard { display: grid; grid-template-columns: 1fr auto; gap: var(--s3) var(--s5); align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s4) var(--s5); box-shadow: var(--shadow-sm); }
.ic-title { font-weight: 600; font-size: 19px; color: var(--ink); text-decoration: none; }
.ic-title:hover { color: var(--accent); text-decoration: underline; }
.ic-detail { color: var(--ink-2); font-size: 17px; margin: var(--s1) 0 var(--s2); }
.ic-meta { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; font-size: 15px; color: var(--muted); }
.ic-actions { display: flex; flex-direction: column; gap: var(--s2); align-items: stretch; }
@media (max-width: 640px) { .itemcard { grid-template-columns: 1fr; } .ic-actions { flex-direction: row; } }

/* detail page */
.detail h1 { margin-top: var(--s1); }
.status { font-weight: 700; }
.status.done { color: var(--success); }
.status.dropped { color: var(--muted); }
.notes { margin-top: var(--s8); }
.notefrm { display: flex; gap: var(--s3); align-items: flex-start; margin-bottom: var(--s5); flex-wrap: wrap; }
.notefrm textarea { flex: 1 1 320px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 var(--s5); border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: var(--s4); }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: calc(-1 * var(--s5) - 7px); top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--line); border: 2px solid var(--surface); }
.timeline li.note::before { background: var(--accent); }
.tl-when { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.tl-who { color: var(--muted); font-size: 15px; font-weight: 600; margin-left: var(--s2); }
.tl-text { color: var(--ink); margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline li.event .tl-text { color: var(--ink-2); font-size: 17px; }

/* done */
.seeall { font-size: 16px; font-weight: 500; margin-left: var(--s3); }
.donelist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.donelist li { display: flex; gap: var(--s3); align-items: baseline; padding: var(--s2) 0; border-bottom: 1px solid var(--line); font-size: 17px; }
.donelist li:last-child { border-bottom: none; }
.donelist.big li { padding: var(--s3) 0; }
.donelist .tick { color: var(--success); font-weight: 700; }
.donelist .tick.dropped { color: var(--muted); }
.donelist .when { margin-left: auto; color: var(--muted); font-size: 15px; white-space: nowrap; }

/* sign-in */
.signin { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 80px); }
.signin-brand { background: var(--brand-deep); color: #FFFFFF; padding: var(--s12) var(--s10); display: flex; flex-direction: column; justify-content: center; gap: var(--s6); }
.signin-brand img { width: min(320px, 70%); height: auto; }
.signin-brand p { color: rgba(255, 255, 255, 0.82); font-size: 20px; max-width: 30ch; }
.signin-brand .tag { font-family: var(--font-display); font-weight: 600; font-size: 13px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--highlight); }
.signin-form { padding: var(--s12) var(--s10); display: flex; flex-direction: column; justify-content: center; }
.signin-form .stack { max-width: 460px; }
@media (max-width: 760px) {
  .signin { grid-template-columns: 1fr; min-height: 0; }
  .signin-brand { padding: var(--s8) var(--s6); }
  .signin-brand img { width: 200px; }
  .signin-form { padding: var(--s8) var(--s6); }
}
body.plain main { max-width: none; padding: 0; }
