:root {
  color-scheme: dark;
  --ground: #131719;
  --panel: #1b2023;
  --panel-2: #232a2e;
  --line: #333c41;
  --ink: #e8e6e1;
  --ink-2: #a7aeb3;
  --ink-3: #727a80;
  --amber: #e0a03c;
  --amber-ink: #141719;
  --steel: #7fa9bf;
  --red: #d9534a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 {
  font-family: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  font-stretch: condensed;
  font-weight: 800;
  font-size: 40px;
  line-height: 1;
  letter-spacing: .01em;
  text-transform: uppercase;
}
h2 { font-size: 22px; font-weight: 700; line-height: 1.15; }
h3 { font-size: 15px; font-weight: 600; }
.eyebrow {
  font: 600 11px/1.3 ui-monospace, "SF Mono", Consolas, monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card.accent { border-left: 4px solid var(--amber); }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px 11px;
  display: flex;
  flex-direction: column;
}
.chip b { font-size: 19px; line-height: 1.15; font-variant-numeric: tabular-nums; }

.btn {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-weight: 600;
}
.btn.primary { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); }
.btn.big { min-height: 58px; font-size: 18px; width: 100%; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); background: transparent; }
.btn:disabled { opacity: .5; }
.btn:active { transform: translateY(1px); }
.link { background: none; border: none; padding: 8px 0; color: var(--amber); font-weight: 600; }

.targets { display: flex; flex-direction: column; }
.target {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.target:last-child { border-bottom: none; }
.target .d { color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }

/* --- session --- */
.mic {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 3px solid var(--amber);
  background: var(--panel);
  color: var(--amber);
  font-weight: 700;
  font-size: 17px;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.mic svg { width: 40px; height: 40px; }
.mic.rec { background: var(--red); border-color: var(--red); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
.mic.busy { opacity: .6; }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px rgba(217, 83, 74, .18); } }
@media (prefers-reduced-motion: reduce) { .mic.rec { animation: none; } }

.entry { display: flex; gap: 8px; }
.entry input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.entry input:focus, .btn:focus-visible, .mic:focus-visible { outline: 2px solid var(--steel); outline-offset: 2px; }

.exercise { display: flex; flex-direction: column; gap: 6px; }
.setrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 6px 10px;
  border-left: 2px solid var(--line);
}
.setrow .n { color: var(--ink-3); width: 20px; font-variant-numeric: tabular-nums; }
.setrow .v { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.setrow .x { margin-left: auto; }
.x {
  background: none;
  border: none;
  color: var(--ink-3);
  width: 40px;
  height: 40px;
  font-size: 20px;
  line-height: 1;
}
.note { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-2); }
.note p { margin: 8px 0; flex: 1; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photos a { position: relative; aspect-ratio: 1; display: block; }
.photos img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; background: var(--panel-2); }

.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  text-align: left;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.item .top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.item b { font-size: 17px; }
.pr { color: var(--amber); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { color: var(--ink-2); padding: 24px 0; text-align: center; }

#tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
#tabs button {
  flex: 1;
  min-height: 56px;
  background: none;
  border: none;
  border-top: 2px solid transparent;
  color: var(--ink-3);
  font-weight: 600;
}
#tabs button.on { color: var(--amber); border-top-color: var(--amber); }

#toast {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(72px + env(safe-area-inset-bottom));
  max-width: 528px;
  margin: 0 auto;
  background: var(--ink);
  color: var(--ground);
  padding: 12px 14px;
  border-radius: 6px;
  font-weight: 500;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
}
#toast.bad { background: var(--red); color: #fff; }

.login { margin-top: 18vh; }

.heard { gap: 6px; border-left: 4px solid var(--steel); }
.heard.warn { border-left-color: var(--red); }
.heard p { margin: 0; color: var(--ink-2); }
