/* Shiori (栞) — "typewritten inventory" look.
   Monospace throughout, sepia paper and brown ink, dense rows, dashed and
   dotted rules. Light tokens live on :root; dark tokens apply either from
   the OS preference (when nothing is stored) or from html[data-theme="dark"],
   which theme.js sets from the masthead toggle. */

:root {
  --paper: #efe3cc;
  --paper-2: #e3d3b4;
  --sheet: #f7eedb;
  --ink: #3a2a1c;
  --ink-2: #5c4934;
  --quiet: #8a7458;
  --rule: #cdb994;
  --rule-2: #a98f68;
  --accent: #a3441d;
  --accent-ink: #f7eedb;
  --ok-bg: #e4dfb9;
  --warn-bg: #efd9a4;
  --warn-rule: #b9903a;
  --err-bg: #ebcdb8;
  --st-in_progress: #4a6b7c;
  --st-paused: #a8791f;
  --st-planned: #8a7458;
  --st-completed: #5f7a3f;
  --st-dropped: #a3441d;
  --mono: "Cascadia Mono", Consolas, "SF Mono", Menlo, "DejaVu Sans Mono", "Liberation Mono", "Courier New", monospace;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235c4934' stroke-width='1.6'/%3E%3C/svg%3E");
  --icon-filter: none;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #2a211a; --paper-2: #362b22; --sheet: #31271f;
    --ink: #eadfc8; --ink-2: #d1c1a5; --quiet: #a5927a;
    --rule: #4b3d31; --rule-2: #6c5644;
    --accent: #e08252; --accent-ink: #2a211a;
    --ok-bg: #343a24; --warn-bg: #473818; --warn-rule: #9d7c33; --err-bg: #4d2d21;
    --st-in_progress: #7fa3b5; --st-paused: #d6a445; --st-planned: #a08b6c;
    --st-completed: #8fb069; --st-dropped: #dc7a4c;
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23d1c1a5' stroke-width='1.6'/%3E%3C/svg%3E");
    --icon-filter: invert(.85) sepia(.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #2a211a; --paper-2: #362b22; --sheet: #31271f;
  --ink: #eadfc8; --ink-2: #d1c1a5; --quiet: #a5927a;
  --rule: #4b3d31; --rule-2: #6c5644;
  --accent: #e08252; --accent-ink: #2a211a;
  --ok-bg: #343a24; --warn-bg: #473818; --warn-rule: #9d7c33; --err-bg: #4d2d21;
  --st-in_progress: #7fa3b5; --st-paused: #d6a445; --st-planned: #a08b6c;
  --st-completed: #8fb069; --st-dropped: #dc7a4c;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23d1c1a5' stroke-width='1.6'/%3E%3C/svg%3E");
  --icon-filter: invert(.85) sepia(.3);
  color-scheme: dark;
}

/* ---- base */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.5 var(--mono);
  overflow-wrap: anywhere;            /* long unbroken strings never overflow */
}
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 2px; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
h1, h2, h3 { font-weight: 700; line-height: 1.25; margin: 0; }
h1 { font-size: 1.3rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 1rem; }
h1::before { content: "== "; color: var(--quiet); }
h1::after { content: " =="; color: var(--quiet); }
h1.plain { text-transform: none; letter-spacing: 0; font-size: 1.35rem; }
h1.plain::before, h1.plain::after { content: none; }
h2 { font-size: .95rem; text-transform: uppercase; letter-spacing: .1em; margin: 1.75rem 0 .6rem; padding-bottom: .25rem; border-bottom: 1px dashed var(--rule-2); }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
code { background: var(--paper-2); padding: .05em .35em; }
.eyebrow { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; margin: 0 0 .25rem; }
.eyebrow::before { content: "# "; }
.quiet, .muted { color: var(--quiet); }
.mono { font-family: var(--mono); }
.small-text { font-size: .85rem; }
.hint { color: var(--quiet); font-size: .9rem; margin: .25rem 0 .75rem; }
.byline { color: var(--ink-2); margin: 0 0 .75rem; }
.blurb { color: var(--quiet); font-size: .9rem; }
.colophon { color: var(--quiet); font-size: .8rem; margin-top: 2rem; padding-top: .5rem; border-top: 1px dashed var(--rule-2); }
.description { white-space: pre-wrap; max-width: 72ch; }

/* uppercase sans-style labels, in mono */
.label, .menu a, .tabs a, .table th, .tag, .sep-mark, .link-sep span, .view-toggle a, .role, legend, label, button, .button {
  text-transform: uppercase; letter-spacing: .04em; font-size: .78rem;
}

