@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage_grotesque.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

/* The app's Metronome look: ink and saffron. Dark follows the device ("System"), or a chosen theme:
   <html data-theme="light|dark"> (cookie tr_theme). Every dark rule is written twice, guarded for both. */
:root {
  --ink: #17324D;
  --saffron: #E8A317;
  --bg: #F6F4EF;
  --surface: #FFFFFF;
  --text: #17324D;
  --muted: #5B6B7C;
  --line: #D9DEE5;
  --error: #B3261E;
  --focus: #E8A317;
  --late: #B3261E;
  --done: #2E7D4F;
  --soft: #EDEAE2;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1E2E;
    --surface: #17324D;
    --text: #EEF2F6;
    --muted: #A9B7C6;
    --line: #2C4A68;
    --error: #FFB4AB;
    --late: #FFB4AB;
    --done: #8FD6A8;
    --soft: #1C3954; }
}
:root[data-theme="dark"] {
    --bg: #0F1E2E;
    --surface: #17324D;
    --text: #EEF2F6;
    --muted: #A9B7C6;
    --line: #2C4A68;
    --error: #FFB4AB;
    --late: #FFB4AB;
    --done: #8FD6A8;
    --soft: #1C3954; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Manrope", system-ui, sans-serif;
}
h1, h2 { font-family: "Bricolage Grotesque", "Manrope", sans-serif; line-height: 1.15; margin: 0 0 .5rem; }
h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.01em; }
a { color: inherit; text-decoration-color: var(--saffron); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.top { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.mark { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 1.25rem; text-decoration: none; }
.mark::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--saffron); margin-right: 8px; vertical-align: middle; }

