/* ═══════════════════════════════════════════════════════════
   Iron Log — Stylesheet
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #08080a;
  --surface: #111114;
  --surface-2: #19191e;
  --surface-3: #222228;
  --border: #2a2a32;
  --border-light: #35353f;
  --text: #e8e6e3;
  --text-dim: #a0a0a8;
  --text-muted: #6a6a72;
  --accent: #e85d3a;
  --accent-glow: #e85d3a33;
  --accent-dim: #e85d3a18;
  --green: #34d399;
  --green-dim: #34d39918;
  --blue: #60a5fa;
  --blue-dim: #60a5fa18;
  --yellow: #fbbf24;
  --yellow-dim: #fbbf2418;
  --red: #f87171;
  --red-dim: #f8717118;
  --set-warmup: var(--yellow);
  --set-warmup-dim: var(--yellow-dim);
  --set-normal: #8a8a94;
  --set-normal-dim: #8a8a9418;
  --set-drop: #a78bfa;
  --set-drop-dim: #a78bfa1f;
  --set-failure: var(--red);
  --set-failure-dim: var(--red-dim);
  --set-negative: var(--blue);
  --set-negative-dim: var(--blue-dim);
  --radius: 10px;
  --radius-sm: 6px;
  --font: "Instrument Sans", -apple-system, sans-serif;
  --mono: "DM Mono", "SF Mono", monospace;
}

*,
*::before,
*::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, #e85d3a08 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, #60a5fa05 0%, transparent 40%);
}

.container { max-width: 800px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

/* ── Header ── */
header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  animation: fadeDown 0.5s ease;
}

.logo { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 1rem; }

.logo-mark {
  width: 32px; height: 32px;
  background: var(--accent); border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; color: white;
  box-shadow: 0 0 20px var(--accent-glow);
}

.logo h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.04em; white-space: nowrap; }
.logo h1 span { color: var(--text-muted); font-weight: 400; }

.account {
  margin-left: auto;
  position: relative;
  display: flex; align-items: center;
  flex-shrink: 0;
}

.avatar-btn {
  background: transparent; border: none; padding: 0;
  cursor: pointer; line-height: 0;
  border-radius: 50%;
}
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-dim), var(--surface-3));
  border: 1px solid var(--border-light);
  color: var(--text);
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.02em;
  transition: border-color 0.2s;
}
.avatar-btn:hover .avatar,
.avatar-btn[aria-expanded="true"] .avatar { border-color: var(--accent); }

.avatar-menu {
  position: absolute; top: calc(100% + 0.5rem); right: 0;
  min-width: 200px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 50;
  overflow: hidden;
}
.avatar-menu[hidden] { display: none; }
.avatar-menu-email {
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.avatar-menu-item {
  display: block; width: 100%;
  text-align: left;
  background: transparent; border: none;
  font-family: var(--font); font-size: 0.85rem;
  color: var(--text);
  text-decoration: none;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
}
.avatar-menu-item:hover { background: var(--surface-3); }
.avatar-menu-item[hidden] { display: none; }

/* ── Tabs ── */
.tabs {
  display: flex; gap: 2px;
  background: var(--surface); border-radius: 100px; padding: 3px;
  border: 1px solid var(--border); width: fit-content;
}

.tab {
  font-family: var(--font); font-size: 0.78rem; font-weight: 600;
  padding: 0.4rem 1rem; border-radius: 100px;
  border: none; background: transparent; color: var(--text-muted);
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}

.tab:hover { color: var(--text-dim); }
.tab.active { background: var(--accent); color: white; box-shadow: 0 2px 8px var(--accent-glow); }

/* ── Panels ── */
.panel { display: none; animation: fadeUp 0.35s ease; }
.panel.active { display: block; }
.hidden { display: none !important; }

/* ── Cards ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  margin-bottom: 0.75rem; transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-light); }

.card-header {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-muted);
  margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem;
}

.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.dot-blue { background: var(--blue); }
.dot-green { background: var(--green); }

.stack { display: flex; flex-direction: column; gap: 0.5rem; }

/* ── Form Elements ── */
label {
  display: block; font-size: 0.72rem; font-weight: 500;
  color: var(--text-muted); margin-bottom: 0.3rem;
  font-family: var(--mono); letter-spacing: 0.02em;
}

textarea, input[type="text"], input[type="number"], input[type="date"], select {
  width: 100%;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--mono); font-size: 0.82rem;
  padding: 0.6rem 0.75rem; transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

textarea:focus, input:focus, select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim);
}

textarea { min-height: 180px; resize: vertical; line-height: 1.7; }
textarea::placeholder { color: var(--text-muted); opacity: 0.4; }

