/* Library page (#/). Uses the tokens in tokens.css. */
.hm { max-width: 1440px; margin: 0 auto; padding: 18px 24px 56px; font-size: 13px; }
.hm .dim { color: var(--faint) !important; }

/* message banner */
.hm-msg { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; margin-bottom: 14px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--chrome); color: var(--text-2); font-weight: 600; }
.hm-msg.bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-text); }
.hm-msg.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); }
.hm-msg .txt { flex: 1; min-width: 0; }
.hm-msg > .i { width: 16px; height: 16px; }
/* Papers from the previous PaperDesk that did not fit in this browser: stays until they are brought over */
.hm-mig { display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 12px; margin-bottom: 14px; border-radius: var(--radius); border: 1px solid var(--warn-line); background: var(--warn-bg); }
.hm-mig-ic { display: grid; place-items: center; align-self: flex-start; color: var(--warn); padding-top: 1px; }
.hm-mig-ic .i { width: 18px; height: 18px; }
.hm-mig-t { flex: 1; min-width: 0; line-height: 1.45; }
.hm-mig-t b { display: block; color: var(--warn-text); font-weight: 750; }
.hm-mig-t span { display: block; color: var(--text-2); margin-top: 1px; }
.hm-mig-acts { display: flex; align-items: center; gap: 8px; flex: none; }
.hm-mig-acts .btn .i { width: 15px; height: 15px; }

/* head: title, totals, add */
.hm-head { display: flex; align-items: flex-end; gap: 20px; margin: 0 0 16px; }
.hm-title { flex: none; }
.hm-title h1 { margin: 5px 0 0; font-size: 42px; }
.hm-kpis { display: flex; margin-left: auto; background: var(--chrome); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.hm-kpi { padding: 8px 18px 8px 14px; min-width: 112px; }
.hm-kpi + .hm-kpi { border-left: 1px solid var(--line); }
.hm-kpi b { display: block; font-size: 20px; font-weight: 800; line-height: 1.15; font-stretch: 92%; white-space: nowrap; }
.hm-kpi b span { color: var(--faint); font-size: 14px; font-weight: 700; }
.hm-kpi small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.hm-kpi.skel { height: 48px; width: 120px; border-radius: 0; }
.hm-kpi.dim b { color: var(--faint); }
.hm-add { flex: none; }
.hm-kpis[hidden] + .hm-add { margin-left: auto; }

/* tabs: your papers / find a paper (the official papers catalog, app/catalog.js) */
.hm-tabs { display: flex; align-items: flex-end; gap: 4px; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.hm-tabs [role="tab"] { height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px 0 10px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--muted); font: inherit; font-size: 14px; white-space: nowrap; flex: none; cursor: pointer; }
.hm-tabs [role="tab"] b { font-weight: 800; }
.hm-tabs [role="tab"] .i { width: 17px; height: 17px; color: var(--faint); }
.hm-tabs [role="tab"]:hover { color: var(--text); }
.hm-tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.hm-tabs [role="tab"][aria-selected="true"] .i { color: var(--accent); }
:root[data-theme="light"] .hm-tabs [role="tab"][aria-selected="true"] .i { color: var(--text); }
.hm-tabs [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.hm-tabs .n { min-width: 20px; height: 19px; padding: 0 6px; border-radius: 10px; background: var(--raised); color: var(--muted); font-size: 11px; font-weight: 750;
  font-variant-numeric: tabular-nums; display: inline-grid; place-items: center; }
.hm-tabs .n[hidden] { display: none; }
.hm-tabs [aria-selected="true"] .n { background: var(--accent); color: var(--accent-ink); }
/* first visit, on the catalog: what PaperDesk does, in one strip */
.hm-intro { display: flex; align-items: center; gap: 10px 28px; flex-wrap: wrap; margin: 0 0 18px; padding: 14px 16px; background: var(--chrome);
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); }
.hm-intro-t { flex: 1 1 360px; min-width: 0; }
.hm-intro h2 { margin: 0 0 3px; font-size: 16px; font-weight: 800; line-height: 1.3; }
.hm-intro p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; max-width: 70ch; }
/* the steps are plain numbered text with chevrons between them, nothing that looks like a button */
.hm-intro-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; row-gap: 4px; color: var(--text-2); font-size: 12.5px; font-weight: 700; }
.hm-intro-steps li { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.hm-intro-steps li + li::before { content: ""; align-self: center; width: 5px; height: 5px; margin: 0 12px 0 9px; border-top: 1.5px solid var(--faint); border-right: 1.5px solid var(--faint); transform: rotate(45deg); }
.hm-intro-steps i { font-style: normal; }
.hm-intro-steps b { color: var(--accent); font-weight: 850; font-variant-numeric: tabular-nums; }
.hm-cat { min-width: 0; }
/* inside the library the page already has its heading: the catalog keeps only its one-line lede,
   and on a first visit the intro above says it, so the catalog's head goes entirely */
.hm-cat .pdc-ttl { display: none; }
.hm-find.has-intro .pdc-head { display: none; }
.hm-cat-boards { width: min(100%, 520px); margin-top: 8px; text-align: left; }

.hm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.hm-main { min-width: 0; }

/* upload queue */
.hm-queue { background: var(--chrome); border: 1px solid var(--line-strong); border-radius: var(--radius); margin: 0 0 14px; overflow: hidden; }
.q-head { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 6px 4px 14px; border-bottom: 1px solid var(--line); }
.q-head b { flex: 1; font-weight: 800; font-size: 13.5px; }
.q-head b span { margin-left: 10px; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.q-rows { max-height: 280px; overflow-y: auto; }
.q-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) 150px auto; gap: 12px; align-items: center; padding: 8px 14px; }
.q-row + .q-row { border-top: 1px solid var(--line-soft); }
.q-ic { color: var(--faint); display: grid; }
.q-ic .i { width: 18px; height: 18px; }
.q-row.busy .q-ic { color: var(--accent); }
.q-row.done .q-ic { color: var(--good); }
.q-row.warn .q-ic { color: var(--warn); }
.q-row.error .q-ic { color: var(--bad); }
.q-txt { min-width: 0; }
.q-txt b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-txt small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; }
.q-row.error small { color: var(--bad-text); }
.q-row.warn small { color: var(--warn-text); }
.q-row.wait .q-txt b { color: var(--muted); }
.q-bar { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.q-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .25s ease; }
.q-row.done .q-bar i { background: var(--good); }
.q-row.warn .q-bar i { background: var(--warn); }
.q-row:not(.busy) .q-bar { visibility: hidden; }
.q-act { min-width: 0; }

