/* PowerDASH – plain CSS, no build step (SPEC.md UI-12, UI-23..UI-26).
   Brand tokens: see the brand package (navy / blue / cyan / slate / cloud).
   Category colours: keep in sync with data/categories.csv.
   Themes: <html data-theme="system|light|dark">; "system" follows prefers-color-scheme. */

/* ------------------------------------------------------------------ tokens */
:root {
    --powerdash-navy: #0b1f33; --powerdash-blue: #2878ff; --powerdash-cyan: #20c7d9;
    --powerdash-slate: #52677c; --powerdash-cloud: #f4f7fa; --powerdash-white: #ffffff;

    --font-ui: Inter, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-serif: "Source Serif 4", "Source Serif Pro", Charter, "Bitstream Charter", "Sitka Text", Cambria, "Iowan Old Style", Georgia, serif;
    --radius: 14px; --radius-sm: 10px;
    --header-h: 4.25rem;

    /* light */
    --bg: var(--powerdash-cloud); --surface: #ffffff; --surface-2: #f8fafc;
    --fg: var(--powerdash-navy); --fg-2: #2b4157; --muted: var(--powerdash-slate);
    --line: #dfe7ef; --line-strong: #c4d2df;
    --accent: #1f5fcc; --primary: #1f63d6; --primary-fg: #ffffff; --focus: #2878ff;
    --hover: rgba(40, 120, 255, .07); --selected: rgba(40, 120, 255, .12);
    --read: #5f7489; --star: #1f63d6; --bad: #c62828; --new: #0b8a9a;
    --warn-bg: #fff6dd; --warn-fg: #7a4b00; --warn-line: #f1d48a; --bad-bg: #fde8e8;
    --shadow: 0 1px 2px rgba(11, 31, 51, .05), 0 2px 8px rgba(11, 31, 51, .04);
    --shadow-lg: 0 10px 30px rgba(11, 31, 51, .18);
    --c: var(--muted);
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme=light]) {
        --bg: #0b1f33; --surface: #11283f; --surface-2: #15304b;
        --fg: #eef4fa; --fg-2: #c6d4e2; --muted: #9fb2c5;
        --line: #213e5a; --line-strong: #2f5373;
        --accent: #7aaeff; --primary: #4d91ff; --primary-fg: #06172a; --focus: #6ea4ff;
        --hover: rgba(110, 164, 255, .08); --selected: rgba(110, 164, 255, .16);
        --read: #8ea3b8; --star: #7aaeff; --bad: #f58b8b; --new: #20c7d9;
        --warn-bg: #33270a; --warn-fg: #fbdc8e; --warn-line: #5c4712; --bad-bg: #3a1518;
        --shadow: 0 1px 2px rgba(0, 0, 0, .25); --shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
        color-scheme: dark;
    }
}
:root[data-theme=dark] {
    --bg: #0b1f33; --surface: #11283f; --surface-2: #15304b;
    --fg: #eef4fa; --fg-2: #c6d4e2; --muted: #9fb2c5;
    --line: #213e5a; --line-strong: #2f5373;
    --accent: #7aaeff; --primary: #4d91ff; --primary-fg: #06172a; --focus: #6ea4ff;
    --hover: rgba(110, 164, 255, .08); --selected: rgba(110, 164, 255, .16);
    --read: #8ea3b8; --star: #7aaeff; --bad: #f58b8b; --new: #20c7d9;
    --warn-bg: #33270a; --warn-fg: #fbdc8e; --warn-line: #5c4712; --bad-bg: #3a1518;
    --shadow: 0 1px 2px rgba(0, 0, 0, .25); --shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
    color-scheme: dark;
}

