:root {
  color-scheme: light;
  --ink: #102a43;
  --ink-soft: #486581;
  --muted: #627d98;
  --paper: #f5f8fb;
  --panel: #ffffff;
  --line: #d9e2ec;
  --accent: #d64545;
  --accent-dark: #a92732;
  --blue: #1769aa;
  --blue-soft: #e9f3fb;
  --green: #19764b;
  --shadow: 0 14px 36px rgba(16, 42, 67, .08);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--blue); text-decoration-thickness: .08em; text-underline-offset: .16em; }
a:hover { color: var(--accent-dark); }
button, input, select { font: inherit; }
button, .button { cursor: pointer; }
:focus-visible { outline: 3px solid #f6bd60; outline-offset: 3px; }

.shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.site-header { background: var(--ink); color: #fff; border-bottom: 4px solid var(--accent); }
.header-inner { min-height: 78px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.brand { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 12px; }
.brand:hover { color: #fff; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 2px solid #f6bd60; color: #f6bd60; border-radius: 8px; font-size: 24px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.2rem; letter-spacing: .02em; }
.brand small { color: #bcccdc; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.primary-nav { display: flex; gap: 20px; flex-wrap: wrap; justify-content: flex-end; }
.primary-nav a { color: #d9e2ec; text-decoration: none; font-size: .92rem; }
.primary-nav a:hover { color: #fff; }

.page-shell { padding-top: 48px; padding-bottom: 68px; min-height: calc(100vh - 180px); }
.hero { max-width: 760px; margin: 12px auto 36px; text-align: center; }
.eyebrow { margin: 0 0 8px; color: var(--accent-dark); font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 16px; color: var(--ink); font-size: clamp(2rem, 5vw, 4rem); line-height: 1.04; letter-spacing: -.045em; }
h2 { margin-bottom: 10px; font-size: clamp(1.35rem, 3vw, 2rem); line-height: 1.15; letter-spacing: -.025em; }
h3 { margin-bottom: 5px; line-height: 1.2; }
.hero-copy { max-width: 650px; margin: 0 auto 28px; color: var(--ink-soft); font-size: 1.05rem; }
.search-form { display: flex; gap: 10px; max-width: 720px; margin: 0 auto; }
.home-live-results { max-width: 960px; margin: 24px auto 0; }
.search-form input, .filter-row input, .filter-row select { min-height: 48px; width: 100%; border: 1px solid #9fb3c8; border-radius: 8px; background: #fff; color: var(--ink); padding: 10px 14px; }
.search-form input { font-size: 1.05rem; box-shadow: 0 4px 15px rgba(16, 42, 67, .06); }
.search-form input:focus, .filter-row input:focus, .filter-row select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23, 105, 170, .16); outline: none; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 7px; padding: 8px 15px; text-decoration: none; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-dark); color: #fff; }
.button-secondary { border-color: #8fb9d7; background: var(--blue-soft); color: #0b4f7e; }
.button-secondary:hover { background: #d5eaf7; color: #073b5d; }
.button-ghost { border-color: var(--line); background: #fff; color: var(--ink-soft); }
.button-ghost:hover { border-color: #9fb3c8; color: var(--ink); }
.button-small { min-height: 32px; padding: 5px 10px; font-size: .82rem; }
.quick-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 36px 0 52px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); box-shadow: var(--shadow); }
.stats-strip > div { display: flex; min-height: 92px; flex-direction: column; justify-content: center; background: var(--panel); padding: 15px 18px; }
.stats-strip strong { color: var(--ink); font-size: 1.2rem; }
.stats-strip span { color: var(--muted); font-size: .8rem; }
.section-heading, .results-toolbar, .title-card-heading, .panel-heading, .result-title-row, .release-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.section-heading { margin-bottom: 18px; }
.text-link { font-weight: 700; }
.title-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.title-card, .result-card, .detail-panel, .callout, .empty-state { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.title-card { padding: 20px; }
.title-card h3 a, .result-card h2 a { color: var(--ink); text-decoration: none; }
.title-card h3 a:hover, .result-card h2 a:hover { color: var(--accent-dark); text-decoration: underline; }
.new-badge, .source-chip, .authoritative, .approximate, .no-match, .metadata-status, .valid-badge, .warning-badge { display: inline-block; border-radius: 999px; padding: 3px 8px; font-size: .68rem; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.new-badge { background: #fff1e8; color: var(--accent-dark); }
.source-chip { border: 1px solid var(--line); color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .68rem; }
.authoritative { background: #e6f6ee; color: var(--green); }
.approximate { background: #fff7df; color: #9a6700; }
.no-match { background: #f8d7da; color: #842029; }
.metadata-status { background: #fff3cd; color: #8a5a00; }
.valid-badge { background: #e6f6ee; color: var(--green); }
.warning-badge { background: #fff1e8; color: var(--accent-dark); }
.muted { color: var(--muted); }
.freshness { margin: 16px 0 0; color: var(--muted); font-size: .78rem; }
.release-list { display: grid; gap: 9px; margin-top: 15px; }
.release-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; min-width: 0; }
.format-pill { display: inline-block; border-radius: 5px; background: #edf2f7; color: var(--ink-soft); padding: 3px 7px; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.upc-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.upc-link { color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem; text-decoration: none; overflow-wrap: anywhere; }
.upc-link:hover { color: var(--accent-dark); text-decoration: underline; }
.barcode-mini { border-left: 1px solid var(--line); padding-left: 7px; font-size: .76rem; }
.callout { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 36px; padding: 20px 22px; background: #edf7fc; }
.callout p { margin: 3px 0 0; color: var(--ink-soft); }

.search-header { margin-bottom: 26px; }
.search-header h1 { font-size: clamp(2rem, 4vw, 3rem); }
.search-form.compact { max-width: none; margin: 0 0 16px; }
.filter-row { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; }
.filter-row label { display: grid; gap: 5px; color: var(--ink-soft); font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.filter-row select, .filter-row input { min-height: 40px; width: auto; min-width: 130px; padding: 7px 10px; font-size: .9rem; text-transform: none; letter-spacing: normal; }
.filter-row .button { min-height: 40px; }
.results-toolbar { margin: 18px 0 12px; color: var(--ink-soft); font-size: .9rem; }
.results-list { display: grid; gap: 12px; }
.result-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; }
.result-main { min-width: 0; flex: 1; }
.result-card h2 { margin: 0; font-size: 1.2rem; }
.result-title-row .year { color: var(--muted); font-weight: 700; }
.result-card .muted { margin: 6px 0 0; font-size: .85rem; }
.result-releases { margin-top: 14px; }
.result-actions { flex: 0 0 auto; }
.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 24px; color: var(--muted); text-align: center; }
.pagination > :last-child { justify-self: end; }
.empty-state { margin-top: 20px; padding: 46px 25px; text-align: center; }
.empty-icon { margin-bottom: 8px; color: var(--accent); font-size: 3rem; }
.empty-state p { max-width: 500px; margin: 0 auto 18px; color: var(--ink-soft); }

.back-link { display: inline-block; margin-bottom: 26px; font-weight: 700; }
.title-detail-header { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 26px; }
.title-detail-header h1 { margin-bottom: 8px; font-size: clamp(2.1rem, 5vw, 3.7rem); }
.detail-subtitle { margin: 0; color: var(--ink-soft); font-size: 1.05rem; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 18px; align-items: start; }
.detail-panel { padding: 22px; }
.panel-heading { margin-bottom: 18px; }
.panel-heading h2 { margin: 0; font-size: 1.2rem; }
.detail-release { padding: 0 0 17px; border-bottom: 1px solid var(--line); }
.detail-release + .detail-release { padding-top: 17px; }
.detail-release:last-of-type { border-bottom: 0; }
.release-heading h3 { margin: 0; font-size: 1rem; }
.detail-upc-list { display: grid; gap: 10px; margin-top: 10px; }
.detail-upc { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.detail-upc > div:first-child { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.upc-label { color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.detail-upc code { font-size: .98rem; letter-spacing: .04em; overflow-wrap: anywhere; }
.upc-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.provenance { display: grid; gap: 3px; margin-top: 13px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.metadata-top { display: grid; grid-template-columns: 135px 1fr; gap: 18px; }
.poster { display: block; width: 135px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 7px; background: #d9e2ec; box-shadow: 0 6px 16px rgba(16, 42, 67, .13); }
.poster-placeholder { display: grid; place-items: center; color: var(--muted); font-weight: 800; text-align: center; }
.metadata-overview h3 { font-size: 1.15rem; }
.metadata-overview p { color: var(--ink-soft); font-size: .9rem; }
.metadata-list { display: grid; gap: 0; margin: 20px 0 0; }
.metadata-list div { display: grid; grid-template-columns: 145px 1fr; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.metadata-list dt { color: var(--muted); font-size: .8rem; font-weight: 800; }
.metadata-list dd { margin: 0; color: var(--ink-soft); font-size: .87rem; }
.metadata-empty { display: flex; align-items: center; gap: 18px; color: var(--ink-soft); }
.metadata-empty .poster { flex: 0 0 100px; width: 100px; }
.notice { margin: 16px 0 0; border-radius: 7px; background: #fff7df; color: #795500; padding: 10px 12px; font-size: .82rem; }
.no-match-note { background: #f8d7da; color: #842029; }
.footer-note { margin-top: 18px; }

.site-footer { border-top: 1px solid var(--line); background: #eaf0f5; color: var(--ink-soft); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; padding: 30px 0; font-size: .82rem; }
.footer-grid strong { display: block; margin-bottom: 7px; color: var(--ink); }
.footer-grid p { max-width: 300px; margin: 0; }
.footer-grid a, .footer-grid span { display: block; margin: 3px 0; }
.skip-link { position: absolute; left: -9999px; z-index: 20; padding: 10px; background: #fff; }
.skip-link:focus { left: 10px; top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 760px) {
  .shell { width: min(100% - 28px, 620px); }
  .header-inner { min-height: 72px; align-items: flex-start; padding: 14px 0; }
  .primary-nav { gap: 10px 14px; font-size: .82rem; }
  .page-shell { padding-top: 34px; }
  .hero { margin-top: 0; }
  h1 { font-size: clamp(2rem, 11vw, 3rem); }
  .search-form { flex-direction: column; }
  .search-form .button { width: 100%; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); margin: 28px 0 38px; }
  .stats-strip > div { min-height: 72px; padding: 12px; }
  .stats-strip strong { font-size: 1rem; }
  .stats-strip span { font-size: .72rem; }
  .section-heading { align-items: start; flex-direction: column; gap: 3px; }
  .title-grid { grid-template-columns: 1fr; }
  .callout { align-items: flex-start; flex-direction: column; }
  .filter-row { align-items: stretch; display: grid; grid-template-columns: 1fr 1fr; }
  .filter-row label, .filter-row input, .filter-row select { width: 100%; min-width: 0; }
  .filter-row .button { width: 100%; }
  .result-card { align-items: stretch; flex-direction: column; gap: 15px; }
  .result-actions { display: flex; }
  .result-actions .button { width: 100%; }
  .pagination { grid-template-columns: 1fr; gap: 9px; }
  .pagination > :last-child { justify-self: center; }
  .pagination > :first-child { justify-self: center; }
  .title-detail-header { align-items: flex-start; flex-direction: column; gap: 10px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-upc { align-items: flex-start; flex-direction: column; }
  .upc-actions { width: 100%; }
  .upc-actions .button { flex: 1; }
  .metadata-top { grid-template-columns: 100px 1fr; gap: 14px; }
  .poster { width: 100px; }
  .metadata-list div { grid-template-columns: 115px 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 18px; }
}

@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --ink: #e6edf3; --ink-soft: #bdc9d5; --muted: #9fb3c8; --paper: #0b1724; --panel: #122334; --line: #2b465d; --blue-soft: #17364f; --shadow: 0 14px 36px rgba(0,0,0,.2); }
  body { background: var(--paper); }
  .site-header { background: #07111c; }
  .search-form input, .filter-row input, .filter-row select, .button-ghost { background: #102334; color: var(--ink); }
  .stats-strip > div, .title-card, .result-card, .detail-panel, .callout, .empty-state { background: var(--panel); }
  .callout { background: #102e43; }
  .site-footer { background: #07111c; }
  .title-card h3 a, .result-card h2 a, .upc-link { color: var(--ink); }
  .format-pill { background: #1b3449; }
  .no-match, .no-match-note { background: #652b32; color: #ffd6da; }
  .metadata-status { background: #5a431c; color: #ffe6a8; }
}

@media print {
  .site-header, .site-footer, .back-link, .primary-nav, .button, .upc-actions, .footer-note, .notice, .source-chip { display: none !important; }
  .page-shell { width: 100%; padding: 0; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .detail-panel, .title-card, .result-card { box-shadow: none; border-color: #999; }
  a { color: inherit; text-decoration: none; }
}

/* v2 interaction and barcode refinements */
.theme-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; border: 1px solid #486581; border-radius: 999px; padding: 5px 10px; background: transparent; color: #d9e2ec; font-size: .82rem; }
.theme-toggle:hover { border-color: #f6bd60; color: #fff; }
.button:disabled { cursor: not-allowed; opacity: .48; }
.browse-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.button-link { min-height: auto; border: 0; border-left: 1px solid var(--line); border-radius: 0; padding: 0 0 0 7px; background: transparent; color: var(--blue); font-size: .76rem; font-weight: 700; text-decoration: underline; text-underline-offset: .16em; }
.button-link:hover { color: var(--accent-dark); }
.title-actions { display: flex; gap: 8px; margin-top: 14px; }
.metadata-links { display: grid; gap: 4px; }
.metadata-source-note { margin: 16px 0 0; color: var(--muted); font-size: .78rem; }
.exe-hosting { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--line); }
.exe-link { display: inline-flex !important; align-items: center; gap: 8px; color: var(--ink-soft); text-decoration: none; }
.exe-link:hover { color: var(--blue); }
.exe-link strong { display: inline; margin: 0; color: inherit; }
.exe-logo { width: 26px; height: 26px; color: var(--blue); }
.barcode-dialog { width: min(760px, calc(100% - 24px)); max-width: 760px; margin: auto; border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--panel); color: var(--ink); box-shadow: 0 24px 80px rgba(0,0,0,.28); }
.barcode-dialog::backdrop { background: rgba(7, 17, 28, .72); backdrop-filter: blur(3px); }
.barcode-dialog-inner { padding: 24px; }
.barcode-dialog-heading, .barcode-page-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.barcode-dialog-heading h2, .barcode-page-heading h2 { margin: 0; }
.barcode-dialog-upc { margin: 14px 0 8px; color: var(--muted); text-align: center; }
.barcode-dialog-upc code, .barcode-page-heading code { font-size: 1.1rem; letter-spacing: .08em; }
.barcode-large-wrap { display: grid; place-items: center; min-height: 220px; padding: 28px 20px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.barcode-large { display: block; width: min(100%, 680px); height: auto; image-rendering: crisp-edges; }
.barcode-dialog-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.barcode-page-header { margin-bottom: 24px; }
.barcode-page-header h1 { margin-bottom: 8px; }
.barcode-page-card { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); padding: 24px; }
.barcode-page-card .barcode-large-wrap { margin-top: 22px; }
.barcode-print-note { margin: 12px 0 0; color: var(--muted); font-size: .82rem; text-align: center; }
.barcode-matches-heading { margin-top: 40px; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) { color-scheme: dark; --ink: #e6edf3; --ink-soft: #bdc9d5; --muted: #9fb3c8; --paper: #0b1724; --panel: #122334; --line: #2b465d; --blue-soft: #17364f; --shadow: 0 14px 36px rgba(0,0,0,.2); }
  :root:not([data-theme]) body { background: var(--paper); }
  :root:not([data-theme]) .site-header { background: #07111c; }
  :root:not([data-theme]) .search-form input, :root:not([data-theme]) .filter-row input, :root:not([data-theme]) .filter-row select, :root:not([data-theme]) .button-ghost { background: #102334; color: var(--ink); }
  :root:not([data-theme]) .stats-strip > div, :root:not([data-theme]) .title-card, :root:not([data-theme]) .result-card, :root:not([data-theme]) .detail-panel, :root:not([data-theme]) .callout, :root:not([data-theme]) .empty-state { background: var(--panel); }
  :root:not([data-theme]) .callout { background: #102e43; }
  :root:not([data-theme]) .site-footer { background: #07111c; }
  :root:not([data-theme]) .title-card h3 a, :root:not([data-theme]) .result-card h2 a, :root:not([data-theme]) .upc-link { color: var(--ink); }
  :root:not([data-theme]) .format-pill { background: #1b3449; }
}
html[data-theme="light"] { color-scheme: light; --ink: #102a43; --ink-soft: #486581; --muted: #627d98; --paper: #f5f8fb; --panel: #ffffff; --line: #d9e2ec; --blue-soft: #e9f3fb; --shadow: 0 14px 36px rgba(16, 42, 67, .08); }
html[data-theme="dark"] { color-scheme: dark; --ink: #e6edf3; --ink-soft: #bdc9d5; --muted: #9fb3c8; --paper: #0b1724; --panel: #122334; --line: #2b465d; --blue-soft: #17364f; --shadow: 0 14px 36px rgba(0,0,0,.2); }
html[data-theme="dark"] body { background: var(--paper); }
html[data-theme="dark"] .site-header { background: #07111c; }
html[data-theme="dark"] .search-form input, html[data-theme="dark"] .filter-row input, html[data-theme="dark"] .filter-row select, html[data-theme="dark"] .button-ghost { background: #102334; color: var(--ink); }
html[data-theme="dark"] .stats-strip > div, html[data-theme="dark"] .title-card, html[data-theme="dark"] .result-card, html[data-theme="dark"] .detail-panel, html[data-theme="dark"] .callout, html[data-theme="dark"] .empty-state { background: var(--panel); }
html[data-theme="dark"] .callout { background: #102e43; }
html[data-theme="dark"] .site-footer { background: #07111c; }
html[data-theme="dark"] .title-card h3 a, html[data-theme="dark"] .result-card h2 a, html[data-theme="dark"] .upc-link { color: var(--ink); }
html[data-theme="dark"] .format-pill { background: #1b3449; }

@media (max-width: 760px) {
  .browse-actions .button { flex: 1 1 0; }
  .title-actions { margin-top: 12px; }
  .barcode-dialog-inner, .barcode-page-card { padding: 18px; }
  .barcode-dialog-heading, .barcode-page-heading { align-items: stretch; flex-direction: column; }
  .barcode-dialog-heading > .button { align-self: flex-end; }
  .barcode-large-wrap { min-height: 150px; padding: 18px 10px; }
}

.brand strong { white-space: nowrap; }
@media (max-width: 760px) {
  .brand { gap: 8px; }
  .brand-mark { width: 38px; height: 38px; font-size: 21px; }
  .brand strong { font-size: 1rem; }
  .brand small { font-size: .62rem; letter-spacing: .09em; }
  .primary-nav { gap: 8px 11px; font-size: .78rem; }
  .theme-toggle { min-height: 30px; padding: 4px 8px; font-size: .74rem; }
}

/* Final theme contrast and interaction states */
html[data-theme="light"] .search-form input,
html[data-theme="light"] .filter-row input,
html[data-theme="light"] .filter-row select,
html[data-theme="light"] .button-ghost {
  background: #fff;
  color: #102a43;
}
html[data-theme="light"] .site-footer { background: #eaf0f5; }
html[data-theme="light"] .stats-strip > div,
html[data-theme="light"] .title-card,
html[data-theme="light"] .result-card,
html[data-theme="light"] .detail-panel,
html[data-theme="light"] .callout,
html[data-theme="light"] .empty-state { background: #fff; }
html[data-theme="light"] .callout { background: #edf7fc; }
html[data-theme="light"] .format-pill { background: #edf2f7; color: #486581; }
html[data-theme="dark"] .button-secondary { background: #20587d; color: #f5f8fb; border-color: #6da8cc; }
html[data-theme="dark"] .button-secondary:hover { background: #2d7099; color: #fff; }
html[data-theme="dark"] .button-ghost { background: #102334; color: #e6edf3; border-color: #486581; }
.filter-row [data-filter-submit] { transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease; }
.filter-row [data-filter-submit]:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 5px 14px rgba(214, 69, 69, .24); }
.filter-row [data-filter-submit]:not(:disabled):hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.filter-row [data-filter-submit]:disabled { background: #e4e7eb; border-color: #cbd2d9; color: #7b8794; opacity: 1; box-shadow: none; }
.quick-actions { margin-bottom: 16px; }
.exe-logo { width: 42px; height: 42px; object-fit: contain; }

@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; }
  .brand { flex: 1 1 auto; }
  .primary-nav { flex: 1 1 100%; justify-content: flex-end; }
}

.barcode-page-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.barcode-page-nav .back-link { margin-bottom: 0; }
.barcode-page-poster-wrap { display: flex; justify-content: center; margin: 0 0 24px; }
.barcode-page-poster { display: block; width: min(210px, 55vw); aspect-ratio: 2 / 3; object-fit: cover; border-radius: 9px; box-shadow: 0 10px 24px rgba(16, 42, 67, .18); }
.barcode-dialog-poster-wrap { display: flex; justify-content: center; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); position: relative; }
.barcode-dialog-poster { display: block; width: min(180px, 55vw); aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px; box-shadow: 0 8px 20px rgba(16, 42, 67, .16); }
.barcode-dialog-poster-wrap.is-loading::after { content: ""; position: absolute; top: 24px; left: 50%; width: min(180px, 55vw); height: calc(min(180px, 55vw) * 1.5); transform: translateX(-50%); border-radius: 8px; background: var(--line); opacity: .35; }
.barcode-dialog-poster-wrap.is-loading::before { content: ""; position: absolute; top: calc(24px + (min(180px, 55vw) * 1.5) / 2 - 18px); left: 50%; width: 36px; height: 36px; margin-left: -18px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: barcode-poster-spin .7s linear infinite; z-index: 1; }
@keyframes barcode-poster-spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .barcode-page-nav { margin-bottom: 18px; }
}

.home-filter-row { margin-top: 16px; justify-content: center; }

/* Discussion */
.topic-list { display: grid; gap: 14px; }
.topic-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); padding: 20px; }
.topic-card-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.topic-card-heading h3 { margin: 0 0 4px; }
.topic-card-heading h3 a { color: var(--ink); text-decoration: none; }
.topic-card-heading h3 a:hover { color: var(--accent-dark); text-decoration: underline; }
.topic-stats { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; color: var(--ink-soft); font-size: .9rem; }
.thread-list { display: grid; gap: 12px; }
.thread-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); padding: 18px 20px; display: flex; justify-content: space-between; gap: 16px; }
.thread-card-main { min-width: 0; }
.thread-card-main h2 { margin: 0 0 4px; font-size: 1.15rem; }
.thread-card-main h2 a { color: var(--ink); text-decoration: none; }
.thread-card-main h2 a:hover { color: var(--accent-dark); text-decoration: underline; }
.thread-preview { margin: 8px 0 0; color: var(--ink-soft); font-size: .92rem; overflow-wrap: anywhere; }
.thread-card-meta { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; color: var(--ink-soft); font-size: .9rem; }
.post-list { display: grid; gap: 14px; }
.post-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); padding: 18px 20px; }
.post-thread { border-left: 4px solid var(--accent); }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; font-size: .88rem; color: var(--muted); }
.post-author { font-weight: 800; color: var(--ink); }
.post-body { color: var(--ink); line-height: 1.6; overflow-wrap: anywhere; }
.post-body p { margin: 0 0 10px; }
.post-body p:last-child { margin-bottom: 0; }
.post-body a { color: var(--accent-dark); }
.post-body blockquote { margin: 10px 0; padding: 8px 12px; border-left: 3px solid var(--blue); background: var(--blue-soft); color: var(--ink-soft); }
.post-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.post-actions form { display: inline-flex; }
.discussion-form { display: grid; gap: 14px; }
.discussion-form label { display: grid; gap: 6px; font-weight: 700; color: var(--ink-soft); }
.discussion-form input, .discussion-form textarea, .discussion-form select { min-height: 44px; width: 100%; border: 1px solid #9fb3c8; border-radius: 8px; background: #fff; color: var(--ink); padding: 10px 12px; font: inherit; }
.discussion-form textarea { resize: vertical; }
.callout-error { background: #fdecec; }
.callout-error p { color: #a92732; }
html[data-theme="dark"] .discussion-form input,
html[data-theme="dark"] .discussion-form textarea,
html[data-theme="dark"] .discussion-form select { background: #102334; color: var(--ink); border-color: #486581; }
html[data-theme="dark"] .topic-card,
html[data-theme="dark"] .thread-card,
html[data-theme="dark"] .post-card { background: var(--panel); }
html[data-theme="dark"] .callout-error { background: #3a1d22; }
html[data-theme="dark"] .callout-error p { color: #f2b8bd; }
@media (max-width: 760px) {
  .thread-card { flex-direction: column; }
  .thread-card-meta { flex-direction: row; align-items: center; }
}
.report-dialog { width: min(520px, calc(100% - 24px)); margin: auto; border: 1px solid var(--line); border-radius: 12px; padding: 0; background: var(--panel); color: var(--ink); box-shadow: 0 24px 80px rgba(0,0,0,.28); }
.report-dialog::backdrop { background: rgba(7,17,28,.72); backdrop-filter: blur(3px); }
.report-dialog .barcode-dialog-inner { padding: 24px; }
.report-dialog h2 { margin-top: 0; }

/* Maintainer login (subtle, collapsible) */
.maintainer-zone { margin-top: 18px; }
.maintainer-toggle { margin-bottom: 10px; }
.maintainer-panel { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--panel); }
.maintainer-panel[hidden] { display: none; }
.identity-card-heading { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.identicon { display: inline-block; width: 28px; height: 28px; flex: 0 0 28px; color: var(--blue); }
.identicon svg, .identicon-svg { display: block; width: 100%; height: 100%; }
.author-with-identicon .identicon-svg { width: 18px; height: 18px; flex: 0 0 18px; }
.author-with-identicon { display: inline-flex; align-items: center; gap: 5px; }
.profile-flair { border-radius: 999px; background: var(--blue-soft); color: var(--ink-soft); padding: 2px 7px; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.identity-appearance-note { width: 100%; margin: 10px 0 0; color: var(--muted); font-size: .78rem; }
.inline-success { width: 100%; margin: 10px 0 0; color: var(--green) !important; font-size: .82rem; font-weight: 800; }
.flair-form { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.flair-form label { display: grid; gap: 4px; color: var(--ink-soft); font-size: .76rem; font-weight: 800; }
.flair-form select { min-height: 34px; border: 1px solid #9fb3c8; border-radius: 7px; background: #fff; color: var(--ink); padding: 5px 8px; font: inherit; }
.identity-links { margin-top: 10px; font-size: .82rem; }
.browser-capability-warning { width: 100%; margin-top: 12px; padding: 10px 12px; border: 1px solid #d69e2e; border-radius: 8px; background: #fff7df; color: #795500; font-size: .82rem; }
.browser-capability-warning p { margin: 3px 0 0; color: inherit; }
.identity-help { width: 100%; margin-top: 10px; font-size: .78rem; }
.identity-help summary { cursor: pointer; color: var(--ink-soft); font-weight: 700; }
.identity-help p { margin: 7px 0 0; color: var(--muted); }
.workflow-status { display: inline-block; border-radius: 999px; padding: 3px 8px; font-size: .7rem; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.workflow-status-new { background: #edf2f7; color: var(--ink-soft); }
.workflow-status-acknowledged { background: #e9f3fb; color: #0b4f7e; }
.workflow-status-planned { background: #fff7df; color: #795500; }
.workflow-status-in_progress { background: #f3e8ff; color: #6b35a8; }
.workflow-status-shipped { background: #e6f6ee; color: var(--green); }
.workflow-status-line { margin: -4px 0 14px; }
.workflow-status-panel { margin: 16px 0 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.workflow-status-panel summary { cursor: pointer; color: var(--ink-soft); font-size: .84rem; font-weight: 800; }
.workflow-status-panel .discussion-form { max-width: 520px; margin-top: 12px; }
.workflow-history { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .82rem; }
.workflow-history ol { margin: 8px 0 0; padding-left: 20px; }
.workflow-history li + li { margin-top: 8px; }
html[data-theme="dark"] .flair-form select { background: #102334; color: var(--ink); border-color: #486581; }
html[data-theme="dark"] .browser-capability-warning { border-color: #c7962d; background: #5a431c; color: #ffe6a8; }
html[data-theme="dark"] .workflow-status-new { background: #1b3449; color: var(--ink); }
html[data-theme="dark"] .workflow-status-acknowledged { background: #17364f; color: #c9e9ff; }
html[data-theme="dark"] .workflow-status-planned { background: #5a431c; color: #ffe6a8; }
html[data-theme="dark"] .workflow-status-in_progress { background: #3d2755; color: #e5caff; }
html[data-theme="dark"] .workflow-status-shipped { background: #194b37; color: #bbf4d5; }

.device-panel { max-width: 780px; margin: 0 auto; }
.device-list { display: grid; gap: 12px; }
.device-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.device-card h3 { margin: 0 0 4px; font-size: 1rem; }
.device-card p { margin: 3px 0 0; font-size: .82rem; }
.device-privacy-note { margin: 18px 0 0; font-size: .82rem; }
@media (max-width: 760px) { .device-card { align-items: stretch; flex-direction: column; } .device-card form, .device-card form .button { width: 100%; } }


.bookmark-button.is-saved { border-color: #6ea88d; background: #e6f6ee; color: var(--green); }
.bookmark-shelf-panel { max-width: 780px; margin: 0 auto; }
.bookmark-shelf-panel .panel-heading { align-items: center; }
.bookmark-shelf-note { margin: 18px 0 0; font-size: .82rem; }
.bookmark-list { display: grid; gap: 12px; }
.bookmark-item { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.bookmark-item-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.bookmark-item-heading h3 { margin: 0; }
.bookmark-item-heading p { margin: 3px 0 0; font-size: .82rem; }
.bookmark-note-label { display: grid; gap: 5px; margin-top: 12px; color: var(--ink-soft); font-size: .78rem; font-weight: 800; }
.bookmark-note-label textarea { width: 100%; min-height: 60px; resize: vertical; border: 1px solid #9fb3c8; border-radius: 7px; background: #fff; color: var(--ink); padding: 8px 10px; font: inherit; font-weight: 400; }
.bookmark-item-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
html[data-theme="dark"] .bookmark-button.is-saved { background: #194b37; border-color: #6fb995; color: #bbf4d5; }
html[data-theme="dark"] .bookmark-note-label textarea { background: #102334; color: var(--ink); border-color: #486581; }

.handle-pick { margin-top: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.handle-pick h2 { margin: 0 0 6px; font-size: 1.15rem; }
.identity-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.identity-restore { width: min(100%, 480px); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.identity-restore summary { cursor: pointer; color: var(--ink-soft); font-size: .82rem; font-weight: 700; }
.identity-restore .discussion-form { margin-top: 12px; }
.identity-notice { background: #fff7df; }
.recovery-code-card { align-items: flex-start; background: #e6f6ee; }
.recovery-code-value { display: block; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink); font: 700 .95rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; overflow-wrap: anywhere; }
.restore-confirm-panel { max-width: 680px; }
.handle-options { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.handle-options form { display: inline-flex; }

.thread-context, .thread-catalog-crumb, .search-result-context { margin: 4px 0 0; color: var(--muted); font-size: .82rem; }
.thread-context a, .thread-catalog-crumb a, .search-result-context a { font-weight: 700; }
.discussion-sort { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.sort-link, .sort-current { border-radius: 999px; padding: 4px 9px; font-size: .78rem; }
.sort-link { border: 1px solid var(--line); text-decoration: none; }
.sort-current { background: var(--blue-soft); color: var(--ink); }
.discussion-search-form { max-width: 760px; }
.discussion-search-results { display: grid; gap: 12px; }
.search-result-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); padding: 18px 20px; }
.search-result-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.search-result-heading h2 { margin: 0; font-size: 1.15rem; }
.search-result-heading h2 a { color: var(--ink); text-decoration: none; }
.search-result-heading h2 a:hover { color: var(--accent-dark); text-decoration: underline; }
.search-result-card .thread-preview { margin-bottom: 0; }
.post-edit { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.post-edit summary { cursor: pointer; color: var(--blue); font-size: .8rem; font-weight: 800; }
.post-edit .discussion-form { margin-top: 12px; }
.reply-context { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 10px; border-left: 3px solid var(--blue); background: var(--blue-soft); color: var(--ink-soft); font-size: .84rem; }
.reply-target { color: var(--muted); font-size: .78rem; text-decoration: none; }
.reply-target:hover { color: var(--blue); text-decoration: underline; }
.thread-locked-notice { margin-top: 18px; }
html[data-theme="dark"] .search-result-card { background: var(--panel); }
html[data-theme="dark"] .identity-notice { background: #5a431c; color: #ffe6a8; }
html[data-theme="dark"] .reply-context { background: #17364f; }

.new-replies-badge { display: inline-block; margin-left: 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .68rem; font-weight: 800; letter-spacing: .04em; padding: 2px 8px; vertical-align: middle; }

/* Title discussion section */
.title-discussion-panel { margin-top: 24px; }