/* continue card */
.hm-cont { position: relative; display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 18px; padding: 14px 14px 14px 16px; margin: 0 0 16px;
  background: var(--chrome); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius-lg); }
.hm-cont.skel { border-left-color: var(--line); }
.hm-cont.drop-on { box-shadow: 0 0 0 1px var(--accent); border-color: var(--accent); }
.cont-cover { display: block; width: 112px; aspect-ratio: 595 / 842; border-radius: 3px; overflow: hidden; background: #f1f1f1; box-shadow: 0 0 0 1px var(--line-strong); align-self: start; }
.cont-cover img, .pc-cover img, .pr-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity .2s; }
.cont-cover img.in, .pc-cover img.in, .pr-cover img.in { opacity: 1; }
.cont-body { min-width: 0; display: flex; flex-direction: column; }
.cont-body h2 { margin: 4px 0 2px; font-size: 20px; font-weight: 800; line-height: 1.2; }
.cont-body h2 a { text-decoration: none; }
.cont-body h2 a:hover { color: var(--accent); }
.cont-sub { color: var(--muted); font-size: 12.5px; }
.cont-stats { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 14px 0; }
.cs b { display: block; font-size: 24px; font-weight: 850; line-height: 1.05; font-stretch: 90%; white-space: nowrap; }
.cs b span { color: var(--faint); font-size: 15px; font-weight: 700; }
.cs b.dim { font-size: 17px; line-height: 1.4; }
.cs small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.cs .pbar { display: block; width: 130px; margin-top: 7px; }
.cont-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.cont-step { color: var(--muted); font-size: 12.5px; }
.cont-step.warn { color: var(--warn-text); }
.cont-step.good { color: var(--text-2); }
.cont-when { display: flex; align-items: center; gap: 2px; align-self: start; color: var(--faint); font-size: 12px; white-space: nowrap; margin: -4px -4px 0 0; }

