/* Shared look for the desktop pages that live outside the main desktop app
   (Collector Hub, Placeholder Library, Account). Tokens match desktop_home.html.
   Collector Hub and Placeholder Library are "reading pages" (body.scroll-page, .page.reading):
   tiles and file lists that scroll as a whole. Account uses panels in .columns. */
:root {
  --bg: #08111d;
  --panel: #0e1828;
  --panel-2: #132036;
  --panel-3: #0a1322;
  --line: rgba(136, 162, 205, 0.16);
  --line-strong: rgba(136, 162, 205, 0.3);
  --text: #eaf1ff;
  --muted: #93a6c8;
  --faint: #6f82a6;
  --accent: #4da3ff;
  --accent-soft: rgba(77, 163, 255, 0.16);
  --good: #3ddc97;
  --good-soft: rgba(61, 220, 151, 0.14);
  --bad: #ff7d7d;
  --bad-soft: rgba(255, 125, 125, 0.14);
  --warn: #f5b94a;
  --radius: 14px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
/* Scrollbars: thin and in the page's colors, with no track; a little brighter while
   the pointer is over the scrolling area. scrollbar-color covers Firefox and current
   Chrome/Edge; the ::-webkit-scrollbar rules cover older Chrome and Safari. */
* { scrollbar-width: thin; scrollbar-color: rgba(136, 162, 205, 0.16) transparent; }
*:hover { scrollbar-color: rgba(136, 162, 205, 0.32) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(136, 162, 205, 0.16); border-radius: 8px; }
:hover::-webkit-scrollbar-thumb { background: rgba(136, 162, 205, 0.32); }
html, body { height: 100%; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }

/* page frame: a title bar, then panels */
.page { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 16px; padding: 16px 20px 8px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head h1 { margin: 0; font-size: 22px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 16px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); }
.panel-body { padding: 16px 18px; }
.panel-scroll { flex: 1; min-height: 0; overflow-y: auto; }

.segment { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--panel-3); border: 1px solid var(--line); flex-wrap: wrap; }
.segment button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; }
.segment button[aria-pressed="true"] { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px rgba(77, 163, 255, 0.45); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; white-space: nowrap;
  border: 1px solid var(--line-strong); background: var(--panel-2); cursor: pointer; text-decoration: none; font-weight: 600;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04121f; }
.btn.danger { color: var(--bad); border-color: rgba(255, 125, 125, 0.45); background: var(--bad-soft); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 2px 9px; border-radius: 999px; font-size: 12px; color: var(--muted); background: var(--panel-3); border: 1px solid var(--line); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.stat { padding: 10px 12px; border-radius: 10px; background: var(--panel-3); border: 1px solid var(--line); }
.stat span { display: block; font-size: 12px; color: var(--muted); }
.stat strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.note { padding: 10px 12px; border-radius: 10px; background: var(--panel-3); border: 1px solid var(--line); color: var(--muted); }
.note.warn { color: var(--warn); border-color: rgba(245, 185, 74, 0.35); }
.empty { padding: 40px 24px; text-align: center; color: var(--muted); }

.legal { padding: 0 20px 8px; font-size: 11px; line-height: 1.4; color: var(--faint); }

/* Narrow screens (phones, small tablets). These pages are built for desktop, but a phone
   can still open them: stack the columns and let the page scroll. The `html` prefix beats
   the same rules in a page's own <style>. */
@media (max-width: 900px) {
  html, html body { height: auto; }
  html body { overflow: auto; }
  .page { flex: none; padding: 12px 16px 8px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .columns { grid-template-columns: minmax(0, 1fr); }
}

/* Reading pages (Collector Hub, Placeholder Library): the page scrolls as a whole and the
   content keeps a comfortable width, instead of the app's fixed-height columns. */
html:has(body.scroll-page), body.scroll-page { height: auto; }
body.scroll-page { min-height: 100vh; }
.page.reading { max-width: 1280px; width: 100%; margin: 0 auto; padding: 24px 20px 32px; gap: 20px; }
.page.reading .page-head { align-items: flex-start; }
.page.reading .page-head p { max-width: 760px; line-height: 1.6; }
.page.reading .page-head a { color: var(--accent); }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.step { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.step b { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.step strong { display: block; margin-bottom: 2px; }
.step span { color: var(--muted); font-size: 13px; }

.tile-section h2 { margin: 6px 0 2px; font-size: 18px; }
.tile-section > .muted { margin: 0 0 12px; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.tile h3 { margin: 0; font-size: 16px; }
.tile p { margin: 0; color: var(--muted); line-height: 1.5; }
.tile .tile-stats { font-size: 12px; color: var(--faint); }
.tile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }

.file-list { padding: 4px 0; }
.file-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid rgba(136, 162, 205, 0.07); }
.file-row:last-child { border-bottom: 0; }
.file-main { display: grid; gap: 2px; min-width: 0; }
.file-main span { color: var(--muted); font-size: 13px; }
.file-main .file-meta { color: var(--faint); font-size: 12px; }
.file-row .tile-actions { margin: 0; padding: 0; justify-content: flex-end; }

@media (max-width: 900px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .file-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .file-row .tile-actions { justify-content: flex-start; }
}
.tile-section + .tile-section { margin-top: 28px; }
