/* The collection screen: one collection on a page of its own. Uses only theme variables. */
body.coll-open { overflow: hidden; }
.coll-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  grid-template-rows: minmax(100%, auto);
  overflow-y: auto;
  background: var(--bg);
  color: var(--text);
}
.coll-screen[hidden] { display: none; }

/* The left column (Quizlet's sidebar, docs/design-research.md): the way back, then the sections. */
.coll-side { position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh; box-sizing: border-box; display: flex; flex-direction: column; gap: 14px; padding: max(16px, env(safe-area-inset-top)) 12px 16px 16px; overflow-y: auto; }
.coll-back { min-height: 44px; align-self: flex-start; }
.coll-tabs { display: flex; flex-direction: column; gap: 2px; }
.coll-tab { display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 8px 14px; border: 0; border-radius: var(--r-lg); background: transparent; color: var(--muted); font: inherit; text-align: left; cursor: pointer; }
.coll-tab:hover { background: var(--control); color: var(--text); }
.coll-tab[aria-selected="true"] { background: var(--control); color: var(--text); font-weight: 600; }
.coll-tab[aria-selected="true"] .coll-icon { color: var(--accent-2); }
.coll-tab .coll-badge { margin-left: auto; }
.coll-main { min-width: 0; box-sizing: border-box; display: flex; flex-direction: column; padding: 0 clamp(16px, 3vw, 48px) 24px; }
.coll-topbar { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: max(8px, env(safe-area-inset-top)) 0 4px; background: var(--bg); }
.coll-topsearch { position: relative; flex: 1 1 200px; max-width: 380px; margin-left: auto; display: block; }
.coll-topsearch .coll-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.coll-screen .coll-main .coll-topsearch input.coll-search[type="search"] { width: 100%; max-width: none; padding-left: 42px; border-radius: 999px; }
.coll-screen .coll-topbar button.round-btn.coll-mode { border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); }
.coll-screen .coll-topbar button.round-btn.coll-mode:hover { background: var(--control); color: var(--text); }
.coll-mode .coll-icon { width: 22px; height: 22px; stroke-width: 1.8; }
.coll-head { flex: none; display: flex; align-items: center; gap: 18px; padding: 8px 0 20px; }
.coll-head-tile { flex: none; display: grid; place-items: center; width: 72px; height: 72px; border-radius: var(--r-lg); background: var(--control); color: var(--muted); }
.coll-head-tile .coll-icon { width: 34px; height: 34px; stroke-width: 1.5; }
.coll-head-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.coll-title { margin: 0; font-size: clamp(1.5rem, 4vw, 2.2rem); line-height: 1.15; overflow-wrap: anywhere; }
.coll-about { margin: 0; color: var(--muted); line-height: 1.5; }
.coll-about strong { color: var(--text); font-weight: 600; }