.page { padding: 24px 16px 48px; max-width: 960px; margin: 0 auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.narrow { max-width: 420px; margin: 0 auto; }
.lead { color: var(--muted); margin: 0 0 1.25rem; }
.aside { margin: 1.25rem 0 0; color: var(--muted); }

.stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 600; }
input[type=email], input[type=password], input[type=text] {
  font: inherit; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); width: 100%;
}
button { font: inherit; font-weight: 700; padding: 12px 18px; border-radius: 999px; border: 0; cursor: pointer; }
.primary { background: var(--ink); color: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .primary { background: var(--saffron); color: #17324D; }
}
:root[data-theme="dark"] .primary { background: var(--saffron); color: #17324D; }
.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
.error { color: var(--error); font-weight: 600; margin: 0 0 1rem; }
.inline { display: inline; }
.card > form.inline { margin-top: 1rem; display: block; }

/* ---------------------------------------------------------------- signed-in chrome */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.nav a { text-decoration: none; padding: 6px 12px; border-radius: 999px; font-weight: 600; color: var(--muted); }
.nav a[aria-current=page] { color: var(--text); background: var(--soft); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.who .email { color: var(--muted); font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28ch; }
.who form { margin: 0; }
.who button { padding: 6px 14px; font-size: .875rem; }
@media (max-width: 560px) { .who .email { display: none; } .nav { order: 3; width: 100%; margin: 0 -12px; } }

/* ---------------------------------------------------------------- view header */
.view-head { margin-bottom: 12px; }
.view-head h1 { font-size: clamp(2rem, 7vw, 2.75rem); font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.subtitle { color: var(--muted); margin: 2px 0 14px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.pill { display: inline-block; padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-weight: 700; font-size: .9375rem; cursor: pointer; list-style: none; background: var(--surface); }
.pill::-webkit-details-marker { display: none; }
.pill[aria-current=page], .more[open] > .pill { background: var(--ink); border-color: var(--ink); color: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pill[aria-current=page], :root:not([data-theme="light"]) .more[open] > .pill { background: var(--saffron); border-color: var(--saffron); color: #17324D; }
}
:root[data-theme="dark"] .pill[aria-current=page], :root[data-theme="dark"] .more[open] > .pill { background: var(--saffron); border-color: var(--saffron); color: #17324D; }
.more { position: relative; }
.more-menu { position: absolute; z-index: 2; top: calc(100% + 6px); left: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: grid; min-width: 140px; box-shadow: 0 8px 24px rgb(23 50 77 / .12); }
.more-menu a { padding: 8px 12px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.more-menu a[aria-current=page] { background: var(--soft); }

.filters { margin: 4px 0 12px; }
.filters > summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 6px 0; width: max-content; }
.filter-form { display: grid; gap: 12px; padding: 14px; margin-top: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
@media (min-width: 720px) { .filter-form { grid-template-columns: 2fr 1fr 1fr; align-items: end; } .tag-picks { grid-column: 1 / -1; } .filter-form button { justify-self: start; } }
select, input[type=search] { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%; }
.tag-picks { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.tag-picks legend { font-weight: 600; margin-bottom: 6px; }
.tag-pick { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--soft); text-decoration: none; font-weight: 600; font-size: .875rem; }
.clear { font-size: .875rem; font-weight: 600; color: var(--muted); }
.swatch { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }

/* ---------------------------------------------------------------- sections and rows */
.section { margin-top: 18px; }
.section-title, .group-title { font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 1.0625rem; margin: 0 0 6px; }
.section-overdue .section-title { color: var(--late); }
.group-title { margin-top: 16px; display: flex; align-items: baseline; gap: 8px; }
.group-sub { font-family: "Manrope", sans-serif; font-weight: 500; font-size: .9375rem; color: var(--muted); }
details > summary.section-title { cursor: pointer; }
.count { color: var(--muted); font-weight: 600; }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; gap: 12px; padding: 12px 14px; margin: 0 0 6px; background: var(--surface); border-radius: 12px; border: 1px solid var(--line); border-left: 4px solid var(--cat); }
.row .time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); min-width: 3.2em; padding-top: 1px; }
.body { min-width: 0; flex: 1; }
.title { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.meta { margin: 2px 0 0; display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: .875rem; }
.meta:empty { display: none; }
.cat { display: inline-flex; align-items: center; gap: 5px; }
.late .date { color: var(--late); font-weight: 700; }
.prio { font-size: .75rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; background: var(--soft); color: var(--muted); }
.prio-high { background: var(--late); color: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .prio-high { color: #17324D; }
}
:root[data-theme="dark"] .prio-high { color: #17324D; }
.pill-count { font-weight: 700; color: var(--text); background: var(--soft); padding: 0 8px; border-radius: 6px; }
.next { font-weight: 600; }
.done .title { text-decoration: line-through; text-decoration-color: var(--muted); color: var(--muted); }
.done .title::before { content: "✓ "; color: var(--done); text-decoration: none; display: inline-block; margin-right: 2px; }
.projected { background: transparent; border-style: dashed; border-left-style: solid; }
.projected .title { font-weight: 600; color: var(--muted); }

/* The rhythm strip: the next 14 days, one cell each. */
.strip { list-style: none; display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; margin: 8px 0 0; padding: 0; max-width: 280px; }
.cell { height: 8px; border-radius: 2px; background: var(--soft); }
.cell-current { background: var(--ink); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cell-current { background: #EEF2F6; }
}
:root[data-theme="dark"] .cell-current { background: #EEF2F6; }
.cell-occurrence { background: var(--saffron); }
.cell-non_workday { background: transparent; outline: 1px dashed var(--line); outline-offset: -1px; }

/* Today as a timeline: rows on a rail, a saffron line for now. */
.timeline .rows { position: relative; padding-left: 18px; }
.timeline .rows::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); border-radius: 2px; }
.timeline .row { position: relative; }
/* A small solid stop on the rail (centred on it, clear of the card): grey, green once done. Not a checkbox. */
/* Offsets count from inside the card's 4px colour edge: list padding 18 + edge 4 = 22, rail centre at 6, so 6 - 22 - 4 = -20. */
.timeline .row::before { content: ""; position: absolute; left: -20px; top: 20px; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.timeline .row.done::before { background: var(--done); }
.now { position: relative; height: 0; margin: 10px 0 14px -18px; border-top: 2px solid var(--saffron); list-style: none; }
.now span { position: absolute; top: -11px; left: 22px; background: var(--saffron); color: #17324D; font-weight: 800; font-size: .75rem; padding: 2px 8px; border-radius: 999px; }
.now::before { content: ""; position: absolute; left: 1px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--saffron); }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty-title { font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 1.25rem; color: var(--text); margin: 0 0 4px; }
.empty-inline { color: var(--muted); }
.zone-note { margin-top: 32px; color: var(--muted); font-size: .8125rem; }

/* ---------------------------------------------------------------- calendar */
.calendar-layout { display: grid; gap: 24px; }
@media (min-width: 880px) { .calendar-layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; } }
.month-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.month-head h1 { font-size: 1.75rem; margin: 0; flex: 1; text-align: center; }
.step { text-decoration: none; font-size: 1.5rem; line-height: 1; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.today-link { font-weight: 700; font-size: .875rem; }
.grid { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.grid th { font-size: .75rem; color: var(--muted); font-weight: 700; padding-bottom: 4px; }
.grid td { padding: 0; }
.day { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; aspect-ratio: 1 / 1; min-height: 40px; padding-top: 6px; border-radius: 10px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.day .n { font-weight: 700; }
.day .dots { font-size: .6875rem; font-weight: 800; color: #17324D; background: var(--saffron); border-radius: 999px; padding: 0 6px; }
.day.outside { opacity: .45; }
.day.holiday { border-style: dashed; }
.day.is-today .n { color: var(--saffron); }
.day.picked { background: var(--ink); border-color: var(--ink); color: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .day.picked { background: #EEF2F6; border-color: #EEF2F6; color: #17324D; }
}
:root[data-theme="dark"] .day.picked { background: #EEF2F6; border-color: #EEF2F6; color: #17324D; }
.holidays { list-style: none; padding: 0; margin: 12px 0 0; color: var(--muted); font-size: .875rem; display: grid; gap: 2px; }
.hd { font-weight: 700; color: var(--text); margin-right: 6px; }
.inline-filter { margin-top: 10px; display: flex; gap: 8px; align-items: end; max-width: 360px; }
.inline-filter label { flex: 1; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* ---------------------------------------------------------------- actions (phase 4b) */
button.small { padding: 5px 12px; font-size: .8125rem; }
.secondary.small { border-color: var(--line); }
.link-button { background: none; border: 0; padding: 0 4px; color: inherit; font-weight: 800; text-decoration: underline; text-decoration-color: var(--saffron); text-underline-offset: 3px; }
.danger { color: var(--late); }

.flash { display: flex; align-items: center; gap: 12px; justify-content: space-between; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; margin: 0 0 16px; font-weight: 600; }
.flash .link-button { color: var(--saffron); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .flash { background: #EEF2F6; color: #17324D; }
  :root:not([data-theme="light"]) .flash .link-button { color: #17324D; }
}
:root[data-theme="dark"] .flash { background: #EEF2F6; color: #17324D; }
:root[data-theme="dark"] .flash .link-button { color: #17324D; }

.quick-add { display: flex; gap: 8px; margin: 4px 0 10px; }
.quick-add input[type=text] { flex: 1; min-width: 0; font: inherit; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.quick-add select { width: auto; border-radius: 999px; background: var(--surface); }
.quick-add button { padding: 10px 18px; }
@media (max-width: 420px) { .quick-add { flex-wrap: wrap; } .quick-add input[type=text] { flex-basis: 100%; } .quick-add select { flex: 1; } }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head .section-title { margin: 0 0 6px; }

.row { align-items: flex-start; }
.title-link { text-decoration: none; }
.title-link:hover { text-decoration: underline; text-decoration-color: var(--saffron); }

/* The complete button: an empty ring that fills with a tick on hover/focus. */
.check-form { margin: 0; }
.check { width: 22px; height: 22px; flex: none; padding: 0; margin-top: 1px; border-radius: 50%; border: 2px solid var(--muted); background: transparent; cursor: pointer; list-style: none; display: inline-grid; place-items: center; }
.check::-webkit-details-marker { display: none; }
.check:hover, .check:focus-visible, .check-menu[open] > .check { border-color: var(--done); }
.check:hover::after, .check:focus-visible::after, .check-menu[open] > .check::after { content: "✓"; color: var(--done); font-weight: 800; font-size: .8125rem; line-height: 1; }

.check-menu, .row-menu { position: relative; }
.row-end { margin-left: auto; flex: none; }
.row-menu > summary { list-style: none; cursor: pointer; padding: 0 8px; border-radius: 8px; color: var(--muted); font-weight: 800; line-height: 1.5; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu[open] > summary { background: var(--soft); color: var(--text); }
.menu { position: absolute; z-index: 3; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: grid; min-width: 190px; box-shadow: 0 8px 24px rgb(23 50 77 / .14); }
.row-menu .menu { right: 0; }
.check-menu .menu { left: 0; min-width: 230px; }
.menu form { margin: 0; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; background: none; border: 0; font: inherit; font-weight: 600; color: inherit; text-decoration: none; cursor: pointer; }
.menu a:hover, .menu button:hover, .menu a:focus-visible, .menu button:focus-visible { background: var(--soft); }
.menu .danger { color: var(--late); }

.early { display: flex; gap: 8px; margin-top: 8px; }
.history-actions { display: flex; gap: 6px; }
@media (max-width: 420px) { .history-actions { flex-direction: column; } }

/* The missed review */
.missed-line { display: flex; gap: 10px; align-items: center; margin: 0 0 12px; padding: 8px 14px; border-radius: 12px; background: var(--soft); font-weight: 600; }
.small-link { font-weight: 800; }
.review { max-width: 520px; margin: 0 auto; }
.review-task { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1.125rem; margin: 0 0 4px; }
.review-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.review-actions form, .review-actions button { width: 100%; margin: 0; }
.review-all { display: grid; gap: 6px; margin-top: 14px; justify-items: start; }
.review-all form { margin: 0; }

/* ---------------------------------------------------------------- the editor */
.editor { max-width: 680px; margin: 0 auto; }
.editor-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 12px; }
.editor-head h1 { margin: 0; }
.back { font-weight: 700; text-decoration: none; color: var(--muted); }
.errors { background: color-mix(in srgb, var(--late) 12%, var(--surface)); border: 1px solid var(--late); color: var(--text); border-radius: 12px; padding: 10px 16px; margin-bottom: 14px; }
.errors ul { margin: 0; padding-left: 18px; }
.editor-form { display: grid; gap: 14px; }
.editor-form textarea { font: inherit; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%; resize: vertical; }
input[type=date], input[type=time], input[type=number] { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); max-width: 100%; }
.field-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); align-items: end; }
.hint { color: var(--muted); font-size: .8125rem; margin: -8px 0 0; }
.preview .hint, .place .hint { margin: 0; }
.editor-form fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px 16px; margin: 0; display: grid; gap: 12px; background: var(--surface); }
.editor-form legend { font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; padding: 0 6px; }
.choices { display: grid; gap: 6px; }
.choices label, .check-label, .days label { display: flex; align-items: center; gap: 8px; font-weight: 500; flex-wrap: wrap; }
.days { display: flex !important; flex-wrap: wrap; gap: 6px 14px !important; border: 0 !important; padding: 0 !important; background: none !important; }
.inline-num { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.inline-num input { width: 4.5em; }
.tiny { width: 5em; }
.preview { background: var(--soft); border-radius: 12px; padding: 10px 14px; }
.summary { font-weight: 800; margin: 0 0 4px; }
.next-dates { margin: 0; padding-left: 20px; }
.why { color: var(--muted); font-size: .875rem; }
.subtask-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.subtask-list li { display: flex; gap: 6px; align-items: center; }
.subtask-list input[type=text] { flex: 1; min-width: 0; }
.icon { padding: 6px 10px; background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--text); font-weight: 700; }
.icon:disabled { opacity: .35; cursor: default; }
.add-subtask { display: flex; gap: 8px; }
.add-subtask input { flex: 1; min-width: 0; }
.editor-actions { display: flex; gap: 16px; align-items: center; }
.secondary-link { font-weight: 700; }
.delete-form { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.danger-button { background: none; border: 1px solid var(--late); color: var(--late); }

/* Show a pattern's extra fields only with that pattern (where :has() exists; otherwise they all show). */
@supports selector(:has(*)) {
  .month-extra .ord-pos, .month-extra .ord-dow, .month-extra .nth-field, .year-extra { display: none; }
  .repeat:has(input[name="Form.Rule.MonthMode"][value="nth"]:checked) .month-extra .ord-pos,
  .repeat:has(input[name="Form.Rule.MonthMode"][value="nth"]:checked) .month-extra .ord-dow,
  .repeat:has(input[name="Form.Rule.MonthMode"][value="lastweekday"]:checked) .month-extra .ord-dow,
  .repeat:has(input[name="Form.Rule.MonthMode"][value="nthwd"]:checked) .month-extra .nth-field,
  .repeat:has(input[name="Form.Rule.MonthMode"][value="fromend"]:checked) .month-extra .nth-field { display: grid; gap: 6px; }
  .repeat:has(input[name="Form.Rule.YearMode"][value="ordinal"]:checked) .year-extra { display: grid; }
}

/* Radios and checkboxes in the accent colour */
input[type=radio], input[type=checkbox] { accent-color: var(--saffron); }

/* The theme switch */
.theme-menu { position: relative; }
.theme-menu > summary { list-style: none; cursor: pointer; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font-weight: 700; color: var(--muted); }
.theme-menu > summary::-webkit-details-marker { display: none; }
.theme-menu .menu { right: 0; min-width: 150px; }
.theme-menu button[aria-pressed=true] { background: var(--soft); }
.theme-menu button[aria-pressed=true]::after { content: " ✓"; color: var(--done); }

/* ---------------------------------------------------------------- managers and settings */
.manager { max-width: 680px; margin: 0 auto; }
.manage-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.manage-list > li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.manage-row { display: flex; align-items: center; gap: 10px; }
.manage-list > li.manage-row { padding: 8px 14px; }
.manage-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.muted { color: var(--muted); font-size: .875rem; }
.swatch.big { width: 16px; height: 16px; }
.manage-edit { margin-top: 6px; }
.manage-edit > summary { cursor: pointer; font-weight: 700; font-size: .875rem; color: var(--muted); width: max-content; }
.manage-edit[open] > summary { margin-bottom: 8px; }
.manage-new { margin: 16px 0; }
.palette { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.palette legend { font-weight: 600; margin-bottom: 6px; }
.swatch-pick { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; }
.swatch-pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch-pick:has(input:checked) { border-color: var(--text); }
.swatch-pick:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.packs { margin: 20px 0; }
.pack { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; }
.pack p { margin: 0 0 8px; }
.settings section { margin-bottom: 22px; }
.settings dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; }
.settings dt { color: var(--muted); }
.settings dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.link-list a { display: block; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; font-weight: 700; }
.choice-row { display: flex; gap: 8px; flex-wrap: wrap; }
.choice-row button[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .choice-row button[aria-pressed=true] { background: var(--saffron); color: #17324D; border-color: var(--saffron); }
}
:root[data-theme="dark"] .choice-row button[aria-pressed=true] { background: var(--saffron); color: #17324D; border-color: var(--saffron); }
.notice { background: var(--soft); border-radius: 10px; padding: 10px 14px; font-weight: 600; margin: 0 0 1rem; }
.field-row > label > input, .field-row > label > select { width: 100%; min-width: 0; }