.cat-pe { --c: #2878ff; } .cat-drives { --c: #009e9b; } .cat-machine { --c: #7057d9; } .cat-energy { --c: #2e9b57; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme=light]) .cat-pe { --c: #6ea4ff; } :root:not([data-theme=light]) .cat-drives { --c: #2cc9c4; }
    :root:not([data-theme=light]) .cat-machine { --c: #a594f5; } :root:not([data-theme=light]) .cat-energy { --c: #53c784; }
}
:root[data-theme=dark] .cat-pe { --c: #6ea4ff; } :root[data-theme=dark] .cat-drives { --c: #2cc9c4; }
:root[data-theme=dark] .cat-machine { --c: #a594f5; } :root[data-theme=dark] .cat-energy { --c: #53c784; }

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html { font-size: 106.25%; -webkit-text-size-adjust: 100%; } /* 17px */
body { margin: 0; font-family: var(--font-ui); font-size: 1rem; line-height: 1.55; color: var(--fg); background: var(--bg);
       -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
main { max-width: 64rem; margin: 0 auto; padding: 0 1.25rem 4rem; }
h1, h2, h3 { font-family: var(--font-serif); color: var(--fg); }
h1 { font-size: 2rem; line-height: 1.2; letter-spacing: -.01em; margin: 1.6rem 0 .4rem; font-weight: 650; }
h2 { font-size: 1.2rem; font-weight: 650; }
code { font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 0 .3em; }
small { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: .5rem; z-index: 10; background: var(--surface); padding: .5rem 1rem; border-radius: var(--radius-sm); }
.skip:focus { left: .5rem; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Icons (public/assets/icons, 24×24): drawn as masks so they follow the text colour in both themes. */
.ico { display: inline-block; width: 1.2em; height: 1.2em; flex: none; vertical-align: -.24em; background-color: currentColor;
       -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; }
.ico-latest { -webkit-mask-image: url(icons/latest.svg); mask-image: url(icons/latest.svg); }
.ico-list { -webkit-mask-image: url(icons/list.svg); mask-image: url(icons/list.svg); }
.ico-bookmark { -webkit-mask-image: url(icons/bookmark.svg); mask-image: url(icons/bookmark.svg); }
.ico-journal { -webkit-mask-image: url(icons/journal.svg); mask-image: url(icons/journal.svg); }
.ico-status { -webkit-mask-image: url(icons/status.svg); mask-image: url(icons/status.svg); }
.ico-filter { -webkit-mask-image: url(icons/filter.svg); mask-image: url(icons/filter.svg); }
.ico-user { -webkit-mask-image: url(icons/user.svg); mask-image: url(icons/user.svg); }
.ico-sun { -webkit-mask-image: url(icons/sun.svg); mask-image: url(icons/sun.svg); }
.ico-moon { -webkit-mask-image: url(icons/moon.svg); mask-image: url(icons/moon.svg); }
.ico-monitor { -webkit-mask-image: url(icons/monitor.svg); mask-image: url(icons/monitor.svg); }
.ico-close { -webkit-mask-image: url(icons/close.svg); mask-image: url(icons/close.svg); }
.ico-restore { -webkit-mask-image: url(icons/restore.svg); mask-image: url(icons/restore.svg); }
.ico-external-link { -webkit-mask-image: url(icons/external-link.svg); mask-image: url(icons/external-link.svg);
                     width: .9em; height: .9em; margin-left: .2em; vertical-align: -.08em; }

/* ------------------------------------------------------------------ buttons & form controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.75rem; padding: .5rem 1.15rem;
       font: 600 .95rem/1.2 var(--font-ui); border-radius: var(--radius-sm); border: 1px solid var(--primary);
       background: var(--primary); color: var(--primary-fg); cursor: pointer; text-decoration: none; transition: filter .15s, background .15s; }
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn.secondary { background: var(--surface); color: var(--fg); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--hover); filter: none; }
.linkbtn { font: inherit; font-size: .92rem; background: none; border: 0; color: var(--accent); text-decoration: underline; text-underline-offset: .15em;
           cursor: pointer; padding: .3rem .2rem; min-height: 2rem; }
.iconbtn { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 0; border-radius: var(--radius-sm);
           background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.iconbtn .ico { width: 1.35rem; height: 1.35rem; }
.iconbtn:hover { background: var(--hover); color: var(--fg); }
input[type=text], input[type=date], input[type=email], input[type=password], select {
    font: inherit; font-size: .95rem; min-height: 2.6rem; padding: .4rem .65rem; color: var(--fg); background: var(--surface);
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--primary); vertical-align: -.15em; }
.field { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
.field.grow { flex: 1 1 14rem; }
.field input, .field select { font-weight: 400; }

/* ------------------------------------------------------------------ header */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .5rem 1.25rem; min-height: var(--header-h);
       padding: .5rem 1.25rem; background: color-mix(in srgb, var(--surface) 88%, transparent); border-bottom: 1px solid var(--line);
       -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); }
.brand { display: flex; flex: none; border-radius: var(--radius-sm); }
.brand .logo { display: block; height: 42px; width: auto; } /* 42px high = 180px wide: brand minimum */
.brand .logo-dark, .brand .logo-mark { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme=light]) .brand .logo-light { display: none; }
    :root:not([data-theme=light]) .brand .logo-dark { display: block; }
}
:root[data-theme=dark] .brand .logo-light { display: none; }
:root[data-theme=dark] .brand .logo-dark { display: block; }
.top-title { display: none; }
.mainnav { display: flex; flex-wrap: wrap; gap: .15rem; }
.mainnav a { position: relative; display: inline-flex; align-items: center; gap: .45rem; min-height: 2.6rem; padding: .4rem .8rem; border-radius: var(--radius-sm);
             color: var(--muted); text-decoration: none; font-weight: 550; font-size: .95rem; }
.mainnav a:hover { background: var(--hover); color: var(--fg); }
.mainnav a[aria-current] { color: var(--fg); background: var(--selected); }
.mainnav a[aria-current] .ico { color: var(--primary); }
.badge { display: inline-block; min-width: 1.35rem; padding: 0 .4rem; border-radius: 999px; background: var(--primary); color: var(--primary-fg);
         font: 700 .72rem/1.35rem var(--font-ui); text-align: center; }
.tools { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.theme-form { margin: 0; }
.profile-link { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; padding: .25rem .8rem .25rem .3rem; border-radius: 999px;
                border: 1px solid var(--line); color: var(--fg); text-decoration: none; font-weight: 550; font-size: .95rem; background: var(--surface); }
.profile-link .ico-user { margin-left: .5rem; color: var(--muted); }
.profile-link:hover, .profile-link[aria-current] { border-color: var(--line-strong); background: var(--hover); }
.avatar { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; font: 700 .9rem var(--font-ui);
          background: linear-gradient(135deg, var(--powerdash-blue), var(--powerdash-cyan)); color: #fff; }
.avatar.big { width: 2.6rem; height: 2.6rem; font-size: 1.1rem; }
.tabbar { display: none; }

/* ------------------------------------------------------------------ page head, notices */
.listhead { margin: 1.6rem 0 1rem; }
.listhead h1 { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.listhead .count { font: 650 .9rem var(--font-ui); color: var(--muted); background: var(--surface); border: 1px solid var(--line);
                   border-radius: 999px; padding: .1rem .7rem; }
.listhead .sub { margin: .4rem 0 0; color: var(--muted); font-size: .95rem; }
.unreadlink { font-weight: 650; text-decoration: none; }
.unreadlink.on { text-decoration: underline; }
.newcount { color: var(--new); font-weight: 650; }
.stats { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: .5rem 0 0; color: var(--muted); }
.stats strong { color: var(--fg); font-size: 1.1rem; }
.stats a { color: var(--muted); text-decoration: none; }
.stats a strong { color: var(--accent); }
.notice { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: var(--radius-sm);
          padding: .75rem 1rem; margin: 0 0 1rem; font-size: .95rem; }
.notice.warn { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-line); border-left-color: var(--warn-fg); }
.notice.warn a { color: inherit; font-weight: 650; }
.hint { color: var(--muted); font-size: .92rem; margin: .4rem 0 .9rem; }
.pill { display: inline-block; font-size: .72rem; font-weight: 650; padding: .05rem .45rem; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.pill.warn { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-line); }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1.5rem; margin: 1rem 0; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty strong { color: var(--fg); font-family: var(--font-serif); font-size: 1.25rem; font-weight: 650; }

/* ------------------------------------------------------------------ filters */
.filters { margin: 0 0 1.25rem; padding: .85rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.filter-bar { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.seg { display: inline-flex; padding: .2rem; gap: .15rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.seg label { display: block; }
.seg input, .chip input, .jchip input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: grid; place-items: center; min-width: 2.9rem; min-height: 2.3rem; padding: 0 .6rem; border-radius: 8px;
            font-size: .9rem; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.seg span:hover { color: var(--fg); }
.seg input:checked + span { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgba(11, 31, 51, .15); }
.seg input:focus-visible + span, .chip input:focus-visible + span, .jchip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip span { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.5rem; padding: .2rem .9rem .2rem .3rem; border: 1px solid var(--line-strong);
             border-radius: 999px; color: var(--fg-2); background: var(--surface); cursor: pointer; font-size: .92rem; font-weight: 550; white-space: nowrap;
             transition: border-color .15s, background .15s; }
.chip span:hover { border-color: var(--c); }
.chip.plain span { padding-left: .9rem; }
.chip input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: var(--fg); box-shadow: inset 0 0 0 1px var(--c); }
.chip.plain input:checked + span { --c: var(--primary); }
.caticon { width: 26px; height: 26px; border-radius: 7px; }
.filter-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-top: .65rem; }
.more { flex: 1 1 auto; }
.more[open] { flex-basis: 100%; }
.more > summary { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.5rem; padding: .3rem .75rem; border-radius: var(--radius-sm);
                  color: var(--fg-2); font-weight: 600; font-size: .92rem; cursor: pointer; list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary:hover { background: var(--hover); }
.more > summary .badge { margin-left: .1rem; }
.filter-more { padding: .8rem .25rem .25rem; display: grid; gap: 1rem; }
.journals { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.journals legend { font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: .4rem; }
.journals .pub { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 .1rem 0 .5rem; }
.journals .pub:first-of-type { margin-left: 0; }
.jchip span { display: inline-grid; place-items: center; min-height: 2.25rem; padding: 0 .7rem; border: 1px solid var(--line-strong); border-radius: 8px;
              font-size: .85rem; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--fg-2); cursor: pointer; background: var(--surface); }
.jchip input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.grid { display: flex; flex-wrap: wrap; gap: .8rem 1.1rem; align-items: flex-end; }
.grid.checks { gap: .5rem 1.5rem; }
.grid.checks label { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.2rem; font-size: .93rem; color: var(--fg-2); cursor: pointer; }
.filter-actions { display: flex; gap: .9rem; align-items: center; margin-left: auto; }
.reset { font-size: .92rem; color: var(--muted); }

/* ------------------------------------------------------------------ article list */
.list { display: flex; flex-direction: column; gap: .65rem; }
.list:empty { display: none; }
.group { position: sticky; top: var(--header-h); z-index: 2; margin: 1.1rem 0 .1rem; padding: .45rem .15rem; background: var(--bg);
         font: 700 .78rem var(--font-ui); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.group:first-child { margin-top: 0; }
.item { position: relative; display: grid; grid-template-columns: 1.4rem minmax(0, 1fr) auto; gap: 0 .7rem; align-items: start;
        padding: 1rem .85rem .85rem .7rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
        box-shadow: var(--shadow); scroll-margin-top: calc(var(--header-h) + 3rem); transition: border-color .15s, box-shadow .15s, opacity .15s; }
.item:hover { border-color: var(--line-strong); }
.item.is-current { border-color: var(--focus); box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus) 35%, transparent); }
.item.is-gone { display: none; }
.item.is-dismissed { opacity: .55; }
.item.is-dismissed:hover, .item.is-dismissed.is-current { opacity: .9; }
.act { display: none; }

.readdot { position: relative; width: 1.4rem; height: 1.6rem; margin-top: .1rem; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 6px; }
.readdot::after { content: ""; position: absolute; left: 50%; top: 50%; width: .7rem; height: .7rem; transform: translate(-50%, -50%); border-radius: 50%;
                  background: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); transition: background .15s, box-shadow .15s; }
.item.is-read .readdot::after, .item.no-profile .readdot::after { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.readdot:hover::after { box-shadow: inset 0 0 0 2px var(--primary); }

.item-body { min-width: 0; }
.kicker { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .45rem; margin: 0; font-size: .84rem; color: var(--muted); }
.kicker .sep { opacity: .6; }
.jcode { font-weight: 750; color: var(--fg); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.quart { font-size: .72rem; font-weight: 700; padding: .02rem .4rem; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.quart.q-q1 { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.status { font-weight: 600; }
.status.ea { color: #b35c00; }
:root[data-theme=dark] .status.ea { color: #ffb45c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .status.ea { color: #ffb45c; } }
.status.unknown, .status.type { font-style: italic; font-weight: 500; }
.cats { display: inline-flex; gap: .3rem; margin-left: .15rem; }
.cat { display: inline-block; line-height: 0; border-radius: 6px; cursor: help; }
.cat img { width: 22px; height: 22px; border-radius: 6px; }
.cat.uncertain { opacity: .45; outline: 1px dashed var(--c); outline-offset: 1px; }
.cat.manual { outline: 1.5px solid var(--c); outline-offset: 1px; }

.title { margin: .35rem 0 .2rem; font-family: var(--font-serif); font-size: 1.22rem; line-height: 1.35; font-weight: 650; letter-spacing: -.003em; overflow-wrap: anywhere; }
.title a { color: var(--fg); text-decoration: none; }
.title a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.item.is-read .title { font-weight: 450; }
.item.is-read .title a { color: var(--read); }
.newtag { display: inline-block; margin-left: .5rem; padding: .05rem .4rem; border-radius: 5px; font: 700 .68rem var(--font-ui); text-transform: uppercase;
          letter-spacing: .05em; color: var(--new); border: 1px solid currentColor; vertical-align: .2em; }
.authors { margin: 0; font-size: .92rem; color: var(--fg-2); }
.links { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem 1rem; margin-top: .45rem; font-size: .9rem; }
.lnk { display: inline-flex; align-items: center; min-height: 2rem; font-weight: 650; text-decoration: none; }
.lnk:hover { text-decoration: underline; }
.lnk[aria-disabled] { pointer-events: none; color: var(--muted); opacity: .5; }
.edit { display: inline-block; }
.edit summary { display: inline-flex; align-items: center; min-height: 2rem; color: var(--muted); font-size: .88rem; cursor: pointer; list-style: none; }
.edit summary::-webkit-details-marker { display: none; }
.edit summary:hover { color: var(--fg); }
.edit[open] { flex-basis: 100%; }
.edit-body { display: flex; flex-wrap: wrap; gap: .4rem; padding: .4rem 0 .2rem; }
.edit-body form { margin: 0; }
.toggle { font: inherit; font-size: .85rem; font-weight: 600; min-height: 2.25rem; padding: .2rem .8rem; border-radius: 999px; border: 1px solid var(--c);
          color: var(--c); background: transparent; cursor: pointer; }
.toggle.on { background: var(--c); color: #fff; }

.item-actions { display: flex; gap: .2rem; margin: -.35rem -.35rem 0 0; }
.star[aria-pressed=true] { color: var(--star); }
.star[aria-pressed=true] .ico { -webkit-mask-image: url(icons/bookmark-filled.svg); mask-image: url(icons/bookmark-filled.svg); }
.dismiss:hover { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }

/* Pagination (SPEC.md UI-08): centred  ‹ 1 2 3 … 159 ›  with range + page size underneath */
.pager { display: flex; flex-direction: column; align-items: center; gap: .7rem; margin: 2rem 0 1rem; color: var(--muted); font-size: .92rem; }
.pages { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .3rem; }
.pg { display: inline-grid; place-items: center; min-width: 2.6rem; min-height: 2.6rem; padding: 0 .55rem; border-radius: var(--radius-sm);
      border: 1px solid var(--line); background: var(--surface); font-weight: 650; font-variant-numeric: tabular-nums;
      color: var(--fg-2); text-decoration: none; white-space: nowrap; }
a.pg:hover { border-color: var(--line-strong); background: var(--hover); color: var(--fg); }
.pg.nav { font-size: 1.25rem; line-height: 1; }
.pg.nav[aria-disabled] { opacity: .35; }
.pg[aria-current] { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.pg.gap { min-width: 1.4rem; padding: 0; border: 0; background: none; color: var(--muted); }
.pager-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .4rem 1.2rem; }
.pager .range, .listhead .range { font-variant-numeric: tabular-nums; }
.pagesize { display: flex; align-items: center; gap: .5rem; margin: 0; }
.pagesize label { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.pagesize select { min-height: 2.3rem; }

/* Title search (UI-17) and keyboard help (UI-21) */
.searchrow { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.filters.searchonly .searchrow { margin-bottom: 0; }
.search { flex: 1 1 auto; position: relative; display: block; }
.search::before { content: ""; position: absolute; left: .8rem; top: 50%; width: 1.05rem; height: 1.05rem; transform: translateY(-50%);
                  background: var(--muted); -webkit-mask: url(icons/search.svg) center / contain no-repeat; mask: url(icons/search.svg) center / contain no-repeat; }
.search input { width: 100%; font: inherit; font-size: 1rem; min-height: 2.9rem; padding: .45rem .9rem .45rem 2.4rem; color: var(--fg);
                background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 999px; }
.search input:focus { background: var(--surface); outline: 2px solid var(--focus); outline-offset: 1px; }
mark { background: color-mix(in srgb, var(--powerdash-cyan) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 .08em; }
.listhead-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.kbdhelp { position: relative; flex: none; }
.kbdhelp > summary { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.4rem; padding: .25rem .8rem; border: 1px solid var(--line);
                     border-radius: 999px; background: var(--surface); color: var(--fg-2); font-size: .88rem; font-weight: 600; cursor: pointer; list-style: none; }
.kbdhelp > summary::-webkit-details-marker { display: none; }
.kbdhelp[open] > summary { border-color: var(--line-strong); background: var(--hover); }
.kbdhelp dl { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 4; margin: 0; padding: .8rem 1rem; min-width: 17rem;
              display: grid; grid-template-columns: auto 1fr; gap: .4rem .9rem; align-items: center; font-size: .9rem;
              background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.kbdhelp dt { text-align: right; white-space: nowrap; }
.kbdhelp dd { margin: 0; color: var(--fg-2); }
.btn.small { min-height: 2.4rem; padding: .3rem .8rem; }
kbd { font: 600 .8rem var(--font-ui); padding: .05rem .4rem; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--fg); }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: .9rem;
         max-width: calc(100vw - 2rem); padding: .7rem 1rem .7rem 1.2rem; border-radius: 12px; background: var(--fg); color: var(--bg);
         box-shadow: var(--shadow-lg); font-size: .95rem; }
.toast[hidden] { display: none; }
.toast .linkbtn, .toast a { color: var(--bg); font-weight: 700; white-space: nowrap; }

/* ------------------------------------------------------------------ cards (profile) */
.cards { display: grid; gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.3rem; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 .5rem; display: flex; align-items: center; gap: .6rem; }
.card.highlight { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
form.inline { display: flex; flex-wrap: wrap; gap: .7rem; align-items: flex-end; margin: .4rem 0 0; }
.card input.wide, .copyrow input { flex: 1 1 18rem; min-width: 0; }
.copyrow { display: flex; gap: .6rem; flex-wrap: wrap; margin: .6rem 0; }
.copyrow input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85rem; }
.emailrow { margin: .8rem 0 .5rem; }
.reveal { margin: .4rem 0 .6rem; }
.reveal > summary { list-style: none; }
.reveal > summary::-webkit-details-marker { display: none; }
.reveal[open] > summary { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: .3rem 1.5rem; }
.actions form { margin: 0; }
.themes { display: inline-flex; padding: .2rem; gap: .2rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.themebtn { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.6rem; padding: .3rem 1rem; border: 0; border-radius: 8px; background: transparent;
            font: 600 .93rem var(--font-ui); color: var(--muted); cursor: pointer; }
.themebtn[aria-pressed=true] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgba(11, 31, 51, .15); }

/* ------------------------------------------------------------------ footer, admin */
.foot { max-width: 64rem; margin: 0 auto; padding: 1rem 1.25rem 2rem; display: flex; justify-content: space-between; gap: 1rem;
        color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); }
.foot a { color: var(--muted); }
.headaction { display: inline; margin-left: auto; }
.narrowcards { max-width: 32rem; }

/* ------------------------------------------------------------------ web installer (SPEC.md OPS-09) */
main.narrow { max-width: 46rem; }
.installer .brand .logo-mark { display: none; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; font-size: .92rem; }
.checklist li { display: flex; gap: .6rem; align-items: baseline; padding: .2rem 0 .2rem 1.6rem; position: relative; }
.checklist li::before { position: absolute; left: .2rem; font-weight: 800; }
.checklist li.ok::before { content: "✓"; color: #2e9b57; }
.checklist li.bad::before { content: "✕"; color: var(--bad); }
.checklist li.warn::before { content: "!"; color: var(--warn-fg); }
.checklist span { color: var(--muted); }
.stack { display: grid; gap: .9rem; margin-top: .8rem; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .8rem 1rem; }
.formgrid legend { font: 650 1rem var(--font-serif); margin-bottom: .5rem; }
.formgrid .wide { grid-column: 1 / -1; }
.formgrid input[type=email], .formgrid input[type=password] {
    font: inherit; font-size: .95rem; min-height: 2.6rem; padding: .4rem .65rem; color: var(--fg); background: var(--surface);
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.field small { font-weight: 400; }
.checkline { display: flex; align-items: center; gap: .5rem; font-size: .93rem; color: var(--fg-2); }
.mailtest { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.configform > summary { list-style: none; margin-top: .3rem; }
.configform > summary::-webkit-details-marker { display: none; }
.configform[open] > summary { display: none; }
.steps { margin: .4rem 0 1rem; padding-left: 1.3rem; display: grid; gap: .6rem; }
code.block { display: block; margin: .35rem 0; padding: .5rem .7rem; overflow-x: auto; white-space: nowrap; }
progress { width: 100%; height: .7rem; accent-color: var(--primary); margin: .3rem 0 .8rem; }
pre.log { max-height: 14rem; overflow: auto; font-size: .78rem; padding: .6rem .8rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ------------------------------------------------------------------ tables (journals, status) */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.tbl { border-collapse: collapse; width: 100%; font-size: .9rem; }
.tbl th, .tbl td { border-bottom: 1px solid var(--line); padding: .6rem .75rem; text-align: left; vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--muted); white-space: nowrap; background: var(--surface-2); }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.bad td { background: var(--bad-bg); }
.tbl tr.warnrow td { background: var(--warn-bg); }
.tbl tr.inactive td { opacity: .5; }
.tbl .links a { margin-right: .7rem; white-space: nowrap; }

/* ------------------------------------------------------------------ mobile (SPEC.md UI-26) */
@media (max-width: 760px) {
    :root { --header-h: 3.6rem; }
    html { font-size: 100%; } /* 16px – avoids iOS zoom on inputs */
    main { padding: 0 .85rem 1.5rem; }
    .foot { flex-direction: column; padding: 1rem .85rem calc(5.5rem + env(safe-area-inset-bottom)); }
    h1 { font-size: 1.6rem; }

    .top { gap: .6rem; padding: .4rem .85rem; padding-top: max(.4rem, env(safe-area-inset-top)); }
    .brand .logo { display: none !important; }
    .brand .logo.logo-mark { display: block !important; width: 36px; height: 36px; }
    .top-title { display: block; flex: 1 1 auto; min-width: 0; font: 650 1.05rem var(--font-serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .mainnav { display: none; }
    .pname { display: none; }
    .profile-link { padding: .2rem; border: 0; background: transparent; min-height: 2.75rem; min-width: 2.75rem; justify-content: center; }
    .profile-link .ico-user { margin: 0; width: 1.35rem; height: 1.35rem; }

    .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
              padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent);
              border-top: 1px solid var(--line); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); }
    .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-height: 3.2rem;
                border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 650; }
    .tabbar a .ico { width: 1.45rem; height: 1.45rem; }
    .tabbar a[aria-current] { color: var(--primary); }
    .tabbar a[aria-current]::before { content: ""; position: absolute; top: 0; width: 1.8rem; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
    .tabbar .badge { position: absolute; top: .2rem; left: calc(50% + .35rem); min-width: 1.1rem; padding: 0 .3rem; font-size: .62rem; line-height: 1.1rem; }

    .listhead { margin: 1.1rem 0 .8rem; }
    .listhead .count { font-size: .8rem; }

    /* Filters: one horizontally scrollable row for time range and topics */
    .filters { padding: .7rem; margin-left: -.15rem; margin-right: -.15rem; }
    .filter-bar { flex-direction: column; align-items: stretch; gap: .6rem; }
    .seg { display: flex; overflow-x: auto; scrollbar-width: none; }
    .seg::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
    .seg label { flex: 1 0 auto; }
    .seg span { min-width: 2.6rem; }
    .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -.7rem; padding: 0 .7rem .1rem; scroll-padding: .7rem; }
    .filter-foot { margin-top: .4rem; }
    .filter-actions { margin-left: auto; }
    .grid { flex-direction: column; align-items: stretch; }
    .grid .field { width: 100%; }

    .group { top: var(--header-h); margin-top: .8rem; }
    .item { grid-template-columns: 1.25rem minmax(0, 1fr) auto; gap: 0 .45rem; padding: .85rem .55rem .7rem .45rem; border-radius: 12px; }
    .item-actions { flex-direction: column; gap: 0; margin: -.45rem -.25rem -.3rem 0; }
    .title { font-size: 1.12rem; }
    .kicker { font-size: .8rem; }
    .authors { font-size: .88rem; }
    .cat img { width: 20px; height: 20px; }

    .pg { min-width: 2.4rem; min-height: 2.5rem; padding: 0 .4rem; }
    .pg.far { display: none; } /* mobile: 1 … 9 10 11 … 159 */
    .pages { flex-wrap: nowrap; gap: .2rem; }
    .kbdhelp { display: none; } /* no keyboard on phones */
    .search input { min-height: 2.75rem; }

    .toast { bottom: calc(4.8rem + env(safe-area-inset-bottom)); width: calc(100vw - 1.5rem); justify-content: space-between; }
    .card { padding: 1rem; }
    .themes { display: flex; }
    .themebtn { flex: 1; justify-content: center; padding: .3rem .5rem; }
    .tbl { font-size: .85rem; }
}
@media (max-width: 380px) {
    .tabbar a { font-size: .66rem; }
}
