/* Edition Finder: shared by index.html and isbn-converter.html */
/* Layout: a plain search-engine page. Home: centred wordmark and one search box. After a search:
   the wordmark and box sit in a bar at the top and the results read as a single list below. */
:root {
  --bg: #ffffff;
  --fg: #202124;
  --muted: #70757a;
  --line: #dfe1e5;
  --rule: #ebebeb;
  --link: #1a0dab;
  --visited: #681da8;
  --green: #006621;
  --btn: #e8eaed;        /* light-theme buttons: a touch darker so they stand out on white */
  --btn-fg: #3c4043;
  --good: #188038;
  --warn: #b06000;
  --bad: #c5221f;
  --surface2: #f8f9fa;   /* table heads, menu footer */
  --alt: #fafafa;        /* striped rows */
  --hover: #f1f3f4;
  --footer: #f2f2f2;
  --footer-line: #dadce0;
  --text2: #4d5156;      /* secondary text in results */
  --icon: #5f6368;
  --picked: #e8f0fe;
  --detail: #fbfbfb;
  --crumb-sep: #9aa0a6;
  --shadow: rgba(32, 33, 36, 0.28);
  --overlay: rgba(255, 255, 255, 0.75);
  --font: Arial, Helvetica, sans-serif;
  --font-logo: Georgia, "Times New Roman", serif;
  color-scheme: light;
}
/* Dark: follows the device unless the visitor picks a theme (data-theme on <html>, set by theme.js). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #202124; --fg: #e8eaed; --muted: #9aa0a6; --line: #5f6368; --rule: #3c4043;
    --link: #8ab4f8; --visited: #c58af9; --green: #81c995; --btn: #303134; --btn-fg: #e8eaed;
    --good: #81c995; --warn: #fdd663; --bad: #f28b82;
    --surface2: #303134; --alt: #26272a; --hover: #3c4043; --footer: #171717; --footer-line: #3c4043;
    --text2: #bdc1c6; --icon: #9aa0a6; --picked: #1f3354; --detail: #26272a; --crumb-sep: #80868b;
    --shadow: rgba(0, 0, 0, 0.6); --overlay: rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #202124; --fg: #e8eaed; --muted: #9aa0a6; --line: #5f6368; --rule: #3c4043;
  --link: #8ab4f8; --visited: #c58af9; --green: #81c995; --btn: #303134; --btn-fg: #e8eaed;
  --good: #81c995; --warn: #fdd663; --bad: #f28b82;
  --surface2: #303134; --alt: #26272a; --hover: #3c4043; --footer: #171717; --footer-line: #3c4043;
  --text2: #bdc1c6; --icon: #9aa0a6; --picked: #1f3354; --detail: #26272a; --crumb-sep: #80868b;
  --shadow: rgba(0, 0, 0, 0.6); --overlay: rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-logo); }   /* every title and heading in Georgia, like the home title */
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--fg);
  font: 16px/1.6 var(--font);
  min-height: 100vh; display: flex; flex-direction: column;
}
/* every full-width band keeps the same side gutter */
.topbar, .wrap, .f-row {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---- header: a row of small links and the menu, top right ---- */
.topbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding-block: 20px;
  border-bottom: 1px solid var(--rule);
  padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px));
}
@media (max-width: 560px) { .topbar { padding-block: 14px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); } }
.topleft { display: flex; justify-content: flex-start; }
.toplinks { justify-content: flex-end; }
.logo.toplogo { font-size: 28px; justify-self: center; }
.masthead .logo { display: none; }                     /* the header logo is the only one */
.toplinks { display: flex; align-items: center; gap: 18px; font-size: 15px; }
.toplinks > a { color: var(--fg); }
.toplinks > a:visited { color: var(--fg); }
/* the Tools dropdown in the header links */
.tl-drop { position: relative; }
.tl-btn { display: inline-flex; align-items: center; gap: 5px; height: auto; padding: 0; border: 0; background: none; box-shadow: none; filter: none; font: 15px var(--font); color: var(--fg); cursor: pointer; }
.tl-btn:hover { text-decoration: underline; border: 0; box-shadow: none; filter: none; color: var(--fg); }
.tl-btn svg { color: var(--muted); transition: transform 0.15s; }
.tl-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.tl-list {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 40; min-width: 220px; white-space: nowrap; margin: 0; padding: 6px 0; list-style: none;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 2px 10px var(--shadow);
}
.tl-list a { display: block; padding: 7px 16px; font: 15px var(--font); color: var(--fg); }
.tl-list a:visited { color: var(--fg); }
.tl-list a:hover, .tl-list a:focus-visible { background: var(--hover); text-decoration: none; outline: none; }
.tl-list a[aria-current="page"] { font-weight: bold; }
@media (prefers-reduced-motion: reduce) { .tl-btn svg { transition: none; } }
/* phones and tablets: the tools, About and Contact are all in the ☰ menu, so the header keeps just the theme switch */
@media (max-width: 1024px) { .toplinks > a, .toplinks .tl-drop { display: none; } }
.menu { position: relative; }
.menu-btn { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--icon); display: grid; place-items: center; }
.menu-btn:hover, .menu-btn[aria-expanded="true"] { background: var(--hover); border: 0; box-shadow: none; }
.menu-list {
  position: absolute; left: 0; top: 44px; z-index: 40; min-width: 300px; white-space: nowrap; margin: 0; padding: 6px 0; list-style: none;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 2px 10px var(--shadow);
}
.menu-list a, .menu-list button {
  display: block; width: 100%; text-align: left; padding: 7px 16px; height: auto;
  font: 15px var(--font); color: var(--fg); background: none; border: 0; border-radius: 0; box-shadow: none;
}
.menu-list a:visited { color: var(--fg); }
.menu-list a:hover, .menu-list button:hover, .menu-list a:focus-visible, .menu-list button:focus-visible { background: var(--hover); text-decoration: none; outline: none; }
.menu-list .sep { height: 1px; margin: 6px 0; background: var(--rule); }
.menu-list .label { padding: 4px 16px 2px; font-size: 13px; color: var(--muted); }
/* the menu's own footer: the site footer's links and lines, small and grey */
.menu-list .menu-foot { padding: 6px 16px 4px; background: var(--surface2); margin-bottom: -6px; border-radius: 0 0 8px 8px; }
.menu-list .mf-links { display: flex; flex-wrap: wrap; gap: 2px 14px; white-space: normal; max-width: 268px; }
.menu-list .menu-foot a, .menu-list .menu-foot a:visited { display: inline; width: auto; padding: 2px 0; font-size: 12px; color: var(--muted); background: none; }
.menu-list .menu-foot a:hover, .menu-list .menu-foot a:focus-visible { background: none; color: var(--fg); text-decoration: underline; }
.menu-list .mf-note { margin: 6px 0 0; font-size: 12px; color: var(--muted); white-space: normal; }
.menu-list .mf-note + .mf-note { margin-top: 2px; }

