:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --text: #22201c;
  --muted: #6b665d;
  --border: #ddd8cc;
  --accent: #8a5a12;
  --accent-soft: #f3e6cf;
  --error: #b3261e;
  --good: #2f7a3b;
  --chart: #8a5a12;
  --chart-wash: rgba(138, 90, 18, .10);
  --mention: #4752c4; --mention-bg: rgba(88, 101, 242, .15);
  color-scheme: light;
}
/* Dark mode: follows the system unless the theme switch forces light or dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1a17; --card: #262420; --text: #ece8df; --muted: #a39d91; --border: #3d3a33;
    --accent: #e0a94a; --accent-soft: #3a3020; --error: #f2847c; --good: #7fcf8a;
    --chart: #c08630; --chart-wash: rgba(192, 134, 48, .12);
    --mention: #c9cdfb; --mention-bg: rgba(88, 101, 242, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1a17; --card: #262420; --text: #ece8df; --muted: #a39d91; --border: #3d3a33;
  --accent: #e0a94a; --accent-soft: #3a3020; --error: #f2847c; --good: #7fcf8a;
  --chart: #c08630; --chart-wash: rgba(192, 134, 48, .12);
  --mention: #c9cdfb; --mention-bg: rgba(88, 101, 242, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, sans-serif;
}
main { max-width: 860px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { margin: 0 0 16px; font-size: 1.75rem; }
h2 { margin: 0 0 12px; font-size: 1.1rem; }
h2 small { color: var(--muted); font-weight: normal; font-size: .85rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.row { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.field > span { font-size: .85rem; color: var(--muted); }
.field.check { align-self: flex-start; justify-content: center; margin-top: calc(.85rem * 1.5 + 4px); min-height: 38px; }  /* level with the inputs, below their labels */
/* The box and its label on one line, with any help text and errors underneath. */
.check-line { display: flex; align-items: center; gap: 8px; }
.tip { cursor: help; opacity: .7; }
.helptext { font-size: .8rem; color: var(--muted); max-width: 240px; }
.levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; }
.levels .field { min-width: 0; }
.levels input[type=number] { width: 100%; }
.prestige { margin-top: 16px; max-width: 280px; }
.prestige[hidden] { display: none; }