.coll-body:not([data-tab="texts"]) { max-width: 920px; } /* only the texts list spreads across the page for now */
.coll-body { flex: 1 1 auto; padding-top: 4px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.coll-block { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.coll-h { margin: 0; font-size: 1.1rem; }
.coll-note, .coll-sub { margin: 0; color: var(--muted); line-height: 1.5; font-size: 0.92rem; }
.coll-empty { margin: 0; padding: 18px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); }

.coll-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.coll-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.coll-item-info { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.coll-item-info strong { overflow-wrap: anywhere; }
.coll-item-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.coll-meter { height: 6px; border-radius: var(--r-sm); background: var(--control); overflow: hidden; }
.coll-meter i { display: block; height: 100%; background: var(--accent-2); }
.coll-add select, .coll-search { width: 100%; max-width: 420px; min-height: 44px; box-sizing: border-box; }

.coll-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.coll-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.coll-stat strong { font-size: 1.5rem; line-height: 1.1; }
.coll-stat span { font-size: 0.82rem; color: var(--muted); }

.coll-glossary { margin: 0; display: grid; gap: 4px 0; }
.coll-glossary dt { margin-top: 12px; font-weight: 650; }
.coll-glossary dd { margin: 0; color: var(--muted); line-height: 1.5; }

.coll-notes { width: 100%; box-sizing: border-box; resize: none; overflow: hidden; field-sizing: content; }
.coll-mark { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--card); display: flex; flex-direction: column; gap: 6px; }
.coll-quote { margin: 0; font-family: var(--reader-font, serif); line-height: 1.5; overflow-wrap: anywhere; }
.coll-notetext { margin: 0; line-height: 1.5; }
.coll-passage { margin: 8px 0 4px; padding: 12px 14px; border-left: 4px solid var(--accent-2); background: var(--control); border-radius: var(--r-md); font-family: var(--reader-font, serif); line-height: 1.6; overflow-wrap: anywhere; }

.coll-form { display: flex; flex-direction: column; gap: 12px; max-width: 520px; }
.coll-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.coll-danger { margin-left: auto; color: var(--accent); border-color: var(--accent); background: transparent; }

/* A test, practice or card run draws the shared panels right in the page. */
.overlay.coll-run { position: static; inset: auto; z-index: auto; background: transparent; padding: 0; min-height: 320px; overflow: visible; }
.overlay.coll-run .panel { animation: none; }

@media (max-width: 560px) {
  .coll-danger { margin-left: 0; }
  .coll-item-actions button { flex: 1 1 auto; min-height: 44px; }
}

/* ---------- Symbols, buttons and choices ---------- */
.coll-icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.coll-screen button.coll-ibtn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 44px; min-height: 44px; padding: 8px; }
.coll-screen button.coll-ibtn.has-text { padding: 8px 14px; }
.coll-screen button.coll-ibtn.primary { padding: 8px 14px; }
.coll-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.coll-bar .coll-search { flex: 1 1 220px; max-width: none; }
.coll-bar .coll-sort { flex: 0 1 220px; min-height: 44px; box-sizing: border-box; }
.coll-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--control); align-self: flex-start; }
.coll-screen button.coll-seg-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 6px 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); }
.coll-screen button.coll-seg-btn[aria-checked="true"] { background: var(--card); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent-2); }
.coll-label { display: flex; align-items: center; gap: 7px; margin: 0; font-weight: 600; }
.coll-label small { font-weight: 400; margin-left: auto; }
.coll-checks { display: flex; flex-direction: column; gap: 8px; }
.coll-check { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.coll-check input { width: 20px; height: 20px; min-height: 0; padding: 0; }
.coll-saved { min-height: 1.2em; font-size: 0.82rem; color: var(--accent-2); }
.coll-range { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.coll-range input[type="range"] { flex: 1 1 160px; min-height: 32px; }

/* ---------- Glossary ---------- */
.gloss { display: flex; flex-direction: column; gap: 8px; }
.gloss-letter { margin: 14px 0 2px; font-size: 1.1rem; color: var(--accent-2); border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.gloss-entry { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--card); display: flex; flex-direction: column; gap: 6px; }
.gloss-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gloss-term { margin: 0; font-size: 1.05rem; font-weight: 700; overflow-wrap: anywhere; }
.gloss-tools { display: flex; gap: 4px; }
.gloss-def { margin: 0; line-height: 1.55; overflow-wrap: anywhere; }
.gloss-note { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 8px 10px; border-radius: var(--r-md); background: var(--control); color: var(--muted); font-size: 0.92rem; line-height: 1.45; }
.gloss-note .coll-icon { margin-top: 2px; color: var(--accent-2); }
.coll-edit-card { display: flex; flex-direction: column; gap: 8px; }
.coll-edit-card input { width: 100%; box-sizing: border-box; }

/* ---------- Notes ---------- */
.notes-text { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.notes-text-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.notes-text-head h4 { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.notes-field { display: flex; flex-direction: column; gap: 6px; }
.coll-mark-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ---------- Appearance ---------- */
.look-grid { display: grid; gap: 10px; }
.look-themes { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.look-fonts { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.coll-screen button.look-choice { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 84px; padding: 10px 8px; border-radius: var(--r-lg); background: var(--card); border: 2px solid var(--border); }
.coll-screen button.look-choice[aria-checked="true"] { border-color: var(--accent-2); }
.look-font { font-size: 2rem; line-height: 1; color: var(--text); }
.look-name { font-size: 0.82rem; color: var(--muted); text-align: center; overflow-wrap: anywhere; }
.look-choice[aria-checked="true"] .look-name { color: var(--text); font-weight: 600; }
.look-same { font-size: 1.8rem; line-height: 1; color: var(--muted); }
.look-themes .swatch-art { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 56px; border-radius: var(--r-md); background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.look-themes .swatch-art i { font: 600 1.25rem/1 Georgia, serif; font-style: normal; }
.look-themes .swatch-art u { position: absolute; right: 7px; bottom: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent-2); }

/* ---------- Settings ---------- */
.coll-langs { display: flex; flex-direction: column; gap: 8px; }
.coll-lang { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.coll-lang-name { flex: 1 1 120px; }
.coll-lang input { width: 90px; }

/* ---------- Moving a text: the collections as books, in a small window ---------- */
.move-dialog { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; background: color-mix(in srgb, var(--bg) 70%, transparent); }
.move-card { width: 100%; max-width: 760px; max-height: 90vh; overflow-y: auto; box-sizing: border-box; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.move-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }

/* ---------- Notes: cards side by side, one text at a time ---------- */
.notes-top { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.note-card, .set-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.note-card textarea { width: 100%; box-sizing: border-box; resize: none; overflow: hidden; }
.notes-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.coll-screen button.notes-chip { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px; border-radius: 999px; background: var(--control); }
.coll-screen button.notes-chip[aria-selected="true"] { background: var(--card); border-color: var(--accent-2); font-weight: 600; }
.notes-panel { display: flex; flex-direction: column; gap: 12px; }
.notes-text-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.notes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.note-card.wide { grid-column: 1 / -1; }
.notes-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.notes-section { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.coll-mark { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); }
.coll-mark-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.coll-mark-side textarea { width: 100%; }

/* ---------- Settings: cards in a grid ---------- */
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.set-card.set-card-wide { grid-column: 1 / -1; } /* the "Tailor the questions" card spans the grid */
.set-card .coll-h { display: flex; align-items: center; gap: 8px; }
.look-views { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.look-choice .coll-icon { width: 28px; height: 28px; color: var(--text); }
.set-save { position: sticky; bottom: 0; z-index: 3; display: flex; padding: 10px 0; background: var(--bg); }

/* ---------- Small extras ---------- */
.coll-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent-2); color: var(--bg); font-size: 0.72rem; font-weight: 700; }
.coll-undo { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card); color: var(--text); max-width: calc(100vw - 32px); }
.coll-screen button.coll-top { position: fixed; right: 20px; bottom: 20px; left: auto; width: auto; max-width: none; margin: 0; z-index: 80; min-width: 48px; min-height: 48px; border-radius: 50%; background: var(--card); border: 1px solid var(--border); }
.coll-screen button.coll-top[hidden] { display: none; }

@media (max-width: 700px) {
  .notes-top, .notes-grid, .coll-mark { grid-template-columns: 1fr; }
}

/* The export window */
.exp-card { max-width: 560px; }
.exp-form { display: flex; flex-direction: column; gap: 12px; }
.exp-field { display: flex; flex-direction: column; gap: 4px; }
.exp-label { font-size: 0.85rem; color: var(--muted); }
.exp-field select { width: 100%; min-height: 44px; box-sizing: border-box; }
.exp-options { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-md); }
.exp-check { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.exp-summary { margin: 12px 0 0; font-weight: 600; }
.exp-help { margin: 4px 0 8px; }
.exp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gloss-type { margin-right: auto; margin-left: 8px; padding: 1px 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 0.8rem; }
.coll-tags { width: 100%; box-sizing: border-box; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--control); color: inherit; font: inherit; font-size: 0.9rem; }

/* Segmented control, Readwise-style (docs/design-research.md): a quiet pill track, the picked segment a lifted pill. */
.coll-seg { gap: 2px; padding: 3px; border-color: transparent; border-radius: 22px; }
.coll-screen button.coll-seg-btn { border-radius: 20px; padding: 6px 16px; }
.coll-screen button.coll-seg-btn[aria-checked="true"] { box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--accent-2); }

/* Quizlet-style set page (docs/design-research.md): the three practice modes are three equal boxes, and a text row starts with an icon tile. */
.coll-seg.coll-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0; border: 0; border-radius: 0; background: transparent; align-self: stretch; }
.coll-screen .coll-modes button.coll-seg-btn { flex-direction: column; justify-content: center; gap: 6px; min-height: 64px; padding: 10px 12px; border: 2px solid transparent; border-radius: 16px; background: var(--control); color: var(--text); font-weight: 600; }
.coll-screen .coll-modes button.coll-seg-btn:hover { background: var(--control-hover); }
.coll-screen .coll-modes button.coll-seg-btn[aria-checked="true"] { background: var(--card); border-color: var(--accent-2); box-shadow: var(--shadow-sm); }
.coll-item-tile { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--accent-2) 14%, var(--card)); color: var(--accent-2); }
.coll-item-tile .coll-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.coll-item-info strong { font-size: 1.02rem; }

/* Labels and callouts (design audit) */
.coll-mark, .coll-passage, .gloss-entry { border: 1px solid color-mix(in srgb, var(--accent-2) 40%, var(--border)); border-radius: var(--r-lg); background: color-mix(in srgb, var(--accent-2) 7%, var(--card)); }

/* Opening a tab (or the page) lifts its content in, one block after another; the header and the tab row stay put. Off with "Screen animations" and for reduced motion (styles.css). */
@keyframes coll-rise { from { opacity: 0; transform: translateY(22px) scale(0.985); } to { opacity: 1; transform: none; } }
.coll-body.enter > * { animation: coll-rise 0.55s var(--ease-out) both; }
.coll-body.enter > *:nth-child(2) { animation-delay: 0.07s; }
.coll-body.enter > *:nth-child(3) { animation-delay: 0.14s; }
.coll-body.enter > *:nth-child(4) { animation-delay: 0.21s; }
.coll-body.enter > *:nth-child(5) { animation-delay: 0.28s; }
.coll-body.enter > *:nth-child(n+6) { animation-delay: 0.35s; }
.coll-body.enter .set-grid > .set-card:nth-child(2), .coll-body.enter .coll-list > li:nth-child(2) { animation: coll-rise 0.55s var(--ease-out) 0.12s both; }
.coll-body.enter .set-grid > .set-card:nth-child(3), .coll-body.enter .coll-list > li:nth-child(3) { animation: coll-rise 0.55s var(--ease-out) 0.2s both; }
.coll-body.enter .set-grid > .set-card:nth-child(n+4), .coll-body.enter .coll-list > li:nth-child(n+4) { animation: coll-rise 0.55s var(--ease-out) 0.28s both; }

/* Texts: wide cards (docs/DESIGN-PRINCIPLES.md 47 to 54 are proposed, so this follows the Quizlet folder page in docs/design-research.md): the whole card opens the text, the rarely used actions sit behind one "..." menu. */
.coll-bar { justify-content: space-between; }
.coll-screen .coll-bar select.coll-sort { flex: 0 0 auto; min-height: 40px; padding: 0 12px; border: 0; border-radius: var(--r-lg); background: transparent; color: var(--text); font-weight: 600; cursor: pointer; }
.coll-screen .coll-bar select.coll-sort:hover { background: var(--control); }
/* A text is one plain wide row: icon tile, title and details, progress, and a quiet "..." at the end. No card, no border; hover tints the row. */
.coll-list { gap: 2px; }
.coll-item.coll-row { position: relative; display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; padding: 0 6px 0 0; border: 0; border-radius: var(--r-lg); background: transparent; box-shadow: none; transition: background-color 0.15s var(--ease-out); }
.coll-item.coll-row:hover, .coll-item.coll-row:focus-within { background: var(--control); }
.coll-screen .coll-list .coll-row button.coll-item-open { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 16px; padding: 12px 8px 12px 12px; border: 0; border-radius: var(--r-lg); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; box-shadow: none; }
.coll-item-open .coll-item-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.coll-item-open .coll-item-info strong { font-size: 1.05rem; }
.coll-item-open .coll-meter { flex: 0 0 clamp(80px, 16vw, 220px); display: block; height: 4px; }
.coll-item-pct { flex: none; width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.9rem; }
.coll-menu-wrap { position: relative; flex: none; }
.coll-screen .coll-row .coll-menu-wrap > button.coll-ibtn { border: 0; background: transparent; box-shadow: none; color: var(--muted); border-radius: 50%; }
.coll-screen .coll-row .coll-menu-wrap > button.coll-ibtn:hover, .coll-screen .coll-row .coll-menu-wrap > button.coll-ibtn[aria-expanded="true"] { background: var(--control-hover); color: var(--text); }
.coll-menu { position: absolute; z-index: 20; top: calc(100% + 4px); right: 0; min-width: 260px; display: flex; flex-direction: column; gap: 2px; padding: 6px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-md, var(--shadow-sm)); }
.coll-menu[hidden] { display: none; }
.coll-screen .coll-menu-wrap .coll-menu button.coll-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; box-shadow: none; white-space: nowrap; }
.coll-screen .coll-menu-wrap .coll-menu button.coll-menu-item:hover, .coll-screen .coll-menu-wrap .coll-menu button.coll-menu-item:focus-visible { background: var(--control); }
.coll-screen .coll-menu-wrap .coll-menu button.coll-menu-item.danger { color: var(--accent); }