.form-group { margin-bottom: 1rem; }
.form-row { display: grid; gap: 0.75rem; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.form-actions { display: flex; align-items: flex-end; }
.stlb-inputs { display: flex; gap: 0.4rem; }
.stlb-inputs > input { flex: 1 1 0; min-width: 0; }

.file-drop {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.85rem; background: var(--bg);
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 0.78rem; font-family: var(--mono);
  cursor: pointer; transition: all 0.2s;
}
.file-drop:hover { border-color: var(--accent); border-style: solid; color: var(--text-dim); }
.file-drop input { display: none; }
.file-drop .arrow { color: var(--accent); font-size: 1.1rem; }

.file-name { font-size: 0.72rem; color: var(--green); font-family: var(--mono); margin-top: 0.25rem; min-height: 1rem; }

.error-msg {
  background: #dc262622; border: 1px solid #dc2626; color: #fca5a5;
  padding: 0.6rem 0.85rem; border-radius: var(--radius-sm);
  font-size: 0.8rem; margin-top: 0.75rem;
}

/* ── Buttons ── */
.btn {
  font-family: var(--font); font-weight: 600; font-size: 0.82rem;
  padding: 0.55rem 1.3rem; border-radius: var(--radius-sm);
  border: none; cursor: pointer; transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 0.4rem;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent); color: white;
  box-shadow: 0 2px 10px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-sm { font-size: 0.75rem; padding: 0.4rem 0.9rem; }

/* ── Session Cards ── */
.session-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  cursor: pointer; transition: all 0.15s;
  display: grid; grid-template-columns: 3.2rem 1fr auto;
  align-items: center; gap: 1rem;
}
.session-card:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-dim); }

.session-day { text-align: center; line-height: 1.2; }
.session-day .num { font-family: var(--mono); font-size: 1.3rem; font-weight: 500; }
.session-day .month { font-size: 0.62rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }

.session-info h3 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.15rem; }
.session-meta { display: flex; align-items: center; gap: 0.85rem; font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted); }

.tag {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 0.22rem 0.65rem;
  border-radius: 100px; white-space: nowrap;
}
.tag-strength { background: var(--accent-dim); color: var(--accent); border: 1px solid #e85d3a30; }
.tag-cardio { background: var(--green-dim); color: var(--green); border: 1px solid #34d39930; }

.effort-pill {
  font-family: var(--mono); font-size: 0.68rem; font-weight: 500;
  padding: 0.1rem 0.5rem; border-radius: 100px;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid #e85d3a30; white-space: nowrap;
}

/* ── Stats Grid ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 0.5rem; }

.stat {
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 0.6rem 0.65rem; text-align: center;
  border: 1px solid transparent; transition: border-color 0.2s;
}
.stat:hover { border-color: var(--border); }

.stat-value { font-family: var(--mono); font-size: 1.15rem; font-weight: 500; }
.stat-value.accent { color: var(--accent); }
.stat-value.green { color: var(--green); }
.stat-value.blue { color: var(--blue); }
.stat-unit { font-size: 0.65rem; color: var(--text-muted); }
.stat-label { font-size: 0.62rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.1rem; }

/* ── HR Zone Bar ── */
.hz-bar { display: flex; height: 22px; border-radius: 4px; overflow: hidden; gap: 2px; }
.hz-bar div {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.58rem; font-weight: 500;
  color: rgba(255,255,255,0.85); min-width: 0; border-radius: 2px;
}
.hz-1 { background: #3b82f6; } .hz-2 { background: #22c55e; }
.hz-3 { background: #eab308; } .hz-4 { background: #f97316; } .hz-5 { background: #ef4444; }

/* ── Exercise Detail ── */
.exercise-block { margin-bottom: 1rem; }
.exercise-block:last-child { margin-bottom: 0; }

.exercise-name {
  font-weight: 600; font-size: 0.88rem; margin-bottom: 0.3rem;
  padding-left: 0.5rem; border-left: 2px solid var(--accent);
}

.set-row {
  display: grid; grid-template-columns: 1.8rem 1fr;
  align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.78rem;
  padding: 0.15rem 0 0.15rem 0.75rem; color: var(--text-muted);
}
.set-row .n { font-size: 0.65rem; }
.set-row .set-summary { color: var(--text); }
.set-row .set-summary { overflow-wrap: anywhere; }

/* ── Exercise Index ── */
.ex-item {
  display: grid; grid-template-columns: 1fr auto auto;
  align-items: center; gap: 1rem; padding: 0.7rem 0;
  border-bottom: 1px solid var(--border); font-size: 0.85rem; cursor: pointer;
}
.ex-item:last-child { border-bottom: none; }
.ex-item .name { font-weight: 500; }
.ex-item .detail { font-family: var(--mono); font-size: 0.75rem; color: var(--text-muted); }
.ex-item .max { font-family: var(--mono); font-size: 0.82rem; color: var(--accent); font-weight: 500; }

/* ── Trend Badges ── */
.trend {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500;
  padding: 0.15rem 0.5rem; border-radius: 100px;
}
.trend-up { color: var(--green); background: var(--green-dim); }
.trend-down { color: var(--red); background: var(--red-dim); }
.trend-steady { color: var(--yellow); background: var(--yellow-dim); }
.trend-neutral { color: var(--text-muted); background: var(--surface-3); }

/* ── Progression Chart ── */
.progression-chart {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.progression-chart-label {
  font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.progression-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.progression-chart .pc-axis {
  font-family: var(--mono); font-size: 10px; fill: var(--text-muted);
}
.progression-chart .pc-point {
  font-family: var(--mono); font-size: 10px; fill: var(--text);
  paint-order: stroke; stroke: var(--bg); stroke-width: 3px;
  pointer-events: none;
}

.chart-block { position: relative; }
.chart-toggle {
  position: absolute; top: 0.5rem; right: 0.5rem; z-index: 1;
  background: transparent; border: 1px solid var(--border); color: var(--text-muted);
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.02em;
  padding: 0.25rem 0.55rem; border-radius: var(--radius-sm); cursor: pointer;
}
.chart-toggle:hover { color: var(--accent); border-color: var(--accent); }
.chart-toggle:active { opacity: 0.8; }

/* ── Body Metrics ── */
.metric-header, .metric-row {
  display: grid; grid-template-columns: 5.5rem 1fr 1fr 1fr auto;
  align-items: center; gap: 0.6rem; padding: 0.55rem 0; font-size: 0.82rem;
}
.metric-header {
  font-size: 0.68rem; font-weight: 600; color: var(--text-dim);
  border-bottom: 1px solid var(--border-light); padding-bottom: 0.4rem; margin-bottom: 0.2rem;
}
.metric-row { border-bottom: 1px solid var(--border); }
.metric-row:last-child { border-bottom: none; }
.metric-row .date { font-family: var(--mono); font-size: 0.75rem; color: var(--text-muted); }
.metric-row .val { font-family: var(--mono); text-align: center; }

/* ── Trend Summary ── */
.trend-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem 1.5rem; margin-bottom: 0.75rem;
}
.trend-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.trend-card-header h3 { font-size: 0.95rem; font-weight: 600; }

.trend-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }

.trend-item { text-align: center; padding: 0.75rem 0.5rem; background: var(--bg); border-radius: var(--radius-sm); }
.trend-item .label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.3rem; }
.trend-item .value { font-family: var(--mono); font-size: 1.3rem; font-weight: 500; }
.trend-item .delta { font-family: var(--mono); font-size: 0.72rem; margin-top: 0.15rem; }

/* ── Section Labels ── */
.section-label {
  font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin: 1.25rem 0 0.6rem;
}

/* ── Overlay ── */
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  z-index: 100; justify-content: center; align-items: flex-start;
  padding-top: 5vh;
}
.overlay.open { display: flex; animation: fadeIn 0.2s ease; }
.overlay-top { z-index: 110; }

.overlay-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 1.5rem; width: 90%;
  max-width: 560px; max-height: 85vh; overflow-y: auto;
  animation: slideUp 0.3s ease;
}
.overlay-panel::-webkit-scrollbar { width: 4px; }
.overlay-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.detail-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border);
}
.detail-top h3 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.02em; }
.detail-top .date { font-family: var(--mono); font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }

