/* Pinboard-ish: dense, text-first, no chrome */

/* National 2 — TRIAL webfonts (app/static/fonts/), development only.
   Not yet licensed. Do not ship these in a release build or public beta —
   see design_handoff_pins_redesign/README.md "Note on fonts". */
@font-face {
  font-family: "National 2"; font-weight: 400; font-style: normal;
  src: url("fonts/national2-regular.woff2") format("woff2");
}
@font-face {
  font-family: "National 2"; font-weight: 400; font-style: italic;
  src: url("fonts/national2-italic.woff2") format("woff2");
}
@font-face {
  font-family: "National 2"; font-weight: 700; font-style: normal;
  src: url("fonts/national2-bold.woff2") format("woff2");
}

:root {
  /* surfaces */
  --bg: #fbfbfa; --surface: #fff; --chrome: #fafaf8; --rail: #fcfcfb;
  --edge: #e7e7e4; --rule: #ededea; --rule-soft: #f3f3f0; --hover: #fafaf8;
  --code-bg: #f4f4f4; --bulk-bg: #f4f4f7; --bulk-edge: #e4e4ea; --pill: #ebebe6;
  /* ink */
  --ink: #333; --ink-2: #666; --ink-3: #888; --ink-4: #999; --ink-5: #aaa; --ink-6: #bbb;
  --link: #00e; --brand: #222266; --brand-hover: #1b1b52; --tag: #b60; --host: #789;
  --star: #f90; --star-off: #ddd;
  --ok: #7a7; --warn: #c60; --danger: #c33; --danger-ink: #c00;
  --danger-bg: #fdf3f3; --danger-edge: #f0dada; --danger-btn-edge: #e3c9c9;
  --success-ink: #060; --success-bg: #f4f9f4; --success-edge: #e2eee2;
  --meter: #5b6fae; --repo: #99b;
  /* type — root is 13.5px, every other size is em-relative to it */
  --f-sm3: 0.72em; --f-sm2: 0.82em; --f-sm: 0.9em; --f-band: 0.92em;
  --f-body: 1em; --f-strong: 1.07em; --f-brand: 1.15em; --f-tile: 1.33em;
  --font: "National 2", Verdana, Geneva, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { font-size: 13.5px; }
body { font: var(--f-body)/1.45 var(--font); color: var(--ink); margin: 0; background: var(--bg); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
input[type=text], input[type=url], input[type=password], input[type=search],
input[type=number], input[type=email], textarea, select {
  font: var(--f-body) var(--font); color: var(--ink);
  padding: 4px 7px; border: 1px solid #ccc; border-radius: 2px;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--brand); outline: none; box-shadow: 0 0 0 2px #2222661a;
}
/* buttons never shrink below their label — a flex/grid parent wraps the row
   instead of squeezing the button's own box */
button { white-space: nowrap; flex: 0 0 auto; }
.n, .stats-table .n, td.cnt { font-variant-numeric: tabular-nums; }

/* header: row 1 wordmark + nav + user group, row 2 search — see
   design_handoff_pins_redesign/README.md "Nav is bookmarks · tags · ..." */
#banner { background: var(--chrome); border-bottom: 1px solid var(--rule);
          padding: 8px 14px; display: flex; flex-direction: column; gap: 7px; }
#banner .chrome-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
#logo { font-weight: bold; color: var(--brand); font-size: var(--f-brand);
        letter-spacing: -0.2px; }
/* #129: the banner mark is the same icon.svg the favicon, extension and
   launcher icons are drawn from — it replaced a 📌 emoji, which rendered
   as a different pushpin on every platform.
   #132: icon.svg turns white under prefers-color-scheme: dark so it survives
   a dark browser tab strip. This page is always light, so pin the embedded
   SVG to the light scheme or the logo goes white-on-white for anyone whose
   OS is in dark mode. */
#logo img { width: 16px; height: 16px; vertical-align: -2px; margin-right: 5px;
            color-scheme: light; }
#banner nav { display: flex; gap: 6px; flex-wrap: wrap; }
#banner nav a { color: var(--link); }
#banner nav a.active { color: var(--ink); font-weight: bold;
  border-bottom: 2px solid var(--brand); padding-bottom: 1px; }
