/* CT Foundation Manual — Contents Hub (fm-hub.css)
   Same tokens as fm-reader.css (CLAUDE-design.md). #111111 dark, Inter + IBM Plex Mono.
   Amber budget (STRICT): exactly two amber elements on this page —
     .btn-primary (resume button) + .highlight (the "binabasa" part row).
   Everything else is brightness vs dimness. No green. No shadows. No gradients.
   Mobile-first. 640px canonical breakpoint. 44px min tap targets.
*/

:root {
  --bg:         #111111;
  --surface:    #1A1A1A;
  --border:     #2A2A2A;
  --text:       #F5F5F5;
  --muted:      #6B7280;
  --accent:     #F59E0B;
  --accent-bg:  rgba(245, 158, 11, 0.08);
  --font-body:  'Inter', sans-serif;
  --font-mono:  'IBM Plex Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

button { -webkit-tap-highlight-color: transparent; font-family: inherit; }
a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Loading overlay (matches reader) ─────────────────────────────────────── */
#loading {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; z-index: 100;
}
.loading-logo {
  width: 44px; height: 44px;
  background: var(--accent); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 16px; color: #111111; letter-spacing: 0.04em;
}
.loading-text { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.08em; }

/* ── Page shell ───────────────────────────────────────────────────────────── */
#hub {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 56px) clamp(16px, 5vw, 32px) 80px;
}

/* Back-to-dashboard link — subtle CT-token text link, mirrors the reader's
   breadcrumb-up-to-hub. Colors locked for all states (no visited purple). */
.hub-back {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  margin-bottom: 24px;
  transition: color 0.12s;
}
.hub-back:link, .hub-back:visited { color: var(--muted); }
.hub-back:hover, .hub-back:focus, .hub-back:active { color: var(--text); text-decoration: underline; }

/* Brand row */
.hub-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.hub-logo {
  width: 36px; height: 36px; background: var(--accent); border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px; color: #111111; letter-spacing: 0.04em;
}
.hub-brand-name { font-weight: 600; font-size: 14px; color: var(--text); line-height: 1.2; }
.hub-brand-sub { font-family: var(--font-mono); font-size: 10px; color: var(--muted); letter-spacing: 0.06em; margin-top: 2px; }

/* Block 1 — overall line */
.hub-overall { margin-bottom: 28px; }
.hub-overall-label {
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  letter-spacing: 0.12em; text-transform: uppercase;
}
.hub-overall-summary {
  font-family: var(--font-mono); font-size: 13px; color: var(--text);
  margin-top: 6px; letter-spacing: 0.02em;
}

/* Block 2 — resume card */
.hub-resume {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 32px;
}
.hub-resume-label {
  font-family: var(--font-mono); font-size: 10px; color: var(--muted);
  letter-spacing: 0.12em; text-transform: uppercase;
}
.hub-resume-title { font-weight: 600; font-size: 17px; color: var(--text); margin: 8px 0 14px; }
.hub-resume-bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.hub-bar-track { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
/* Bright (not amber): the page's amber budget is the btn-primary + the highlight row only. */
.hub-bar-fill { height: 100%; background: var(--text); border-radius: 2px; }
.hub-bar-pct { font-family: var(--font-mono); font-size: 11px; color: var(--muted); min-width: 34px; text-align: right; }

/* The ONE primary button (amber budget #1) */
.btn-primary {
  display: block; width: 100%;
  background: var(--accent); color: #111111;
  border: none; border-radius: 8px;
  padding: 13px 20px; min-height: 44px;
  font-weight: 600; font-size: 14px; letter-spacing: 0.01em;
  cursor: pointer; text-align: center;
}

/* Block 3 — parts list */
.hub-parts-label {
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 12px;
}
.hub-parts { display: flex; flex-direction: column; gap: 10px; }

.part-row {
  display: flex; align-items: center; gap: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px; min-height: 44px;
  background: transparent;
}
.part-row.tappable { cursor: pointer; }
.part-row.tappable:hover { border-color: var(--muted); }

/* Amber budget #2: the in-progress row highlight */
.part-row.highlight { border: 2px solid var(--accent); background: var(--accent-bg); }

/* Node glyph */
.part-glyph { flex-shrink: 0; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; }
.part-glyph.tapos    { color: var(--text); }
.part-glyph.binabasa { color: var(--accent); }
.part-glyph.bukas    { color: var(--muted); }
.part-glyph.darating { color: var(--muted); }

.part-main { flex: 1; min-width: 0; }
.part-tag {
  font-family: var(--font-mono); font-size: 10px; color: var(--muted);
  letter-spacing: 0.1em; text-transform: uppercase;
}
.part-title { font-weight: 500; font-size: 15px; color: var(--text); margin-top: 3px; line-height: 1.3; }
/* Reading-row title gets the amber emphasis label */
.part-row.highlight .part-statelabel { color: var(--accent); }

.part-statelabel { font-family: var(--font-mono); font-size: 10px; color: var(--muted); letter-spacing: 0.06em; margin-top: 5px; }

/* Slim per-row bar (binabasa only) */
.part-bar-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.part-bar-track { flex: 1; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.part-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; }
.part-bar-pct { font-family: var(--font-mono); font-size: 10px; color: var(--muted); min-width: 30px; text-align: right; }

/* Dim treatment for coming-soon parts */
.part-row.darating { opacity: 0.5; }

.part-chevron { flex-shrink: 0; color: var(--muted); font-size: 16px; }

/* Footer note */
.hub-foot {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 10px; color: var(--muted); line-height: 1.6;
}

@media (max-width: 640px) {
  .part-row { padding: 14px 14px; gap: 12px; }
  .hub-resume { padding: 16px; }
}