input, select, button {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
}
input[type=number] { width: 7em; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
th { font-size: .8rem; color: var(--muted); font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.rows { display: block; overflow-x: auto; }
.rows input[type=text] { width: 100%; min-width: 160px; }

button { cursor: pointer; }
button.add { margin-top: 10px; background: none; color: var(--accent); border-style: dashed; }
button.remove { background: none; border: none; color: var(--muted); font-size: 1.2rem; padding: 0 6px; }
button.primary {
  background: var(--accent); color: var(--card); border: none;
  padding: 10px 24px; font-weight: 600; margin-bottom: 16px;
}

.hint { color: var(--muted); font-size: .85rem; margin: 4px 0 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stats div { display: flex; flex-direction: column; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.stats div > span { font-size: .8rem; color: var(--muted); }
.stats strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.stats small { color: var(--muted); font-size: .8rem; }
.stats .hero { background: var(--accent-soft); border-color: var(--accent); }
.breakdown em { color: var(--muted); font-size: .85rem; }
.breakdown tfoot td { font-weight: 600; border-bottom: none; }

.errorlist { list-style: none; margin: 2px 0 0; padding: 0; color: var(--error); font-size: .8rem; }

/* Center everything */
main, .card, th, td, .num { text-align: center; }
.row { justify-content: center; }
.field { align-items: center; }
.field.check { justify-content: center; }
.levels { justify-content: center; grid-template-columns: repeat(6, 100px); }
@media (max-width: 720px) { .levels { grid-template-columns: repeat(3, minmax(0, 100px)); } }
.prestige { margin-left: auto; margin-right: auto; }
.rows { width: fit-content; max-width: 100%; margin: 0 auto; }
.stats div { align-items: center; }
button.primary { display: block; margin: 0 auto 16px; }

/* Navigation */
.topnav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; padding: 12px 16px 0; }
.topnav a {
  color: var(--muted); text-decoration: none; padding: 6px 14px;
  border: 1px solid transparent; border-radius: 999px;
}
.topnav a:hover { color: var(--text); }
.topnav a[aria-current="page"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* Rule guide */
a { color: var(--accent); }
[hidden] { display: none !important; }
.lede { color: var(--muted); margin: -8px auto 16px; max-width: 60ch; }
.guide-search { margin-bottom: 16px; }
.guide-search input { width: 100%; max-width: 480px; padding: 10px 14px; border-radius: 999px; }
.toc { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 16px; }
.toc h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.toc a { display: block; padding: 2px 0; text-decoration: none; }
.toc a:hover { text-decoration: underline; }
h2.group {
  font-size: .85rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin: 28px 0 12px;
}
.rule { scroll-margin-top: 16px; }
.rule h3 { font-size: .95rem; margin: 16px 0 6px; }
.rule p { margin: 6px auto; max-width: 65ch; }
.rule ul, .rule ol { list-style: none; padding: 0; margin: 6px auto; max-width: 65ch; }
.rule ul > li, .rule ol > li { padding: 3px 0; }
.rule ol.boons { counter-reset: boon; }
.rule ol.boons > li { counter-increment: boon; }
.rule ol.boons > li::before {
  content: counter(boon); display: inline-block; min-width: 1.6em; margin-right: 6px;
  font-weight: 600; color: var(--accent);
}
.rule dl { margin: 8px auto; max-width: 65ch; }
.rule dt { font-weight: 600; margin-top: 10px; }
.rule dt small { color: var(--muted); font-weight: normal; }
.rule dd { margin: 2px 0 0; color: var(--text); }
.rule table.mini { display: block; width: auto; max-width: fit-content; overflow-x: auto; margin: 8px auto; font-size: .92rem; }
.rule table.mini td, .rule table.mini th { padding: 5px 10px; }
.rule table.ap { font-variant-numeric: tabular-nums; }
.rule .chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: none; }
.rule .chips li {
  padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px;
  font-size: .88rem; background: var(--bg);
}
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 24px; align-items: start; }
details { margin-top: 8px; }
summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: 6px 0; }

/* Character logs */
main:has(table.log) { max-width: 1120px; }
.summary { max-width: 760px; margin: 0 auto 16px; }
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.scroll { overflow-x: auto; }
table.log { font-size: .92rem; font-variant-numeric: tabular-nums; }
table.log td, table.log th { padding: 6px 8px; white-space: nowrap; }
table.log td.wrap { white-space: normal; min-width: 140px; }
table.log tr.start td { color: var(--muted); font-style: italic; }
table.log tr.derived td { color: var(--muted); }
table.log tr.current td { background: var(--accent-soft); font-weight: 600; }
table.chart { width: auto; margin: 0 auto; }
td.pos { color: var(--good); }
td.neg { color: var(--error); }
.actions { display: flex; gap: 8px; justify-content: center; align-items: center; }
.actions form { margin: 0; }
button.link { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; font-size: inherit; }
button.link.danger { color: var(--error); }
.card > form + form { margin-top: 8px; }
.row + button.primary { margin-top: 16px; }

a.button {
  display: inline-block; padding: 8px 18px; border: 1px solid var(--accent); border-radius: 999px;
  color: var(--accent); text-decoration: none; font-weight: 600;
}
a.button:hover { background: var(--accent-soft); }
.messages { list-style: none; padding: 0; margin: 0 auto 16px; max-width: 720px; }
.messages li { padding: 8px 14px; border-radius: 8px; margin-bottom: 6px; border: 1px solid var(--border); background: var(--card); }
.messages li.success { border-color: var(--good); }
.messages li.warning { border-color: var(--accent); background: var(--accent-soft); }
.messages li.error { border-color: var(--error); color: var(--error); }
.exports { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* Inventory & milestones */
.loadout { max-width: 640px; margin: 16px auto 8px; }
.stats .bad { border-color: var(--error); background: color-mix(in srgb, var(--error) 10%, transparent); }
.verdict { margin: 6px 0; font-weight: 600; }
.verdict.ok { color: var(--good); }
.verdict.bad { color: var(--error); }
input.bring { width: 4.5em; }
table.log tr.blocked td { color: var(--muted); }
table.log tr.blocked small { color: var(--error); }
#loadout { align-items: flex-end; }
#loadout button.primary { margin: 0; }
.milestones { display: grid; gap: 12px; }
.milestone { border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.milestone.claimed { opacity: .75; }
.milestone.available { border-color: var(--accent); }
.m-head { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.badge { font-size: .75rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.badge.available { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.badge.claimed { border-color: var(--good); color: var(--good); }
.m-form { align-items: flex-end; margin-top: 6px; }
button.small { padding: 6px 14px; }

/* Charts (single series: no legend; the heading names it) */
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.charts > div { min-width: 0; }
@media (max-width: 760px) { .charts { grid-template-columns: 1fr; } }
.charts > .hint { grid-column: 1 / -1; }
.chart-box { position: relative; min-height: 220px; }
.chart-box svg { display: block; overflow: visible; }
.c-grid { stroke: var(--border); stroke-width: 1; }
.c-zero { stroke: var(--muted); stroke-width: 1; }
.c-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.c-line { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.c-area { fill: var(--chart-wash); stroke: none; }
.c-dot { fill: var(--chart); stroke: var(--card); stroke-width: 2; }
.c-end { fill: var(--text); font-size: 12px; font-weight: 600; }
.c-cross { stroke: var(--muted); stroke-width: 1; }
.c-hit { fill: transparent; cursor: crosshair; touch-action: pan-y; }
.c-tip {
  position: absolute; pointer-events: none; padding: 6px 10px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--border); box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
  display: flex; flex-direction: column; font-size: .8rem; white-space: nowrap;
}
.c-tip span { color: var(--muted); }

/* Bot check */
.bot-stats { max-width: 720px; margin: 0 auto 12px; }
.stats .good { border-color: var(--good); }
.suggestions { list-style: none; padding: 0; margin: 6px 0; }
.suggestions li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.suggestions li:last-child { border-bottom: none; }
.bot-form { max-width: 520px; margin: 12px auto 0; }
.bot-form .field { align-items: stretch; }
.bot-form textarea {
  font: inherit; color: var(--text); background: var(--bg); width: 100%;
  border: 1px solid var(--border); border-radius: 6px; padding: 8px;
}
.onbot-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.note-copy { max-width: 620px; margin: 12px auto; display: grid; gap: 6px; justify-items: center; }
.note-copy textarea {
  width: 100%; font: inherit; font-size: .88rem; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px; padding: 8px; resize: vertical;
}
.bot-history { max-width: 620px; margin: 8px auto; }
.badge.behind { border-color: var(--error); color: var(--error); }

/* Crafting & estates */
.projects { display: grid; gap: 12px; }
.project { border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.project.done { opacity: .8; }
.progress { height: 8px; border-radius: 999px; background: var(--accent-soft); margin: 10px auto 4px; max-width: 420px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--chart); border-radius: 999px; }
.estate-stats { max-width: 420px; margin: 10px auto; }
.project .actions { flex-wrap: wrap; margin-top: 6px; }
button[disabled] { opacity: .55; cursor: not-allowed; }
.filters { align-items: flex-end; margin-bottom: 8px; }
.filters .clear { align-self: center; }
table.planner td, table.planner th { padding: 6px 10px; }

.theme-toggle { background: none; border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; color: var(--muted); }
.theme-toggle:hover { color: var(--text); }

/* Needs attention */
.attention ul { list-style: none; padding: 0; margin: 0 auto; max-width: 720px; }
.attention li { padding: 8px 10px; border-radius: 8px; margin-bottom: 6px; border: 1px solid var(--border); }
.attention li.warn { border-color: var(--accent); background: var(--accent-soft); }
.attention li a { color: var(--text); text-decoration: none; }
.attention li a:hover { text-decoration: underline; }
.a-icon { margin-right: 6px; color: var(--accent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
table.log tr.levelup td { background: var(--accent-soft); color: var(--text); font-size: .85rem; white-space: normal; padding: 6px 10px; }
table.log tr.levelup span { color: var(--accent); }
.quick-add { align-items: flex-end; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.saved-loadouts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 999px; padding: 2px 6px 2px 10px; }
.chip.on { border-color: var(--accent); background: var(--accent-soft); }
.chip a { text-decoration: none; }
.chip form { margin: 0; }
.save-loadout { align-items: flex-end; margin-top: 8px; }

/* Item names */
small.banned, .badge.banned { color: var(--error); border-color: var(--error); }
.item-text { text-align: left; max-width: 65ch; margin: 12px auto; white-space: pre-line; }

/* Discord preview */
.dc-wrap { width: 100%; display: grid; gap: 4px; }
.dc-label { font-size: .8rem; color: var(--muted); }
.dc-preview {
  text-align: left; background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px; font-size: .92rem; line-height: 1.4; overflow-wrap: anywhere;
}
.dc-h1 { font-size: 1.4rem; font-weight: 700; margin: 6px 0 2px; }
.dc-h2 { font-size: 1.2rem; font-weight: 700; margin: 6px 0 2px; }
.dc-h3 { font-size: 1.05rem; font-weight: 700; margin: 4px 0 2px; }
.dc-quote { border-left: 4px solid var(--border); padding-left: 10px; margin: 2px 0; }
.dc-li { padding-left: 1.1em; text-indent: -.8em; }
.dc-li::before { content: '•'; display: inline-block; width: .8em; text-indent: 0; }
.dc-gap { height: .5em; }
.dc-mention { color: var(--mention); background: var(--mention-bg); border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dc-preview code { background: var(--border); border-radius: 3px; padding: 0 3px; font-size: .85em; }
.name-fill { align-items: flex-end; margin-top: 12px; }

/* At the table */
.tap-list { list-style: none; padding: 0; margin: 0; }
.tap-list li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between;
  padding: 10px 4px; border-bottom: 1px solid var(--border); text-align: left; }
.tap-list li:last-child { border-bottom: none; }
.tap-name { flex: 1 1 220px; }
.tap-count { font-variant-numeric: tabular-nums; }
.tap-count .left { font-size: 1.2rem; }
form.tap { display: flex; gap: 6px; margin: 0; align-items: center; }
form.tap input[type=text] { width: 10em; }
form.tap .use { min-width: 4.5em; font-weight: 600; }

/* Story */
.timeline { list-style: none; padding: 0; margin: 12px auto 0; max-width: 70ch; text-align: left; }
.timeline li { border-left: 3px solid var(--accent); padding: 4px 0 12px 14px; margin-left: 4px; }
.timeline li.empty { border-left-color: var(--border); color: var(--muted); }
.t-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.t-head small { color: var(--muted); }
.small-link { font-size: .85rem; }
.timeline .item-text { margin: 6px 0 0; }

/* Calendar */
.cal-card { overflow-x: auto; }
.cal { min-width: 640px; display: grid; gap: 2px; }
.cal-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-head span { font-size: .8rem; color: var(--muted); font-weight: 600; padding: 4px 0; }
.cal-day { min-height: 92px; border: 1px solid var(--border); border-radius: 6px; padding: 4px; text-align: left;
  display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cal-day.out { opacity: .45; }
.cal-day.today { border-color: var(--accent); background: var(--accent-soft); }
.cal-num { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-ev { display: block; font-size: .72rem; line-height: 1.25; padding: 1px 4px; border-radius: 4px; text-decoration: none;
  color: var(--text); border-left: 3px solid var(--muted); background: var(--bg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.session { border-left-color: var(--accent); }
.cal-ev.downtime { border-left-color: var(--good); }
.cal-ev.due { border-left-color: var(--error); }
.cal-ev.boon { border-left-color: var(--mention); }
.cal-ev.plan { border-left-color: var(--text); }
.cal-key { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.cal-key .cal-ev { display: inline-block; }
@media (min-width: 721px) { .cal-agenda { display: none; } }

/* Gold breakdown bars (one series each: the heading names it) */
table.bars { width: 100%; }
table.bars th { text-align: left; font-size: .88rem; color: var(--text); font-weight: 500; white-space: nowrap; }
table.bars td.bar-cell { width: 55%; }
table.bars .bar { display: block; height: 10px; min-width: 2px; background: var(--chart); border-radius: 0 4px 4px 0; }
table.bars td.num { text-align: right; white-space: nowrap; }
.will-notes { max-width: 560px; margin: 12px auto; align-items: stretch; }
.will-notes textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px; }
.dt-template { max-width: 620px; margin: 0 auto 12px; align-items: stretch; }
.dt-template textarea { font: inherit; font-size: .88rem; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px; }

/* The user menu in the top nav: Discord name, data export, log out. */
.user-menu { position: relative; margin: 0; }
.user-menu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-weight: 400;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary img { border-radius: 50%; }
.user-menu[open] summary { color: var(--text); border-color: var(--accent); }
.user-menu-items {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 200px;
  display: flex; flex-direction: column; gap: 4px; padding: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
}
.user-menu-items a, .user-menu-items button { padding: 6px 8px; text-align: left; border: 0; }
.user-menu-items form { margin: 0; }
@media (max-width: 600px) { .user-menu-items { right: auto; left: 50%; transform: translateX(-50%); } }

/* Landing page and rule-update badges. */
.landing { max-width: 560px; margin: 0 auto; text-align: center; }
.landing .primary { font-size: 1.1em; padding: 10px 20px; }
.badge.updated { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
pre.diff { white-space: pre-wrap; font-size: .85em; max-height: 480px; overflow: auto; }
pre.diff .add { color: var(--good); }
pre.diff .del { color: var(--error); }

/* AP log: copy a Discord search for an entry's date */
.log .find { font-size: .75rem; }
.search-line { font-size: .8rem; background: var(--border); border-radius: 3px; padding: 1px 4px; }

/* Access requests */
.access-form { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.access-form .field { width: min(100%, 420px); }
.access-form textarea { width: 100%; box-sizing: border-box; }
form.decide { display: flex; gap: 6px; align-items: center; justify-content: center; margin: 0; }
form.decide input[type=text] { width: 12em; }

/* Estate request post: the request types as a row of checkboxes */
fieldset.request-types { border: 0; padding: 0; margin: 0; min-width: 0; max-width: 340px;
                         flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px 12px; }
fieldset.request-types > span { flex-basis: 100%; }

/* This month, change history, gaps */
.stats .done { opacity: .75; }
.meter { display: block; align-self: stretch; height: 6px; border-radius: 3px; background: var(--border); margin: 4px 0 2px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); }
.stats .bad .meter > span { background: var(--error); }
nav.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
nav.chips .chip { padding: 2px 10px; text-decoration: none; }
.changes { list-style: none; padding: 0; margin: 0 0 8px; text-align: left; }
.change { display: grid; grid-template-columns: 7.5em 5.5em 1fr auto; gap: 4px 10px; align-items: baseline;
          padding: 6px 0; border-bottom: 1px solid var(--border); }
.change:last-child { border-bottom: 0; }
.change .when { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.change .badge { justify-self: start; }
.change .note { color: var(--muted); }
.change .fields { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: .85rem; color: var(--muted); margin-top: 2px; }
.change .fields s { color: var(--muted); }
.change .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge.added, .badge.restored, .badge.imported { border-color: var(--good); color: var(--good); }
.badge.deleted { border-color: var(--error); color: var(--error); }
.badge.changed { border-color: var(--accent); color: var(--accent); }
form.inline { display: inline; margin: 0; }
.pager { display: flex; gap: 16px; align-items: center; }
@media (max-width: 600px) {
  .change { grid-template-columns: auto 1fr; }
  .change .what { grid-column: 1 / -1; }
  .change .num { grid-column: 1 / -1; }
}