/* The dock: Practice and Add a text in one pill, centred at the bottom of the Texts tab. */
.coll-dock { position: sticky; bottom: 20px; z-index: 5; margin: auto auto 0; display: flex; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); box-shadow: var(--shadow-md, var(--shadow-sm)); }
.coll-screen .coll-dock button.coll-ibtn { min-height: 48px; padding: 8px 22px; border-radius: 999px; font-weight: 600; }
.coll-screen .coll-dock button.coll-ibtn:not(.primary) { border: 0; background: var(--control); }

/* A phone: the left column becomes a strip across the top, the sections scroll sideways. */
@media (max-width: 860px) {
  .coll-screen { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .coll-side { position: sticky; z-index: 6; height: auto; flex-direction: row; align-items: center; gap: 6px; padding: max(8px, env(safe-area-inset-top)) 12px 0; border-bottom: 1px solid var(--border); background: var(--bg); overflow: visible; }
  .coll-back span { display: none; }
  .coll-tabs { flex-direction: row; gap: 2px; overflow-x: auto; scrollbar-width: thin; }
  .coll-tab { flex: 0 0 auto; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: var(--r-md); }
  .coll-topbar { top: 56px; }
  .coll-head { gap: 12px; }
  .coll-head-tile { width: 52px; height: 52px; }
  .coll-head-tile .coll-icon { width: 26px; height: 26px; }
}
@media (max-width: 560px) {
  .coll-item-open .coll-meter, .coll-item-pct { display: none; }
  .coll-screen .coll-list .coll-row button.coll-item-open { padding-left: 10px; gap: 12px; }
  .coll-screen .coll-dock button.coll-ibtn { padding: 8px 16px; }
}
.coll-row .coll-menu-wrap > button .coll-icon { stroke-width: 3.4; }

/* Hovering a row tints the whole row once (the row, not also the button inside it). */
.coll-screen .coll-list .coll-row button.coll-item-open:hover { background: transparent; }

/* A wide page: the title gets bigger and the details move up beside it, in a column of their own, instead of sitting under it. */
.coll-list { container-type: inline-size; }
@container (min-width: 1300px) {
  .coll-item-open .coll-item-tile { width: 52px; height: 52px; }
  .coll-item-open .coll-item-info { flex-direction: row; align-items: baseline; gap: 4px 32px; }
  .coll-item-open .coll-item-info strong { flex: 0 1 42%; font-size: 1.35rem; }
  .coll-item-open .coll-item-info .coll-sub { flex: 1 1 auto; font-size: 1.1rem; }
  .coll-item-open .coll-meter { flex-basis: clamp(160px, 18vw, 320px); }
  .coll-item-pct { font-size: 1rem; }
}