/* ---- info pages: How it works, Settings, Privacy ---- */
.info { padding: 18px 0; border-top: 1px solid var(--rule); }
.info p { margin: 0; max-width: 65ch; }
.info .how { margin: 0; padding-left: 20px; display: grid; gap: 8px; max-width: 65ch; }
.info h3.sub { font-size: 16px; font-weight: bold; margin: 4px 0 0; }
.info h3.sub .hint { font-weight: normal; margin-left: 6px; }

/* ---- footer: two grey rows, as on a classic search homepage ---- */
.site-footer { margin-top: auto; background: var(--footer); color: var(--muted); font-size: 14px; }
.f-row { padding-block: 13px; }
.f-top { border-bottom: 1px solid var(--footer-line); text-align: center; }
.f-bottom { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; }
.f-bottom nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; }
.site-footer a, .site-footer a:visited { color: var(--muted); }
.f-copy { border-top: 1px solid var(--footer-line); text-align: center; font-size: 13px; padding-block: 10px; }
.f-disclose { border-top: 1px solid var(--footer-line); text-align: center; font-size: 12px; padding-block: 8px; }

/* ---- shop links (affiliates.js): plain logo + ↗ links, no boxes, like the rest of the page ---- */
.buy { display: flex; flex-wrap: nowrap; align-items: center; gap: 12px; margin-top: 6px; font-size: 13px; line-height: 1.4; white-space: normal; }
.buy-label { color: var(--muted); }
.buy a { display: inline-flex; align-items: center; gap: 2px; color: var(--link); text-decoration: none; line-height: 1; }
.buy a:hover .buy-arrow, .buy a:focus-visible .buy-arrow { text-decoration: underline; }
.buy a img { width: 22px; height: 22px; object-fit: contain; }
.buy-arrow { font-size: 14px; }
.buy-row { margin: 0 0 12px; }

/* ---- editions as a classic table ---- */
.table-scroll { overflow-x: auto; }
table.eds { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.5; }
table.eds th { text-align: left; font-weight: bold; color: var(--fg); background: var(--surface2); border-bottom: 1px solid var(--line); padding: 12px 14px; white-space: nowrap; font-size: 15px; }
table.eds td { border-bottom: 1px solid var(--rule); padding: 18px 14px; vertical-align: top; }
/* column dividers: a light rule between cells, a darker one between header cells */
table.eds td + td { border-left: 1px solid var(--rule); }
table.eds th + th { border-left: 1px solid var(--line); }
/* The volume number: its own # column on wide screens; on phones that column goes and the number
   sits before the title ("2 · Chamber of Secrets") to save width. */
.pos-inline { display: none; color: var(--muted); font-weight: normal; }
@media (max-width: 560px) {
  table.eds .col-pos { display: none; }
  table.eds .col-pos + td, table.eds .col-pos + th { border-left: 0; }
  .pos-inline { display: inline; }
}
table.eds tr.alt td { background: var(--alt); }
table.eds td.num, table.eds th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.eds td.isbn { color: var(--green); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.eds td.thumb { width: 132px; padding-right: 12px; }
table.eds td.thumb .cover { width: 120px; }
table.eds .vol-name { font-weight: bold; font-size: 17px; }
table.eds .why { color: var(--text2); font-size: 14px; margin-top: 4px; }
table.eds tr.detail > td { background: var(--detail); padding: 8px 8px 12px 24px; max-width: 0; }   /* max-width 0: the inner table scrolls instead of widening this one */
table.eds tr.detail td td { background: none; }
table.eds tr.detail table.eds { background: var(--bg); }
table.eds tr.picked td { background: var(--picked); }
table.eds button.ghost { font-size: 15px; }
table.eds .pick-btn { white-space: nowrap; }
a { color: var(--link); text-decoration: none; }
a:visited { color: var(--visited); }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- home ---- */
.wrap { width: 100%; max-width: 960px; margin: 0 auto; display: grid; gap: 22px; align-content: start; padding-bottom: 48px; }   /* one width for every page */
.masthead { display: grid; justify-items: center; gap: 22px; padding-top: max(40px, 13vh); }
.logo { display: inline-flex; align-items: flex-end; gap: 10px; font: 400 52px/1 var(--font-logo); color: var(--fg); letter-spacing: -1px; }
.logo:visited { color: var(--fg); }
.logo:hover { text-decoration: none; }
.logo-img { display: block; height: 2em; width: auto; }   /* the Bibliofied logo: dark ink, flipped to light in dark mode */

/* breadcrumbs: small grey trail with › between steps */
.crumbs { font-size: 13px; color: var(--muted); padding-top: 14px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 0; }
.crumbs li { display: inline-flex; align-items: baseline; min-width: 0; }
.crumbs li + li::before { content: "›"; margin: 0 8px; color: var(--crumb-sep); }
.crumbs li[aria-current] { color: var(--fg); }
.crumbs button.ghost { font-size: 13px; }

/* an info page replaces the results while it is open */

/* contact form */
form.contact { display: grid; gap: 12px; max-width: 520px; }
form.contact input[type="email"], form.contact select, form.contact textarea {
  font: 14px var(--font); width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 4px; color: var(--fg); background: var(--bg);
}
form.contact textarea { resize: vertical; min-height: 120px; }
form.contact [aria-invalid="true"] { border-color: var(--bad); }
.copybox { display: grid; gap: 6px; }
.copybox textarea { font: 13px var(--font); width: 100%; min-height: 140px; padding: 8px; border: 1px solid var(--line); border-radius: 4px; }
.lede { margin: -10px 0 0; color: var(--muted); text-align: center; }
form.search { width: 100%; display: grid; gap: 18px; justify-items: center; }
.isbn-box { position: relative; width: 100%; }
.isbn-box input {
  width: 100%; height: 42px; padding: 0 92px 0 12px;
  font: 16px var(--font); color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 4px;
}
.isbn-box input:hover { border-color: var(--muted); }
.isbn-box input:focus { border-color: var(--link); box-shadow: 0 0 0 1px var(--link); outline: none; }
.scan-btn {
  position: absolute; top: 3px; right: 6px; width: 36px; height: 36px; padding: 0; border-radius: 50%;
  display: grid; place-items: center; background: transparent; color: var(--muted); border: 0; cursor: pointer;
}
.scan-btn.photo { right: 44px; }
.scan-btn:hover, .scan-btn[aria-expanded="true"] { color: var(--link); background: var(--btn); }
.scan-btn:disabled { color: var(--link); cursor: progress; }
.buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
button {
  font: 14px var(--font); color: var(--btn-fg); background: var(--btn);
  border: 1px solid var(--btn); border-radius: 4px; padding: 0 16px; height: 36px; cursor: pointer;
}
button:hover { border-color: var(--line); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); color: var(--fg); filter: brightness(0.97); }
button:disabled { opacity: 0.6; cursor: default; }
/* Secondary actions look like links, as they would on an old page. */
button.ghost { background: none; border: 0; height: auto; padding: 0; color: var(--link); box-shadow: none; }
button.ghost:hover { text-decoration: underline; }
.examples { margin: 0; color: var(--muted); font-size: 13px; text-align: center; }
.examples button.ghost { font-size: 13px; }
.examples .sep { margin: 0 6px; color: var(--line); }
.msg { margin: 0; font-size: 13px; }
.msg.err { color: var(--bad); }
.msg.ok { color: var(--good); }
.hint { margin: 0; color: var(--muted); font-size: 13px; }