/* tools: search, filters, sort, layout; then the status tabs */
.hm-tools { margin: 0 0 12px; }
.hm-tools-a { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hm-search { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 7px 0 10px; flex: 1 1 220px; max-width: 420px; margin-right: auto; min-width: 0;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--chrome); color: var(--faint); cursor: text; }
.hm-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.hm-search .i { width: 16px; height: 16px; }
.hm-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: 0; color: var(--text); height: 100%; }
.hm-search input::placeholder { color: var(--faint); }
.hm-search input::-webkit-search-cancel-button { filter: grayscale(1); }
.hm-search:focus-within kbd { display: none; }
.hm-seg { display: flex; gap: 4px; margin-top: 10px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.hm-seg::-webkit-scrollbar { display: none; }
.hm-seg button { height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 700; white-space: nowrap; font-size: 13px; flex: none; }
.hm-seg button:hover { color: var(--text); }
.hm-seg i { font-style: normal; }
.hm .l-short { display: none; }
.hm-seg button span { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--raised); color: var(--muted); font-size: 11px; font-weight: 750; font-variant-numeric: tabular-nums; display: inline-grid; place-items: center; }
.hm-seg button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.hm-seg button[aria-selected="true"] span { background: var(--accent); color: var(--accent-ink); }
.hm-tools .select { height: 32px; max-width: 180px; }
.hm-sort { display: inline-flex; align-items: center; gap: 6px; color: var(--faint); }
.hm-sort .i { width: 16px; height: 16px; }
.hm-viewsw { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--chrome); }
.hm-viewsw .ib { width: 28px; height: 26px; color: var(--muted); }
.hm-viewsw .ib[aria-pressed="true"] { background: var(--hover); color: var(--accent); }
:root[data-theme="light"] .hm-viewsw .ib[aria-pressed="true"] { color: var(--text); }

/* cards */
.hm-list.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 370px), 1fr)); gap: 10px; }
.pc { position: relative; display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; gap: 14px; padding: 12px; min-height: 136px;
  background: var(--chrome); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: border-color .12s, background-color .12s; }