.close-btn {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); width: 28px; height: 28px; border-radius: 50%;
  cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.close-btn:hover { background: var(--surface-3); color: var(--text); }

/* ── Empty State ── */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); font-size: 0.85rem; }
.empty .icon { font-size: 1.8rem; margin-bottom: 0.4rem; opacity: 0.5; }

/* ── Animations ── */
@keyframes fadeDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

/* ── New Session Form ── */
.form-row-new-session-compact { grid-template-columns: auto auto auto; align-items: end; }
.form-row-new-session-compact .form-group { margin-bottom: 0; }
.form-row-new-session-compact .form-actions .btn {
  padding: 0.6rem 1.3rem; border: 1px solid transparent;
}

/* ── Session Editor ── */
.editor-exercises { margin-top: 0.5rem; }

.editor-exercise {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.75rem; margin-bottom: 0.5rem;
}

.editor-exercise-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.4rem;
}

.editor-exercise-name {
  font-weight: 600; font-size: 0.85rem;
  padding-left: 0.5rem; border-left: 2px solid var(--accent);
}

.editor-set-row {
  display: grid; grid-template-columns: 1.8rem 1.8rem 1fr;
  align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.78rem;
  padding: 0.15rem 0 0.15rem 0.75rem; color: var(--text-muted);
}
.editor-set-row .n { font-size: 0.65rem; }
.editor-set-row .set-summary { color: var(--text); overflow-wrap: anywhere; }

.editor-exercise-actions {
  display: flex; align-items: center; gap: 0.15rem;
}

.btn-delete-exercise, .btn-edit-exercise {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 0.75rem; padding: 0.15rem 0.35rem;
  border-radius: 4px; transition: all 0.15s;
}
.btn-delete-exercise:hover {
  color: var(--red); background: var(--red-dim);
}
.btn-edit-exercise:hover {
  color: var(--accent); background: var(--accent-dim);
}