/* ---- results page: the masthead becomes a bar ---- */
body.searched .masthead {
  grid-template-columns: minmax(0, 1fr); justify-items: stretch; align-items: center; gap: 8px 22px;
  padding-top: 4px; padding-bottom: 18px; border-bottom: 1px solid var(--rule);
}
body.searched .logo { font-size: 26px; }
body.searched .lede, body.searched .examples, body.searched .buttons { display: none; }
body.searched form.search { justify-items: stretch; gap: 6px; }
body.searched .msg { padding-left: 20px; }

/* ---- sections: no boxes, just headings and rules ---- */
.panel { display: grid; gap: 10px; }
h2 { font: 400 20px/1.3 var(--font-logo); margin: 0; color: var(--fg); }
label { font-size: 13px; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.field { display: grid; gap: 4px; min-width: 0; }
.field.grow { flex: 1 1 220px; }
input[type="text"]:not(#isbn) { font: 14px var(--font); height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; width: 100%; color: var(--fg); background: var(--bg); }

/* progress bar: blue fill for the steps done, a light stripe sliding while a step runs */
.loadbar { position: relative; height: 4px; background: var(--rule); overflow: hidden; border-radius: 2px; }
.loadbar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--link); transition: width 0.4s ease; }
.loadbar.running::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 30%; left: -30%;
  background: linear-gradient(90deg, transparent, rgba(26, 13, 171, 0.45), transparent);
  animation: loadslide 1.1s linear infinite;
}
.loadbar.done i { background: var(--good); }
.loadbar.failed i { background: var(--bad); }
@keyframes loadslide { to { left: 100%; } }
/* Reopening a search on refresh: no sliding stripe, pulsing dots or growing bar, just the results. */
body.restoring .loadbar.running::after { display: none; }
body.restoring .loadbar i { transition: none; }
body.restoring .steps li[data-s="run"] .dot { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .loadbar.running::after { animation: pulse 1.4s ease-in-out infinite; left: 0; width: 100%; background: rgba(26, 13, 171, 0.15); }
  .loadbar i { transition: none; }
}

/* progress */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 13px; }
.steps li { display: grid; grid-template-columns: 14px 8rem 1fr; gap: 6px; align-items: baseline; }
.steps .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); align-self: center; }
.steps li[data-s="run"] .dot { background: var(--link); animation: pulse 1s infinite; }
.steps li[data-s="ok"] .dot { background: var(--good); }
.steps li[data-s="warn"] .dot { background: var(--warn); }
.steps li[data-s="err"] .dot { background: var(--bad); }
.steps .name { color: var(--fg); }
.steps .detail { color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
@keyframes pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .steps li[data-s="run"] .dot { animation: none; } }

/* an edition, written like a search result: blue title, green identifier, grey details */
.ed { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: start; min-width: 0; }
.cover { width: 120px; aspect-ratio: 2 / 3; background: var(--hover); border: 1px solid var(--rule); object-fit: cover; display: block; max-width: 100%; }
.cover.none { display: grid; place-items: center; font-size: 11px; color: var(--muted); text-align: center; }
.ed .meta { min-width: 0; display: grid; gap: 2px; }
.ed .t { font-size: 18px; line-height: 1.3; }
.ed .t a { color: var(--link); }
.ed .t a:visited { color: var(--visited); }
.facts { display: flex; flex-wrap: wrap; gap: 0 12px; font-size: 13px; color: var(--text2); }
.facts.mono, .mono { color: var(--green); font-variant-numeric: tabular-nums; }

