/* Shared by every PNIT page: theme tokens, header, tabs, source picker, story tiles. */
:root {
  color-scheme: light;
  --bg: #f6f6f4; --surface: #fcfcfb; --tile: #fff; --text: #1d1d1f; --text-2: #52514e; --muted: #6b6b70;
  --border: #e2e2e0; --hover: #efefec; --dim: #e4e4e1; /* quieter controls: darker than tile (light) */
  --accent: #2a78d6; --auburn: #a52a2a;
  /* Categorical series, fixed order (validated palette). Cluster colors follow these slots. */
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --warn: #ffd60a; /* warning triangles: bright yellow in either theme, outlined in black */
  --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948;
  --series-other: #b4b3ad;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #161618; --surface: #1a1a19; --tile: #222225; --text: #ececee; --text-2: #c3c2b7; --muted: #9a9aa0;
    --border: #333337; --hover: #2c2c30; --dim: #2f2f33; /* quieter controls: lighter than tile (dark) */
    --accent: #3987e5; --auburn: #d9705f;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
    --series-other: #5c5b57;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #161618; --surface: #1a1a19; --tile: #222225; --text: #ececee; --text-2: #c3c2b7; --muted: #9a9aa0;
  --border: #333337; --hover: #2c2c30; --dim: #2f2f33;
  --accent: #3987e5; --auburn: #d9705f;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  --series-other: #5c5b57;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text);
       font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, select, input { font: inherit; color: var(--text); }

header { position: sticky; top: 0; z-index: 10; display: flex; gap: 12px; align-items: center;
         flex-wrap: wrap; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--border); }