/* ---- masthead */
.masthead { border-bottom: 1px dashed var(--ink); background: var(--paper); }
.masthead-inner {
  max-width: 1120px; margin: 0 auto; padding: .7rem 1.25rem;
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 1.15rem; letter-spacing: .05em; text-decoration: none; white-space: nowrap; }
.brand .mark { display: inline-block; margin-right: .45rem; padding: 0 .3rem; background: var(--accent); color: var(--accent-ink); font-weight: 400; font-size: 1rem; line-height: 1.5; vertical-align: .05em; border-radius: .2rem; }
.brand span { color: var(--accent); }
.brand:hover { color: var(--ink); }
.menu { display: flex; gap: 1.2rem; flex: 1; flex-wrap: wrap; }
.menu a { text-decoration: none; color: var(--ink-2); padding-bottom: .1rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.menu a:hover { color: var(--accent); }
.menu a.active { color: var(--ink); border-bottom-color: var(--accent); }
.who { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.who > a { text-decoration: none; font-weight: 700; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-bottom: 2px solid transparent; }
.who > a.active { border-bottom-color: var(--accent); }
.who > a.meta { font-weight: 400; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; font-size: .78rem; }
.who > a.meta:hover { color: var(--accent); }
.page-head .new-entry { align-self: center; }
.tabs .tabs-manage { margin-left: auto; color: var(--quiet); font-size: .7rem; }
.tabs .tabs-manage::before { content: "⚙ "; }
.tabs .tabs-manage:hover { color: var(--accent); }
.role { color: var(--quiet); font-weight: 400; margin-left: .4rem; }
.badge { background: var(--accent); color: var(--accent-ink); padding: 0 .4em; font-size: .72rem; font-weight: 700; vertical-align: middle; }
.theme-toggle { margin-left: auto; padding: .25rem .5rem; font-size: .7rem; border-color: var(--rule-2); color: var(--quiet); white-space: nowrap; }
.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
.theme-toggle::before { content: "◐ "; }
.who + .theme-toggle { margin-left: 0; }
.admin-link { font-weight: 400; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; font-size: .78rem; text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.admin-link:hover { color: var(--accent); }
.admin-link.active { color: var(--ink); border-bottom-color: var(--accent); }

/* ---- page */
.page { max-width: 1120px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.column { max-width: 760px; }
.narrow { max-width: 480px; margin: 0 auto; }
.sheet { background: var(--sheet); border: 1px dashed var(--rule-2); padding: 1.1rem 1.25rem 1.25rem; }
.auth { max-width: 420px; margin: 3rem auto; }
.page-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.page-head h1 { flex: 1 1 20rem; min-width: 0; }
.page-head .actions { flex: 0 0 auto; display: flex; gap: .4rem; }
.detail { display: grid; grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); gap: 2.5rem; align-items: start; }
@media (max-width: 820px) { .detail { grid-template-columns: 1fr; } }
.detail h1 { text-transform: none; letter-spacing: 0; font-size: 1.35rem; }
.detail h1::before, .detail h1::after { content: none; }
.detail-side h2 { margin-top: 0; }
.untrack { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px dashed var(--rule-2); }

/* ---- forms */
.stack { display: flex; flex-direction: column; gap: .8rem; }
label { display: flex; flex-direction: column; gap: .25rem; color: var(--quiet); }
label > input, label > select, label > textarea { font-size: .95rem; letter-spacing: 0; text-transform: none; }
.row { display: flex; gap: .75rem; align-items: end; flex-wrap: wrap; }
.row > label { flex: 1 1 10rem; }
.inline { display: inline; }
input, select, textarea {
  font: .95rem/1.4 var(--mono); color: var(--ink); background: var(--sheet);
  border: 1px solid var(--rule-2); border-radius: 0; padding: .35rem .55rem; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }

/* native controls: consistent chrome where the browser lets us */
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 1.9rem; cursor: pointer;
  background-image: var(--chevron); background-repeat: no-repeat; background-position: right .6rem center; background-size: .65rem;
}
select:disabled { cursor: default; opacity: .6; }
input[type=date], input[type=number] { cursor: text; }
input[type=date]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .55; filter: var(--icon-filter); }
input[type=date]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
input[type=number]::-webkit-inner-spin-button { opacity: .6; filter: var(--icon-filter); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: .95rem; height: .95rem; }
input[type=file]::file-selector-button {
  font: 700 .72rem/1 var(--mono); text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink); background: var(--paper-2); border: 1px solid var(--rule-2); padding: .3rem .6rem; margin-right: .6rem; cursor: pointer;
}
input[type=file]::file-selector-button:hover { border-color: var(--ink); }

/* star rating: radio inputs rendered as stars; siblings after the checked
   one (visually to its left, thanks to row-reverse) light up */