/* ── Metric chips + inputs ── */
.metric-chips {
  display: flex; flex-wrap: wrap; gap: 0.25rem;
  width: 100%;
}
.chip {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); font-family: var(--mono);
  font-size: 0.68rem; letter-spacing: 0.03em;
  padding: 0.2rem 0.55rem; border-radius: 999px;
  cursor: pointer; transition: all 0.12s; user-select: none;
}
.chip:hover { color: var(--text); border-color: var(--border-light); }
.chip.active {
  background: var(--accent-dim); border-color: var(--accent);
  color: var(--accent);
}

.metric-inputs {
  display: flex; flex-wrap: wrap; gap: 0.4rem 0.6rem;
  width: 100%; margin-top: 0.25rem;
}
.metric-input {
  display: flex; flex-direction: column; gap: 0.15rem;
}
.metric-input .metric-label {
  font-family: var(--mono); font-size: 0.6rem;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.06em;
}
.metric-input input.metric-value {
  width: 5.5rem; padding: 0.3rem 0.45rem; font-size: 0.78rem;
}
.metric-input select.metric-value {
  width: 5.5rem; padding: 0.3rem 0.45rem; font-size: 0.78rem;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--mono);
}

/* ── Add Exercise Form (in overlay) ── */
.add-exercise-form {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem; margin-top: 0.75rem;
}

.add-exercise-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.5rem; margin-bottom: 0.6rem;
}
.add-exercise-header .section-label { margin-bottom: 0; }

/* Icon-only button — same pattern as .btn-edit-exercise. Lives in the
   Add Exercise header so it's adjacent to the manual-entry path. */
.btn-photo-ocr {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 0.15rem 0.35rem;
  border-radius: 4px; transition: all 0.15s;
  display: inline-flex; align-items: center;
}
.btn-photo-ocr:hover {
  color: var(--accent); background: var(--accent-dim);
}

/* ── Photo confirm dialog ── */
.photo-confirm {
  padding: 1rem;
}
.photo-confirm-title {
  font-family: var(--mono); font-size: 0.78rem;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.04em; margin-bottom: 0.75rem;
}
.photo-confirm-thumb {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  display: flex; justify-content: center; max-height: 50vh;
}
.photo-confirm-thumb img {
  max-width: 100%; max-height: 50vh; object-fit: contain; display: block;
}
.photo-confirm-meta {
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--text-muted); margin: 0.5rem 0 0.75rem;
}
.photo-confirm-actions {
  display: flex; justify-content: flex-end; gap: 0.5rem;
}

/* ── OCR loading / message overlay ── */
.photo-loading {
  padding: 1.5rem 1rem; text-align: center;
}
.photo-loading-spinner {
  width: 36px; height: 36px; margin: 0 auto 1rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: photo-spin 0.9s linear infinite;
}
@keyframes photo-spin { to { transform: rotate(360deg); } }
.photo-loading-stage {
  font-family: var(--mono); font-size: 0.9rem;
  color: var(--text); margin-bottom: 0.4rem;
}
.photo-loading-hint {
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--text-muted); margin-bottom: 1rem;
}
.photo-loading-actions {
  display: flex; justify-content: center; gap: 0.5rem;
}
.photo-loading--error .photo-loading-stage { color: var(--red); }

.autocomplete-wrap { position: relative; }

.autocomplete-list {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--surface-2); border: 1px solid var(--border-light);
  border-top: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 180px; overflow-y: auto; z-index: 10;
}

.autocomplete-item {
  padding: 0.45rem 0.75rem; font-size: 0.82rem;
  font-family: var(--mono); cursor: pointer; transition: background 0.1s;
}
.autocomplete-item:hover, .autocomplete-item.active {
  background: var(--accent-dim); color: var(--accent);
}
.autocomplete-item.create-new {
  color: var(--green); font-style: italic;
}
.autocomplete-item .match-fuzzy {
  color: var(--text-muted); margin-right: 0.15rem;
}
.autocomplete-item.is-fuzzy:not(.active):not(:hover) {
  color: var(--text-muted);
}

/* ── Exercise History Preview ── */
.exercise-history-preview {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.6rem 0.75rem;
  margin: 0.5rem 0; font-family: var(--mono); font-size: 0.72rem;
}
.exercise-history-preview .hist-date {
  color: var(--text-muted); font-size: 0.65rem; margin-bottom: 0.2rem;
  margin-top: 0.4rem;
}
.exercise-history-preview .hist-date:first-child { margin-top: 0; }
.exercise-history-preview .hist-set {
  color: var(--text-dim); padding-left: 0.5rem;
}
.exercise-history-preview .hist-set .hw { color: var(--accent); }

/* ── Set Builder ── */
/* In edit mode the exercise name is locked — out of scope for editing. */
.add-exercise-form[data-mode="edit"] #exercise-search {
  background: var(--surface-2); color: var(--text);
  cursor: not-allowed;
}

