/* Hallmark · component-scope: selection panels · existing ink/paper tokens
 * Pre-emit critique: P4 H4 E4 S5 R4 V4 */
html, body { overflow-x: clip; }
.library-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:20px 18px 14px; }
.library-heading h2 { font:600 22px var(--serif); margin:5px 0 0; color:var(--ink); }
.section-kicker, .library-hint { font-size:10px; letter-spacing:.12em; color:var(--muted); }
.library .selected { margin:0 14px 14px; padding:12px; border:1px solid var(--line); border-radius:8px; background:var(--panel); }
.library .selected-head { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-top:8px; }
.library .selected-head strong { flex:1; font-size:13px; overflow-wrap:anywhere; }
.library .selected p { margin:8px 0 0; color:var(--muted); font-size:11px; }
.library .meta-block { margin-top:8px; }
body .library .toolbar { padding:0 14px 12px; gap:12px; }
body .library .search { background:var(--panel); min-height:40px; }
body .library .tabs { justify-content:flex-start; gap:6px; }
body .library .tab { padding:7px 10px; font-size:11px; border-color:transparent; background:var(--panel); }
body .library .tab.active { background:var(--ink); color:var(--bg); }
.filter-heading { flex-basis:100%; font-size:10px; color:var(--muted); letter-spacing:.1em; margin:8px 0 2px; }
body .library .toolbar-tools { padding-top:8px; border-top:1px solid var(--line); }
body .library .font-grid:not(.list) { gap:12px; padding:4px 12px 20px; }
body .library .font-card { transition:border-color var(--dur-hover), box-shadow var(--dur-hover); }
body .library .font-card:hover { transform:none; border-color:var(--muted); }
body .library .font-card.is-current:hover { transform:none; border-color:var(--accent); }
body .library .font-card .specimen-name { white-space:normal; overflow-wrap:anywhere; font-size:15px; line-height:1.35; max-height:none; }
body .library .font-card .poster.has-poster .specimen-name { padding:8px; }
body .library .font-card:hover .specimen-name { transform:none; }
body .library .font-card .favorite { opacity:1; }
body .library .font-card .now { color:var(--accent); background:none; font-size:10px; left:10px; top:10px; }
body .library .font-grid:not(.list) .font-name { font-size:11px; font-weight:500; }
body .library .font-grid:not(.list) .card-dl { font-size:11px; }
.poet-search, .work-section-label { display:none; }
body.is-zh .poet-search { display:flex; flex-direction:column; gap:9px; margin:20px 0 12px; }
.poet-search > span, body.is-zh .work-section-label { font-size:11px; letter-spacing:.08em; color:var(--muted); }
.poet-search input { width:100%; min-width:0; box-sizing:border-box; padding:9px 10px; border:1px solid var(--line); border-radius:6px; color:var(--ink); background:var(--bg); font:12px var(--sans); }
#poetSearchEmpty { color:var(--muted); font-size:12px; }
#poetSearchEmpty[hidden], #poetButtons button[hidden] { display:none; }
body:not(.is-zh) #poetSearchEmpty { display:none; }
body.is-zh #poetButtons { display:grid; grid-template-columns:repeat(auto-fit,minmax(58px,1fr)); gap:4px; max-height:200px; overflow-y:auto; padding:2px; }
body.is-zh #poetButtons .poet-tab { border-radius:5px; padding:9px 3px; min-height:34px; background:transparent; color:var(--muted); font:12px var(--sans); white-space:nowrap; }
body.is-zh #poetButtons .poet-tab.active { background:var(--ink); color:var(--bg); }
body.is-zh #poetButtons .poet-tab:hover:not(.active) { background:var(--card); color:var(--ink); }
body.is-zh .work-section-label { display:flex; justify-content:space-between; margin:24px 0 12px; }
body.is-zh #workButtons { display:flex; flex-direction:column; gap:8px; padding:0; border:0; }
body.is-zh #workButtons .work-chip { width:100%; min-width:0; text-align:left; border:0; border-radius:6px; background:transparent; padding:12px; white-space:normal; }
#workButtons strong, #workButtons span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#workButtons strong { font:500 13px var(--serif); color:var(--ink); }
#workButtons span { font:11px var(--sans); color:var(--muted); margin-top:6px; }
body.is-zh #workButtons .work-chip.active { background:var(--card); box-shadow:none; }
body.is-zh #workButtons .work-chip.active strong { color:var(--accent); }
body.is-zh #copyRow { background:none; border:0; box-shadow:none; padding:0; margin-top:24px; }
body.is-zh .works-head { align-items:flex-start; flex-direction:column; gap:6px; }
body.is-zh .work-cite { font-size:11px; color:var(--muted); }
#poetryPicker { border-radius:12px; }
#poetryPicker .poetry-picker-head { padding-bottom:16px; border-bottom:1px solid var(--line); }
#poetryPicker .poetry-picker-columns { grid-template-columns:156px minmax(0,1fr); gap:24px; }
#poetryPicker .poetry-chips { grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
#poetryPicker .poetry-chips button { padding:9px 4px; border-radius:5px; font:12px var(--sans); white-space:nowrap; }
#poetryPicker .poetry-chips button[aria-pressed=true] { background:var(--ink); color:var(--bg); border-color:var(--ink); }
#poetryWorksPanel { container-type:inline-size; }
#poetryPicker #poetryWorksTitle { margin-bottom:8px; }
#poetryWorks { display:grid; grid-template-columns:minmax(0,1fr); gap:0 16px; }
#poetryWorks button { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:4px 10px; background:transparent; border:0; border-bottom:1px solid var(--line); border-radius:0; padding:10px 8px; text-align:left; }
#poetryWorks button :is(strong, small, span) { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#poetryWorks button strong { grid-column:1 / -1; color:var(--ink); font:500 15px/1.5 var(--serif); }
#poetryWorks button span { margin:0; color:var(--muted); font:12px/1.5 var(--sans); }
#poetryPicker .poetry-author-search select { flex:0 0 auto; min-width:68px; padding:8px; border:1px solid var(--line); border-radius:6px; background:var(--card); color:var(--ink); font:14px var(--sans); }
#poetryPicker .poetry-author-search button { flex-shrink:0; }
#poetryPicker .poetry-search-hint { margin:-8px 0 0; color:var(--muted); font:12px/1.6 var(--sans); }
#poetryPicker :is(input, select):focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
#poetryListStatus { min-height:20px; margin:0 0 8px; line-height:1.7; overflow-wrap:anywhere; }
#poetryWorks button small { display:block; max-width:9em; margin:0; color:var(--muted); font:11px/1.5 var(--sans); }
#poetryWorks mark { background:color-mix(in srgb, var(--accent) 28%, var(--card)); color:var(--ink); border-radius:2px; padding:1px 2px; }
#poetryWorks .poetry-empty { padding:32px 12px; margin:0; color:var(--muted); font:14px/1.8 var(--sans); }
.poetry-skeleton { padding:13px 8px; border-bottom:1px solid var(--line); }
.poetry-skeleton i { display:block; height:16px; width:42%; border-radius:3px; background:var(--line); opacity:.45; }
.poetry-skeleton i + i { width:82%; height:12px; margin-top:10px; opacity:.25; }
@container (min-width:520px) {
  #poetryWorks { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
#poetryStatus:empty { display:none; }
#poetryWorks button:hover, #poetryWorks button[aria-pressed=true] { background:var(--card); box-shadow:none; }
#poetryPicker button:focus-visible, #previewSettings button:focus-visible, .library button:focus-visible, .poet-search input:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
#poetryPicker button:disabled { opacity:.5; cursor:wait; }
@media(max-width:560px) {
  #poetryPicker .poetry-picker-columns { grid-template-columns:80px minmax(0,1fr); gap:12px; }
  #poetryPicker .poetry-chips { grid-template-columns:minmax(0,1fr); }
  #poetryPicker h2 { font-size:19px; }
  #poetryWorks button { padding:8px 4px; column-gap:8px; }
  #poetryPicker .poetry-author-search { gap:6px; }
  #poetryPicker .poetry-author-search input { font-size:16px; padding:8px; }
  #poetryPicker .poetry-author-search select { min-width:60px; padding:6px; }
  #poetryPicker .poetry-author-search button { padding:8px 10px; }
  .library-heading { padding-top:16px; }
}
@media(prefers-reduced-motion:reduce) { body .library .font-card { transition:none; } }
body.is-poetry #copyRow .poet-search,
body.is-poetry #copyRow #poetButtons,
body.is-poetry #copyRow #workButtons,
body.is-poetry #copyRow .work-section-label,
body.is-poetry #poetSearchEmpty { display:none; }
body.is-zh #copyRow::before, body.is-zh #copyRow::after { display:none; }
.current-poem { display:none; }
body.is-poetry .current-poem { display:block; padding:16px 0; border-bottom:1px solid var(--line); margin-bottom:16px; }
.current-poem h3 { margin:8px 0; color:var(--ink); font:500 18px var(--serif); overflow-wrap:anywhere; }
.current-poem p { margin:6px 0; color:var(--muted); font-size:12px; line-height:1.7; }
body.is-poetry #previewSettings #poetryOpen { font-size:12px; }
.library-heading, .library > .selected, .library > .toolbar { flex-shrink:0; }

/* Sidebar groups use whitespace; focus uses one border rather than two rings. */
body.is-zh #copyRow .works-head { margin:0; gap:8px; }
body.is-zh #copyRow #poetButtons { gap:6px; }
body.is-zh #copyRow .poet-search input:focus-visible { outline:none; border-color:var(--accent); box-shadow:none; }
body.is-zh #workButtons .work-chip:hover:not(.active) { background:var(--panel); }

/* Compact library controls: show specimens before secondary metadata. */
.library-heading { padding:12px 14px 8px; }
.library-heading .section-kicker { display:none; }
.library-heading h2 { font-size:16px; margin:0; }
.library .selected { margin:0 14px 8px; padding:8px 10px; border:0; background:var(--panel); }
.library .selected > .section-kicker { display:none; }
.library .selected-head { margin:0; gap:8px; }
.library .selected-head strong { font-size:12px; }
.library .selected #selectedHint { margin:4px 0 0; font-size:10px; }
.font-details { display:none; margin-top:6px; }
body.has-font .font-details { display:block; }
.font-details summary { cursor:pointer; color:var(--muted); font-size:11px; }
body .library .toolbar { gap:8px; padding-bottom:8px; }
body .library .search { min-height:34px; }
body .library .search input { padding:6px 0; }
body .library .tabs { gap:5px; }
body .library .tab { padding:6px 9px; }
body .library .filter-heading { flex-basis:auto; margin:0 0 0 8px; align-self:center; font-size:10px; }
body .library .toolbar-tools { padding-top:6px; }
body .library .font-grid:not(.list) { grid-template-columns:repeat(auto-fill,148px); justify-content:center; align-content:start; }
@media(max-width:760px) {
  body .library .font-grid:not(.list) { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:4px 12px 16px; }
  .library-heading { padding-top:12px; }
  .library .selected-head { align-items:flex-start; }
  .library .font-actions { flex-wrap:wrap; }
  body .library .filter-heading { flex-basis:100%; margin:4px 0 0; }
}
/* Stationary controls with independently scrolling selections. */
.panel-collapse { position:absolute; top:10px; z-index:7; width:26px; height:28px; padding:0; border:1px solid var(--line); border-radius:6px; background:var(--panel); color:var(--muted); cursor:pointer; font-size:20px; }
.panel-collapse:hover, .panel-collapse:focus-visible { color:var(--accent); border-color:var(--accent); }
#settingsCollapse { left:6px; }
#libraryCollapse { right:6px; }
.panel-collapse[hidden] { display:none; }
.work.settings-collapsed #previewSettings, .work.library-collapsed #library { display:none; }
.work.settings-collapsed .preview-stage { padding-left:38px; }
.library-heading { padding-right:42px; }
@media(min-width:1280px) {
 body:not(.is-theater) #previewSettings { display:flex; flex-direction:column; overflow:hidden; }
 body:not(.is-theater) .work.settings-collapsed #previewSettings { display:none; }
 body:not(.is-theater) #previewSettings .sidebar-title { padding-left:22px; flex-shrink:0; }
 body:not(.is-theater) #previewSettings .preview-sizing, body:not(.is-theater) #previewSettings .preview-bar { flex-shrink:0; }
 body:not(.is-theater).is-zh:not(.is-poetry) #copyRow { display:flex; flex-direction:column; flex:1; min-height:0; overflow:hidden; margin-top:18px; }
 body:not(.is-theater) #copyRow .works-head, body:not(.is-theater) #copyRow .poet-search, body:not(.is-theater) #copyRow .work-section-label { flex-shrink:0; }
 body:not(.is-theater).is-zh #copyRow #poetButtons { flex-shrink:0; max-height:126px; overflow-y:auto; overscroll-behavior:contain; }
 body:not(.is-theater).is-zh #copyRow #workButtons { flex:1; min-height:80px; overflow-y:auto; overscroll-behavior:contain; padding-right:6px; }
 body:not(.is-theater).is-poetry #copyRow { min-height:0; overflow-y:auto; overscroll-behavior:contain; }
 body:not(.is-theater) #copyRow .work-section-label { margin-top:16px; }
}
#poetButtons, #workButtons, #poetryControls { scrollbar-width:thin; scrollbar-color:var(--line) transparent; }
body.is-zh #copyRow #workButtons { flex-wrap:nowrap; }
#workButtons > .work-chip { flex-shrink:0; }
.chrome-right button.chrome-link { background:transparent; cursor:pointer; }
#offlineDialog { box-sizing:border-box; width:min(440px,calc(100vw - 32px)); max-height:calc(100dvh - 40px); overflow:auto; padding:28px; border:1px solid var(--line); border-radius:18px; background:var(--panel); color:var(--ink); box-shadow:0 24px 100px #0005; }
#offlineDialog::backdrop { background:#0008; backdrop-filter:blur(5px); }
#offlineDialog .offline-head { display:flex; align-items:center; justify-content:space-between; gap:16px; }
#offlineDialog form { margin:0; }
#offlineDialog .offline-eyebrow { font-size:10px; letter-spacing:.18em; color:var(--accent); }
#offlineDialog h2 { margin:4px 0 0; font:600 24px var(--serif); letter-spacing:.04em; }
#offlineDialog p { font-size:12px; line-height:1.7; color:var(--muted); margin:0; }
#offlineDialog #offlineIntro { margin:10px 0 22px; }
#offlineDialog button { font:inherit; font-size:12px; cursor:pointer; transition:background .15s; }
#offlineDialog .offline-close { display:grid; place-items:center; width:32px; height:32px; padding:0; border:0; border-radius:50%; background:transparent; color:var(--muted); font:24px/1 sans-serif; }
#offlineDialog .offline-close:hover { background:var(--line); color:var(--ink); }
#offlineDialog button:focus-visible, #offlineDialog summary:focus-visible { outline:2px solid var(--accent); outline-offset:4px; }
#offlineDialog .offline-summary { padding:20px; background:color-mix(in srgb,var(--ink) 4%,var(--panel)); border-radius:12px; }
#offlineDialog .offline-count { display:flex; align-items:baseline; gap:10px; }
#offlineDialog .offline-count strong { font:400 42px/1.1 var(--serif); font-variant-numeric:tabular-nums; }
#offlineDialog .offline-count span { font-size:12px; color:var(--muted); }
#offlineDialog #fontCacheStatus { margin:8px 0 18px; }
#offlineDialog .offline-readiness { display:flex; gap:8px; align-items:center; font-size:11px; color:var(--muted); }
.offline-dot { width:6px; height:6px; border-radius:50%; background:var(--muted); flex-shrink:0; }
.offline-ready .offline-dot { background:#77a77b; }
#offlineDialog .offline-manage { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:22px 0; }
#offlineDialog h3 { font:500 13px/1.5 sans-serif; margin:0 0 4px; }
#offlineDialog #persistCache { flex-shrink:0; border:1px solid var(--line); background:var(--ink); color:var(--panel); padding:9px 13px; border-radius:8px; }
#offlineDialog .offline-help { padding:0 0 20px; color:var(--muted); font-size:12px; }
#offlineDialog summary { cursor:pointer; width:fit-content; }
#offlineDialog .offline-help p { margin-top:10px; }
#offlineDialog .offline-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding-top:16px; border-top:1px solid var(--line); }
#offlineDialog .offline-footer span { font-size:10px; color:var(--muted); }
#offlineDialog #clearFontCache { flex-shrink:0; border:0; padding:6px 0 6px 8px; background:transparent; color:var(--accent); }
#offlineDialog #storageStatus:not(:empty) { margin-top:16px; padding:10px 12px; border-radius:8px; background:color-mix(in srgb,var(--accent) 8%,var(--panel)); color:var(--ink); }
@media(max-width:480px) { #offlineDialog { padding:22px; } #offlineDialog .offline-manage p { max-width:170px; } }
@media(min-width:1280px) {
 body:not(.is-theater) #previewSettings { padding:16px; }
 body:not(.is-theater) #previewSettings .sidebar-title { margin-bottom:12px; }
 body:not(.is-theater) #previewSettings .preview-sizing { gap:6px; padding-bottom:10px; margin-bottom:10px; }
 body:not(.is-theater) #previewSettings .preview-bar { gap:10px; }
 body:not(.is-theater) #previewSettings .lang-rail { gap:4px; }
 body:not(.is-theater) #previewSettings .lang-chip { min-height:28px; padding:5px 8px; }
 body:not(.is-theater) #copyRow .poet-search { margin:12px 0 8px; gap:6px; }
 body:not(.is-theater).is-zh #copyRow #poetButtons { max-height:84px; }
 body:not(.is-theater) #copyRow .work-section-label { margin:12px 0 8px; }
 body:not(.is-theater) #copyRow .works-head { gap:4px; }
}

/* Compact specimens; keep metadata and actions readable. */
body .library .font-grid:not(.list) .font-card { padding-top:24px; }
body .library .font-grid:not(.list) .poster { height:54px; min-height:54px; aspect-ratio:auto; padding:4px 8px; }
body .library .font-grid:not(.list) .poster.has-poster { padding:0; }
body .library .font-grid:not(.list) .poster-img { object-fit:contain; }
body .library .font-grid:not(.list) .card-body { padding:6px 0 0; gap:4px; }
body .library .font-grid:not(.list) .font-name { min-height:28px; line-height:14px; margin:0 8px; }
body .library .font-grid:not(.list) .poster-badges { margin:0 5px 2px; min-height:14px; gap:2px; }
body .library .font-grid:not(.list) .card-dl { min-height:28px; }
/* Dialog-local contrast tokens preserve the surrounding page palette. */
#offlineDialog { --panel:#211f1a; --muted:#c7c0b2; --line:#625c50; --accent:#ef9874; --ink:#fffaf0; }
body.light #offlineDialog { --panel:#fffdf8; --muted:#575044; --line:#a69a86; --accent:#9c3e1c; --ink:#252018; }
#offlineDialog .offline-summary { background:color-mix(in srgb,var(--ink) 7%,var(--panel)); }
#offlineDialog::backdrop { background:#000b; backdrop-filter:blur(5px); }
#offlineDialog .offline-footer span { font-size:11px; }
#offlineDialog .offline-eyebrow { font-size:11px; }

/* Shared high-contrast surface for every site dialog. */
body :is(dialog, #offlineDialog, #poetryPicker, #gameDialog) {
 --panel:#25221c; --card:#302c24; --bg:#1c1915;
 --ink:#fffaf0; --muted:#d4cbbb; --line:#978975; --accent:#ffad82;
 background:var(--panel); color:var(--ink);
 border:2px solid var(--line);
 box-shadow:0 0 0 1px #e8cf9b26, 0 24px 100px #0009;
}
body.light :is(dialog, #offlineDialog, #poetryPicker, #gameDialog) {
 --panel:#fffdf8; --card:#f1ece2; --bg:#f6f1e7;
 --ink:#252018; --muted:#574c3d; --line:#85735c; --accent:#963b18;
}
body :is(dialog, #offlineDialog, #poetryPicker, #gameDialog)::backdrop { background:#000b; backdrop-filter:blur(5px); }
body dialog input::placeholder { color:var(--muted); opacity:1; }
body dialog :is(.chrome-link,.work-chip) { border:1px solid var(--line); color:var(--ink); background:var(--card); }
body dialog :is(button,input,summary,a):focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
body dialog :is(.chrome-link,.work-chip):hover { border-color:var(--ink); }

/* Reading controls: one sizing rail and compact font choices. */
.library > .preview-sizing { display:flex; flex-direction:column; align-items:stretch; gap:8px; padding:12px 16px 6px; margin:0; border:0; }
.sizing-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; padding-right:26px; }
.sizing-heading > label, .library-heading h2 { color:var(--ink); font:600 16px/1.5 var(--sans); }
.sizing-heading > div { display:flex; align-items:center; gap:10px; }
.sizing-heading output { font:12px/1.5 var(--sans); font-variant-numeric:tabular-nums; color:var(--muted); }
.library .preview-sizing #previewAutoSize { padding:4px 8px; min-height:26px; border:0; border-radius:6px; background:transparent; font:11px var(--sans); color:var(--muted); }
.library .preview-sizing #previewAutoSize[aria-pressed=true] { color:var(--accent); background:color-mix(in srgb,var(--accent) 10%,transparent); }
.sizing-track { display:flex; align-items:center; gap:12px; height:38px; padding:0 14px; border-radius:24px; background:color-mix(in srgb,var(--ink) 6%,var(--panel)); }
.sizing-track > span { color:var(--muted); font:500 13px/1 var(--sans); }
.sizing-track > span:last-child { font-size:21px; }
.library .preview-sizing input { appearance:none; -webkit-appearance:none; flex:1; min-width:0; width:100%; height:4px; margin:0; border:0; border-radius:8px; background:linear-gradient(to right,var(--accent) var(--size-progress,27%),var(--line) var(--size-progress,27%)); cursor:pointer; }
.library .preview-sizing input::-webkit-slider-thumb { appearance:none; -webkit-appearance:none; width:26px; height:26px; border:2px solid var(--panel); border-radius:50%; background:var(--ink); box-shadow:0 2px 5px #0003; }
.library .preview-sizing input::-moz-range-thumb { width:22px; height:22px; border:2px solid var(--panel); border-radius:50%; background:var(--ink); box-shadow:0 2px 5px #0003; }
.library .preview-sizing input:focus-visible { outline:none; }
.sizing-track:has(input:focus-visible) { outline:2px solid var(--accent); outline-offset:3px; }
.library #previewOverflowHint { font:11px/1.5 var(--sans); }
.library #previewOverflowHint[hidden] { display:none; }
.library-heading { padding:8px 16px 8px; }
.library-hint { font:11px var(--sans); letter-spacing:0; }
.library > .selected { margin:0 16px 10px; background:transparent; padding:0; }
body:not(.has-font) .library > .selected { display:none; }
body .library .toolbar { padding:0 16px 6px; gap:6px; }
body .library .search { min-height:32px; border-radius:9px; background:var(--card); }
body .library .tabs { display:flex; flex-direction:column; align-items:stretch; gap:6px; width:100%; }
.scope-tabs { display:flex; gap:3px; padding:4px; border-radius:24px; background:color-mix(in srgb,var(--ink) 6%,var(--panel)); }
body .library .scope-tabs .tab { flex:1; min-width:0; padding:6px 4px; border:0; border-radius:20px; background:transparent; color:var(--muted); font:12px/1.4 var(--sans); white-space:nowrap; }
body .library .scope-tabs .tab.active { background:var(--card); color:var(--ink); box-shadow:0 2px 6px #0002; }
.style-tabs { display:flex; flex-wrap:wrap; align-items:center; gap:4px; }
body .library .style-tabs .tab { padding:5px 10px; border:0; border-radius:6px; background:transparent; font:12px/1.4 var(--sans); }
body .library .style-tabs .tab.active { color:var(--accent); background:color-mix(in srgb,var(--accent) 12%,transparent); }
body .library .toolbar-tools { padding-top:0; border:0; }
body .library .font-grid:not(.list) .font-card { padding:12px 0 0; border:1px solid transparent; border-radius:12px; background:var(--card); background-image:none; }
body .library .font-grid:not(.list) .font-card:hover { background:var(--card-hover); border-color:var(--line); }
body .library .font-grid:not(.list) .font-card.is-current { background:color-mix(in srgb,var(--accent) 7%,var(--card)); border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); }
body .library .font-grid:not(.list) .poster { height:60px; min-height:60px; padding:4px 10px; background:transparent; }
body .library .font-grid:not(.list) .poster.has-poster { padding:0 4px; }
body .library .font-grid:not(.list) .poster-img { mix-blend-mode:lighten; }
body.light .library .font-grid:not(.list) .poster-img { filter:invert(1) contrast(1.25); mix-blend-mode:multiply; }
body .library .font-grid:not(.list) .specimen-name { font-size:16px; font-weight:400; line-height:1.5; }
body .library .font-grid:not(.list) .font-name { display:none; }
body .library .font-grid:not(.list) .card-body { display:grid; grid-template-columns:minmax(0,1fr) 28px; align-items:center; min-height:36px; padding:0 30px 5px 8px; gap:2px; text-align:left; }
body .library .font-grid:not(.list) .poster-badges { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:1px; min-width:0; margin:0; }
body .library .font-grid:not(.list) .poster-badges > span { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:0; font-size:9px; color:var(--muted); }
body .library .font-grid:not(.list) .card-dl { min-height:28px; border:0; border-radius:6px; font-size:10px; }
body .library .font-grid:not(.list) .favorite { top:auto; bottom:7px; right:5px; width:24px; height:28px; font-size:15px; }
body .library .font-grid:not(.list) .now { top:4px; left:8px; font:9px var(--sans); }
@media(max-width:760px) {
 .sizing-heading { padding-right:0; }
 .library > .preview-sizing { padding-top:20px; }
 body .library .font-grid:not(.list) .font-card { min-height:110px; }
}
.local-font-panel { flex-shrink:0; margin:0 14px 12px; padding:10px 12px; border:1px solid var(--line); border-radius:6px; background:var(--panel); }
.local-font-panel > div { display:flex; gap:8px; flex-wrap:wrap; }
.local-font-panel button { padding:6px 10px; border:1px solid var(--muted); border-radius:5px; background:var(--card); color:var(--ink); cursor:pointer; font:12px/1.5 var(--sans); }
.local-font-panel button:disabled { opacity:.55; cursor:default; }
.local-font-panel button[hidden] { display:none; }
.local-font-panel p { margin:7px 0 0; color:var(--muted); font:11px/1.6 var(--sans); }
.local-font-panel button:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
