:root {
  --bg: #0f1115;
  --card: #1a1e26;
  --fg: #f2f4f8;
  --muted: #8b93a3;
  --accent: #3ddc97;
  --warn: #ffcc4d;
  --danger: #ff6b6b;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, "Hiragino Sans", "Noto Sans JP", sans-serif;
  -webkit-text-size-adjust: 100%;
}
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100%;
  padding: env(safe-area-inset-top) 20px env(safe-area-inset-bottom);
  display: flex;
  flex-direction: column;
}
.screen { padding: 24px 0 40px; flex: 1; display: flex; flex-direction: column; }
.hidden { display: none !important; }
h1 { font-size: 1.6rem; margin: 12px 0 4px; }
h2 { font-size: 1.9rem; margin: 8px 0; line-height: 1.25; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .8rem; margin-top: auto; padding-top: 24px; }

/* 音声カード */
.voice-card { background: var(--card); border-radius: 14px; padding: 14px; margin-top: 18px; }
.vol-line { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.vol-line span { white-space: nowrap; font-size: .95rem; }
.vol-line input[type="range"] { flex: 1; accent-color: var(--accent); }

button.small { padding: 8px 12px; font-size: .85rem; }

.day-pick { display: flex; align-items: center; gap: 12px; margin: 18px 0 10px; }
.day-pick select {
  flex: 1; min-width: 0; background: var(--card); color: var(--fg);
  border: 1px solid #2a303c; border-radius: 12px; padding: 12px; font-size: 1rem;
}
#day-summary { color: var(--accent); font-weight: 600; margin-bottom: 12px; }
#exercise-preview { list-style: none; padding: 0; margin: 0 0 24px; }
#exercise-preview li {
  background: var(--card); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
  display: flex; justify-content: space-between; gap: 10px;
}
#exercise-preview .sets { color: var(--muted); white-space: nowrap; }
#exercise-preview .flag { color: var(--warn); }

button {
  font-family: inherit; cursor: pointer; border: none; border-radius: 14px;
  font-size: 1rem; padding: 14px 18px;
}
button.primary { background: var(--accent); color: #06281c; font-weight: 700; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid #2a303c; }
button.big { font-size: 1.3rem; padding: 20px; width: 100%; }
button:active { transform: scale(.98); }

.session-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.head-btns { display: flex; gap: 6px; align-items: center; }
.head-btns button { padding: 10px 12px; font-size: .9rem; }
.head-btns #vol-up, .head-btns #vol-down { padding: 10px 11px; font-size: 1.1rem; }
.vol-ind { color: var(--muted); font-size: .8rem; min-width: 40px; text-align: center; }
button.wide { width: 100%; margin-top: 12px; }
.set-label { color: var(--accent); font-weight: 700; letter-spacing: .05em; margin: 0; }
.detail { font-size: 1.2rem; color: var(--muted); margin: 4px 0 24px; }
.warn { color: var(--warn); font-weight: 700; }
#exercise-view { flex: 1; display: flex; flex-direction: column; }
.rest-setter { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 8px 0 4px; }
.rest-setter #ex-rest-val { font-size: 1.25rem; font-weight: 700; min-width: 4em; text-align: center; font-variant-numeric: tabular-nums; }
#done-btn { margin-top: auto; }
.subcontrols { display: flex; gap: 10px; margin-top: 14px; }
.subcontrols button { flex: 1; }

#rest-view { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rest-count { font-size: 5rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
#rest-view .subcontrols { width: 100%; margin-top: 40px; }

#done-view { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
#done-view .primary { margin-top: 30px; width: 100%; }

/* 種目選択オーバーレイ */
.overlay {
  position: fixed; inset: 0; z-index: 10; background: var(--bg);
  max-width: 480px; margin: 0 auto; padding: 24px 20px env(safe-area-inset-bottom);
  display: flex; flex-direction: column; overflow-y: auto;
}
.overlay-head { display: flex; justify-content: space-between; align-items: center; }
.overlay-head h3 { margin: 0; }
.hint-inline { font-size: .85rem; margin: 6px 0 16px; }
#picker-list { list-style: none; padding: 0; margin: 0; }
#picker-list li {
  background: var(--card); border-radius: 12px; padding: 16px 14px; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
#picker-list li.done { opacity: .5; }
#picker-list li.current { outline: 2px solid var(--accent); }
#picker-list .mark { font-size: 1.1rem; color: var(--accent); width: 1.4em; }
#picker-list .pname { flex: 1; }
#picker-list .pname.flag { color: var(--warn); }
#picker-list .psets { color: var(--muted); white-space: nowrap; font-size: .85rem; }