.set-builder { margin-top: 0.5rem; }
.set-builder-row {
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: flex-start;
  margin-bottom: 0.6rem; padding: 0.4rem 0.5rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg);
}

/* Per-row set number sits at the start of the row. Height matches the
   set-type pill below so they line up with the row pinned to flex-start. */
.set-builder-row .set-label {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.2rem; height: 2rem;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  color: var(--text-dim);
}

/* Per-row set-type selector: pill-shaped wrapper holding the colored
   chip and a native <select>. Tapping anywhere on the pill opens the
   OS dropdown. Drop / negative rows render the static variant (chip +
   name, no select) since their type isn't re-pickable. */
.row-set-type {
  position: relative;
  display: inline-flex; align-items: center; gap: 0.4rem;
  height: 2rem; padding: 0 0.55rem 0 0.25rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  color: var(--text-dim); font-family: var(--font);
  font-size: 0.78rem; line-height: 1; user-select: none;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
button.row-set-type { font-family: var(--font); }
.row-set-type:hover {
  border-color: var(--border-light); color: var(--text);
  background: var(--surface-3);
}
.row-set-type:focus-visible {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}
.row-set-type[aria-expanded="true"] {
  border-color: var(--accent); color: var(--text);
}
.row-set-type .set-type-chip {
  width: 1.4rem; height: 1.4rem; font-size: 0.65rem;
}
.row-set-type-name {
  font-weight: 600; letter-spacing: 0.01em;
}
.row-set-type-caret {
  font-size: 0.7rem; opacity: 0.6;
}

/* Static variant for drop / negative rows. */
.row-set-type--static { cursor: default; }
.row-set-type--static:hover {
  border-color: var(--border); color: var(--text-dim);
  background: var(--surface-2);
}

/* Inline popover menu anchored beneath the pill. Closed by clicking
   outside, Escape, or picking an option (handled in sessions.js). */
.row-set-type-menu {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 100;
  display: flex; flex-direction: column; gap: 0.1rem;
  min-width: 8.5rem;
  padding: 0.25rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  animation: row-set-type-menu-in 0.1s ease;
}
@keyframes row-set-type-menu-in {
  from { transform: translateY(-2px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.row-set-type-option {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  background: transparent; border: 0;
  color: var(--text); font-family: var(--font);
  font-size: 0.78rem; line-height: 1;
  cursor: pointer; text-align: left;
  border-radius: var(--radius-sm);
  transition: background 0.1s;
}
.row-set-type-option:hover,
.row-set-type-option.is-current {
  background: var(--surface-2);
}
.row-set-type-option .set-type-chip {
  width: 1.4rem; height: 1.4rem; font-size: 0.65rem;
  flex-shrink: 0;
}
.row-set-type-option-name {
  font-weight: 600;
}

/* Row × button. Hidden by JS on the only remaining row. */
.btn-remove-row {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 0.85rem; line-height: 1;
  padding: 0.2rem 0.4rem; margin-left: auto;
  border-radius: 4px; transition: color 0.12s, background 0.12s;
}
.btn-remove-row:hover {
  color: var(--red); background: var(--red-dim);
}

/* View-full-history icon button — sits at the top-right of the
   "Previous sessions" header on the Add Exercise form's inline
   preview. */
.exercise-history-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.3rem;
}
.exercise-history-header-label {
  font-size: 0.65rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.view-history-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.45rem;
  font-size: 0.85rem; line-height: 1;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.view-history-btn:hover {
  color: var(--text); border-color: var(--border-light);
  background: var(--surface-2);
}

.set-builder-actions {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem;
  align-items: center;
}
/* Save button hugs the right edge; the rest pile up from the left. */
.set-builder-actions #btn-save-exercise {
  margin-left: auto;
}
.set-builder-actions .btn[disabled] {
  opacity: 0.45; cursor: not-allowed;
}
.set-builder-actions #btn-add-drop-row { color: var(--set-drop); }
.set-builder-actions #btn-add-negative-row { color: var(--set-negative); }

/* ── Watch Upload (in editor) ── */
.editor-watch-section {
  border-top: 1px solid var(--border); padding-top: 0.75rem; margin-top: 0.75rem;
}
.editor-watch-section .file-drop { font-size: 0.72rem; padding: 0.4rem 0.7rem; }

/* ── Share ── */
.editor-share-section {
  display: flex; justify-content: flex-end;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem; margin-top: 0.75rem;
}
.share-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.share-btn svg { display: block; }

/* ── Ghost / secondary buttons ── */
.btn-ghost {
  background: var(--surface-3); color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border-light); color: var(--text); }

.btn-green {
  background: var(--green); color: #000;
  box-shadow: 0 2px 10px rgba(52,211,153,0.2);
}
.btn-green:hover { transform: translateY(-1px); }

/* ── Weight Calculator ── */
.calc-picker { margin-bottom: 0.9rem; }
.calc-picker label {
  font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.35rem;
}
.calc-picker .metric-chips { gap: 0.35rem; }
.calc-picker .chip {
  font-size: 0.72rem; padding: 0.3rem 0.7rem;
}
.calc-subtype-kg { color: var(--text-muted); font-size: 0.62rem; margin-left: 0.2rem; }
.chip.active .calc-subtype-kg { color: var(--accent); }

.calc-target-group { margin-top: 0.4rem; }

.calc-hint {
  font-size: 0.78rem; color: var(--text-muted); font-style: italic;
  padding: 0.75rem 0; text-align: center;
}

.calc-results-grid {
  display: grid; gap: 0.5rem;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 0.5rem;
}

.calc-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.7rem 0.75rem;
  display: flex; flex-direction: column; gap: 0.35rem;
}

.calc-card-pct {
  font-family: var(--mono); font-size: 0.65rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em;
}

.calc-card-main {
  display: flex; flex-direction: column; gap: 0.1rem;
}
.calc-card-main .calc-raw {
  font-family: var(--mono); font-size: 0.65rem; color: var(--text-muted);
}
.calc-card-main .calc-achieved {
  font-family: var(--mono); font-size: 1.3rem; font-weight: 500;
  color: var(--accent); line-height: 1.1;
}
.calc-card-main .calc-unit {
  font-size: 0.65rem; color: var(--text-muted); margin-left: 0.15rem;
}

.calc-card-detail {
  border-top: 1px dashed var(--border);
  padding-top: 0.35rem; margin-top: 0.1rem;
  display: flex; flex-direction: column; gap: 0.15rem;
  font-family: var(--mono); font-size: 0.7rem; color: var(--text-dim);
}
.calc-detail-label {
  color: var(--text-muted); font-size: 0.6rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-right: 0.3rem;
}
.calc-plates {
  color: var(--accent); word-break: break-word;
}

.calc-actions {
  display: flex; justify-content: flex-end; margin-top: 0.9rem;
}

/* Chip row below weight inputs in the set builder */
.calc-chip-row {
  display: flex; gap: 0.2rem; margin-top: 0.2rem;
}
.calc-chip {
  background: var(--blue-dim); border: 1px solid #60a5fa40;
  color: var(--blue); font-family: var(--mono);
  font-size: 0.65rem; font-weight: 500;
  padding: 0.15rem 0.45rem; border-radius: 999px;
  cursor: pointer; transition: all 0.12s; line-height: 1.2;
}
.calc-chip:hover {
  background: var(--blue); color: #0a0a0f; border-color: var(--blue);
}

/* ── Settings ── */
.panel-subheader {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1rem;
}
.panel-subheader-title {
  color: var(--text-muted);
  font-size: 1rem; font-weight: 400;
  letter-spacing: -0.02em;
}
.settings-row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-label {
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.settings-value {
  color: var(--text);
  font-size: 0.9rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}

.settings-row-stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.settings-hint {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.4;
}
.settings-hint-sub {
  font-size: 0.7rem;
}
.settings-hint strong {
  color: var(--text-dim);
  font-weight: 600;
}

.seg-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  align-self: flex-start;
  background: var(--bg);
}
.seg-btn {
  background: transparent;
  color: var(--text-dim);
  border: 0;
  padding: 0.5rem 1rem;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border-right: 1px solid var(--border);
  transition: background 0.15s, color 0.15s;
}
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.success-msg {
  background: var(--green-dim);
  border: 1px solid var(--green);
  color: var(--green);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-top: 0.75rem;
}

.set-type-toggle-group {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  align-self: stretch;
}
.set-type-toggle {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.3rem 0.7rem 0.3rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-dim);
  font-family: var(--font); font-size: 0.78rem; font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.set-type-toggle:hover { border-color: var(--text-muted); }
.set-type-toggle.is-active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--text-muted);
}
.set-type-toggle:not(.is-active) .set-type-chip { opacity: 0.4; }
.set-type-toggle:not(.is-active) .set-type-toggle-label {
  text-decoration: line-through;
  color: var(--text-muted);
}
.set-type-toggle .set-type-chip { width: 1.4rem; height: 1.4rem; font-size: 0.65rem; }

