/* Repose portal — BRANDBOOK palette
   Slate Repose #2A3A44 · Mineral #4A6470 · Graphite #1F2428 · Ochre Still #C08A48
   Verdigris #4B7A5A · Rust #A85A3A · Ink #0B1416 · Fog #7A8288 · Vellum #F3EFE6 · Paper #FFFFFF */
:root {
  --repose-primary:   #2A3A44;
  --repose-mineral:   #4A6470;
  --repose-graphite:  #1F2428;
  --repose-accent:    #C08A48;
  --repose-verdigris: #4B7A5A;
  --repose-rust:      #A85A3A;
  --repose-ink:       #0B1416;
  /* BRANDBOOK's literal Fog (#7A8288) is ~3.9:1 on Paper and ~3.4:1 on
     Vellum at the small/non-bold sizes it's actually used at (.label,
     table headers, footer, meta text) — below WCAG AA's 4.5:1 for normal
     text. Darkened here to #626A70 (same slate-gray family, same hue) to
     clear 4.5:1 on both light backgrounds (~4.8:1 on Vellum, ~5.5:1 on
     Paper) while still reading as the quiet "meta/timestamp" tone.
     The original hex remains the BRANDBOOK.md reference value for large
     bold (>=18.66px/700) use, which this codebase does not currently have. */
  --repose-fog:       #626A70;
  --repose-fog-wash:  rgba(122, 130, 136, 0.15);
  --repose-vellum:    #F3EFE6;
  --repose-paper:     #FFFFFF;
  --border:           #DDD6C6;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { background: var(--repose-vellum); color: var(--repose-ink); font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.55; }
a { color: var(--repose-mineral); }
code, .mono { font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace; }
#app { max-width: 1080px; margin: 0 auto; padding: 12px 24px 40px; }
.brand-bar { background: var(--repose-vellum); border-bottom: 1px solid var(--border); padding: 14px 24px; display: flex; align-items: center; gap: 14px; }
.brand-bar .brand-title { font-family: 'Fraunces', 'Iowan Old Style', Georgia, serif; font-weight: 500; font-size: 20px; color: var(--repose-primary); letter-spacing: -0.2px; }
.brand-bar .brand-sub { color: var(--repose-fog); font-size: 12px; }
header { display: flex; align-items: center; gap: 12px; padding: 20px 0 16px; border-bottom: 2px solid var(--repose-primary); }
header h1 { font-family: 'Fraunces', Georgia, serif; font-weight: 500; font-size: 1.35rem; color: var(--repose-primary); }
.badge { background: var(--repose-accent); color: #fff; font-size: 0.65rem; padding: 3px 9px; border-radius: 4px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; }
#user-info { margin-left: auto; font-size: 0.85rem; color: var(--repose-fog); display: flex; gap: 12px; align-items: center; }
button, .btn { padding: 9px 16px; border: none; border-radius: 6px; background: var(--repose-primary); color: #fff; cursor: pointer; font-size: 0.9rem; font-family: inherit; }
button:hover, .btn:hover { background: var(--repose-mineral); }
button.ghost { background: transparent; color: var(--repose-primary); border: 1px solid var(--repose-primary); }
button.ghost:hover { background: var(--repose-vellum); }
section { margin-top: 20px; }
h2 { font-family: 'Fraunces', Georgia, serif; font-weight: 500; font-size: 1.1rem; margin-bottom: 12px; color: var(--repose-primary); }
.card-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.card { background: var(--repose-paper); border: 1px solid var(--border); border-radius: 8px; padding: 16px; text-align: center; }
.label { display: block; font-size: 0.7rem; color: var(--repose-fog); text-transform: uppercase; letter-spacing: 0.4px; }
.val { display: block; font-size: 1.5rem; font-weight: 700; color: var(--repose-primary); font-family: 'Fraunces', Georgia, serif; }
form { display: flex; flex-direction: column; gap: 12px; max-width: 380px; background: var(--repose-paper); padding: 24px; border-radius: 8px; border: 1px solid var(--border); }
input[type=email], input[type=password], input[type=text], input[type=number], select {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.95rem;
  background: var(--repose-paper); color: var(--repose-ink); font-family: inherit;
}
input:focus { outline: 2px solid var(--repose-accent); outline-offset: 1px; }

/* Keyboard-focus rings — brand-consistent (Ochre Still), only for
   focus-visible so pointer clicks don't get a persistent ring. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--repose-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; background: var(--repose-paper); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
th { text-align: left; padding: 10px 12px; background: var(--repose-vellum); border-bottom: 1px solid var(--border); font-size: 0.72rem; color: var(--repose-fog); text-transform: uppercase; letter-spacing: 0.4px; }
td { padding: 10px 12px; border-bottom: 1px solid #EEE7D8; }
tr:last-child td { border-bottom: none; }
.error { color: var(--repose-rust); font-size: 0.85rem; }
.form-success { color: var(--repose-verdigris); font-size: 0.85rem; }
button.small { padding: 4px 10px; font-size: 0.78rem; }
.hidden { display: none !important; }
.pill { display: inline-block; font-size: 0.7rem; padding: 2px 8px; border-radius: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.pill.ok { background: rgba(75, 122, 90, 0.15); color: var(--repose-verdigris); }
.pill.warn { background: rgba(192, 138, 72, 0.18); color: #8A5F26; }
.pill.bad { background: rgba(168, 90, 58, 0.15); color: var(--repose-rust); }
.pill.mute { background: var(--repose-fog-wash); color: var(--repose-fog); }
#project-list { margin-bottom: 16px; display: grid; gap: 8px; }
.project-card { background: var(--repose-paper); border: 1px solid var(--border); border-radius: 6px; padding: 14px; }
.project-card strong { color: var(--repose-primary); font-family: 'Fraunces', Georgia, serif; }
footer.disclaimer { margin-top: 40px; padding: 16px 24px; border-top: 1px solid var(--border); font-size: 0.75rem; color: var(--repose-fog); line-height: 1.6; }
footer.disclaimer .rgy { color: var(--repose-rust); font-weight: 600; }

/* Error banner — distinct from empty-state copy; shown when an initial
   data fetch fails outright (network error / 5xx), with a retry action. */
.error-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: rgba(168, 90, 58, 0.08); border: 1px solid var(--repose-rust);
  color: var(--repose-rust); padding: 12px 16px; border-radius: 8px;
  margin-bottom: 16px; font-size: 0.88rem;
}
.error-banner .error-banner-msg { flex: 1 1 auto; }
.error-banner button {
  background: var(--repose-rust); color: #fff; flex: 0 0 auto; padding: 7px 14px; font-size: 0.82rem;
}
.error-banner button:hover { background: #8A4830; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .card-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  #app { padding: 12px 16px 32px; }
  .card-row { grid-template-columns: 1fr; }
  .brand-bar { flex-wrap: wrap; padding: 12px 16px; }
  header { flex-wrap: wrap; }
  #user-info { margin-left: 0; }
  .error-banner { flex-direction: column; align-items: stretch; text-align: center; }
}
