/* Slop Scan: the page, the header, the pages list and the panel's controls. Colours come from the --sl-* tokens that
   shared/theme/theme.js sets on every page for every theme (with fallbacks). The three columns and the phone's sheet are
   shared/frame/frame.css; the view and the corners: stage.css. Phones first: everything a finger touches is 44 px. */
:root {
  --sc-bg: var(--sl-background, #161616); --sc-panel: var(--sl-surface, #1f1f1f); --sc-line: var(--sl-border, #333);
  --sc-fg: var(--sl-text, #ececec); --sc-dim: var(--sl-muted, color-mix(in srgb, var(--sc-fg) 70%, var(--sc-bg)));
  --sc-accent: var(--sl-accent, #d4ff3a); --sc-radius: 10px; --sc-stage: color-mix(in srgb, var(--sc-bg) 82%, #000);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--sc-bg); color: var(--sc-fg); font: 14px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  display: flex; flex-direction: column; overflow: hidden; }
h1, p { margin: 0; }
.sc-bar { position: sticky; top: 0; z-index: 5; background: var(--sc-panel); border-bottom: 1px solid var(--sc-line); padding: 0 16px;
  --slop-hbtn-h: 36px; --slop-hbtn-radius: 8px; --slop-hbtn-bg: var(--sc-panel); --slop-hbtn-line: var(--sc-line); --slop-hbtn-fs: 13px; }
.sc-bar .brand { display: grid; place-items: center; width: 36px; height: 36px; flex: none; color: var(--sc-accent); text-decoration: none; }
.sc-main { flex: 1 1 auto; min-height: 0; }

/* the pages */
.sc-list { display: flex; flex-direction: column; gap: 8px; padding: 12px; overflow-y: auto; background: var(--sc-panel); }
.sc-count { color: var(--sc-dim); font-size: 13px; }
.sc-pages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sc-row { display: flex; align-items: stretch; gap: 6px; border: 1px solid var(--sc-line); border-radius: var(--sc-radius); background: var(--sc-bg); padding: 6px; }
.sc-row.is-current { border-color: var(--sc-accent); box-shadow: 0 0 0 1px var(--sc-accent) inset; }
.sc-open { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: 64px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  text-align: start; background: none; border: 0; color: inherit; font: inherit; padding: 2px; cursor: pointer; border-radius: 8px; min-height: 44px; }
.sc-open:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 2px; }
.sc-thumb { grid-row: 1 / 3; width: 64px; height: 84px; object-fit: contain; background: #fff; border-radius: 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.sc-label { font-weight: 600; }
.sc-meta { color: var(--sc-dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-row-tools { display: grid; grid-template-columns: repeat(2, 36px); gap: 4px; align-content: center; }
.sc-icon { min-width: 36px; min-height: 36px; padding: 0; font-size: 17px; line-height: 1; }
.sc-list-more { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.sc-list-more .sui-btn { flex: 1 1 140px; min-height: 40px; }

/* the panel's controls */
.sc-styles { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.sc-styles .sui-btn { min-height: 40px; }
.sc-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.sc-check { display: flex; align-items: center; gap: 10px; min-height: 36px; cursor: pointer; }
.sc-check input { width: 18px; height: 18px; accent-color: var(--sc-accent); }
.sc-val { color: var(--sc-dim); font-variant-numeric: tabular-nums; }
.sc-panel input[type=text], .sc-panel select { font: inherit; width: 100%; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--sc-line);
  background: var(--sc-bg); color: var(--sc-fg); min-height: 36px; }
.sc-panel input[type=range] { width: 100%; accent-color: var(--sc-accent); }

@media (pointer: coarse) {
  .sc-icon, .sc-row-tools { min-height: 44px; }
  .sc-icon { min-width: 44px; }
  .sc-row-tools { grid-template-columns: repeat(2, 44px); }
  .sc-panel input[type=text], .sc-panel select, .sc-styles .sui-btn, .sc-check { min-height: 44px; }
  .sc-panel input[type=range] { height: 44px; }
}
@media (max-width: 860px) {
  .sc-bar { padding: 0 8px; }
  .sc-list { background: var(--sc-bg); padding: 12px 16px calc(12px + var(--sf-foot-h, 0px)); }
}