#btn-save-prefs { margin-top: 1rem; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .container { padding: 1.25rem 1rem 3rem; }
  .form-row-2, .form-row-3, .form-row-new-session-compact { grid-template-columns: 1fr; }
  .form-row-4 { grid-template-columns: 1fr 1fr; }
  .trend-summary { grid-template-columns: 1fr; }
  .calc-results-grid { grid-template-columns: 1fr; }
  .metric-header, .metric-row { grid-template-columns: 4.5rem repeat(3, 1fr) auto; gap: 0.4rem; font-size: 0.75rem; }
  .session-card { grid-template-columns: 2.8rem 1fr auto; gap: 0.7rem; }
  .editor-set-row { grid-template-columns: 2rem 1.5rem 1fr auto; }
  .logo { gap: 0.5rem; }
  .logo h1 { font-size: 1.2rem; }
}

/* ── Set Type Chip + Picker ── */
.set-type-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.6rem; height: 1.6rem; border-radius: 999px;
  font-family: var(--mono); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.02em; user-select: none;
  border: 1px solid transparent;
  background: var(--set-normal-dim); color: var(--set-normal);
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
  padding: 0; line-height: 1;
}
button.set-type-chip { cursor: pointer; }
button.set-type-chip:hover { border-color: currentColor; }
button.set-type-chip:active { transform: scale(0.94); }
button.set-type-chip:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.set-type-chip--warmup   { background: var(--set-warmup-dim);   color: var(--set-warmup); }
.set-type-chip--normal   { background: var(--set-normal-dim);   color: var(--set-normal); }
.set-type-chip--drop     { background: var(--set-drop-dim);     color: var(--set-drop); }
.set-type-chip--failure  { background: var(--set-failure-dim);  color: var(--set-failure); }
.set-type-chip--negative { background: var(--set-negative-dim); color: var(--set-negative); }