.userinfo { margin-left: auto; color: var(--ink-2); white-space: nowrap; }
.userinfo .linklike { color: var(--ink-2); }
#searchbox { display: flex; }
.search-field { display: flex; align-items: stretch; flex: 1; max-width: 480px;
  border: 1px solid #ccc; border-radius: 2px; background: var(--surface); }
.search-field:focus-within { border-color: var(--brand);
  box-shadow: 0 0 0 2px #2222661a; }
.search-field input[type="search"] { flex: 1; border: none; border-radius: 0;
  font-size: var(--f-sm); padding: 4px 7px; background: transparent;
  -webkit-appearance: none; appearance: none; }
.search-field input[type="search"]:focus { box-shadow: none; }
.search-field input[type="search"]::-webkit-search-decoration,
.search-field input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-field .ft-toggle { display: flex; align-items: center; gap: 4px;
  font-size: var(--f-sm2); color: var(--ink-2); white-space: nowrap;
  padding: 4px 8px; border-left: 1px solid var(--rule); cursor: pointer; }
.search-field .ft-toggle.active { background: var(--pill); }
.search-field .ft-toggle input { margin: 0; }

main { padding: 0; }

/* layout — card + right rail, centred, per README "Layout" */
.pagewrap { max-width: 1060px; margin: 0 auto; padding: 24px 16px 56px;
  display: flex; align-items: flex-start; }
.card { flex: 1; min-width: 0; background: var(--surface);
  border: 1px solid var(--edge); border-radius: 3px; }
/* issue #181 item 1: header, list and rail read as one card, not chrome
   floating above a separate box — the header is the card's first child
   (see _header.html + index.html/tags.html's {% block header %} override).
   Rounded on top to match the card (not overflow:hidden on .card itself,
   which would clip the tag-suggest popover that can extend past its edge). */
.card > #banner { border-radius: 2px 2px 0 0; }
/* issue #181 item 2: the rail is a flex sibling of the list *inside* the
   card, not the card itself — .cardbody is the flex row that used to be
   .pagewrap's job when the rail sat beside the card rather than in it. */
.cardbody { display: flex; }
.listcol { flex: 1; min-width: 0; }
/* #177 item 2: rail items are --f-sm and counts --f-sm2 per spec. Sizes are
   set per part rather than once on .rail, because em compounds — a 0.82em
   rail made a 0.82em child render at 0.67em. */
.rail { width: 208px; flex-shrink: 0; overflow: hidden; border-left: 1px solid var(--rule);
  background: var(--rail); padding: 12px 14px; font-size: var(--f-sm); }
.railhead { color: var(--ink-4); font-size: var(--f-sm); margin-bottom: 8px; }
.raillink { display: block; color: var(--ink-4); font-size: var(--f-sm);
  text-decoration: underline; margin-top: 12px; }

/* chrome/content separation: header band + filter band */
.listband { background: var(--chrome); border-bottom: 1px solid var(--rule);
  padding: 9px 14px; display: flex; align-items: baseline; gap: 8px;
  flex-wrap: wrap; font-size: var(--f-band); color: var(--ink-3); }
.listband .count { font-weight: bold; font-size: var(--f-strong); color: var(--ink);
  font-variant-numeric: tabular-nums; margin-right: 4px; }
.listband .filter.active { font-weight: bold; color: var(--ink); }
.listband .crumb { color: var(--ink-3); }
.listband .selectall { margin-left: auto; }

/* #78: bulk edit. #bulkall (band) is always available once something can be
   picked; the styled bar below only appears once something is (n > 0). */
.bulkpick { margin: 0 2px 0 0; vertical-align: middle; }
.bulkbar { background: var(--bulk-bg); border-bottom: 1px solid var(--bulk-edge);
  padding: 7px 14px; display: flex; align-items: center; gap: 10px;
  font-size: var(--f-sm2); color: var(--ink-2); flex-wrap: wrap; }
/* .bulkbar's own display:flex otherwise beats the [hidden] attribute's
   default display:none — an author rule always wins over the UA stylesheet
   regardless of selector specificity, so it needs an explicit override */
.bulkbar[hidden] { display: none; }
.bulkbar select, .bulkbar input, .bulkbar button { font: inherit; }
.bulkbar input[type="number"] { width: 72px; }
.bulkbar .pill { background: var(--pill); font-weight: bold; padding: 1px 7px;
  border-radius: 3px; color: var(--ink); }
.bulkbar .scope { margin-left: auto; }
.bulkbar.delete button[type="submit"] { background: #fff; color: var(--danger-ink);
  border: 1px solid var(--danger-btn-edge); }

/* row grid — star | content | archive glyphs, per README "Row anatomy" */
.rows { }
.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 6px; align-items: start; padding: 9px 14px;
  border-bottom: 1px solid var(--rule-soft); }
.row:last-child { border-bottom: none; }
.row:hover, .row:focus-within { background: var(--hover); }
.col-star { grid-column: 1; grid-row: 1 / 3; min-width: 15px;
  display: flex; align-items: center; gap: 3px; padding-top: 1px; }
.col-main { grid-column: 2; grid-row: 1; min-width: 0; }
/* #177 item 1: the meta line owns grid row 2 and the row actions ride along
   inside it, so a row nobody is hovering spends no height on them. Rows that
   keep .rowacts as a direct child (the archives queue) get the same slot. */
.row > .metaline, .row > .rowacts { grid-column: 2; grid-row: 2; min-width: 0;
  margin-top: 3px; }
.metaline { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.col-archive { grid-column: 3; grid-row: 1 / 3; display: flex; align-items: center;
  gap: 4px; white-space: nowrap; padding-top: 1px; }
.star { cursor: pointer; color: var(--star-off); font-size: var(--f-sm); }
.star.on { color: var(--star); }
.row-title { font-size: var(--f-body); text-wrap: pretty; unicode-bidi: isolate; }
.host { color: var(--host); font-size: var(--f-sm2); margin-left: 6px; unicode-bidi: isolate; }
/* row actions — a flex item at the end of .metaline, not inline in the
   title's text flow (which wrapped them mid-title). Hover-revealed via
   opacity, not display, so revealing it never reflows the row;
   :focus-within keeps it reachable by keyboard. */
.rowacts { display: flex; align-items: center; gap: 8px;
  opacity: 0; transition: opacity .12s; font-size: var(--f-sm2); }
.row:hover .rowacts, .row:focus-within .rowacts { opacity: 1; }
.note { color: var(--ink-2); margin: 3px 0 0; max-width: 700px; }
.note blockquote { margin: 4px 0 4px 8px; padding-left: 8px;
  border-left: 3px solid #ddd; color: #555; }
.note p { margin: 4px 0; }
.note code { background: #f2f2f2; padding: 0 3px; border-radius: 2px; }
.meta { color: var(--ink-4); font-size: var(--f-sm2); }
.col-main > .meta { margin-top: 3px; }
.meta .priv { margin-left: 4px; }
a.tag { color: var(--tag); unicode-bidi: isolate; }
a.when { color: var(--ink-4); font-size: var(--f-sm2); }
/* font-size lives on .rowacts (line ~179); setting it again here compounded
   0.82em x 0.82em to ~0.67em — issue #185 item B */
a.edit, a.delete, a.pin, .confirm a, .tagrow .rowextra .cancel { color: var(--ink-4); }
.confirm .destroy { color: var(--danger-ink); }

/* archive glyph column — status meanings unchanged, restyled per glyph table */
.archived { color: var(--ok); }
.archived sup { font-size: var(--f-sm3); }
.glyph { cursor: pointer; color: var(--ok); }
.glyph.failed { color: var(--danger); }  /* #69: failed archive, error in title */
.glyph.off { color: var(--ink-4); cursor: default; }  /* #75: archiving opted out */
.glyph.download { color: var(--ink-4); cursor: default; }  /* #95: repo tarball */
.glyph.refresh { color: var(--repo); }  /* #100: re-clone a repo snapshot */
.glyph.pending { color: var(--ok); cursor: default; }

/* tag rail — ranked list (count drives order, not font size) */
.railtag { display: flex; justify-content: space-between; gap: 8px;
  padding: 3px 0; }
.railtag a.tag { overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0; }
/* 0.91em of the rail's 0.9em == --f-sm2 against the root */
.railtag .cnt { color: var(--ink-6); font-variant-numeric: tabular-nums;
  flex-shrink: 0; font-size: 0.91em; }

/* archives queue (#137, redesigned) — counts as tiles, worker health its own
   band, job rows reuse the list screen's row grid and glyph gutter */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px; padding: 14px; margin: 0; }
.tile { border: 1px solid #eee; border-radius: 3px; padding: 6px 12px; }
.tile b { display: block; font-size: var(--f-tile); color: var(--brand);
  font-variant-numeric: tabular-nums; }
.tile b.ok { color: var(--ok); }
.tile span { color: var(--ink-3); font-size: var(--f-sm2); }

#worker-health { padding: 9px 14px; border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule); color: var(--ink-2); font-size: var(--f-sm2); }
#worker-health.unhealthy { background: var(--danger-bg); color: var(--danger);
  border-color: var(--danger-edge); }
#worker-health small { color: inherit; }

.actionrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 14px; border-bottom: 1px solid var(--rule); }
.actionrow form { display: contents; }
.actionrow .pushright { margin-left: auto; }
button.secondary { background: #fff; color: var(--ink); border: 1px solid var(--edge);
  padding: 5px 12px; border-radius: 2px; cursor: pointer; font: var(--f-body) var(--font);
  white-space: nowrap; }
button.secondary:hover { background: var(--hover); }
button.danger-outline { background: #fff; color: var(--danger-ink);
  border: 1px solid var(--danger-btn-edge); padding: 5px 12px; border-radius: 2px;
  cursor: pointer; font: var(--f-body) var(--font); white-space: nowrap; }

.glyph.wait { color: var(--ink-6); cursor: default; }
.glyph.static { cursor: default; }
.row.stuck { background: var(--danger-bg); }
.meta.url { word-break: break-all; }
.reason { white-space: pre-line; color: var(--ink-2); border-left: 2px solid #eee;
  padding-left: 8px; margin: 4px 0; }
.warn { color: var(--warn); }
.railtag a.active { color: var(--ink); font-weight: bold; text-decoration: none; }
.more { font-size: var(--f-sm2); color: var(--ink-3); margin: 6px 0 16px; padding: 0 14px; }

#pagination { padding: 14px; color: var(--ink-3); font-size: var(--f-sm2);
  display: flex; align-items: center; flex-wrap: wrap; }
#pagination a { margin: 0 4px; }
.perpage { margin-left: auto; }
.empty { color: var(--ink-4); padding: 14px; }

/* add/edit bookmark — one right-aligned label column (README screen 2).
   Lives in .pagewrap > .card > .cardbody like every other screen (issue #185
   item M); .addcol keeps its own 660px cap as .cardbody's other flex item. */
.addcol { flex: 1; min-width: 0; max-width: 660px; padding: 14px; }
.formerror { background: var(--danger-bg); border: 1px solid var(--danger-edge);
  border-left: 3px solid var(--danger); color: var(--danger-ink);
  padding: 7px 14px; margin-bottom: 14px; }
.formgrid { display: grid; grid-template-columns: 96px minmax(0, 1fr);
  row-gap: 11px; column-gap: 12px; align-items: start; }
.formgrid > label { text-align: right; padding-top: 5px; color: var(--ink-3); }
.formgrid > label.label-top { align-self: start; }
.fcol { min-width: 0; }
.fcol input[type=url], .fcol input[type=text], .fcol textarea, .fcol .tagwrap { width: 100%; }
.fcol .tagwrap input { width: 100%; }
#addform textarea { min-height: 15em; resize: vertical; line-height: 1.45; }
label.check { font-weight: normal; }
label.check input { margin-right: 4px; }
small.hint { display: block; color: var(--ink-3); font-size: var(--f-sm2); margin-top: 2px; }
.advgrid { display: flex; gap: 12px; margin-bottom: 6px; }
.advgrid label { display: flex; flex-direction: column; gap: 3px; font-size: var(--f-sm2); color: var(--ink-3); }
.advgrid input[type=number] { width: 72px; }
#addform details.advanced label.check { margin-top: 8px; }
.fcol.actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
button.primary, .bulkbar button[type="submit"] { background: var(--brand); color: #fff;
  border: none; padding: 5px 15px; border-radius: 2px; cursor: pointer;
  font: var(--f-body) var(--font); }
button.primary:hover { background: var(--brand-hover); }
.actions a.cancel { color: var(--ink-4); text-decoration: underline; }
.actions .delete_link { margin-left: auto; }
.actions .delete_link .delete, .actions .delete_link .destroy { color: var(--danger-ink); font-size: var(--f-sm2); }

/* edit-mode snapshot rail */
.railstat { margin-bottom: 4px; }
.rail hr { border: none; border-top: 1px solid var(--edge); margin: 10px 0; }
.railaction { display: inline-block; margin-top: 4px; }

/* tag editor (redesigned) — rest state is name + count only; rename/delete
   are hover-revealed instead of a <form> per row (412 tags was ~824 controls) */
.listband #tagfilter { margin-left: auto; width: 200px; }
.matchcount { color: var(--ink-3); font-size: var(--f-sm2); }
.tags-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.alpha-band { grid-column: 1 / -1; background: var(--rail); font-family: var(--font-mono);
  padding: 6px 14px; color: var(--ink-2); font-size: var(--f-band); border-top: 1px solid var(--rule); }
.tagrow { display: flex; align-items: center; gap: 8px; padding: 5px 14px;
  border-bottom: 1px solid var(--rule-soft); }
.tagrow:hover, .tagrow:focus-within { background: var(--hover); }
/* .rowacts is opacity:0 by default and only revealed by .row:hover/:focus-within
   (line ~180); tag rows are .tagrow, not .row, so they need their own reveal
   rule or rename/delete never appear above 720px — issue #185 item A */
.tagrow:hover .rowacts, .tagrow:focus-within .rowacts { opacity: 1; }
/* openExtra() sets .rowacts' [hidden] attribute while renaming, but .rowacts'
   own display: flex otherwise beats [hidden] (same fix as .bulkbar[hidden]
   above) — issue #185 item H */
.rowacts[hidden] { display: none; }
/* issue #181 item 9: row order is name, actions, count — count owns the
   auto margin so it's always the far-right element regardless of whether
   .rowacts or its .rowextra replacement (renaming/confirming) is showing */
.tagrow .cnt { margin-left: auto; color: var(--ink-6); font-size: var(--f-sm2);
  font-variant-numeric: tabular-nums; }
.tagrow .rowextra { font-size: var(--f-sm2); color: var(--ink-3); white-space: nowrap; }
.tagrow .rowextra .destroy { color: var(--danger-ink); text-decoration: underline; }
.renameinput { width: 120px; padding: 2px 5px; }
/* font-size lives on .rowextra (0.82em); setting it again here compounded
   0.82em x 0.82em to ~0.67em — issue #185 item I */
button.rename-apply { background: var(--brand); color: #fff; border: none;
  padding: 2px 8px; border-radius: 2px; cursor: pointer; font: inherit; }
button.rename-apply:hover { background: var(--brand-hover); }

/* The letters double as click targets, so they get real padding rather
   than letter-spacing: at 11px a bare character is a hard thing to hit. */
#alphaindex { font-family: var(--font-mono); font-size: var(--f-sm); line-height: 2;
  padding: 6px 14px; border-bottom: 1px solid var(--rule); margin: 0; }