.pc:hover { border-color: var(--line-strong); background: var(--subtle); }
:root[data-theme="light"] .pc:hover { background: #fbfbfc; }
.pc:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pc.drop-on, .pr.drop-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.pc-cover { display: block; width: 78px; aspect-ratio: 595 / 842; border-radius: 3px; overflow: hidden; background: #f1f1f1; box-shadow: 0 0 0 1px var(--line-strong); align-self: start; }
.pc-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pc-meta { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 11.5px; font-weight: 600; color: var(--faint); padding-right: 22px; }
.pc-meta > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-board { flex: none; font-size: 10px; font-weight: 850; letter-spacing: .8px; text-transform: uppercase; font-stretch: 87%; color: var(--text); padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--raised); }
.pc-title { display: block; margin-top: 3px; font-size: 17px; font-weight: 800; line-height: 1.2; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc:hover .pc-title { color: var(--accent); }
:root[data-theme="light"] .pc:hover .pc-title { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.pc-sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 17px; }
.pc-prog { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pc-prog .pbar { width: 104px; }
.pc-foot { display: flex; align-items: center; gap: 10px; margin-top: 7px; color: var(--faint); font-size: 12px; min-width: 0; }
.pc-time { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pc-time .i { width: 13px; height: 13px; }
.pc-when { margin-left: auto; white-space: nowrap; }
.pc-score { display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-end; text-align: right; min-width: 64px; padding-bottom: 1px; }
.pc-score b { font-size: 26px; font-weight: 850; line-height: 1; font-stretch: 85%; white-space: nowrap; }
.pc-score b span { color: var(--faint); font-size: 14px; font-weight: 700; }
.pc-score small { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; color: var(--muted); font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.pc-none { color: var(--faint); font-size: 12px; white-space: nowrap; }
.pc-more { position: absolute; top: 6px; right: 6px; color: var(--faint); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; background: var(--faint); }
.dot.good { background: var(--good); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.hm-tagbtn { cursor: pointer; font-family: inherit; }
.hm-addscheme { border-style: dashed; color: var(--muted); }
.hm-addscheme:hover { color: var(--text); border-color: var(--accent); border-style: solid; }
.tag.warn.hm-tagbtn:hover { border-color: var(--warn); }

/* rows */
.hm-list.rows { background: var(--chrome); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pr { display: grid; grid-template-columns: 30px minmax(0, 1fr) 132px 96px 92px 92px 28px; gap: 14px; align-items: center; padding: 7px 8px 7px 12px; cursor: pointer; border: 1px solid transparent; border-top-color: var(--line-soft); }
.pr:first-child { border-top-color: transparent; }
.pr:hover:not(.pr-head) { background: var(--hover); }
.pr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pr-head { cursor: default; padding-top: 8px; padding-bottom: 8px; background: var(--rail); font-size: 10.5px; font-weight: 750; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); font-stretch: 87%; }
.pr-cover { display: block; width: 30px; height: 42px; border-radius: 2px; overflow: hidden; background: #f1f1f1; box-shadow: 0 0 0 1px var(--line-strong); }
.pr-main { min-width: 0; }
.pr-main b { display: block; font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-main small { display: block; color: var(--faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-prog { display: flex; align-items: center; gap: 8px; }
.pr-prog .pbar { width: 60px; }
.pr-prog small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.pr-score { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.pr-score b { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pr-score b span { color: var(--faint); font-size: 12px; }
.pr-score small { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 11.5px; }
.pr-score small .dot { display: none; }
.pr-when { color: var(--faint); font-size: 12px; white-space: nowrap; }

.hm-none { grid-column: 1 / -1; display: grid; justify-items: center; gap: 6px; padding: 40px 16px; text-align: center; color: var(--muted); background: var(--chrome); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.hm-none .i { width: 26px; height: 26px; color: var(--faint); }
.hm-none b { color: var(--text); font-size: 14px; }
.hm-none .btn { margin-top: 6px; }
.hm-list.rows .hm-none { border: 0; border-radius: 0; }

/* side column */
.hm-side { position: sticky; top: calc(var(--top-h) + 16px); display: grid; gap: 12px; }
.hs-card { background: var(--chrome); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.hs-h { margin: 0 0 10px; font-size: 11px; font-weight: 750; letter-spacing: 1.3px; text-transform: uppercase; font-stretch: 87%; color: var(--muted); }
.hs-add { border-style: dashed; border-color: var(--line-strong); transition: border-color .12s, background-color .12s; }
.hm.dragging .hs-add, .hm.dragging .he-drop { border-color: var(--accent); background: var(--accent-soft); }
.hs-add-top { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.hs-ic { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.hs-ic .i { stroke-width: 2; }
.hs-add-top b { display: block; font-size: 14px; font-weight: 800; margin-bottom: 2px; }
.hs-add-top small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.hs-add .btn { width: 100%; }
.hs-list { list-style: none; margin: 12px 0 0; padding: 11px 0 0; border-top: 1px solid var(--line); display: grid; gap: 7px; }
.hs-list li { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12.5px; }
.hs-list .i { width: 15px; height: 15px; color: var(--faint); }
.hs-list b { color: var(--text-2); font-weight: 700; }
.hs-boards { display: grid; gap: 6px; }
.hs-boards a { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--rail); color: var(--text); text-decoration: none; transition: border-color .12s; }
.hs-boards a:hover { border-color: var(--accent); }
.hs-boards b { font-size: 13.5px; font-weight: 800; }
.hs-boards span { grid-row: 2; color: var(--muted); font-size: 12px; }
.hs-boards .i { grid-row: 1 / 3; grid-column: 2; width: 16px; height: 16px; color: var(--faint); }
.hs-boards a:hover .i { color: var(--accent); }
.hs-user { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.hs-user b { display: block; font-size: 13.5px; }
.hs-user small { display: block; color: var(--muted); font-size: 12px; }
.hs-p { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.hs-signin { width: 100%; margin-bottom: 12px; }
.hs-switch { position: relative; display: flex; gap: 10px; align-items: flex-start; padding-top: 12px; border-top: 1px solid var(--line); cursor: pointer; }
.hs-switch.off { cursor: default; opacity: .6; }
.hs-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hs-switch .track { position: relative; width: 32px; height: 18px; margin-top: 1px; border-radius: 9px; background: var(--line-strong); flex: none; transition: background-color .15s; }
.hs-switch .track i { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.hs-switch input:checked + .track { background: var(--accent); }
.hs-switch input:checked + .track i { transform: translateX(14px); background: var(--accent-ink); }
.hs-switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.hs-switch .lbl b { display: block; font-size: 13px; font-weight: 700; }
.hs-switch .lbl small { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 1px; }
.hs-note { display: flex; gap: 9px; margin: 0 2px; color: var(--faint); font-size: 12px; line-height: 1.55; }
.hs-note .i { width: 15px; height: 15px; margin-top: 2px; }
.hs-store { display: block; margin-top: 4px; font-style: normal; color: var(--muted); }
.hs-findlink { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; margin: 0 0 8px; padding: 9px 10px 9px 12px;
  border: 1px solid var(--accent); border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.hs-findlink:hover { background: var(--hover); }
.hs-findlink > .i { width: 17px; height: 17px; color: var(--accent); }
:root[data-theme="light"] .hs-findlink > .i { color: var(--text); }
.hs-findlink b { display: block; font-size: 13.5px; font-weight: 800; }
.hs-findlink small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; }
.hs-classic { margin: -4px 2px 0 26px; color: var(--faint); font-size: 12px; }
.hs-classic a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.hs-classic a:hover { color: var(--text); }
.hs-sync.good::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 6px 1px 0; border-radius: 50%; background: var(--good); }
.hs-sync.warn { color: var(--warn-text); }

/* empty library */
.he-drop { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: center; padding: 32px; background: var(--chrome); border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg); transition: border-color .12s, background-color .12s; }
.he-main { display: grid; justify-items: start; gap: 12px; min-width: 0; }
.he-how { min-width: 0; }
.he-ic { width: 52px; height: 52px; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.he-ic .i { width: 28px; height: 28px; stroke-width: 2; }
.he-drop h2 { margin: 6px 0 0; font-size: clamp(34px, 4.2vw, 50px); max-width: 15ch; }
.he-drop p { margin: 0; max-width: 62ch; color: var(--muted); font-size: 15px; line-height: 1.55; }
.he-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-top: 8px; }
.he-or { color: var(--faint); font-size: 13px; }
.he-block { background: var(--chrome); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-top: 12px; }
.he-boards .hs-boards { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.he-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.he-steps li { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--rail); }
.he-steps b { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-ink); font-weight: 850; }
.he-steps span { color: var(--muted); line-height: 1.45; }
.he-steps strong { color: var(--text); font-weight: 700; }
.he-feats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 12px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.he-feats > div { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 2px; align-content: start; padding: 14px; background: var(--chrome); }
.he-feats .i { grid-row: span 2; width: 20px; height: 20px; color: var(--accent); }
:root[data-theme="light"] .he-feats .i { color: var(--text); }
.he-feats b { font-weight: 800; font-size: 13.5px; }
.he-feats span { color: var(--muted); font-size: 12.5px; line-height: 1.45; }

/* drop overlay: the page stays visible so a mark scheme can land on its paper */
.hm-drop { position: fixed; inset: 0; z-index: 60; pointer-events: none; display: grid; place-items: end center; padding: 22px;
  background: color-mix(in srgb, var(--desk) 30%, transparent); outline: 3px dashed var(--accent); outline-offset: -8px; }
.hm-drop-in { display: flex; align-items: center; gap: 14px; max-width: 680px; padding: 13px 18px; border-radius: var(--radius); background: #ffd60a; color: #121212; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.hm-drop-in .i { width: 26px; height: 26px; stroke-width: 2; }
.hm-drop-in b { font-size: 16px; font-weight: 850; white-space: nowrap; text-transform: uppercase; font-stretch: 80%; letter-spacing: .3px; }
.hm-drop-in span { font-weight: 600; font-size: 13px; line-height: 1.4; }

/* ---------- narrower ---------- */
@media (max-width: 1180px) {
  .hm-layout { grid-template-columns: minmax(0, 1fr); }
  .hm-side { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
  .hs-note { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .hm-head { flex-wrap: wrap; }
  .hm-kpis { order: 3; flex-basis: 100%; margin-left: 0; }
  .hm-kpi { flex: 1; min-width: 0; }
  .hm-add { margin-left: auto; }
  .he-drop { grid-template-columns: minmax(0, 1fr); }
  .he-feats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pr { grid-template-columns: 30px minmax(0, 1fr) 110px 84px 28px; }
  .pr > :nth-child(5), .pr > :nth-child(6) { display: none; }
}
@media (max-width: 640px) {
  .hm { padding: 14px 12px 40px; }
  .hm-mig { flex-wrap: wrap; row-gap: 8px; padding: 10px; }
  .hm-mig-t { flex-basis: calc(100% - 30px); }
  .hm-mig-acts { flex-basis: 100%; padding-left: 30px; }
  .hm-mig-acts .ib { margin-left: auto; }
  .hm-head { gap: 12px; margin-bottom: 12px; align-items: center; }
  .hm-title h1 { font-size: 32px; }
  .hm-add { height: 36px; padding: 0 12px; font-size: 13px; }
  .hm-kpis { display: grid; grid-template-columns: 1fr 1fr; }
  .hm-kpi { padding: 7px 12px; }
  .hm-kpi:nth-child(3) { border-left: 0; }
  .hm-kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .hm-kpi b { font-size: 18px; }
  .hm-tabs { gap: 0; margin-bottom: 12px; }
  .hm-tabs [role="tab"] { flex: 1 1 0; min-width: 0; justify-content: center; padding: 0 6px; gap: 6px; font-size: 13.5px; }
  .hm-tabs [role="tab"] b { overflow: hidden; text-overflow: ellipsis; }
  .hm-intro { padding: 12px; gap: 10px; margin-bottom: 14px; }
  .hm-intro-t { flex-basis: 100%; }
  .hm-intro h2 { font-size: 15px; }
  /* the paragraph already says it: no steps on a phone, so the papers start higher */
  .hm-intro-steps { display: none; }
  .hm-cont { grid-template-columns: 74px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .cont-cover { width: 74px; }
  .cont-body h2 { font-size: 16px; padding-right: 26px; }
  .cont-when span { display: none; }
  .cont-when { position: absolute; top: 8px; right: 8px; margin: 0; }
  .cont-body { display: contents; }
  .cont-body > .eyebrow, .cont-body > h2, .cont-body > .cont-sub { grid-column: 2; }
  .cont-body > .eyebrow { grid-row: 1; align-self: end; padding-right: 26px; }
  .cont-body > h2 { grid-row: 2; margin: 0; }
  .cont-body > .cont-sub { grid-row: 3; align-self: start; }
  .hm-cont { grid-template-rows: auto auto 1fr auto auto; row-gap: 4px; }
  .cont-cover { grid-row: 1 / 4; }
  .cont-stats { grid-column: 1 / -1; grid-row: 4; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 10px 0 8px; }
  .cs b { font-size: 18px; }
  .cs b span { font-size: 13px; }
  .cs b.dim { font-size: 14px; }
  .cs small { font-size: 11.5px; }
  .cs .pbar { width: 100%; max-width: 96px; }
  .cont-acts { grid-column: 1 / -1; grid-row: 5; }
  .hm-tools-a { gap: 6px; }
  .hm-search { flex-basis: 100%; max-width: none; margin-right: 0; }
  .hm-search kbd { display: none; }
  .hm-tools .select { flex: 1 1 calc(50% - 3px); max-width: none; min-width: 0; }
  .hm-sort { flex: 1 1 calc(50% - 40px); min-width: 0; }
  .hm-sort .select { width: 100%; }
  .hm-sort .i { display: none; }
  .hm-seg { gap: 0; }
  .hm-seg button { padding: 0 8px; gap: 6px; }
  .hm .l-long { display: none; }
  .hm .l-short { display: inline; }
  .pc { grid-template-columns: 62px minmax(0, 1fr) auto; gap: 11px; padding: 10px; min-height: 0; }
  .pc-cover { width: 62px; }
  .pc-title { font-size: 15.5px; }
  .pc-score b { font-size: 21px; }
  .pc-prog .pbar { width: 72px; }
  .pc-foot { flex-wrap: wrap; row-gap: 4px; }
  .pr { grid-template-columns: 26px minmax(0, 1fr) auto 28px; gap: 10px; padding-left: 10px; }
  .pr-cover { width: 26px; height: 37px; }
  .pr > :nth-child(3) { display: none; }
  .pr-head { display: none; }
  .hm-side { grid-template-columns: minmax(0, 1fr); }
  .he-drop { padding: 22px 18px; }
  .he-drop p { font-size: 14px; }
  .he-feats { grid-template-columns: minmax(0, 1fr); }
  .he-boards .hs-boards { grid-template-columns: minmax(0, 1fr); }
  .hm-drop-in { flex-direction: column; text-align: center; gap: 6px; }
  .q-row { grid-template-columns: 18px minmax(0, 1fr) auto; }
  .q-bar { grid-column: 2 / -1; grid-row: 2; }
  .q-row:not(.busy) .q-bar { display: none; }
}