.editor-set-row .set-type-chip { justify-self: start; }

/* Cluster: parent row + its linked drops/negatives. `display: contents` keeps
   the grid columns aligned with standalone rows above/below the cluster. */
.editor-set-cluster { display: contents; }

/* Child row: indent with a coloured connector line down the left edge. */
.editor-set-row--child {
  position: relative;
  padding-left: 1.9rem;
}
.editor-set-row--child::before {
  content: "";
  position: absolute;
  left: 0.9rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--set-normal);
  border-radius: 1px;
}
.editor-set-row--child-drop::before     { background: var(--set-drop); }
.editor-set-row--child-negative::before { background: var(--set-negative); }
.editor-set-row--child-warmup::before   { background: var(--set-warmup); }
.editor-set-row--child-failure::before  { background: var(--set-failure); }
/* Round the bottom of the connector on the final child in a cluster. */
.editor-set-cluster > .editor-set-row--child:last-child::before {
  bottom: 50%;
}

/* History preview echoes the same indent treatment, scaled down. */
.exercise-history-preview .hist-set--child {
  position: relative;
  padding-left: 1.4rem;
}
.exercise-history-preview .hist-set--child::before {
  content: "";
  position: absolute;
  left: 0.7rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--set-normal);
  border-radius: 1px;
}
.exercise-history-preview .hist-set--child-drop::before     { background: var(--set-drop); }
.exercise-history-preview .hist-set--child-negative::before { background: var(--set-negative); }

.exercise-history-preview .hist-set .set-type-chip {
  width: 1.15rem; height: 1.15rem; font-size: 0.6rem;
  margin-right: 0.3rem; vertical-align: -2px;
}

.set-type-picker {
  display: flex; flex-direction: column; gap: 0.4rem;
  padding: 0.25rem 0 0.5rem;
}
.set-type-picker-header {
  font-family: var(--mono); font-size: 0.68rem;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 0.2rem;
}
.set-type-picker-row {
  display: grid; grid-template-columns: 1.8rem 1fr;
  gap: 0.65rem; align-items: center;
  padding: 0.55rem 0.6rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  cursor: pointer; text-align: left; width: 100%;
  color: var(--text); font-family: var(--font); font-size: 0.82rem;
  transition: border-color 0.12s, background 0.12s;
}
.set-type-picker-row:hover { border-color: var(--border-light); background: var(--surface-3); }
.set-type-picker-row.is-current {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim);
}
.set-type-picker-row .picker-name { font-weight: 600; font-size: 0.82rem; }
.set-type-picker-row .picker-desc {
  font-size: 0.7rem; color: var(--text-muted); margin-top: 0.1rem;
  line-height: 1.35;
}
.set-type-picker-row .picker-letter-wrap {
  display: flex; align-items: center; justify-content: center;
}
.set-type-picker-divider {
  height: 1px; background: var(--border); margin: 0.25rem 0;
}
.set-type-picker-delete {
  display: block; width: 100%; text-align: center;
  padding: 0.55rem; border-radius: var(--radius-sm);
  background: transparent; color: var(--red);
  border: 1px solid var(--red-dim); cursor: pointer;
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em;
  transition: background 0.12s;
}
.set-type-picker-delete:hover { background: var(--red-dim); }

/* ── Confirm Dialog ── */
.confirm-dialog {
  display: flex; flex-direction: column; gap: 0.75rem;
  padding: 0.25rem 0;
}
.confirm-message {
  font-weight: 600; font-size: 0.92rem; line-height: 1.4;
  color: var(--text);
}
.confirm-note {
  font-size: 0.78rem; line-height: 1.4;
  color: var(--text-muted);
}
.confirm-actions {
  display: flex; justify-content: flex-end; gap: 0.5rem;
  margin-top: 0.25rem;
}
.confirm-destructive-btn {
  background: var(--red); color: #0a0a0f;
  border: 1px solid var(--red);
  font-weight: 600;
}
.confirm-destructive-btn:hover {
  background: transparent; color: var(--red);
}