/* title search pickers */
.work-list { display: grid; gap: 0; }
button.work {
  display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: start; text-align: left;
  height: auto; padding: 10px 0; background: none; border: 0; border-radius: 0; border-bottom: 1px solid var(--rule); color: var(--fg); box-shadow: none;
}
button.work:hover { box-shadow: none; }
button.work:hover .t { text-decoration: underline; }
button.work .cover { width: 56px; }
button.work .meta { display: grid; gap: 2px; min-width: 0; }
button.work .t { font-size: 18px; color: var(--link); }
.ed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 16px 14px; }
button.ed-tile {
  display: grid; gap: 2px; align-content: start; text-align: left; height: auto; padding: 0;
  background: none; border: 0; border-radius: 0; color: var(--fg); min-width: 0; box-shadow: none;
}
button.ed-tile:hover { box-shadow: none; }
button.ed-tile:hover .t { text-decoration: underline; }
button.ed-tile .cover { width: 100%; margin-bottom: 4px; }
button.ed-tile .t { color: var(--link); font-size: 14px; overflow-wrap: anywhere; }
button.ed-tile .facts { font-size: 12px; gap: 0 8px; }
label.check { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--fg); padding-bottom: 8px; }
.series-pick { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.series-pick button { background: none; border: 0; height: auto; padding: 0; color: var(--link); box-shadow: none; }
.series-pick button:hover { text-decoration: underline; }
.series-pick button[aria-pressed="true"] { color: var(--fg); font-weight: bold; text-decoration: none; cursor: default; }

/* volume list */
.vols { display: grid; gap: 0; }
.vol { display: grid; grid-template-columns: 2.4rem 1fr; gap: 10px; padding: 18px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.vol .pos { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
.vol .body { min-width: 0; display: grid; gap: 8px; }
.vol .head { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.vol .head h3 { margin: 0; font-size: 13px; font-weight: bold; color: var(--fg); }
.pill { font-size: 13px; white-space: nowrap; }
.pill.strong { color: var(--good); }
.pill.possible { color: var(--warn); }
.pill.weak, .pill.gap { color: var(--bad); }
.pill.seed { color: var(--link); }
.pill.info { color: var(--muted); }
.score { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.score::before { content: "Match"; }
.bar { width: 70px; height: 4px; background: var(--rule); position: relative; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--muted); }
.signals { display: flex; flex-wrap: wrap; gap: 0 12px; font-size: 13px; }
.sig { color: var(--text2); }
.sig b { font-weight: normal; }
/* Edition Finder: the ✓/✗ reasons sit in a closed dropdown under each match */
.why-drop { margin-top: 6px; font-size: 13px; }
.why-drop > summary { cursor: pointer; color: var(--link); width: max-content; list-style: none; }
.why-drop > summary::-webkit-details-marker { display: none; }
.why-drop > summary::after { content: ' ▾'; font-size: 11px; }
.why-drop[open] > summary::after { content: ' ▴'; }
.why-drop > summary:hover { text-decoration: underline; }
.why-drop .signals { margin-top: 4px; }
.sig.y b { color: var(--good); }
.sig.p b { color: var(--warn); }
.sig.n b { color: var(--bad); }
details { font-size: 13px; }
summary { cursor: pointer; color: var(--link); }
summary:hover { text-decoration: underline; }
.cands { display: grid; gap: 14px; margin-top: 12px; padding-left: 12px; border-left: 2px solid var(--rule); }
.cand { display: grid; grid-template-columns: 20px 1fr; gap: 4px; align-items: start; }
.cand .ed { grid-template-columns: 72px 1fr; gap: 12px; }
.cand .cover { width: 72px; }
.cand .ed .t { font-size: 15px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; justify-content: space-between; }
.empty { color: var(--muted); margin: 0; }
textarea.copy { width: 100%; min-height: 7rem; font: 13px var(--font); border: 1px solid var(--line); padding: 8px; margin-top: 10px; }

/* footer, as on an old homepage: a rule and a line of small links */
.settings-body { display: grid; gap: 10px; color: var(--fg); }

/* scanner pop-up */
.scanner {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: var(--overlay);
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.scanner .sheet { width: min(460px, 100%); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 18px; display: grid; gap: 12px; box-shadow: 0 4px 16px var(--shadow); }
.scanner .sheet.drop { outline: 2px dashed var(--link); outline-offset: -8px; }
.viewfinder { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #000; overflow: hidden; }
.viewfinder video { width: 100%; height: 100%; object-fit: cover; display: block; }
.viewfinder .guide { position: absolute; left: 12%; right: 12%; top: 32%; bottom: 32%; border: 2px solid #fff; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35); }
.viewfinder .guide::after { content: ""; position: absolute; left: 4%; right: 4%; top: 50%; height: 2px; background: #ea4335; opacity: 0.8; }

@media (max-width: 560px) {
  .logo { font-size: 40px; }
  body.searched .masthead { grid-template-columns: 1fr; justify-items: center; }
  body.searched form.search { justify-items: stretch; }
  .vol { grid-template-columns: 1fr; gap: 4px; }
  .ed { grid-template-columns: 90px 1fr; }
  .cover { width: 90px; }
  .steps li { grid-template-columns: 14px 1fr; }
  .steps .detail { grid-column: 2; }
}

/* ---- ISBN converter page ---- */
.tool-head { display: grid; gap: 12px; padding-top: 18px; }
.tool-head h1 { font: 400 30px/1.2 var(--font-logo); margin: 0; color: var(--fg); }
.tool-head .lede { text-align: left; margin: 0; }
/* a tool page with its title centred and the line under it showing, like Edition Finder */
.tool-head.centred .lede { display: block; text-align: center; max-width: 70ch; justify-self: center; }
.tool-head.centred h1 { font-size: 40px; }
@media (max-width: 560px) { .tool-head.centred h1 { font-size: 32px; } }
/* the footer pages (About, How it works, Contact, Privacy): the same big title and line under it, left-aligned */
.tool-head.page-head .tool-title { font-size: 40px; text-align: left; }
.tool-head.page-head .lede { display: block; text-align: left; margin: 0; }
@media (max-width: 560px) { .tool-head.page-head .tool-title { font-size: 32px; } }
table.conv th { width: 150px; background: var(--surface2); border-bottom: 1px solid var(--rule); font-weight: bold; vertical-align: middle; }
table.conv td { vertical-align: middle; }
table.conv td.isbn { font-size: 18px; letter-spacing: 0.5px; }
table.conv td.act { width: 70px; text-align: right; }
svg.ean { display: block; max-width: 100%; height: auto; }
details.batch summary { font-size: 14px; }
.batch-body { display: grid; gap: 10px; margin-top: 12px; }
.batch-body textarea { font: 14px var(--font); width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; color: var(--fg); background: var(--bg); }
.batch-body .row { align-items: center; }
.dl-link { font-size: 14px; }
.explain { border-top: 1px solid var(--rule); padding-top: 18px; }
.explain p { margin: 0; max-width: 70ch; }
.explain h3 { font-size: 17px; margin: 6px 0 0; }

/* the logo image is dark ink on transparent, so dark mode inverts it to light ink */
:root[data-theme="dark"] .logo-img { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-img { filter: invert(1); } }
/* theme switch in the header */
.theme-btn { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--icon); display: grid; place-items: center; }
.theme-btn:hover { background: var(--hover); border: 0; box-shadow: none; color: var(--fg); }
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .moon { display: none; }
  :root:not([data-theme="light"]) .theme-btn .sun { display: block; }
}

/* Progress, Your edition and Series sit side by side above the table, and stack on narrow screens */
.overview { display: grid; grid-template-columns: minmax(250px, 1.1fr) minmax(280px, 1.3fr) minmax(180px, 0.8fr); gap: 22px 32px; align-items: start; }
.overview > .panel { min-width: 0; }
/* the dropdown around it: a quiet one-line summary when folded */
.overview-drop > summary { cursor: pointer; list-style: none; display: block; padding: 8px 0; font-size: 14px; color: var(--link); }
.overview-drop > summary::-webkit-details-marker { display: none; }
.overview-drop > summary::after { content: ' ▾'; font-size: 12px; }
.overview-drop[open] > summary::after { content: '▴'; }
.overview-drop > summary:hover { text-decoration: underline; }
.overview-drop[open] > summary { margin-bottom: 8px; }
.overview .ed { grid-template-columns: 84px 1fr; gap: 12px; }
.overview .ed .cover { width: 84px; }
.overview .ed .t { font-size: 16px; }
.overview .steps li { grid-template-columns: 14px 6.5rem 1fr; }
@media (max-width: 900px) { .overview { grid-template-columns: 1fr 1fr; } .overview > #progress { grid-column: 1 / -1; } }
@media (max-width: 560px) { .overview { grid-template-columns: 1fr; } }

/* ---- converter boxes, laid out like a translator: from | swap | to ---- */
.cw { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cw-side { display: grid; grid-template-rows: auto 1fr auto; min-width: 0; background: var(--bg); }
.cw-out-side { background: var(--surface2); border-left: 1px solid var(--line); }
.cw-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); min-height: 46px; }
.cw-bar select { font: bold 14px var(--font); color: var(--link); background: transparent; border: 0; padding: 4px 2px; cursor: pointer; }
.cw-bar select option { color: var(--fg); background: var(--bg); }
.cw-detected { font-size: 12px; color: var(--muted); }
.cw-input, .cw-output {
  display: block; width: 100%; min-height: 96px; padding: 16px 14px 6px; border: 0; outline: none;
  font: 26px/1.3 var(--font); letter-spacing: 0.5px; color: var(--fg); background: transparent; overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.cw-input:focus-visible { box-shadow: inset 0 0 0 2px var(--link); }
.cw-output.na { font-size: 16px; color: var(--muted); }
.cw-placeholder { color: var(--muted); }
.cw-foot { display: flex; justify-content: flex-end; gap: 12px; padding: 4px 14px 10px; min-height: 30px; }
.cw-swap {
  align-self: start; margin-top: 4px; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: none; color: var(--icon); position: relative; z-index: 1;
}
.cw > .cw-swap { margin-inline: -20px; margin-top: 3px; background: var(--bg); border: 1px solid var(--line); }
.cw-swap:hover { background: var(--hover); color: var(--fg); box-shadow: none; }
@media (max-width: 560px) {
  .cw { grid-template-columns: 1fr; }
  .cw-out-side { border-left: 0; border-top: 1px solid var(--line); }
  .cw > .cw-swap { justify-self: center; margin: -20px 0; transform: rotate(90deg); }
  .cw-input, .cw-output { font-size: 22px; min-height: 70px; }
}

.tool-examples { text-align: left; }

/* the converter's explanation: one column of wide paragraphs under the tool */
.explain-band { border-top: 1px solid var(--rule); padding-block: 28px 36px; }
.explain-inner {
  max-width: 1100px; margin: 0 auto; display: grid; gap: 12px;
  padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px));
}
.explain-col { display: grid; gap: 10px; }
.explain-col + .explain-col { margin-top: 10px; }
.explain-col h2 { font-size: 18px; }
.explain-col p { margin: 0; }
@media (max-width: 560px) {
  .explain-inner { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
}

/* larger cover viewer: dark in both themes, like a photo viewer */
img.zoomable[src] { cursor: zoom-in; }
img.zoomable:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.lightbox {
  position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.88);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.lb-figure { margin: 0; display: grid; justify-items: center; gap: 12px; min-width: 0; }
.lb-figure img { height: min(calc(100vh - 140px), 1000px); width: auto; max-width: 100%; object-fit: contain; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6); background: #222; }   /* fills the viewer even when Open Library's "large" scan is small */
.lb-figure figcaption { color: #e8eaed; font-size: 14px; text-align: center; max-width: 60ch; }
.lb-btn { width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #fff; font: 28px/1 var(--font); display: grid; place-items: center; }
.lb-btn:hover { background: rgba(255, 255, 255, 0.24); border: 0; box-shadow: none; color: #fff; }
.lb-close { position: absolute; top: max(16px, env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); font-size: 20px; }
.lb-prev[hidden], .lb-next[hidden] { display: block !important; visibility: hidden; }
@media (max-width: 560px) { .lb-btn { width: 40px; height: 40px; } .lb-figure img { height: auto; max-height: calc(100vh - 160px); width: 100%; } }

/* extra images (usually the back cover) */
.ed-cover { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.back-link { font-size: 12px !important; }
table.eds td.thumb .back-link { display: block; margin-top: 4px; }
.lb-figure figcaption { display: grid; gap: 4px; }
.lb-note { color: #fdd663; font-size: 13px; }
.lb-note:empty { display: none; }
.lb-strip { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.lb-strip:empty { display: none; }
.lb-thumb { display: grid; gap: 4px; justify-items: center; height: auto; padding: 4px; border: 2px solid transparent; border-radius: 6px; background: rgba(255, 255, 255, 0.08); color: #e8eaed; font-size: 12px; }
.lb-thumb img { width: 44px; height: 64px; object-fit: cover; display: block; }
.lb-thumb.on { border-color: #8ab4f8; }
.lb-thumb:hover { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.4); box-shadow: none; color: #fff; }
.lb-figure img#lb-img { height: min(calc(100vh - 220px), 1000px); }

.sortbar { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 14px; }
.sortbar .sep { color: var(--crumb-sep); }
.sortbar [aria-pressed="true"] { color: var(--fg); font-weight: bold; text-decoration: none; cursor: default; }

/* tinted cells: how well each detail matches your edition */
:root { --hue-y: rgba(24, 128, 56, 0.13); --hue-p: rgba(234, 134, 0, 0.16); --hue-n: rgba(197, 34, 31, 0.12); --hue-seed: rgba(26, 115, 232, 0.10); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --hue-y: rgba(129, 201, 149, 0.16); --hue-p: rgba(253, 214, 99, 0.16); --hue-n: rgba(242, 139, 130, 0.16); --hue-seed: rgba(138, 180, 248, 0.14); } }
:root[data-theme="dark"] { --hue-y: rgba(129, 201, 149, 0.16); --hue-p: rgba(253, 214, 99, 0.16); --hue-n: rgba(242, 139, 130, 0.16); --hue-seed: rgba(138, 180, 248, 0.14); }
table.eds tr td.m-strong { background: var(--hue-y); }
table.eds tr td.m-possible { background: var(--hue-p); }
table.eds tr td.m-weak, table.eds tr td.m-gap { background: var(--hue-n); }
table.eds tr td.m-seed { background: var(--hue-seed); }
table.eds td[title] { cursor: help; }
.match-cell { min-width: 120px; }
.match-cell .m-label { display: block; font-size: 14px; font-weight: bold; }
.match-cell .m-score { display: block; font-size: 20px; font-variant-numeric: tabular-nums; color: var(--fg); }
.match-cell .m-score small { font-size: 13px; color: var(--muted); }
.m-strong .m-label { color: var(--good); }
.m-possible .m-label { color: var(--warn); }
.m-weak .m-label, .m-gap .m-label { color: var(--bad); }
.m-seed .m-label { color: var(--link); }
table.eds tr.detail td.match-cell { min-width: 0; }
/* the Compare table inside a row: as readable as the main table */
table.eds tr.detail table.eds { font-size: 17px; }
table.eds tr.detail table.eds th { font-size: 15px; padding: 12px 14px; }
table.eds tr.detail table.eds td { padding: 14px; }
table.eds tr.detail table.eds .why, table.eds tr.detail table.eds .sig { font-size: 15px; }
table.eds tr.detail table.eds td.thumb { width: 106px; }
table.eds tr.detail table.eds td.thumb .cover { width: 94px; }
table.eds tr.detail td.match-cell .m-score { font-size: 19px; }
table.eds tr.detail .pick-btn { font-size: 15px; height: 38px; }
table.eds tr.detail > td > .hint { font-size: 14px; margin-top: 8px; }

/* author and edition-title lines */
.by { font-size: 14px; color: var(--text2); }
table.eds .by { margin-top: 2px; }
table.eds .by.other { color: var(--warn); font-weight: bold; cursor: help; }
table.eds .ed-title { font-size: 14px; color: var(--fg); margin-top: 2px; }

/* export menu above the results */
.export { position: relative; }
.export-menu {
  position: absolute; right: 0; top: 26px; z-index: 30; min-width: 250px; margin: 0; padding: 6px 0; list-style: none; white-space: nowrap;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 2px 10px var(--shadow);
}
.export-menu button { display: block; width: 100%; text-align: left; height: auto; padding: 8px 16px; border: 0; border-radius: 0; background: none; box-shadow: none; font: 14px var(--font); color: var(--fg); }
.export-menu button:hover, .export-menu button:focus-visible { background: var(--hover); outline: none; }
.export-menu .label { padding: 4px 16px 2px; font-size: 12px; color: var(--muted); }
.export-menu .sep { height: 1px; margin: 6px 0; background: var(--rule); }
.export-menu .opt label { display: flex; gap: 8px; align-items: center; padding: 6px 16px; font-size: 14px; color: var(--fg); cursor: pointer; }

/* printing: just the matched editions table */
@media print {
  .topbar, .crumbs, .masthead, .overview, .site-footer, .sortbar, #copyout, .lightbox, .scanner,
  tr.detail, [data-toggle], .back-link, .why.signals, .why-drop { display: none !important; }
  body { background: #fff; color: #000; }
  .wrap { max-width: none; padding: 0; }
  table.eds { font-size: 11pt; }
  table.eds td, table.eds th { padding: 6px 8px; }
  table.eds td.thumb .cover { width: 48px; }
  table.eds tr { break-inside: avoid; }
  table.eds tr td.m-strong, table.eds tr td.m-possible, table.eds tr td.m-weak, table.eds tr td.m-gap, table.eds tr td.m-seed { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* tool name on a tool's start screen */
.tool-title { font: 400 40px/1.1 var(--font-logo); margin: 0; color: var(--fg); text-align: center; }
body.searched .masthead .tool-title { display: none; }

/* Bibliofied home page */
.home { gap: 40px; }
.home-hero { display: grid; justify-items: center; gap: 18px; padding-top: max(36px, 10vh); }
.home-title { font: 400 36px/1.2 var(--font-logo); margin: 0; color: var(--fg); text-align: center; text-wrap: balance; }
.home-hero .lede { margin: 0; }
/* the home search box has the same rounded look as Edition Finder's */

.tools { display: grid; gap: 14px; border-top: 1px solid var(--rule); padding-top: 24px; }
/* the tools as blocks: three across on a wide screen, fewer as it narrows; the whole block is the link */
.tool-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.tools-intro { margin: -6px 0 4px; color: var(--muted); }
.tool-list li {
  position: relative; display: grid; grid-template-rows: auto 1fr auto; gap: 8px; padding: 18px 20px;
  background: var(--surface2); border: 1px solid var(--rule); border-radius: 0; transition: border-color 0.15s, box-shadow 0.15s;
}
.tool-list li:hover, .tool-list li:focus-within { border-color: var(--line); box-shadow: 0 2px 10px var(--shadow); }
.tool-name { font: 400 21px/1.25 var(--font-logo); }
.tool-name::after { content: ""; position: absolute; inset: 0; }   /* stretches the link over the block */
.tool-name:hover { text-decoration: none; }
.tool-list li:hover .tool-name { text-decoration: underline; }
.tool-list p { margin: 0; }
@media (prefers-reduced-motion: reduce) { .tool-list li { transition: none; } }
.tool-meta { font-size: 13px; color: var(--muted); }
@media (max-width: 560px) { .home-title { font-size: 28px; } .tool-title { font-size: 32px; } }

/* ---- ISBN barcode generator ---- */
.bc-form { display: grid; gap: 12px; }
.bc-form .bc-input#isbn { height: 46px; font-size: 18px; border-radius: 6px; letter-spacing: 0.5px; padding: 0 14px; }
.bc-form select, .fe-form select { font: 14px var(--font); height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--fg); background: var(--bg); }
.bc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 16px; align-items: end; }
.bc-grid input:disabled { opacity: 0.5; }
.bc-out { gap: 12px; }
.bc-preview { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 24px; display: grid; place-items: center; overflow-x: auto; }
.bc-preview svg { width: auto; height: auto; max-width: 100%; min-width: 200px; transform-origin: center; }
.bc-out .row { gap: 12px; align-items: center; }

/* ---- First edition checker ---- */
.fe .panel { gap: 12px; }
.fe-find { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.fe-find .isbn-box { flex: 1 1 320px; }
.fe-find .isbn-box input { padding-right: 20px; }
.fe-picks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fe-picks button.ghost { font-size: 16px; }
.fe-book h2 { font: 400 26px/1.2 var(--font-logo); }
.fe-book h3 { font-size: 17px; margin: 8px 0 0; }
.fe-note { margin: 0; padding: 10px 14px; border-radius: 6px; max-width: 75ch; }
.fe-note.warn { background: var(--hue-p); }
.fe-note.ok { background: var(--hue-y); }
.fe-table td.thumb { width: 108px; }
.fe-table td.thumb .cover { width: 96px; }
.fe-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
.fe-form { display: grid; gap: 14px; max-width: 760px; }
.fe-q { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.fe-q legend { padding: 0; margin-bottom: 6px; font-size: 14px; color: var(--fg); }
.fe-q label { display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--fg); cursor: pointer; }
.fe-verdict { border-radius: 8px; padding: 16px 18px; background: var(--surface2); }
.fe-verdict.v-y { background: var(--hue-y); }
.fe-verdict.v-p { background: var(--hue-p); }
.fe-verdict.v-n { background: var(--hue-n); }
.fe-verdict-title { font: 400 22px/1.3 var(--font-logo); margin: 0 0 8px; }
.fe-reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fe-reasons b { display: inline-block; width: 1.2em; }
.fe-reasons .r-y b { color: var(--good); }
.fe-reasons .r-n b { color: var(--bad); }
.fe-reasons .r-p b, .fe-reasons .r-q b { color: var(--warn); }

/* grid sections may shrink below their content's width, so wide tables scroll inside their own box
   instead of widening the page */
.wrap > *, .panel > *, #book { min-width: 0; }

.lb-figure img#lbx-img { height: min(calc(100vh - 220px), 1000px); }

/* search bars: field and button on one line, same height, on every page */
.searchrow { display: flex; gap: 10px; align-items: stretch; width: 100%; }
.searchrow .isbn-box { flex: 1 1 auto; width: auto; min-width: 0; }
.searchrow.fe-find { flex-wrap: nowrap; align-items: stretch; }
.searchrow > button, .searchrow button[type="submit"] { height: 42px; flex: none; padding: 0 18px; }
.searchrow .isbn-box input#q, .searchrow .isbn-box input#find {
  height: 42px; padding: 0 12px; font: 16px var(--font); border-radius: 4px; border: 1px solid var(--line);
}
.searchrow .isbn-box input#q:hover, .searchrow .isbn-box input#find:hover { border-color: var(--muted); }
.searchrow .isbn-box input#q:focus, .searchrow .isbn-box input#find:focus { border-color: var(--link); box-shadow: 0 0 0 1px var(--link); outline: none; }
@media (max-width: 420px) { .searchrow { flex-wrap: wrap; } .searchrow > button, .searchrow button[type="submit"] { width: 100%; } }

/* Edition Finder's explanation below the tool; hidden while an info page is open */
.ef-tips { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

/* barcode generator: list mode */
#batchdl { gap: 12px; align-items: center; }
.bc-bad { margin: 0; padding-left: 20px; color: var(--bad); font-size: 14px; }
.bc-bad:empty { display: none; }
.bc-grid-out { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.bc-cell { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 10px; display: grid; justify-items: center; gap: 6px; }
.bc-cell svg { width: 100%; height: auto; }
.bc-cell figcaption { font-size: 12px; color: #3c4043; font-variant-numeric: tabular-nums; }

/* header: a soft pastel band (a pale blue in light mode, a muted deep blue-grey in dark) */
:root { --header-bg: #e8f0fe; --header-line: #d2e3fc; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --header-bg: #1f2633; --header-line: #2c3646; } }
:root[data-theme="dark"] { --header-bg: #1f2633; --header-line: #2c3646; }
.topbar { background: var(--header-bg); border-bottom-color: var(--header-line); }
.topbar .menu-btn:hover, .topbar .menu-btn[aria-expanded="true"], .topbar .theme-btn:hover { background: rgba(26, 13, 171, 0.08); }

/* ---- Series in Order ---- */
.sio .toolbar { align-items: flex-end; }
.sio .toolbar h2 { font: 400 26px/1.2 var(--font-logo); }
.sio-owned { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.sio-owned .msg { font-size: 15px; }
.sio-table td.own { text-align: center; }
.sio-table td.own input { width: 20px; height: 20px; cursor: pointer; }
.sio-table tr[data-owned] td { background: var(--hue-y); }
.sio-table td.thumb { min-width: 108px; }
.sio-table td.thumb .cover { min-width: 96px; }

/* net.js: shown when a result comes from a saved copy because a source is down */
.net-stale { position: fixed; left: 16px; bottom: 16px; z-index: 50; display: flex; gap: 10px; align-items: flex-start; max-width: min(460px, calc(100vw - 32px)); padding: 10px 12px 10px 14px; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-left: 4px solid #f9ab00; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.15); font-size: 14px; line-height: 1.45; }
.net-stale button { flex: none; width: 24px; height: 24px; padding: 0; border: 0; background: none; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; }
@media print { .net-stale { display: none; } }

/* Edition Finder on phones: cover with a card under it (match, Compare), the title, then ISBN,
   Publisher, Format, Year and Dimensions columns; the Match column is hidden. The
   columns keep a readable width and the table scrolls sideways inside its box when it must.
   Desktop keeps the full table. */
.m-card, .m-only { display: none; }
@media (max-width: 560px) {
  .m-only { display: inline-block; }
  .m-compare { margin-top: 6px; font-size: 14px; }
  #vols .wide-only { display: none; }
  td.thumb .m-card .why-drop { margin-top: 0; font-size: 12px; }
  td.thumb .m-card .why-drop .signals { display: grid; gap: 2px; width: max-content; max-width: 9em; }
  table.eds .col-wide { display: none; }
  .m-card { display: grid; gap: 4px; justify-items: start; margin-top: 8px; font-size: 14px; }
  .m-card .m-badge { padding: 2px 6px; border-radius: 4px; font-size: 15px; font-weight: bold; line-height: 1.3; white-space: nowrap; }
  .m-card .m-badge small { font-size: 11px; font-weight: normal; }   /* the colour says strong / possible / weak */
  /* under the cover: the score spans the column on its hue, the score and "Why" centred */
  td.thumb .m-card { width: 84px; justify-items: stretch; text-align: center; }
  td.thumb .m-card .m-badge { display: block; padding: 4px 0; }
  td.thumb .m-card .why-drop > summary { width: auto; text-align: center; }
  td.thumb .m-card .why-drop .signals { justify-self: center; text-align: left; }
  .m-card.m-strong .m-badge { background: var(--hue-y); color: var(--good); }
  .m-card.m-possible .m-badge { background: var(--hue-p); color: var(--warn); }
  .m-card.m-weak .m-badge, .m-card.m-gap .m-badge { background: var(--hue-n); color: var(--bad); }
  .m-card.m-seed .m-badge { background: var(--hue-seed); color: var(--link); }
  .m-card .m-num { font-variant-numeric: tabular-nums; }
  .m-card button { margin-top: 2px; font-size: 14px; }
  table.eds td, table.eds th { padding-left: 10px; padding-right: 10px; }
  table.eds th { font-size: 13px; }
  #vols table.eds td { font-size: 14px; }
  #vols table.eds .vol-name { font-size: 16px; }
  #vols > .table-scroll > table.eds > tbody > tr > td:nth-child(3) { min-width: 10.5em; }   /* title + card */
  table.eds td.col-narrow { min-width: 6.5em; }
  table.eds td.thumb { width: 92px; padding-right: 8px; }
  table.eds td.thumb .cover { width: 84px; }
}

/* ---- Bookshelf scanner ---- */
/* the upload box: a plain bordered box in the site's search-box style (thin grey border, square-ish
   corners, white), with the photo icon and wording centred inside */
.bs-drop { display: grid; gap: 10px; justify-items: start; width: 100%; }
.bs-bar {
  width: 100%; height: auto; min-height: 150px; padding: 24px 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  font: 16px var(--font); color: var(--muted); text-align: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: 4px; box-shadow: none; filter: none;
}
.bs-bar-text { max-width: 100%; white-space: normal; }
.bs-bar-icon { flex: none; order: -1; width: 34px; height: 34px; color: var(--muted); }   /* icon above the wording */
.bs-bar:hover { border-color: var(--muted); color: var(--muted); box-shadow: none; filter: none; }
.bs-bar:hover .bs-bar-icon, .bs-bar:hover .bs-bar-text { color: var(--link); }
.bs-bar:focus-visible { border-color: var(--link); box-shadow: 0 0 0 1px var(--link); outline: none; }
.bs-bar:disabled { cursor: progress; opacity: 1; }
.bs-drop.over .bs-bar { border-color: var(--link); box-shadow: 0 0 0 1px var(--link); background: var(--surface2); }
.bs-or { margin: 0; font-size: 14px; color: var(--muted); }
.bs-cam { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; vertical-align: -3px; }
.bs-viewfinder video { object-fit: contain; }   /* show the whole frame: that is what the photo will be */
.bs-preview { width: 160px; max-height: 120px; object-fit: cover; border: 1px solid var(--rule); border-radius: 4px; }
.bs-actions { gap: 14px; align-items: baseline; }
.bs-flag { display: inline-block; font-size: 12px; font-weight: bold; color: var(--warn); border: 1px solid currentColor; border-radius: 3px; padding: 0 5px; vertical-align: 2px; }
table.eds.bs-table td.thumb { width: 72px; }
table.eds.bs-table td.thumb .cover { width: 60px; }
table.eds.bs-table td.act { white-space: nowrap; }
.bs-isbn-m { display: none; font-size: 14px; }
.bs-links { display: grid; gap: 4px; font-size: 14px; justify-items: start; }
@media (max-width: 600px) {
  .bs-preview { width: 100%; max-height: 160px; }
  table.eds.bs-table th:nth-child(1), table.eds.bs-table td:nth-child(1), table.eds.bs-table th:nth-child(4), table.eds.bs-table td:nth-child(4) { display: none; }
  table.eds.bs-table td { padding: 12px 8px; }
  .bs-isbn-m { display: block; }
  table.eds.bs-table td.thumb { width: 52px; } table.eds.bs-table td.thumb .cover { width: 44px; }
}