h1 { font-size: 18px; margin: 0; }
h1 a { color: inherit; text-decoration: none; }
.tabs { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--tile); }
.tabs a { padding: 3px 12px; border-radius: 6px; color: var(--text-2); text-decoration: none; font-size: 14px; }
.tabs a:hover { background: var(--hover); }
.tabs a[aria-current="page"] { background: var(--text); color: var(--bg); }
/* Flex items ignore the hidden attribute in Safari unless display is set here. */
.tabs a[hidden], #fetch[hidden] { display: none; }
select, .btn { padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px;
               background: var(--tile); cursor: pointer; max-width: 100%; }
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: 0.5; cursor: default; background: var(--tile); }
.btn.danger { color: var(--series-8); border-color: var(--series-8); }
.btn.danger:hover { background: color-mix(in srgb, var(--series-8) 12%, var(--tile)); }
#search { padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--tile); min-width: 0; }
.stat { color: var(--muted); font-size: 13px; }
.stat.fresh { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 13px; }
.stat.fresh:hover { text-decoration: underline; }
.fetch { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* A running fetch: a box in place of the Fetch button, filling up as the feeds finish. */
.fetch-indicator { display: inline-block; padding: 4px 10px; border: 1px solid var(--accent); border-radius: 6px;
                   color: var(--text); font-size: 14px; text-decoration: none; white-space: nowrap;
                   background: linear-gradient(to right, color-mix(in srgb, var(--accent) 22%, transparent) var(--progress, 0%),
                                           var(--tile) var(--progress, 0%)); }
a.fetch-indicator:hover { border-color: var(--text); }
.fetch-indicator[hidden], .fetch .btn[hidden] { display: none; }
.fetch-break { flex-basis: 100%; height: 0; }
.fetch-break[hidden] { display: none; }
.flare { color: var(--series-8); font-weight: 700; }
.flaring { animation: flare 0.6s ease-out; }
@keyframes flare { 0% { transform: scale(1.4); } 40% { transform: scale(0.95); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .flaring { animation: none; } }

/* Source picker: a button that opens a filterable checkbox list. No selection = all sources. */
.picker { position: relative; }
.picker > .btn { display: inline-flex; gap: 6px; align-items: center; max-width: 260px; }
.picker > .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-pop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; width: min(340px, calc(100vw - 32px));
              background: var(--tile); border: 1px solid var(--border); border-radius: 10px;
              box-shadow: 0 8px 28px rgb(0 0 0 / 0.18); padding: 8px; }
.picker-pop[hidden] { display: none; }
.picker-pop.inline { position: static; width: auto; border: 0; box-shadow: none; padding: 0; }
.picker-pop.inline .picker-list { max-height: none; }
.picker-list hr { margin: 6px 0; border: 0; border-top: 1px solid var(--border); }
.picker-list label.off { opacity: 0.45; cursor: default; }
/* The interactive search bar: beside the tiles (above them on a phone), its tabs each an open picker. */
.isb-layout { display: flex; align-items: flex-start; }
.isb-layout > main { flex: 1; min-width: 0; }
/* Sticky below the (sticky) header, whose height --header-h follows (common.ts), so its top always shows. */
.filter-tray { position: sticky; top: calc(var(--header-h, 0px) + 8px); flex: none; display: flex; flex-direction: column; gap: 8px; width: 340px;
               max-height: calc(100vh - var(--header-h, 0px) - 16px); box-sizing: border-box; margin: 16px 0 16px 16px; padding: 12px; overflow: hidden;
               background: var(--tile); border: 1px solid var(--border); border-radius: 10px; }
.filter-tray[hidden], .tray-pane[hidden] { display: none; }
/* Only the list scrolls: the tabs, options, modes, filter box and All/Selected stay put above it. */
.filter-tray .tray-pane:not([hidden]), .filter-tray [data-picker], .filter-tray .picker-pop.inline { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.filter-tray .picker-pop.inline .picker-list { flex: 1; min-height: 0; overflow-y: auto; }
/* Shown, it grows from its bottom-left corner into place. */
.filter-tray:not([hidden]) { transform-origin: bottom left; animation: tray-grow 0.25s ease-out; }
@keyframes tray-grow { from { transform: scale(0.05); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .filter-tray:not([hidden]) { animation: none; } }
@media (max-width: 700px) {
  .isb-layout { flex-direction: column; align-items: stretch; }
  .filter-tray { position: static; width: auto; max-height: none; margin: 16px 16px 0; }
}
.isb-open { align-self: flex-start; justify-self: start; grid-column: 1 / -1; padding: 2px 8px; border: 1px solid var(--border);
            border-radius: 6px; background: none; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; }
.isb-open:hover { background: var(--hover); }
.isb-open, .tray-close.arrow { color: var(--accent); font-weight: 700; }
.tray-head { display: flex; align-items: center; gap: 8px; }
.tray-options { display: flex; gap: 8px; align-items: center; }
.tray-group { padding: 3px 8px; border: 1px solid var(--border); border-radius: 6px; background: none; color: var(--muted);
              font-size: 12px; cursor: pointer; }
.tray-group[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tray-tabs { display: flex; gap: 4px; flex: 1; }
.tray-tabs button, .tray-close { padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px; background: none;
                                 color: var(--muted); font-size: 13px; cursor: pointer; }
.tray-tabs button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.tray-close { font-size: 16px; line-height: 1; }
.tray-modes { display: flex; gap: 4px; margin-bottom: 8px; }
.tray-modes button { flex: 1; padding: 3px 8px; border: 1px solid var(--border); border-radius: 6px; background: none;
                     color: var(--muted); font-size: 12px; cursor: pointer; }
.tray-modes button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.picker-top { display: flex; gap: 6px; margin-bottom: 6px; }
.picker-top .btn.icon { flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 4px 7px; line-height: 1; }
.picker-top .btn[hidden] { display: none; }
.picker-top input { flex: 1; min-width: 0; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.picker .picker-top select { flex: none; width: auto; }
.picker-list { max-height: min(60vh, 420px); overflow-y: auto; }
.picker-list label { display: flex; gap: 8px; align-items: baseline; padding: 4px 6px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.picker-list label:hover { background: var(--hover); }
/* The search: mood chips in order, label pills in the search box, committed text clauses. */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chip, .label-pill { display: inline-flex; gap: 4px; align-items: center; padding: 1px 4px 1px 8px; border: 1px solid var(--border);
                     border-radius: 999px; background: var(--surface); font-size: 13px; max-width: 100%; }
.chip small { color: var(--muted); }
.chip button, .label-pill button { width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: none;
                                   color: var(--muted); cursor: pointer; font-size: 12px; line-height: 1; }
.chip button:hover:not(:disabled), .label-pill button:hover { background: var(--hover); color: var(--text); }
.chip button:disabled { opacity: 0.3; cursor: default; }
.label-pill i { color: var(--muted); font-style: normal; }
.mood-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mood-status { color: var(--muted); font-size: 13px; }
.mood-line input[hidden] { display: none; }
.picker-pop .picker-list details.group summary { display: flex; gap: 6px; margin: 10px 6px 2px; cursor: pointer; list-style: none;
                                                  font-size: 13px; color: var(--muted); font-weight: 600; }
.picker-pop .picker-list details.group:first-child summary { margin-top: 2px; }
.picker-pop .picker-list details.group summary::-webkit-details-marker { display: none; }

.picker-list label span { flex: 1; overflow-wrap: anywhere; }
.picker-list label small { color: var(--muted); }
.picker-list .only { flex: none; margin-left: 2px; padding: 0 6px; border: 1px solid transparent; border-radius: 4px;
                     background: none; color: var(--muted); font-size: 12px; cursor: pointer; white-space: nowrap; }
.picker-list label:hover .only { border-color: var(--border); color: var(--text); }
.picker-list .only:hover { background: var(--tile); }
.feed-form { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.feed-form input { flex: 1 1 200px; min-width: 0; }
.feed-row { display: flex; gap: 8px; align-items: center; padding: 4px 6px; font-size: 14px; }
.feed-row span { flex: 1; overflow-wrap: anywhere; }
.feed-row small { color: var(--muted); }
.feeds-heading { font-size: 14px; margin: 18px 0 4px; }

/* Story tiles (Stories, Outliers). */
main { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
       gap: 14px; padding: 16px; }
article { background: var(--tile); border: 1px solid var(--border); border-radius: 10px;
          padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
article img { display: block; width: calc(100% + 32px); margin: -14px -16px 4px; aspect-ratio: 16 / 9;
              object-fit: cover; border-radius: 10px 10px 0 0; background: var(--border); }
article { position: relative; }
.heart { position: absolute; top: 6px; right: 6px; z-index: 1; width: 30px; height: 30px; padding: 0;
         border: 1px solid var(--border); border-radius: 50%; background: var(--tile); color: var(--muted);
         font-size: 17px; line-height: 1; cursor: pointer; }
/* A translated story: a translucent green sash (yellow while it waits to be translated) across the
   tile's top-left corner, clear of the heart and ⋮. */
.sash-clip { position: absolute; top: 0; left: 0; z-index: 1; width: 84px; height: 84px; overflow: hidden;
             border-top-left-radius: 10px; pointer-events: none; }
.sash { position: absolute; top: 17px; left: -30px; width: 120px; padding: 5px 0; transform: rotate(-45deg);
        background: color-mix(in srgb, var(--series-6) 58%, transparent); color: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.2); text-align: center;
        font-size: 11px; font-weight: 600; letter-spacing: 0.03em; pointer-events: auto; cursor: default; }
.sash.pending { background: rgb(242 201 76 / 0.58); color: #3a2e00; } /* waiting in the translation queue */
.sash.two { top: 12px; padding: 5px 0; white-space: pre-line; font-size: 10px; line-height: 1.15; } /* Translated, then from what */
.sash.available { background: rgb(23 190 207 / 0.66); } /* cyan: its own language shown, though translated */
.sash.failed { background: rgb(214 69 65 / 0.66); font-size: 9px; } /* the translator gave up on it */
article.translated:not(:has(> img)) h2 { text-indent: 44px; } /* no picture under the sash: the title clears it */
.heart:hover { color: var(--series-8); }
.heart[aria-pressed="true"] { color: var(--series-8); }
article h2 { font-size: 16px; line-height: 1.3; margin: 0; padding-right: 64px; } /* clear of ⋮ and the heart */
article h2 a { color: var(--text); text-decoration: none; }
article h2 a:hover { text-decoration: underline; }
.meta { color: var(--muted); font-size: 12px; }
.source-link { color: inherit; text-decoration: none; }
.source-link:hover { color: var(--text); text-decoration: underline; }
.summary { margin: 0; overflow-wrap: anywhere; }
.empty { color: var(--muted); padding: 16px; }
div.empty { grid-column: 1 / -1; }
div.empty p { margin: 0 0 6px; }
.where { margin: 0; padding: 0; list-style: none; max-width: 480px; }
.where li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 3px 0; }

/* Preferences page: a single column instead of the tile grid. */
main.prefs { display: block; max-width: 880px; }
.rules-layout { display: grid; grid-template-columns: minmax(240px, 34%) minmax(0, 1fr); gap: 16px; align-items: start; }
.rules-layout:has(#rule-form[hidden]) { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 560px) { .rules-layout { grid-template-columns: 1fr; } }
.rules-layout .picker-list label { min-width: 0; }
.rules-layout .picker-list label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
.rules-layout .picker-list label small { flex: none; }
.rules-layout .mood-row { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 8px 6px; border-radius: 8px; }
.rules-layout .mood-row[aria-current] { background: var(--hover); }
.rules-layout .mood-name { display: flex; gap: 8px; align-items: baseline; }
.rules-layout .mood-name small, .rules-layout .mood-summary { color: var(--muted); }
.rules-layout .mood-summary { font-size: 13px; }
.rules-layout .mood-row .btn { flex: none; }
.rule-form { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rule-form input[name="name"] { padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--tile); }
.rule-form select { padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--tile); }
.rule-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.clause-builder { display: flex; flex-direction: column; gap: 10px; }
.clause { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 8px;
          background: var(--surface); overflow: visible; }
.clause h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.condition { display: grid; grid-template-columns: auto auto 1fr; gap: 6px 8px; align-items: center; }
.condition .value-picker { grid-column: 1 / -1; position: relative; min-width: 0; }
.condition .value-btn { width: 100%; max-width: none; justify-content: space-between; }
.condition .value-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.condition > .btn { grid-column: 3; justify-self: end; }
.prefs .value-pop { z-index: 40; width: min(400px, calc(100vw - 48px)); }
.prefs .value-pop .value-list { max-height: min(50vh, 320px); overflow-y: auto; }
.clause-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.prefs [hidden] { display: none !important; }
.prefs-tools { display: flex; gap: 8px; margin-bottom: 10px; }
.prefs-tools input { flex: 1; min-width: 0; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--tile); }
.prefs-tools .btn[aria-pressed="true"], .btn.toggle[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.subtabs { display: inline-flex; flex-wrap: wrap; margin-bottom: 8px; }
.subtabs a[aria-current] { background: var(--text); color: var(--bg); }
.prefs .picker-list { max-height: none; }
.features-list { display: flex; flex-direction: column; gap: 10px; max-width: 520px; }
.features-list .feature-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--tile); cursor: pointer; }
.features-list .feature-row input { margin-top: 3px; }
.features-list .feature-row span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.features-list .feature-row b { font-weight: 600; }
.features-list .feature-row small { color: var(--muted); }
/* Admin > Users: each user's Flags, a dropdown under their row */
table.stats tr:has(+ tr.flags-row) td { border-bottom: 0; }
table.stats tr.flags-row td { white-space: normal; padding-top: 0; }
.user-flags summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.user-flags .features-list { margin: 6px 0; }
.user-flags .feature-row.unavailable { opacity: 0.45; cursor: not-allowed; }
.prefs details.group summary { display: flex; gap: 6px; align-items: baseline; padding: 4px 6px; border-radius: 6px;
                               cursor: pointer; list-style: none; font-size: 14px; font-weight: 600; }
.prefs details.group summary::-webkit-details-marker { display: none; }

.prefs details.group summary:hover { background: var(--hover); }
.prefs details.group summary span { flex: 1; }
.prefs details.group summary small { color: var(--muted); font-weight: 700; }
.prefs details.group > label { margin-left: 1.2em; }
/* A warning: a triangle pointing up, outlined in black, with a black "!" in it; yellow, or red for
   an error. The black triangle is the outline; the colored one (::before) sits inside it, under the
   "!". An empty one only keeps the rows lined up. */
.prefs .warn { flex: none; align-self: center; position: relative; isolation: isolate; box-sizing: border-box;
               width: 15px; height: 13px; padding-top: 5px; color: #000; font-size: 7px; font-weight: 900;
               line-height: 7px; text-align: center; cursor: help; }
.prefs .warn:not(:empty) { background: #000; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.prefs .warn:not(:empty)::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--warn);
               clip-path: polygon(50% 2.6px, calc(100% - 2.2px) calc(100% - 1.3px), 2.2px calc(100% - 1.3px)); }
.prefs .warn.error:not(:empty)::before { background: var(--series-8); }

/* Sign-out button in the page header; account pages (sign in, register, choose password). */
.side { margin-left: auto; }  /* the first of a right-hand tab (About etc.), ⋮ and the user's menu, and the rest after it, at the right */
/* Account: a dropdown with Preferences and Sign out */
.account { position: relative; }
.account summary { list-style: none; }
.account summary::-webkit-details-marker { display: none; }
.account summary::after { content: " ▾"; color: var(--muted); }
.account.current summary { background: var(--text); color: var(--bg); }
.account .menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 150px; padding: 4px;
                 background: var(--tile); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 20px rgb(0 0 0 / 0.18); }
.account .menu a, .account .menu button { display: block; width: 100%; padding: 6px 10px; border: 0; border-radius: 6px;
                 background: none; color: var(--text); text-align: left; text-decoration: none; font-size: 14px; cursor: pointer; }
.account .menu a:hover, .account .menu button:hover { background: var(--hover); }
.account .menu a[aria-current] { font-weight: 600; }
.account .menu form { margin: 0; }
.page-menu summary::after { content: none; }
.account .menu [hidden] { display: none; }
.account .menu hr { margin: 4px 0; border: 0; border-top: 1px solid var(--border); }
.account .menu button:disabled { opacity: 0.4; background: none; cursor: default; }
.auth { max-width: 360px; margin: 10vh auto; padding: 0 16px; }
.auth h2 { font-size: 16px; font-weight: 600; margin: 4px 0 16px; }
.auth form { display: flex; flex-direction: column; gap: 12px; }
.auth label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--text-2); }
.auth input { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--tile); }
.auth .btn { align-self: flex-start; }
.auth a { color: var(--accent); }
.error { color: var(--series-8); }

/* Fetch progress page: one row per feed with its status. */
.progress-list { list-style: none; margin: 8px 0 0; padding: 0; }
.progress-list li { display: flex; gap: 10px; align-items: baseline; padding: 3px 6px; border-radius: 6px; font-size: 14px; }
.progress-list .icon { flex: none; width: 1.2em; text-align: center; }
.progress-list .name { flex: 1; overflow-wrap: anywhere; }
.progress-list .detail { color: var(--muted); font-size: 12px; text-align: right; overflow-wrap: anywhere; max-width: 50%; }
.progress-list .pending { color: var(--muted); }
.progress-list .running { background: var(--hover); }
.progress-list .running .icon { color: var(--accent); animation: spin 1s linear infinite; }
.progress-list .done .icon { color: var(--series-3); }
.progress-list .error .icon { color: var(--series-8); }
.progress-list .skipped { color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .progress-list .running .icon { animation: none; } }
.entity-list { list-style: none; margin: 8px 0 0; padding: 0; }
.entity-list li { display: flex; gap: 10px; align-items: baseline; padding: 3px 6px; border-radius: 6px; font-size: 14px; }
.entity-list li:hover { background: var(--hover); }
.entity-list li > a:first-child { flex: 1; overflow-wrap: anywhere; color: var(--text); text-decoration: none; }
.entity-list li > a:first-child:hover { text-decoration: underline; }
.entity-list .wiki { font-size: 12px; color: var(--accent); white-space: nowrap; }
.entity-list small { color: var(--muted); min-width: 3em; text-align: right; }
.entity-list li.in-filter > a:first-child { font-weight: 700; } /* has stories in the current filter */
.view-count { margin: 0 0 8px; }
.entity-table { width: 100%; border-collapse: collapse; margin: 0; font-size: 14px; }
.entity-table th, .entity-table td { padding: 4px 8px; text-align: left; vertical-align: baseline; border-bottom: 1px solid var(--border); }
.entity-table th.num, .entity-table td.num { text-align: right; white-space: nowrap; width: 1%; }
.entity-table th button { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; padding: 0; cursor: pointer; }
.entity-table th button:hover { color: var(--text); }
.entity-table th button[aria-sort] { color: var(--text); }
.entity-table th button[aria-sort="ascending"]::after { content: " ↑"; }
.entity-table th button[aria-sort="descending"]::after { content: " ↓"; }
.entity-table tbody tr:hover { background: var(--hover); }
.entity-table td > a:first-child { color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.entity-table td > a:first-child:hover { text-decoration: underline; }
.entity-table .wiki { font-size: 12px; color: var(--accent); white-space: nowrap; }
.entity-table tr.in-filter td > a:first-child { font-weight: 700; }
.entity-table .empty { color: var(--muted); }
.entity-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 12px 0; }
.entity-pager[hidden] { display: none; }
.license summary { cursor: pointer; }
.license p { color: var(--text-2); font-size: 13px; }
/* About: copyright centred and version on the right, at the bottom of the window or page */
body.about { min-height: 100vh; display: flex; flex-direction: column; }
body.about main { flex: 1; }
.page-footer { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; padding: 12px 16px;
               border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.page-footer > :last-child { text-align: right; }
/* About and Preferences: the content region centred and wider; text stays left-aligned */
main.prefs.centered { margin: 0 auto; width: 100%; max-width: 760px; box-sizing: border-box; }
/* Stories: search, filters and sort in one box; the filter icon opens the filters and sort */
/* Opened, the box grows wider and downward: the other controls, labelled, drop below the search,
   over the page. Both directions animate, opening and closing. */
.filters { position: relative; display: flex; gap: 8px; align-items: center; width: 280px; max-width: 100%; padding: 3px;
           border: 1px solid var(--border); border-radius: 8px; background: var(--tile);
           transition: width 0.2s ease, margin 0.2s ease, border-radius 0.2s ease, box-shadow 0.2s ease; }
/* Open, it grows the same on both sides (negative margins keep its place in the header). */
.filters.open { width: 620px; margin-left: -170px; margin-right: -170px; z-index: 16; border-radius: 8px 8px 0 0; border-bottom-color: transparent; box-shadow: 0 6px 20px rgb(0 0 0 / 0.18); }
.filter-toggle { display: inline-flex; align-items: center; padding: 4px 8px; }
.filter-toggle[aria-expanded="true"] { background: var(--hover); }
.filter-panel { position: absolute; top: 100%; left: -1px; right: -1px; z-index: 15; display: grid;
                grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; padding: 10px 12px;
                background: var(--tile); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 8px 8px;
                box-shadow: 0 10px 20px rgb(0 0 0 / 0.18);
                transform-origin: top; transform: scaleY(0.6); opacity: 0; visibility: hidden;
                transition: transform 0.2s ease, opacity 0.2s ease, visibility 0s linear 0.2s; }
.filters.open .filter-panel { transform: none; opacity: 1; visibility: visible;
                              transition: transform 0.2s ease, opacity 0.2s ease, visibility 0s; }
.filter-panel .field { display: contents; }
.filter-panel .field[hidden] { display: none; }
.filter-panel .field.unlabeled > * { grid-column: 2; } /* no heading: under the other controls */
.field-label { color: var(--muted); font-size: 13px; }
.filter-panel .picker > .btn, .filter-panel select { width: 100%; max-width: none; text-align: left; }
.filter-panel .picker > .btn span { flex: 1; }
@media (prefers-reduced-motion: reduce) { .filters, .filter-panel, .filters.open .filter-panel { transition: none; } }
/* The search text box (inset in .filters): glass, entity pill, input and clear live inside it. */
.search-field { position: relative; flex: 1; display: flex; align-items: center; gap: 4px; min-width: 0;
                padding: 1px 2px 1px 6px; border-radius: 6px; background: var(--surface); }
.search-field[hidden] { display: none; }
/* Wider when a pill is in the closed bar; when open, .filters.open (620px, centred) wins. */
.filters:has(.pill):not(.open) { width: min(560px, 100%); }
.filters #search { flex: 1; min-width: 0; padding: 4px 24px 4px 20px; border: 0; background: transparent;
                   outline: none; -webkit-appearance: none; appearance: none; }
/* The box itself: one line of words and pills (searchbox.ts); its placeholder while empty. */
.search-box { white-space: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; line-height: 22px; cursor: text; }
.search-box::-webkit-scrollbar { display: none; }
.search-box:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.search-box:empty::after { content: attr(data-placeholder-note); color: var(--series-8); opacity: 0.6; pointer-events: none; }
.search-box .pill { vertical-align: middle; margin: 0 1px; user-select: all; -webkit-user-select: all; cursor: default; }
/* Whole inset field (pill + text) is the focused box — not just #search. */
.search-field:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.filters #search::-webkit-search-cancel-button { display: none; }
.search-glass { position: absolute; left: 8px; color: var(--muted); opacity: 0.6; pointer-events: none; }
.search-clear { position: absolute; right: 2px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%;
                background: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; }
.search-clear:hover { background: var(--hover); color: var(--text); }
.search-field:has(#search:not(:placeholder-shown):not(:empty)) .search-glass { display: none; }
.search-field:has(#search:placeholder-shown) .search-clear, .search-field:has(.search-box:empty) .search-clear { display: none; }
.search-field:has(#search:not(:placeholder-shown):not(:empty)) #search { padding-left: 6px; }
/* Stories: ↙ left of the search field opens the interactive search bar, while neither it nor the filter panel shows. */
.isb-quick { flex: none; padding: 0 4px; border: 0; background: none; color: var(--accent);
             font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer; }
.filters.open .isb-quick, body.isb-on .isb-quick { display: none; }
/* Watching: the eye on the mood line (blue while watched), and the banner of what's new under the header. */
.btn.watch { display: inline-flex; align-items: center; }
.btn.watch[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.watch-news { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin: 8px 16px 0; padding: 8px 12px;
              border: 1px solid var(--accent); border-radius: 8px; background: color-mix(in srgb, var(--accent) 10%, var(--tile)); font-size: 14px; }
.watch-news[hidden] { display: none; }
.watch-news a { color: var(--accent); font-weight: 600; }
.mood-actions { display: flex; gap: 6px; align-items: flex-start; }
.watch-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.watch-row .btn { margin-left: auto; padding: 0 8px; }
.watch-news .close { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; }
/* The blue arrows answer a click: pressed in, then a blue flash around them. */
.isb-quick, .isb-open, .tray-close.arrow { border-radius: 6px; transition: transform 0.08s ease; }
.isb-quick:active, .isb-open:active, .tray-close.arrow:active:not(:disabled) { transform: scale(0.8); }
.tray-close.arrow:disabled { opacity: 0.35; cursor: default; }
.flash { animation: arrow-flash 0.4s ease-out; }
@keyframes arrow-flash { from { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 40%, transparent); }
                         to { box-shadow: 0 0 0 10px transparent; } }
/* An entity in the search box (Stories): a pill, so it reads as the entity, not text to match. */
.entity-pill { display: inline-flex; gap: 5px; align-items: center; flex: 0 1 auto; min-width: 0; max-width: 60%;
               padding: 1px 2px 1px 8px; border-radius: 999px; background: var(--hover); font-size: 13px; white-space: nowrap; }
/* "n.", as a dictionary marks a noun. */
.entity-pill i { color: var(--muted); font-family: Georgia, "Times New Roman", serif; font-style: italic; flex: none; }
.entity-pill b { overflow: hidden; text-overflow: ellipsis; font-weight: 600; min-width: 0; }
.entity-pill button { width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: none;
                      color: var(--muted); font-size: 14px; line-height: 1; cursor: pointer; flex: none; }
.entity-pill button:hover { background: var(--border); color: var(--text); }
/* A pill in the selection: marked as selected, as its text would be. */
.search-box .pill::selection, .search-box .pill *::selection { background: transparent; }
.search-box .pill.selected { background: color-mix(in srgb, var(--accent) 22%, var(--hover));
  outline: 2px solid var(--accent); outline-offset: 1px; }
.filter-toggle { display: inline-flex; align-items: center; padding: 4px 8px; }
.filter-toggle[aria-expanded="true"] { background: var(--hover); }
.filter-panel { position: absolute; top: 100%; left: -1px; right: -1px; z-index: 15; display: flex; flex-direction: column;
                align-items: stretch; gap: 8px; padding: 8px; background: var(--tile); border: 1px solid var(--border);
                border-top: 0; border-radius: 0 0 8px 8px; box-shadow: 0 10px 20px rgb(0 0 0 / 0.18); }
.filter-panel[hidden] { display: none; }
.filter-panel > .picker > .btn, .filter-panel > select { width: 100%; max-width: none; text-align: left; }
.filter-panel > .picker > .btn span { flex: 1; }
.outliers { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; justify-self: start; align-self: flex-start; }
.outliers select[hidden] { display: none; }
/* A toggle button: a switch (pill and knob) before its text; pressed, it inverts and the knob slides right. */
.btn.toggle { display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; justify-self: start; align-self: flex-start; }
.switch { position: relative; flex: none; width: 26px; height: 14px; border-radius: 7px; border: 1.5px solid currentColor; box-sizing: border-box; }
.switch::after { content: ""; position: absolute; top: 1.5px; left: 1.5px; width: 8px; height: 8px; border-radius: 50%;
                 background: currentColor; transition: transform 0.15s; }
.btn.toggle[aria-pressed="true"] .switch::after { transform: translateX(12px); }
/* NOT: a toggle that doesn't invert; pressed it reads in the text colour, otherwise dimmed. */
.btn.toggle.not { font-variant: small-caps; color: var(--muted); }
.btn.toggle.not[aria-pressed="true"] { background: var(--tile); color: var(--text); }
/* Data stats: plain tables, numbers right-aligned; a wide table scrolls inside its box on a phone */
.table-wrap { overflow-x: auto; margin-bottom: 16px; }
table.stats { border-collapse: collapse; font-size: 14px; }
table.stats th, table.stats td { padding: 4px 12px 4px 0; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
table.stats th { color: var(--muted); font-weight: 600; }
table.stats .num { text-align: right; font-variant-numeric: tabular-nums; }
details.section > summary { cursor: pointer; }
details.section > summary h3 { display: inline; }
.loading::before { content: ""; display: inline-block; width: 0.9em; height: 0.9em; margin-right: 6px; vertical-align: -0.1em;
                   border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
.help { display: inline-block; width: 1.2em; height: 1.2em; line-height: 1.2em; border: 1px solid currentColor; border-radius: 50%;
        font-size: 11px; text-align: center; cursor: help; }
.and-button { flex: none; }
.filters:not(.open) .and-button { display: none; } /* only with the filter box open */
.clause-chips .chip { padding-top: 0; padding-bottom: 0; white-space: nowrap; }
/* The moods in the filter box: a block each, its name and × above its sections. */
.mood-blocks { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.mood-block { border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; }
.mood-head { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.mood-head b { flex: 1; font-size: 14px; }
.mood-head small { color: var(--muted); }
.mood-head > button { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.mood-head > button:hover { background: var(--hover); color: var(--text); }
.mood-section { display: grid; grid-template-columns: auto 80px 1fr; gap: 8px; align-items: center; margin-top: 4px; }
.mood-section .picker > .btn { width: 100%; max-width: none; text-align: left; }
.mood-section .negatable { display: flex; gap: 8px; align-items: center; }
.mood-section .negatable .picker { flex: 1; min-width: 0; }
.mood-section .not { flex: none; }
/* Below the moods, after a rule: the other options two by two. */
.filter-panel .options { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; align-items: center;
                         padding-top: 10px; border-top: 1px solid var(--border); }
.filter-panel .options .field[hidden] { display: none; }
.filter-panel .mood-field > * { grid-column: 1 / -1; }
/* "+": a select that looks like a small square button. */
.mood-line [hidden] { display: none !important; }
.filter-panel select.mood-pick { width: auto; }
button.remove { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted);
  cursor: pointer; font-size: 14px; line-height: 1; }
button.remove:hover { background: var(--hover); color: var(--text); }
.save-options { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 6px 0 8px; }
.save-options[hidden], .save-options [hidden] { display: none !important; }
.mood-status.flash { color: var(--text); background: var(--hover); padding: 2px 8px; border-radius: 6px; }
.and-rows { display: contents; }
.terms .or { font-variant: small-caps; color: var(--muted); }
.show-bar { display: flex; gap: 4px; margin-bottom: 6px; }
.show-bar[hidden] { display: none; }
.show-bar .btn { padding: 2px 8px; font-size: 12px; }
.show-bar .btn[aria-pressed="true"] { background: var(--text); color: var(--bg); }
/* While a multi-picker is open, the whole filter box uses --dim (gray: darker in light, lighter in dark). */
.filters:has(.filter-panel.picking),
.filter-panel.picking {
  background: var(--dim);
  transition: background 0.15s ease;
}
.filter-panel.picking .picker:not(.open) > .btn,
.filter-panel.picking .mood-section:not(:has(.picker.open)),
.filter-panel.picking .mood-line,
.filter-panel.picking .save-options,
.filter-panel.picking select,
.filter-panel.picking .outliers,
.filter-panel.picking .btn.toggle,
.filter-panel.picking .btn.toggle[aria-pressed="true"],
.filter-panel.picking label:has(input[type="checkbox"]) {
  background: var(--dim);
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.filter-panel.picking .field-label,
.filter-panel.picking .mood-head b,
.filter-panel.picking button.remove,
.filter-panel.picking label:has(input[type="checkbox"]) {
  color: color-mix(in srgb, var(--muted) 50%, var(--dim));
}
/* The open list's own rows stay full strength. The dimming above is for the other controls. */
.filter-panel.picking .picker-pop label:has(input[type="checkbox"]) {
  background: none;
  color: var(--text);
}
.filter-panel.picking .picker-pop label:has(input[type="checkbox"]):hover {
  background: var(--hover);
}
.filter-panel.picking .picker.open > .btn,
.filter-panel.picking .mood-section:has(.picker.open) .field-label {
  background: var(--tile);
  color: var(--text);
}
@media (prefers-reduced-motion: reduce) {
  .filters:has(.filter-panel.picking),
  .filter-panel.picking,
  .filter-panel.picking .picker:not(.open) > .btn,
  .filter-panel.picking .mood-section:not(:has(.picker.open)),
  .filter-panel.picking .mood-line,
  .filter-panel.picking .save-options,
  .filter-panel.picking select,
  .filter-panel.picking .outliers,
  .filter-panel.picking .btn.toggle,
  .filter-panel.picking .btn.toggle[aria-pressed="true"],
  .filter-panel.picking label:has(input[type="checkbox"]) { transition: none; }
}
.picker-list .preset { display: block; width: 100%; text-align: left; padding: 4px 6px; border: 0; border-radius: 6px;
  background: none; color: var(--text); font-weight: 600; cursor: pointer; }
.picker-list .preset:hover { background: var(--hover); }
.stat.unsaved { color: #c62828; font-weight: 600; }

/* Expand/collapse: a chevron, pointing right when closed and down when open. */
.picker-pop .picker-list details.group summary::before, .prefs details.group summary::before,
.section > summary::before, .license > summary::before, .source-editor details.group > summary .arrow::before,
.entity-table .group-row .arrow::before {
  content: ""; flex: none; display: inline-block; width: 0.4em; height: 0.4em; margin: 0 0.5em 0.1em 0.2em;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform 0.15s; }
.picker-pop .picker-list details.group[open] summary::before, .prefs details.group[open] summary::before,
.section[open] > summary::before, .license[open] > summary::before, .source-editor details.group[open] > summary .arrow::before,
.entity-table .group-row [aria-expanded="true"] .arrow::before {
  transform: rotate(45deg); }
.section > summary, .license > summary { list-style: none; }
.section > summary::-webkit-details-marker, .license > summary::-webkit-details-marker { display: none; }
.save-options .follow { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; font-size: 13px; }
.save-options .follow:empty { display: none; }
.save-options .near-moods { flex-direction: column; align-items: center; }
/* Preferences: a clause's nearest moods, below its dropdown, in auburn */
.near-pick { margin-top: 6px; color: var(--auburn); font-size: 13px; }
.near-pick:empty { display: none; }
.near-pick > div:not(.near-list) { margin-top: 4px; }
.rules-layout .near-note { margin-top: 4px; padding: 0 8px; font-size: 12px; }
.near-toggle { color: var(--auburn); border-color: var(--auburn); }
.near-list { display: flex; flex-direction: column; gap: 4px; padding: 6px 0 0; }
.near-list .near-row { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
#rule-follow { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; margin: 6px 0; }
.mood-group { margin: 14px 0 2px; font-size: 14px; }
.mood-divider { margin: 18px 0 0; border: 0; border-top: 1px solid var(--border); }
/* Completions for a term being typed in the search box (label:, lang:, source:, mood:). */
.complete { position: absolute; z-index: 60; min-width: 160px; max-width: 360px; max-height: 240px; overflow-y: auto;
  padding: 4px; border: 1px solid var(--border); border-radius: 6px; background: var(--tile); box-shadow: 0 6px 20px rgb(0 0 0 / 0.18); font-size: 13px; }
.complete-item { padding: 3px 8px; border-radius: 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.complete-item.on, .complete-item:hover { background: var(--hover); }
/* A clause in the search box: a pill coloured by its kind (mood, source, language, label, text);
   a "not" one outlined and struck through. */
.clause-pill { display: inline-flex; gap: 4px; align-items: center; padding: 1px 2px 1px 8px; border-radius: 999px; font-size: 13px;
  white-space: nowrap; --pill: var(--muted); background: color-mix(in srgb, var(--pill) 18%, var(--tile));
  border: 1px solid color-mix(in srgb, var(--pill) 45%, transparent); color: var(--text); }
.clause-pill[data-kind="mood"] { --pill: var(--series-7); }
.clause-pill[data-kind="source"] { --pill: var(--series-1); }
.clause-pill[data-kind="language"] { --pill: var(--series-3); }
.clause-pill[data-kind="label"] { --pill: var(--series-2); }
.clause-pill[data-kind="text"] { --pill: var(--series-4); }
.clause-pill[data-negated] { background: var(--tile); border-style: dashed; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--pill) 70%, transparent); }
.clause-pill.error { --pill: var(--series-8); border-style: dotted; }
.clause-pill button { width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted);
  font-size: 14px; line-height: 1; cursor: pointer; flex: none; text-decoration: none; }
.clause-pill button:hover { background: color-mix(in srgb, var(--pill) 30%, var(--tile)); color: var(--text); }
/* While the filter box is open, the rest of the page is dimmed (as the box is while a dropdown in it is). */
main, footer, header > :not(.filters) { transition: opacity 0.2s ease; }
body:has(.filters.open) main, body:has(.filters.open) footer, body:has(.filters.open) header > :not(.filters) { opacity: 0.35; }
/* A notice under the header (e.g. new sources added to My Sources), until dismissed. */
.notice { display: flex; gap: 12px; align-items: center; justify-content: space-between; max-width: 900px;
  margin: 12px auto; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--tile); }

/* The "Loading …" pill in the middle of the dimmed page (loading() in common.ts). */
.loading-screen { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgb(0 0 0 / 0.35); }
.loading-screen[hidden] { display: none; }
/* Work in steps: one bar along the pill's foot for all of them, moving on smoothly, slower as it nears the
   step's end (see loadingSteps); the pill keeps one width whatever it says. */
.loading-pill { position: relative; overflow: hidden; }
.loading-pill.steps { box-sizing: border-box; width: min(26em, calc(100vw - 32px)); text-align: center; font-variant-numeric: tabular-nums;
                      white-space: nowrap; text-overflow: ellipsis; }
.loading-pill::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: var(--progress, 0); background: var(--accent);
                       transition: width 8s cubic-bezier(0.15, 0.7, 0.3, 1); }
/* The Stories page's first load: the page stays as it is under the loading screen until it's all ready. */
body.starting > :not(.loading-screen):not(.news-screen) { visibility: hidden; }
/* What's new: over everything until dismissed. */
.news-screen { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 16px; background: rgb(0 0 0 / 0.45); }
.news-box { width: min(520px, 100%); max-height: 85vh; overflow-y: auto; box-sizing: border-box; padding: 18px 20px;
            border: 1px solid var(--border); border-radius: 12px; background: var(--tile); box-shadow: 0 10px 40px rgb(0 0 0 / 0.3); }
.news-box h2 { margin: 0 0 8px; font-size: 18px; }
.news-box h3 { margin: 12px 0 2px; font-size: 15px; }
.news-box p { margin: 0; color: var(--text-2, var(--text)); font-size: 14px; line-height: 1.45; }
.news-box > .btn { display: block; margin: 16px 0 0 auto; }
.loading-pill { padding: 6px 14px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--tile); box-shadow: 0 4px 14px rgb(0 0 0 / 0.15); }
.another-mood { padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--tile); color: var(--text); font: inherit; font-size: 13px; }
.mood-head > b, .mood-head-name { grid-column: 2 / -1; font-size: 13px; }
.mood-head-name { display: flex; gap: 8px; align-items: center; }
.mood-or .field-label { font-variant: small-caps; }
.mood-empty { grid-column: 2 / -1; display: flex; gap: 10px; align-items: center; }
.mood-read { grid-column: 2 / -1; }
.mood-head.editing b { color: var(--accent); }
.mood-head b.unsaved { color: var(--series-8); }
.mood-edit > .btn { padding: 2px 8px; font-size: 13px; }
/* A mood's rows, indented under its bold heading. */
.mood-sections .mood-section:not(.mood-head):not(.mood-or) { padding-left: 20px; }
/* ⋮ beside a tile's heart, and its menu. */
.story-more { position: absolute; top: 6px; right: 38px; z-index: 2; }
.story-menu-btn { width: 30px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 50%;
  background: var(--tile); color: var(--muted); font-size: 17px; line-height: 1; cursor: pointer; }
.story-menu-btn:hover { color: var(--text); }
.story-menu { position: absolute; top: 34px; right: 0; min-width: 200px; padding: 4px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--tile); box-shadow: 0 6px 20px rgb(0 0 0 / 0.18); }
.story-menu a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 13px; white-space: nowrap; }
.story-menu a:hover { background: var(--hover); }
.story-menu a.danger { color: var(--series-8); } /* takes something away: Remove … from My Sources */
.story-menu-head { display: block; padding: 6px 10px 2px; color: var(--muted); font-size: 13px; white-space: nowrap; cursor: default; }
.story-menu a.story-menu-sub { padding-left: 22px; }
.story-menu .popout { margin-left: 6px; color: var(--muted); vertical-align: -1px; }
.story-menu a.story-menu-sub::before { content: "• "; color: var(--muted); }
.about-tech h4 { margin: 1em 0 0.3em; font-size: 14px; }
.about-tech ul { margin: 0; padding-left: 1.2em; }
.about-tech li { margin: 0.25em 0; font-size: 14px; }