/* ═══════════════════════════════════════════════════════════
   Admin area
   ═══════════════════════════════════════════════════════════ */

.admin-forbidden { max-width: 32rem; margin: 4rem auto; text-align: center; }
.admin-forbidden h1 { color: var(--accent); margin-bottom: 0.5rem; }
.admin-forbidden p { color: var(--text-dim); margin-bottom: 1rem; }

.admin-lede {
  color: var(--text-muted); font-family: var(--mono);
  font-size: 0.74rem; margin-bottom: 1rem;
}
.admin-lede code {
  background: var(--surface-2); padding: 0.05rem 0.35rem;
  border-radius: 3px; font-size: 0.72rem;
}

.admin-status {
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--text-muted);
}

.admin-actions {
  display: flex; gap: 0.5rem; align-items: center;
  margin: 0.75rem 0 1rem;
}

.admin-thumb {
  display: block; max-width: 240px; max-height: 180px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-top: 0.5rem;
}

.admin-field-header {
  display: flex; align-items: baseline;
  justify-content: space-between; gap: 0.5rem;
  margin-bottom: 0.3rem;
}
.admin-field-header label { margin-bottom: 0; }

.admin-prompt-meta {
  font-family: var(--mono); font-size: 0.68rem;
  color: var(--text-muted); margin-top: 0.3rem;
}

.admin-results { display: flex; flex-direction: column; gap: 0.75rem; }
.admin-results .pane {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.85rem 1rem;
}
.admin-results .pane h3 {
  margin: 0 0 0.5rem 0; font-family: var(--mono);
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); font-weight: 600;
}
.admin-results pre {
  white-space: pre-wrap; word-break: break-word;
  font-family: var(--mono); font-size: 0.72rem; color: var(--text);
  margin: 0; line-height: 1.5;
}
.admin-results .err { color: var(--red); }
.admin-results .summary-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
}
.admin-results .summary-cell {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.5rem 0.6rem;
}
.admin-results .summary-cell .lbl {
  font-family: var(--mono); font-size: 0.62rem;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em;
}
.admin-results .summary-cell .val {
  font-family: var(--mono); font-size: 0.85rem;
  color: var(--text); margin-top: 0.15rem;
}
.admin-results .extracted-row {
  padding: 0.4rem 0; border-bottom: 1px solid var(--border);
}
.admin-results .extracted-row:last-child { border-bottom: none; }
.admin-results .extracted-row .name {
  font-family: var(--mono); font-size: 0.85rem; color: var(--text);
}
.admin-results .extracted-row .meta {
  font-family: var(--mono); font-size: 0.7rem; color: var(--text-muted);
}
.admin-results .candidate {
  font-family: var(--mono); font-size: 0.72rem;
  padding: 0.25rem 0; border-bottom: 1px dashed var(--border);
}
.admin-results .candidate:last-child { border-bottom: none; }
.admin-results .candidate .score { color: var(--text-muted); margin-left: 0.5rem; }
.admin-results .candidate .mtype {
  color: var(--accent); font-size: 0.62rem;
  padding: 0.05rem 0.35rem; background: var(--accent-dim);
  border-radius: 3px; margin-left: 0.5rem;
}

.card-header-with-actions {
  display: flex; justify-content: space-between; align-items: center;
}

.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%; border-collapse: collapse;
  font-family: var(--mono); font-size: 0.78rem;
}
.admin-table th {
  text-align: left; font-weight: 600;
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border);
}
.admin-table th.col-num, .admin-table td.col-num { text-align: right; }
.admin-table th.col-flag, .admin-table td.col-flag { text-align: center; }
.admin-table tbody tr {
  cursor: pointer; transition: background 0.1s;
}
.admin-table tbody tr:hover { background: var(--surface-2); }
.admin-table td {
  padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border);
  color: var(--text);
}
.admin-table td.dim { color: var(--text-muted); }
.admin-table .stale-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: var(--yellow);
}

.alias-chips {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-top: 0.4rem;
}
.alias-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 100px; padding: 0.25rem 0.7rem;
  font-family: var(--mono); font-size: 0.72rem;
}
.alias-chip .alias-text { color: var(--text); }
.alias-chip button {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-muted); padding: 0; font-size: 0.7rem;
  font-family: var(--mono); line-height: 1;
}
.alias-chip button:hover { color: var(--accent); }
.alias-chip .alias-promote:hover { color: var(--green); }
.alias-chip .alias-delete:hover { color: var(--red); }

.embed-status {
  font-family: var(--mono); font-size: 0.72rem;
  margin: 0.5rem 0;
}
.embed-status.ok { color: var(--green); }
.embed-status.err { color: var(--red); }

.suggestions-box {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.6rem 0.8rem;
  margin-top: 0.5rem;
}
.suggestion-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.2rem 0; font-family: var(--mono); font-size: 0.78rem;
}
.suggestion-row label { margin: 0; font-family: var(--mono); color: var(--text); }

