:root {
  /* Ironlog — warm graphite + brass + chalk */
  --ink: #14130F;       /* warm graphite bg */
  --panel: #1E1C16;     /* raised card */
  --panel-2: #26231B;   /* input wells */
  --line: #322E24;      /* hairlines */
  --chalk: #EDE6D6;     /* primary text */
  --muted: #8A8272;     /* secondary text */
  --faint: #5A5445;     /* ghost / last-time */
  --brass: #D69A3A;     /* accent: targets, PRs, actions */
  --brass-dim: #8a6a2c;
  --up: #8FB27A;        /* subtle "beat it" green */
  --danger: #cf6b5a;
  --radius: 14px;

  /* aliases so existing component rules keep resolving */
  --bg: var(--ink);
  --surface: var(--panel);
  --surface-2: var(--panel-2);
  --border: var(--line);
  --text: var(--chalk);
  --accent: var(--brass);
  --accent-2: var(--up);

  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: 600px;
  background: var(--ink);
  color: var(--chalk);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(env(safe-area-inset-bottom) + 8px);
}

/* Monospaced, tabular figures for anything numeric */
.mono,
.set-row .wt, .set-row .reps,
.sess-sets, .stat-val {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.center { text-align: center; }
.row { display: flex; align-items: center; }
.gap { gap: 0.6rem; flex-wrap: wrap; }

/* Top bar — brass wordmark */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 18px 12px;
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(to bottom, var(--ink) 78%, transparent);
}
.brand { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand .accent { color: var(--brass); }
.auth { display: flex; align-items: center; gap: 0.6rem; }

/* Nav — pills */
.nav {
  display: flex; gap: 6px; justify-content: center;
  padding: 2px 14px 0; max-width: 600px; margin: 0 auto;
}
.nav a {
  text-decoration: none; color: var(--muted);
  border: 1px solid var(--line); background: var(--panel);
  border-radius: 999px; padding: 8px 20px; font-size: 14px; font-weight: 600;
}
.nav a.active { color: var(--chalk); border-color: var(--brass-dim); background: #231f16; }

/* Layout */
.container { padding: 6px 14px; }
.foot { text-align: center; padding: 1.2rem; color: var(--faint); }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin: 12px 0;
}
.card.center { padding: 2rem 1rem; }
.card h2 { margin: 0 0 0.4rem; font-size: 1.2rem; }

/* Buttons */
button, .btn-link {
  font: inherit; cursor: pointer; border-radius: 10px;
  border: 1px solid var(--line); padding: 0.6rem 0.9rem;
  background: var(--panel-2); color: var(--chalk);
}
button.primary, .btn-link {
  background: var(--brass); color: #231708; border-color: transparent;
  font-weight: 700; width: 100%; margin-top: 0.7rem;
  text-decoration: none; display: inline-block; text-align: center;
}
button.ghost { background: transparent; color: var(--muted); }
button.ghost:hover { color: var(--chalk); }
button.ghost.small, button.small { padding: 0.35rem 0.75rem; font-size: 0.82rem; border-radius: 999px; }
button:disabled { opacity: 0.6; cursor: default; }

/* Inputs */
input, select {
  font: inherit; color: var(--chalk); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 0.55rem 0.6rem;
}
input:focus, select:focus { outline: 2px solid var(--brass-dim); outline-offset: 1px; border-color: transparent; }
select { flex: 1; min-width: 160px; }
input[type="date"] { color-scheme: dark; }

/* Login gate */
.login { max-width: 380px; margin: 8vh auto 0; }
.login h2 { color: var(--chalk); }
.login-input { width: 100%; margin-top: 0.6rem; height: 46px; text-align: center; font-size: 1.05rem; letter-spacing: 0.15em; }
.login-msg { color: var(--danger); min-height: 1.1rem; margin: 0.5rem 0 0; }

/* Log form */
.log-form { margin-top: 0.8rem; }
.exercise { border-top: 1px solid var(--line); padding: 0.9rem 0 0.4rem; }
.exercise:first-child { border-top: none; }
.ex-head { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.ex-name { font-weight: 650; font-size: 1.02rem; }
.ex-target { color: var(--brass); font-size: 0.85rem; white-space: nowrap; }
.badge {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.4px;
  background: #231f16; border: 1px solid var(--brass-dim);
  color: var(--brass); padding: 0.12rem 0.45rem; border-radius: 999px;
}
.set-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.set-num { width: 3.2rem; color: var(--faint); font-size: 0.85rem; }
.set-row .wt, .set-row .reps { width: 5.5rem; text-align: center; height: 46px; font-size: 1.05rem; }
.set-row .x { color: var(--faint); }

/* History */
.sess-head { display: flex; justify-content: space-between; align-items: flex-start; }
.sess-detail { margin-top: 0.7rem; border-top: 1px solid var(--line); padding-top: 0.6rem; }
.sess-ex { display: flex; justify-content: space-between; gap: 1rem; padding: 0.25rem 0; }
.sess-ex-name { color: var(--chalk); font-size: 0.95rem; }
.sess-sets { color: var(--muted); font-size: 0.9rem; text-align: right; }

/* Progress */
.stats { display: flex; gap: 0.6rem; margin: 0.9rem 0; }
.stat { flex: 1; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem 0.5rem; text-align: center; }
.stat-val { font-size: 1.3rem; font-weight: 700; color: var(--chalk); }
.stat-label { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.chart { width: 100%; height: auto; margin-top: 0.4rem; }
.chart-axis { stroke: var(--line); stroke-width: 1; }
.chart-line { fill: none; stroke: var(--brass); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { fill: var(--up); stroke: var(--ink); stroke-width: 1.5; }
.chart-label { fill: var(--muted); font-size: 11px; font-family: ui-monospace, monospace; }
.chart-empty { fill: var(--muted); font-size: 13px; }

code { background: var(--panel-2); padding: 0.2rem 0.4rem; border-radius: 6px; font-size: 0.82rem; color: var(--muted); }