#alphaindex a, #alphaindex .empty {
  display: inline-block; min-width: 16px; padding: 2px 5px; text-align: center;
}
#alphaindex a { text-decoration: none; }
#alphaindex a:hover { background: var(--hover); border-radius: 2px; }
/* #177 item 10: a letter no tag starts with is rendered unlinked and in
   --ink-2, not as a live jump target that scrolls nowhere. */
#alphaindex .empty { color: var(--ink-2); pointer-events: none; }
form.inline { display: inline; }
form.inline input, form.inline button { font-size: 11px; }

/* auth (issue #10, redesigned) */
button.linklike { background: none; border: none; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.loginwrap { max-width: 300px; margin: 40px auto; padding: 0 16px; }
#loginform { display: flex; flex-direction: column; gap: 11px; }
#loginform label { display: flex; flex-direction: column; gap: 3px; color: var(--ink-3); font-size: var(--f-sm2); }
#loginform input { font: var(--f-body) var(--font); padding: 5px 7px; width: 100%; }
#loginform .authcode { font-family: var(--font-mono); letter-spacing: 0.12em; }
#loginform button { align-self: flex-start; }

/* settings page (issue #35, redesigned) */
.formsuccess { background: var(--success-bg); border: 1px solid var(--success-edge);
  color: var(--success-ink); padding: 7px 14px; margin-bottom: 14px; }
.settingsbody { padding: 14px; border-bottom: 1px solid var(--rule); }
.settingsbody:last-child { border-bottom: none; }
.settingsform { max-width: 520px; grid-template-columns: 168px minmax(0, 1fr); }
.settingsform input { width: 220px; }
.tokenheading { color: var(--success-ink); margin-bottom: 4px; }
p.hint { color: var(--ink-3); font-size: var(--f-sm2); max-width: 480px; }
code.api-token { display: inline-block; padding: 4px 8px; background: var(--code-bg);
  border: 1px solid #ccc; word-break: break-all; user-select: all; }

/* add-page improvements (issue #12) */
small.hint { display: block; color: #888; font-size: 11px; margin-top: 2px; }
/* .tagwrap/.tagsuggest are shared with the bulk bar's tags field (issue #124) */
.tagwrap { position: relative; display: inline-block; }
#addform .tagwrap input { width: 100%; }
.tagsuggest { position: absolute; left: 0; top: 100%; z-index: 20; margin: 0;
  padding: 0; list-style: none; background: #fff; border: 1px solid #ccc;
  min-width: 180px; max-height: 220px; overflow-y: auto; box-shadow: 0 2px 6px rgba(0,0,0,.15);
  text-align: left; }
/* colour is pinned: the bulk bar renders its own text grey (#888) */
.tagsuggest li { padding: 3px 8px; cursor: pointer; font-size: 13px; color: #222; }
.tagsuggest li.active, .tagsuggest li:hover { background: #e8f0fe; }

/* advanced archive settings (issue #22) */
#addform details.advanced { border-left: 3px solid #eee; padding-left: 10px; }
#addform details.advanced summary { color: var(--ink-3); font-size: var(--f-sm2); cursor: pointer; }

/* stats page (issue #102, redesigned) — overview tiles reuse the archives
   queue .tile exactly (see #137 block above); h3s became .listband bands */
.tablewrap { overflow-x: auto; padding: 10px 14px; }
.stats-table { border-collapse: collapse; margin: 0; font-size: var(--f-sm); width: 100%; }
.stats-table th, .stats-table td { padding: 3px 10px 3px 0; text-align: left;
  font-weight: normal; white-space: nowrap; }
.stats-table th, .stats-table td { margin: 0; }
.stats-table thead th { color: var(--ink-4); font-size: var(--f-sm2);
  border-bottom: 1px solid var(--rule); font-weight: normal; }
.stats-table tbody th { color: var(--ink); font-weight: normal; }
.stats-table tbody td { color: var(--ink-2); }
.stats-table .n { text-align: right; font-variant-numeric: tabular-nums; }
.stats-table tbody tr:hover { background: var(--hover); }
.stats-table tr.total th, .stats-table tr.total td { border-top: 1px solid var(--rule);
  color: var(--ink-2); }
/* one series, one hue: the bar is a reading aid beside the number, never the
   only place a value appears */
.stats-table .meter { width: 150px; padding-right: 0; }
.stats-table .meter span { display: block; height: 8px; min-width: 1px;
  background: var(--meter); border-radius: 0 2px 2px 0; }
.stats-table th a.tag { font-weight: normal; }
#storage > p { padding: 0 14px 10px; margin: 0; }
/* narrow-viewport column toggle — dormant above 720px, where .extra columns
   always show regardless of cols-few/cols-all (see the @media block below) */
.colstoggle { display: none; margin-left: auto; font-size: var(--f-sm2); }

/* running-version signifier (issue #167) — quiet, out of the reading path */
/* #177 item 3: same 1060px centred column as the card above it, so it reads
   as the page's footer rather than something flush to the viewport edge. */
#version { max-width: 1060px; margin: 12px auto 0; padding: 8px 16px 16px;
  border-top: 1px solid var(--rule); color: var(--ink-2); font-size: var(--f-sm2); }
#version a { color: var(--ink-2); }
#version .hint { color: var(--ink-3); }

/* ===== responsive — one breakpoint, no JS width detection (README) ===== */

/* 721–1060px: rails narrow before they disappear, rather than holding 208px
   while the content column squeezes */
@media (min-width: 721px) and (max-width: 1060px) {
  .rail { width: 176px; }
}

@media (max-width: 720px) {
  /* hover doesn't exist on touch — row/tag/job action groups stay visible.
     One shared class covers what the handoff splits into
     .rowacts/.tagacts/.jobacts, since all three reuse the same hover-reveal
     mechanism here. */
  .rowacts { opacity: 1 !important; }

  /* 44px touch floor on the star, archive-source link, status glyphs,
     edit/delete, tag rename/delete, and job retry/delete — grow the box,
     centred, rather than pad with negative margins (that makes adjacent
     glyphs overlap). The bulk checkbox keeps its native size and gets the
     same 44px tap area via a wrapping <label class="hit"> instead — scaling
     a checkbox's own box up to 44px deforms it (issue #181 item 5). */
  .hit, .star, .archived, .glyph, .rename-trigger, .delete-trigger,
  .rowacts .edit, .rowacts .retry, .rowacts .delete, .rowacts .destroy,
  .rowextra .destroy {
    min-width: 44px; min-height: 44px; display: inline-flex;
    align-items: center; justify-content: center;
  }

  /* the desktop 3-column grid (star | title column | archive glyphs) leaves
     ~90px of gutter that isn't worth it at this width, and forced edit/
     delete to run inline in the title's text flow, wrapping mid-sentence.
     Below 720px: title gets the full row, the meta line (tags/date) the
     next one, then ONE compact control row — checkbox, star, edit, delete
     at left and the archive glyphs pushed right (issue #181 item 6). */
  .row {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "title title title" "meta meta meta" "star acts arch";
  }
  .col-main { grid-area: title; }
  /* .metaline drops its own box so .meta and .rowacts become independent
     grid items of .row — .meta stays on the meta line, .rowacts joins the
     star/archive control line instead of trailing the tags and date. */
  .metaline { display: contents; }
  .meta { grid-area: meta; }
  /* scoped to .metaline's child, not bare .rowacts — the archives queue
     reuses this same .row/.rowacts pairing without a .metaline wrapper
     (job rows' actions already share the meta row there) and shouldn't be
     repositioned by a bookmark-list-specific layout change */
  .metaline > .rowacts { grid-area: acts; }
  .col-star { grid-area: star; gap: 4px; }
  .col-archive { grid-area: arch; margin-left: auto; }

  .rail { display: none !important; }

  /* .listband .selectall's margin-left: auto only just fits beside the other
     filters at 448px, leaving no room for the auto margin to push it right —
     give it its own line instead (issue #185 item F) */
  .listband .selectall { flex-basis: 100%; text-align: right; }

  .cols-few .extra { display: none; }
  .colstoggle { display: inline !important; }

  .formgrid { grid-template-columns: minmax(0, 1fr); }
  .formgrid > label { text-align: left; }
  .formgrid > label:empty { display: none; }
  .settingsform input { width: 100%; }

  .bulkbar { flex-direction: column; align-items: stretch; }
  .bulkbar .scope { margin-left: 0; }

  /* 14px horizontal padding tightens to 12px on every band/section that
     uses it (README's ".pad" rule, applied at each existing selector
     instead of a new class threaded through every template) */
  .listband, .tiles, .tablewrap, .rows .row, .settingsbody, .actionrow,
  #pagination, .empty, #storage > p, .tagrow, #alphaindex, .addcol {
    padding-left: 12px; padding-right: 12px;
  }
}