.stars-field { border: none; padding: 0; margin: 0; }
.stars-field legend { padding: 0; margin-bottom: .25rem; }
.stars-value { text-transform: none; letter-spacing: 0; margin-left: .4rem; }
.stars { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.stars-row { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.stars-row label { cursor: pointer; font-size: 1.45rem; line-height: 1; padding: 0 .06em; color: var(--rule-2); transition: color .08s; }
.stars-row input:checked ~ label, .stars-row label:hover, .stars-row label:hover ~ label { color: var(--st-paused); }
.stars-clear label { cursor: pointer; font-size: .72rem; color: var(--quiet); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.stars-clear label:hover { color: var(--accent); }
.stars input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

/* date box: ISO text field + visible calendar button + app-drawn month grid */
.datebox { position: relative; display: flex; align-items: stretch; }
.datebox input { flex: 1; padding-right: 2.4rem; }
.datebox-btn { position: absolute; right: 0; top: 0; bottom: 0; width: 2.2rem; display: flex; align-items: center; justify-content: center; padding: 0; border: none; border-left: 1px solid var(--rule-2); background: var(--paper-2); color: var(--ink-2); cursor: pointer; }
.datebox-btn:hover { color: var(--accent); background: var(--paper-2); }
.datebox-btn svg { width: 1rem; height: 1rem; }
.datepick { position: absolute; z-index: 45; top: calc(100% + 4px); left: 0; min-width: 16.5rem; padding: .6rem; background: var(--sheet); border: 1px solid var(--rule-2); box-shadow: 4px 4px 0 var(--paper-2); }
.datepick[hidden] { display: none; }
.datepick-head { display: flex; align-items: center; justify-content: space-between; gap: .3rem; margin-bottom: .45rem; }
.datepick-head .title { font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.datepick-head button { padding: .2rem .5rem; font-size: .75rem; }
.datepick-grid { display: grid; grid-template-columns: repeat(7, 2.1rem); gap: 2px; text-align: center; }
.datepick-grid .wd { font-size: .65rem; color: var(--quiet); text-transform: uppercase; padding: .15rem 0; }
.datepick-grid button { padding: .3rem 0; font-size: .85rem; font-weight: 400; border: 1px solid transparent; background: transparent; text-transform: none; letter-spacing: 0; }
.datepick-grid button:hover { border-color: var(--rule-2); background: var(--paper-2); }
.datepick-grid button.other { color: var(--quiet); opacity: .6; }
.datepick-grid button.today { border-color: var(--rule-2); }
.datepick-grid button.selected { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.datepick-foot { display: flex; justify-content: space-between; margin-top: .45rem; }
.datepick-foot button { padding: .25rem .55rem; font-size: .7rem; }

/* tag box: chips + typing area + our own suggestion list (replaces datalist) */
.tagbox { position: relative; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; min-height: 2.1rem; padding: .25rem .4rem; background: var(--sheet); border: 1px solid var(--rule-2); cursor: text; }
.tagbox:focus-within { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.tagbox, .tagbox * { text-transform: none; letter-spacing: 0; }  /* labels uppercase their contents; tags are as typed */
.tagbox .tag-chip { text-transform: none; font-size: .78rem; padding: .1em .45em; }
.tagbox .tag-chip button { all: unset; cursor: pointer; margin-left: .35em; color: var(--quiet); font-size: .8em; }
.tagbox .tag-chip button:hover { color: var(--accent); }
.tagbox-input { flex: 1 1 8rem; min-width: 6rem; width: auto; border: none; background: transparent; padding: .15rem .2rem; }
.tagbox-input:focus { outline: none; }
.tag-suggest { position: absolute; left: -1px; right: -1px; top: 100%; z-index: 40; margin: 0; padding: .2rem 0; list-style: none; background: var(--sheet); border: 1px solid var(--rule-2); box-shadow: 3px 3px 0 var(--paper-2); max-height: 14rem; overflow-y: auto; }
.tag-suggest li { padding: .3rem .6rem; cursor: pointer; font-size: .9rem; }
.tag-suggest li.active, .tag-suggest li:hover { background: var(--paper-2); color: var(--accent); }
.tag-suggest li.new { color: var(--quiet); }
.tag-suggest li.new::before { content: "+ "; }
.tag-suggest li.new b { color: var(--ink); font-weight: 400; }
textarea { resize: vertical; }
.check { flex-direction: row; align-items: center; gap: .35rem; text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--ink-2); }
.check input { width: auto; }
fieldset { border: 1px dashed var(--rule-2); padding: .75rem 1rem 1rem; margin: 0; min-width: 0; }
legend { color: var(--quiet); padding: 0 .4rem; }
.form-actions { display: flex; align-items: center; gap: 1rem; margin-top: .25rem; flex-wrap: wrap; }

button, .button {
  font-family: var(--mono); font-weight: 700; line-height: 1;
  color: var(--ink); background: var(--sheet); border: 1px solid var(--ink);
  border-radius: 0; padding: .5rem .8rem; cursor: pointer; text-decoration: none; display: inline-block; width: auto;
  white-space: nowrap;
}
button:hover, .button:hover { background: var(--paper-2); color: var(--ink); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
button.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.danger, .button.danger { color: var(--accent); border-color: var(--accent); }
button.danger:hover, .button.danger:hover { background: var(--accent); color: var(--accent-ink); }
button.small, .button.small { padding: .3rem .55rem; font-size: .7rem; }
button.icon { padding: .2rem .4rem; font-size: .65rem; border-color: var(--rule-2); color: var(--quiet); }
button.icon:hover { color: var(--ink); border-color: var(--ink); }
button.link { background: none; border: none; padding: 0; font: inherit; text-transform: none; letter-spacing: 0; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--rule-2); white-space: normal; }
button.link:hover { color: var(--accent); background: none; }

/* links editor */
.link-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .45rem; }
.link-row input[name=link_label] { flex: 0 1 180px; }
.link-row input[name=link_url] { flex: 1 1 200px; }
.sep-row { background: var(--paper-2); padding: .3rem .5rem; border-left: 3px solid var(--rule-2); }
.sep-row input[name=link_label] { flex: 1 1 200px; }
.sep-mark { color: var(--quiet); white-space: nowrap; }
.row-tools { display: flex; gap: .2rem; margin-left: auto; flex: 0 0 auto; }
.row-actions { display: flex; gap: .5rem; margin-top: .5rem; flex-wrap: wrap; }
@media (max-width: 600px) { .link-row { flex-wrap: wrap; } .link-row input[name=link_label] { flex-basis: 100%; } }

/* ---- messages */
.flash { background: var(--ok-bg); border-left: 3px solid var(--st-completed); padding: .55rem .8rem; margin-bottom: 1.25rem; }
.error { background: var(--err-bg); border-left: 3px solid var(--accent); padding: .55rem .8rem; margin-bottom: 1rem; }
.warning { background: var(--warn-bg); border-left: 3px solid var(--warn-rule); padding: .6rem .8rem; margin: 1rem 0; }
.notice { background: var(--paper-2); border-left: 3px solid var(--rule-2); padding: .55rem .8rem; }
.tag { background: var(--paper-2); color: var(--quiet); padding: .05em .4em; }
.dim { opacity: .55; }

/* ---- tables */
.table-wrap { overflow-x: auto; max-width: 100%; }
.table { width: 100%; border-collapse: collapse; border-top: 2px solid var(--ink); }
.table th { text-align: left; padding: .4rem .5rem; color: var(--ink-2); font-weight: 700; border-bottom: 1px dashed var(--rule-2); white-space: nowrap; }
.table td { padding: .45rem .5rem; border-bottom: 1px dotted var(--rule-2); vertical-align: top; }
.table tbody tr:hover td { background: var(--paper-2); }
.table .actions { white-space: nowrap; text-align: right; }
.table .actions form { margin-left: .3rem; }
.table input, .table select { width: auto; }
.table td.nowrap { white-space: nowrap; }
/* browse table: fixed layout so long titles/authors wrap inside their column */
.entries { table-layout: fixed; min-width: 760px; }
.entries col.c-title { width: auto; }
.entries col.c-author { width: 18%; }
.entries col.c-kind { width: 11%; }
.entries col.c-status { width: 11.5rem; }
.entries col.c-progress { width: 13%; }
.entries col.c-rating { width: 4.5rem; }
.entries col.c-updated { width: 6.5rem; }
.entries td:first-child > a { font-weight: 700; text-decoration: none; }
.entries td:first-child > a:hover { text-decoration: underline; }
.entries .blurb { margin: .1rem 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.entries .byline { margin: 0; }
.entries td.mono { color: var(--quiet); font-size: .85rem; }

/* status control */
.status-cell select {
  font-family: var(--mono); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em;
  padding: .3rem .4rem .3rem .5rem; border: 1px solid var(--rule-2); border-left-width: 6px; background: var(--sheet); width: 100%; max-width: 11rem;
}
.status-in_progress { border-left-color: var(--st-in_progress) !important; }
.status-paused { border-left-color: var(--st-paused) !important; }
.status-planned { border-left-color: var(--st-planned) !important; }
.status-completed { border-left-color: var(--st-completed) !important; }
.status-dropped { border-left-color: var(--st-dropped) !important; }
.status-cell button { border-style: dashed; color: var(--quiet); font-size: .7rem; padding: .35rem .5rem; white-space: normal; }
.status-cell button:hover { border-style: solid; color: var(--ink); }

/* ---- browse chrome: search/sort bar + collapsible filter panel */
.filters { margin-bottom: 1.1rem; border: 1px dashed var(--rule-2); }
.filter-bar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .6rem; }
.filter-bar input, .filter-bar select { width: auto; }
.filter-bar .filter-search { flex: 1 1 240px; }
.filter-reset { font-size: .85rem; margin-left: .25rem; }
.filter-more > summary { list-style: none; cursor: pointer; padding: .45rem .6rem; border-top: 1px dashed var(--rule-2); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); display: flex; align-items: center; gap: .5rem; }
.filter-more > summary::-webkit-details-marker { display: none; }
.filter-more > summary::before { content: "▸"; color: var(--quiet); font-size: .7rem; }
.filter-more[open] > summary::before { content: "▾"; }
.filter-more > summary:hover { color: var(--accent); }
.filter-active { font-weight: 400; text-transform: none; letter-spacing: 0; }
.filter-panel { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: .55rem 1rem; align-items: center; padding: .25rem .75rem .8rem; background: var(--paper-2); border-top: 1px dashed var(--rule-2); }
.filter-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--quiet); }
.filter-controls { min-width: 0; }
.filter-controls .statuses { display: flex; gap: .7rem; flex-wrap: wrap; }
.filter-controls select, .filter-controls input:not([type=checkbox]) { width: auto; max-width: 100%; background: var(--sheet); }
.filter-controls input[name=author] { width: 18rem; }
.filter-controls .tagbox { max-width: 34rem; }
.statuses { display: flex; gap: .7rem; flex-wrap: wrap; }
@media (max-width: 640px) { .filter-panel { grid-template-columns: 1fr; gap: .2rem 0; } .filter-label { margin-top: .5rem; } }

.tabs { display: flex; gap: .25rem; border-bottom: 1px dashed var(--ink); margin: .5rem 0 1.1rem; flex-wrap: wrap; }
.tabs a { text-decoration: none; color: var(--quiet); padding: .3rem .6rem; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { background: var(--ink); color: var(--paper); font-weight: 700; }
.tabs a.active::before { content: "[ "; } .tabs a.active::after { content: " ]"; }
/* same metrics as button.small so it lines up with "+ New entry" */
.view-toggle { display: flex; align-self: center; }
.view-toggle a {
  text-decoration: none; display: inline-block; line-height: 1; font-weight: 700; font-size: .7rem;
  padding: .3rem .55rem; border: 1px solid var(--ink); color: var(--ink-2); background: var(--sheet);
}
.view-toggle a + a { border-left: none; }
.view-toggle a.active { background: var(--ink); color: var(--paper); }
.view-toggle a:hover { color: var(--ink); background: var(--paper-2); }
.view-toggle a.active:hover { color: var(--paper); background: var(--ink); }

/* ---- cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.card { background: var(--sheet); border: 1px dashed var(--rule-2); border-top: 4px solid var(--rule-2); padding: .9rem 1rem; display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.card.status-in_progress { border-top-color: var(--st-in_progress); }
.card.status-paused { border-top-color: var(--st-paused); }
.card.status-planned { border-top-color: var(--st-planned); }
.card.status-completed { border-top-color: var(--st-completed); }
.card.status-dropped { border-top-color: var(--st-dropped); }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card .byline { margin-bottom: .2rem; }
.card .blurb { margin: .2rem 0 .5rem; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card .links { display: flex; gap: .25rem .8rem; flex-wrap: wrap; font-size: .85rem; }
.card .links a { max-width: 100%; }
.card .links .link-sep { flex-basis: 100%; color: var(--quiet); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; border-top: 1px dashed var(--rule-2); padding-top: .3rem; margin-top: .2rem; }
.card .links .link-sep:empty { padding: 0; margin-top: .15rem; }
.card-foot { margin-top: auto; padding-top: .6rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.card-foot .status-cell { flex: 0 1 11rem; min-width: 8rem; }

/* ---- covers: ThumbHash placeholder painted as background, real image fades in */
.cover {
  display: block; position: relative; overflow: hidden; flex: 0 0 auto;
  width: 96px; aspect-ratio: 2 / 3;
  background: var(--paper-2) center / cover no-repeat; border: 1px solid var(--rule-2);
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; }
.cover.loaded img { opacity: 1; }
.cover-large { width: 200px; max-width: 40%; margin: 0 0 .5rem; }
.cover-note { position: absolute; right: 0; bottom: 0; padding: .05rem .3rem; background: var(--paper); font-size: .7rem; }
.cover-thumb { width: 64px; }
a.cover:hover { border-color: var(--accent); }
.caption { margin: 0 0 .75rem; font-size: .85rem; }
.gallery { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1rem; }
.card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: .9rem; }
.card-body { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.card-body .card-foot { margin-top: auto; }

/* image editor rows on the entry form */
.image-rows { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .75rem; }
.image-row { display: flex; gap: .75rem; align-items: center; padding: .4rem .5rem; border: 1px dotted var(--rule-2); }
.image-row:first-child { border-left: 3px solid var(--accent); }
.image-row:first-child::after { content: "cover"; order: 99; color: var(--accent); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; }
.image-fields { flex: 1 1 12rem; display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.image-row .row-tools { align-items: center; gap: .3rem; }
.image-row .remove { margin-left: .4rem; }
.images-editor input[type=file] { padding: .3rem; }
.new-images { margin-top: .5rem; }
.new-row input[type=file], .new-row input[type=url] { flex: 1 1 220px; }
.new-row input[name^=new_label] { flex: 0 1 200px; }
.link-list a.url { text-decoration-color: transparent; }
.link-list a.url:hover { text-decoration-color: var(--accent); }
@media (max-width: 600px) { .image-row { flex-wrap: wrap; } .image-row .row-tools { margin-left: 0; flex-basis: 100%; } }

/* lightbox */
.lightbox { border: 1px solid var(--rule-2); background: var(--paper); color: var(--ink); padding: .75rem; max-width: min(96vw, 1200px); max-height: 96vh; }
.lightbox::backdrop { background: rgba(0, 0, 0, .75); }
.lightbox img { display: block; max-width: 90vw; max-height: 84vh; object-fit: contain; margin: 0 auto; }
.lightbox-caption { margin: .5rem 0 0; text-align: center; font-size: .85rem; color: var(--quiet); }
.lightbox-caption:empty { display: none; }
.lightbox-close { position: absolute; top: .4rem; right: .4rem; padding: .2rem .5rem; }

/* ---- pager */
.pager { display: flex; gap: .9rem; align-items: baseline; flex-wrap: wrap; margin: .25rem 0 .9rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.table-wrap + .pager, .cards + .pager { margin-top: 1rem; }
.pager a { text-decoration: none; color: var(--ink-2); }
.pager a:hover { color: var(--accent); }
.pager .pager-count { color: var(--quiet); }
.pager .pager-page { font-weight: 700; }
.counter { text-transform: none; letter-spacing: 0; font-size: .78rem; align-self: flex-end; }

/* ---- description excerpt + floating full-text panel */
.blurb.cut { cursor: help; }
.blurb.cut:focus { outline: 1px dashed var(--accent); outline-offset: 2px; }
.popover {
  position: fixed; z-index: 50; padding: .6rem .75rem;
  background: var(--sheet); color: var(--ink); border: 1px solid var(--rule-2);
  box-shadow: 4px 4px 0 var(--paper-2);
  font-size: .9rem; line-height: 1.5; white-space: pre-wrap;
  max-height: 60vh; overflow: auto; pointer-events: none;
}
.popover[hidden] { display: none; }

/* ---- catalog: "on my list" marker */
.entries-catalog col.c-pub { width: 9rem; }
.on-list { color: var(--st-completed); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.on-list + a { margin-left: .4rem; }

/* ---- inline progress editor in the table */
.progress-inline { width: 100%; max-width: 12rem; font-size: .85rem; padding: .25rem .4rem; background: transparent; border-color: transparent; color: var(--quiet); }
.progress-inline:hover { border-color: var(--rule-2); background: var(--sheet); color: var(--ink); }
.progress-inline:focus { background: var(--sheet); color: var(--ink); }
.progress-inline.htmx-request { opacity: .5; }

/* ---- account: sessions */
.sessions tr.current td { background: var(--paper-2); }
.sessions .ua { max-width: 22rem; }
.narrow-form { max-width: 420px; }
.similar { margin: .4rem 0; padding-left: 1.2rem; }

/* ---- tags */
.tags { display: inline-flex; gap: .35rem .4rem; flex-wrap: wrap; }
.tag-chip { display: inline-block; padding: .12em .55em; font-size: .78rem; letter-spacing: .01em; border: 1px solid var(--rule-2); color: var(--ink-2); text-decoration: none; background: var(--paper-2); white-space: nowrap; }
.tag-chip::before { content: "#"; color: var(--quiet); margin-right: .15em; }
.tag-chip:hover { color: var(--accent); border-color: var(--accent); }
.tag-row { margin: .1rem 0 .55rem; }
.tag-row-detail { margin: -.25rem 0 1rem; }
.tags-cell .tags { gap: .3rem; }
.tags-cell .tag-chip { font-size: .72rem; padding: .08em .45em; }
.entries col.c-tags { width: 17%; }
.rating-cell .star, .card-foot .star, .comment .star { color: var(--st-paused); }
.tag-chip.active { border-style: solid; color: var(--ink); }
.tag-chip.active a { text-decoration: none; margin-left: .2rem; color: var(--quiet); }
.tag-chip.active a:hover { color: var(--accent); }
.active-tags { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin: 0 0 .75rem; font-size: .85rem; color: var(--quiet); }
.tabs .tabs-manage-2 { margin-left: .75rem; }

/* ---- publication status: boxed tag (catalog column) or inline text (metadata lines) */
.eyebrow-sep { color: var(--quiet); font-weight: 400; }
.pub-inline { font-weight: 700; }
.pub-inline.pub-ongoing { color: var(--st-in_progress); }
.pub-inline.pub-completed { color: var(--st-completed); }
.pub-inline.pub-hiatus { color: var(--st-paused); }
.pub-inline.pub-cancelled { color: var(--st-dropped); }
.pub-inline.pub-upcoming, .pub-inline.pub-unknown { color: var(--quiet); }
.subline { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; margin-top: .15rem; }
.entries-list col.c-tags { width: 22%; }
.entries-catalog col.c-tags { width: 18%; }
.entries col.c-status { width: 11rem; }

/* ---- publication status tag */
.pub { display: inline-block; margin-left: .4rem; padding: .05em .4em; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border: 1px solid var(--rule-2); color: var(--quiet); vertical-align: middle; }
.pub-ongoing { color: var(--st-in_progress); border-color: var(--st-in_progress); }
.pub-completed { color: var(--st-completed); border-color: var(--st-completed); }
.pub-hiatus { color: var(--st-paused); border-color: var(--st-paused); }
.pub-cancelled { color: var(--st-dropped); border-color: var(--st-dropped); }
.pub-upcoming { border-style: dashed; }
.byline .pub { margin-left: .5rem; }

/* collapsed forms (native disclosure styled as a button) */
details.disclosure { margin-top: .9rem; }
details.disclosure > summary { list-style: none; display: inline-block; cursor: pointer; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure[open] > summary { margin-bottom: .6rem; }

/* ---- comments */
.comments { margin-top: .5rem; }
.comments h2 .quiet { font-weight: 400; letter-spacing: .04em; font-size: .75rem; }
.comment { padding: .6rem 0 .7rem; border-bottom: 1px dotted var(--rule-2); }
.comment-head { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; font-size: .8rem; margin-bottom: .3rem; }
.comment-author { font-weight: 700; }
.comment-tools { margin-left: auto; display: flex; gap: .6rem; }
.comment-tools a, .comment-tools button.link { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.comment-form { margin-top: .9rem; }
.comment-form textarea { font-size: .9rem; }
.comment-form .form-actions .check { margin: 0; }
details.spoiler > summary { cursor: pointer; color: var(--accent); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
details.spoiler[open] > summary { margin-bottom: .3rem; }

/* rendered markdown */
.md { font-size: .95rem; max-width: 72ch; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md blockquote, .md pre, .md table { margin: 0 0 .7rem; }
.md h1, .md h2, .md h3, .md h4 { font-size: 1rem; text-transform: none; letter-spacing: 0; border: none; margin: .9rem 0 .3rem; padding: 0; }
.md h1::before, .md h1::after { content: none; }
.md ul, .md ol { padding-left: 1.4rem; }
.md blockquote { border-left: 3px solid var(--rule-2); padding-left: .75rem; color: var(--ink-2); }
.md pre { background: var(--paper-2); padding: .6rem .75rem; overflow-x: auto; }
.md code { background: var(--paper-2); padding: .05em .3em; }
.md pre code { background: none; padding: 0; }
.md table { border-collapse: collapse; }
.md th, .md td { border: 1px solid var(--rule-2); padding: .2rem .5rem; text-align: left; }
.md img { max-width: 100%; }
.md hr { border: none; border-top: 1px dashed var(--rule-2); margin: .8rem 0; }
.md input[type=checkbox] { width: auto; margin-right: .3rem; }

/* ---- link list on the detail page */
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { padding: .15rem 0; }
.link-list li::before { content: "- "; color: var(--quiet); }
.link-list a { word-break: break-all; }   /* long bare URLs fill the line instead of dropping below the dash */
.link-list .link-sep { margin-top: .5rem; padding-top: .3rem; border-top: 1px dashed var(--rule-2); color: var(--quiet); }
.link-list .link-sep::before { content: none; }
.link-list .link-sep:empty { padding: 0; }
.link-list .link-sep span { font-weight: 700; }
.link-list .quiet { font-size: .85rem; }

/* ---- small screens */
@media (max-width: 720px) {
  .masthead-inner { gap: .75rem 1rem; }
  .page { padding: 1rem .9rem 3rem; }
  .page-head .actions { flex-basis: 100%; margin-bottom: .75rem; }
  .who > a { max-width: 10rem; }
}

/* ---- profiles, avatars, follows */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; position: relative; overflow: hidden; flex: 0 0 auto;
  width: 2rem; height: 2rem; background: var(--paper-2) center / cover no-repeat; border: 1px solid var(--rule-2);
  color: var(--quiet); font-family: var(--mono); font-weight: 700; font-size: .9rem; line-height: 1; vertical-align: middle;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; }
.avatar.loaded img { opacity: 1; }
.avatar-large { width: 96px; height: 96px; font-size: 2.4rem; }
.profile-head { display: flex; gap: 1.25rem; align-items: flex-start; margin-bottom: .5rem; }
.profile-id { flex: 1 1 auto; min-width: 0; }
.profile-id .page-head { margin-bottom: .1rem; }
.profile-id .page-head h1 { margin: 0; }
.profile-id .page-head .actions { align-items: center; }
.profile-meta { margin: 0; font-size: .9rem; }
.profile-meta a { color: var(--quiet); }
.profile-meta a:hover { color: var(--accent); }
.profile-about { display: grid; grid-template-columns: minmax(0, 3fr) minmax(220px, 1fr); gap: 2rem; align-items: start; }
.profile-counts h2 { margin-top: 0; }
.table.counts th { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink-2); white-space: nowrap; }
.table.counts .total th { font-weight: 700; }
.table.counts .total td, .table.counts .total th { border-top: 1px solid var(--ink); }
.table td.num, .table th.num { text-align: right; }
.table.users td.num, .table.users th.num, .table.users td.nowrap { width: 1%; white-space: nowrap; padding-right: 1.5rem; }
.status-dot { display: inline-block; width: .6em; height: .6em; margin-right: .5em; background: var(--rule-2); vertical-align: baseline; }
tr.status-in_progress .status-dot { background: var(--st-in_progress); }
tr.status-paused .status-dot { background: var(--st-paused); }
tr.status-planned .status-dot { background: var(--st-planned); }
tr.status-completed .status-dot { background: var(--st-completed); }
tr.status-dropped .status-dot { background: var(--st-dropped); }
.who-cell { white-space: nowrap; }
.who-link { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 700; vertical-align: middle; }
.who-link:hover span { text-decoration: underline; }
.who-cell .tag { margin-left: .4rem; }
.follow { display: inline-flex; align-items: center; gap: .5rem; }
.tag.friends { color: var(--st-completed); }
.comment-on { font-weight: 700; text-decoration: none; }
.comment-on:hover { text-decoration: underline; }
.profile-form { display: flex; flex-direction: column; gap: .8rem; max-width: 560px; }
.profile-avatar-field { display: flex; gap: 1.25rem; align-items: flex-start; }
.profile-avatar-field .stack { flex: 1 1 auto; gap: .5rem; }
@media (max-width: 720px) {
  .profile-about { grid-template-columns: 1fr; }
}

/* ---- list sharing (phase 2 stage B) */
.visibility-cell select {
  font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--quiet);
  padding: .3rem .4rem; border: 1px solid var(--rule-2); background: var(--sheet); width: 100%; max-width: 8rem;
}
.visibility-cell select.visibility-friends { color: var(--ink-2); }
.visibility-cell select.visibility-members { color: var(--ink); border-color: var(--ink-2); }
.card-foot .visibility-cell { flex: 0 0 auto; }
.card-foot .visibility-cell select { width: auto; }
.status-plain {
  display: inline-block; font-family: var(--mono); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em;
  padding: .3rem .5rem; border: 1px solid var(--rule-2); border-left-width: 6px; background: var(--sheet);
}
.progress-plain { font-size: .85rem; color: var(--quiet); }
.list-owner { margin: 0 0 .1rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.list-owner a { text-decoration: none; color: var(--quiet); }
.list-owner a:hover { color: var(--accent); }
details.bulk { margin: -.25rem 0 .9rem; }
details.bulk > summary { font-size: .72rem; padding: .3rem .55rem; border-style: dashed; color: var(--quiet); }
details.bulk[open] > summary { border-style: solid; color: var(--ink); margin-bottom: .5rem; }
.bulk-bar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; font-size: .9rem; color: var(--ink-2); }
.bulk-bar select { width: auto; }
.tabs .tabs-view { margin-left: auto; align-self: center; margin-bottom: .2rem; }
.tabs .tabs-manage + .tabs-view { margin-left: 1rem; }
/* list table: the per-user columns take only what they need so the title keeps most of the width */
.entries-list { min-width: 860px; }
.entries-list col.c-author { width: 14%; }
.entries-list col.c-tags { width: 15%; }
.entries-list col.c-status { width: 9.5rem; }
.entries-list col.c-progress { width: 7rem; }
.entries-list col.c-rating { width: 4rem; }
.entries-list col.c-visibility { width: 6.5rem; }
.entries-list .status-cell select { max-width: none; }
.progress-inline { max-width: none; }

/* ---- threads (phase 2 stage C): replies nest under a coloured rail; the
   first levels indent, deeper ones hold their indent and cycle the colour */
.comment.pinned { background: var(--paper-2); padding-left: .6rem; padding-right: .6rem; border-left: 3px solid var(--accent); }
.tag.pin { color: var(--accent); }
.tombstone-body { font-style: italic; margin: 0 0 .2rem; }
.permalink { text-decoration: none; }
.permalink:hover { text-decoration: underline; }
.comment:target { outline: 2px solid var(--accent); outline-offset: 4px; }
.comment-tools form { margin: 0; }
details.reply-form { margin: .3rem 0 .1rem; }
details.reply-form > summary { list-style: none; display: inline-block; cursor: pointer; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--quiet); }
details.reply-form > summary::-webkit-details-marker { display: none; }
details.reply-form > summary::before { content: "↩ "; }
details.reply-form > summary:hover { color: var(--accent); }
details.reply-form[open] > summary { color: var(--ink); margin-bottom: .4rem; }
details.reply-form .comment-form { margin-top: 0; }
details.replies { margin-top: .4rem; }
details.replies > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--quiet); padding: .15rem 0; }
details.replies > summary::-webkit-details-marker { display: none; }
details.replies > summary::before { content: "▸"; width: .7rem; color: var(--rail); }
details.replies[open] > summary::before { content: "▾"; }
details.replies > summary:hover { color: var(--ink); }
.replies-list { position: relative; margin-left: .1rem; padding-left: .65rem; }
.rail { position: absolute; left: -4px; top: 0; bottom: 0; width: 12px; display: block; }
.rail::before { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 2px; background: var(--rail); transition: width .08s, left .08s; }
.rail:hover::before, .rail:focus-visible::before { left: 3px; width: 4px; }
.rail:focus-visible { outline: none; }
.replies-list > .comment:last-child { border-bottom: none; padding-bottom: .2rem; }
.replies-list .comment { padding: .45rem 0 .5rem; }
.comment.depth-0 { --rail: var(--st-in_progress); }
.comment.depth-1 { --rail: var(--st-paused); }
.comment.depth-2 { --rail: var(--st-completed); }
.comment.depth-3 { --rail: var(--accent); }
.comment.depth-4 { --rail: var(--st-planned); }
.comment.depth-5 { --rail: var(--st-dropped); }
/* beyond the third level the indent stops growing */
.replies-list .replies-list .replies-list .replies-list { margin-left: 0; padding-left: .45rem; }
.wall .disclosure { margin: 0 0 1rem; }
/* comments use the full width of their column (the 72ch cap stays for bios and the like) */
.comment .md { max-width: none; }

/* ---- forum (phase 2 stage D) */
.table.forum td, .table.posts td { vertical-align: middle; }
.forum-topic a, .post-title a { font-weight: 700; text-decoration: none; }
.forum-topic a:hover, .post-title a:hover { text-decoration: underline; }
.forum-desc { font-size: .85rem; margin-top: .1rem; }
.forum-latest a { text-decoration: none; }
.forum-latest a:hover { text-decoration: underline; }
.forum-latest .small-text a { text-decoration: none; }
.forum-sep th { padding: .9rem .5rem .3rem; border-bottom: 1px dashed var(--ink); color: var(--ink-2); font-size: .8rem; letter-spacing: .08em; }
.table.forum .forum-sep th::before { content: "== "; color: var(--quiet); }
.table.forum tbody tr:first-child.forum-sep th { padding-top: .3rem; }
.forum-manage { margin-top: .75rem; text-align: right; font-size: .7rem; }
.table.posts tr.pinned td { background: var(--paper-2); }
.table.posts .subline { margin-top: .1rem; }
.topics .topic-form { gap: .3rem; }
.topics .topic-name { font-weight: 700; }
.topics input[name=name], .topics input[name=description] { width: 100%; min-width: 10rem; }
.topics .check.inline { display: inline-flex; margin-right: .5rem; }
.post-meta { margin: -.25rem 0 1rem; font-size: .9rem; }
.post-body { max-width: none; margin-bottom: 1.5rem; }
.post-page .comments h2 .quiet { font-weight: 400; letter-spacing: .04em; font-size: .75rem; }
.entry-forum { margin: 1.25rem 0 .5rem; }
.entry-forum .link-list { margin-bottom: .5rem; }
.token-reveal { margin: .5rem 0 1rem; }
.token-reveal .token { display: block; margin-top: .4rem; padding: .4rem .6rem; background: var(--paper); border: 1px dashed var(--rule-2); word-break: break-all; user-select: all; }
.danger-link { color: var(--accent) !important; }

/* ---- notifications (phase 3): bell in the bar, list page */
.who > a.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; max-width: none; overflow: visible; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; }
.bell:hover { color: var(--accent); }
.bell.active { color: var(--ink); border-bottom-color: var(--accent); }
.bell svg { width: 1.1rem; height: 1.1rem; }
.bell .count {
  position: absolute; top: -.25rem; right: -.3rem; box-sizing: border-box; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem;
  display: inline-flex; align-items: center; justify-content: center; border-radius: .6rem;
  background: #c0392b; color: #fff; font-family: var(--mono); font-size: .62rem; font-weight: 700; line-height: 1; letter-spacing: 0;
}
.notifications { list-style: none; padding: 0; margin: 0 0 .75rem; border-top: 2px solid var(--ink); }
.notification { display: flex; gap: 1rem; align-items: baseline; justify-content: space-between; padding: .5rem .5rem; border-bottom: 1px dotted var(--rule-2); }
.notification.unread { background: var(--paper-2); border-left: 3px solid var(--accent); }
.notification-link { text-decoration: none; flex: 1 1 auto; }
.notification-link:hover { text-decoration: underline; }
.notification time { flex: 0 0 auto; font-size: .8rem; white-space: nowrap; }

/* ---- error pages */
.error-page { margin-top: 3rem; }
.error-page .error-links { margin-top: 1.5rem; }
.error-page .error-links a { text-decoration: none; }
.error-page .error-links a:hover { text-decoration: underline; }

/* ---- alternative titles */
.alt-titles { margin: -.35rem 0 .6rem; font-size: .95rem; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; }
.alt-title .tag { margin-right: .25rem; }
.alt-row select { flex: 0 0 9rem; width: auto; }
.alt-row input[name=alt_title] { flex: 1 1 200px; }

/* ---- subscriptions */
.watch { display: inline-flex; align-items: center; }
.watching { list-style: none; padding: 0; margin: 0 0 1rem; border-top: 2px solid var(--ink); }
.watching li { display: flex; gap: .6rem; align-items: baseline; padding: .4rem .5rem; border-bottom: 1px dotted var(--rule-2); }
.watching li a { text-decoration: none; font-weight: 700; flex: 1 1 auto; }
.watching li a:hover { text-decoration: underline; }
.watching form { margin: 0; }
