/* Mona Move · S5 세션 v005-session — v004-player visual language (light, warm/calm/premium) */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #fbf8f2;
  --card: #ffffff;
  --ink: #2b2a26;
  --muted: #6f6a5e;
  --line: #e8e0d1;
  --accent: #2f6b58;
  --accent-ink: #245741;
  --accent-soft: #e7efe9;
  --warn-bg: #fdf3e2;
  --warn-line: #e3c07c;
  --warn-ink: #7c4d00;
  --rest-bg: #f4efe4;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, "Apple SD Gothic Neo", "Pretendard", sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
}

.stage {
  width: 390px;
  max-width: 100vw;
  height: 100dvh;
  max-height: 844px;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen { display: flex; flex-direction: column; min-height: 0; }
.screen.hidden { display: none; }

/* ---------- today ---------- */
.greet .date, .done .date { font-size: 12px; color: var(--muted); }
.greet h1, .done h1 { font-size: 21px; letter-spacing: -0.3px; margin-top: 2px; }
.greet .sub, .done .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

.yesterday {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 12px;
  margin-top: 8px;
}
.y-label {
  flex: none;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 700;
}
.y-text { color: var(--muted); }

.h2 { font-size: 14px; margin-top: 16px; }
.h2 .mins { color: var(--muted); font-weight: 400; }
.h2 .opt { color: var(--muted); font-weight: 400; font-size: 12px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 2px; }

.durations { display: flex; gap: 8px; margin-top: 8px; }
.dur {
  flex: 1;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 8px 4px;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 56px;
  justify-content: center;
}
.dur strong { font-size: 15px; }
.dur span { font-size: 11px; color: var(--muted); }
.dur.is-pick { border-color: var(--accent); background: var(--accent-soft); }

.chips { display: flex; gap: 8px; margin-top: 8px; }
.chips button {
  flex: 1;
  min-height: 44px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--card);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.chips button.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.excluded { margin-top: 4px; }
.excluded ul, .moves { list-style: none; }
.excluded li {
  background: var(--rest-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 7px 12px;
  margin-top: 6px;
}
.excluded .reason { font-size: 12px; color: var(--warn-ink); margin-top: 2px; }

.moves { margin-top: 4px; overflow: hidden; }
.moves li {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 7px 12px;
  margin-top: 6px;
}
.m-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.m-row strong { font-size: 14px; }
.m-row span { font-size: 12px; color: var(--accent-ink); font-weight: 700; }
.moves li > p { font-size: 12px; color: var(--muted); margin-top: 2px; }

.start {
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  width: 100%;
  margin-top: 10px;
}
.start:disabled { opacity: 0.45; }

/* ---------- session (v004 mechanics) ---------- */
.safety {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn-ink);
  font-size: 12px;
  line-height: 1.5;
  border-radius: 12px;
  padding: 8px 12px;
}

.demo { margin-top: 10px; }
.demo-frame {
  position: relative;
  width: 208px;
  aspect-ratio: 4 / 5;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(160deg, #f8eddb 0%, #f1e3c9 55%, #e3dcc4 100%);
  box-shadow: inset 0 2px 18px rgba(122, 96, 58, 0.18);
}
.demo-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.demo-frame video[hidden], .demo-neutral[hidden] { display: none; }
.demo-neutral {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  text-align: center;
}
.demo-name { font-size: 17px; font-weight: 700; color: var(--accent-ink); }
.demo-sub { font-size: 12px; color: var(--muted); }
.demo figcaption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.live-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.move { font-size: 22px; margin-top: 8px; letter-spacing: -0.3px; text-align: center; }
.cue { font-size: 13px; color: var(--muted); margin-top: 4px; text-align: center; }

.meter { margin-top: 6px; font-size: 14px; text-align: center; }
.meter strong { font-size: 24px; font-variant-numeric: tabular-nums; letter-spacing: -0.5px; }

.tempo {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  margin-top: 6px;
  overflow: hidden;
}
.tfill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
}

.nextup {
  margin-top: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.voice {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  min-height: 44px;
}
.controls { display: flex; gap: 8px; margin-top: 8px; }
.ctl {
  flex: 1;
  min-height: 52px;
  border-radius: 14px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
}
.ctl.ghost { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); }
.ctl:disabled { opacity: 0.45; }

.gate { margin-top: 8px; }
.gate[hidden] { display: none; }
.gate-note {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ---------- end ---------- */
.scale { display: flex; gap: 8px; margin-top: 8px; }
.scale button {
  flex: 1;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 8px 4px;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 56px;
  justify-content: center;
}
.scale strong { font-size: 15px; }
.scale span { font-size: 11px; color: var(--muted); }
.scale button.is-pick { border-color: var(--accent); background: var(--accent-soft); }

.notefield {
  margin-top: 6px;
  width: 100%;
  min-height: 44px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
}
.schedule {
  margin-top: 10px;
  font-size: 13px;
  color: var(--accent-ink);
  text-align: center;
}
.saved {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-ink);
  text-align: center;
}
.saved[hidden] { display: none; }

/* keyboard path */
button:focus-visible, a:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 3px solid #2f6b58; outline-offset: 3px; }

@media print {
  .stage { height: auto; max-height: none; overflow: visible; }
  .moves li, .excluded li { break-inside: avoid; }
}
@media screen and (prefers-reduced-motion: reduce) {
  .tfill { transition: none; }
}

/* ---------- v006-loop: tabs / traffic / morning / deferred / clinic / record ---------- */
.tabs { display: flex; gap: 8px; margin-top: 2px; }
.tabs[hidden] { display: none; }
.tabs button {
  flex: 1;
  min-height: 44px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--card);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}
.tabs button.is-pick { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

.phasebar {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.phasebar ol { list-style: none; display: flex; gap: 6px; flex: 1; }
.phasebar li {
  flex: 1;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 4px;
  background: var(--card);
  font-size: 11px;
}
.phasebar li.is-now { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }

.traffic { display: flex; gap: 8px; margin-top: 8px; }
.traffic button {
  flex: 1;
  min-height: 52px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--card);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 1px;
  justify-content: center;
  padding: 6px 4px;
}
.traffic strong { font-size: 13px; }
.traffic span { font-size: 11px; color: var(--muted); }
.traffic button.is-pick[data-traffic="g"] { border-color: var(--accent); background: var(--accent-soft); }
.traffic button.is-pick[data-traffic="y"] { border-color: var(--warn-line); background: var(--warn-bg); }
.traffic button.is-pick[data-traffic="r"] { border-color: #c0574a; background: #fbe9e6; }

.morning { margin-top: 4px; }
.morning[hidden] { display: none; }
.morning .scale button.is-pick { border-color: var(--accent); background: var(--accent-soft); }

.locknote, .adjustnote {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.55;
  border-radius: 12px;
  padding: 8px 12px;
}
.locknote { background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.locknote[hidden], .adjustnote[hidden] { display: none; }
.adjustnote { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); }

.deferred { margin-top: 4px; }
.deferred[hidden] { display: none; }
.deferred ul { list-style: none; }
.deferred li {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 7px 12px;
  margin-top: 6px;
}
.deferred .reason { font-size: 12px; color: var(--muted); margin-top: 2px; }

.clinic {
  margin-top: 8px;
  background: #fbe9e6;
  border: 1px solid #c0574a;
  color: #7a2e26;
  font-size: 13px;
  line-height: 1.6;
  border-radius: 12px;
  padding: 10px 14px;
}
.clinic[hidden] { display: none; }
.clinic strong { display: block; margin-bottom: 2px; }

.rest {
  margin-top: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted);
}
.rest[hidden] { display: none; }

/* ---------- record ---------- */
.range { display: flex; gap: 8px; margin-top: 8px; }
.range button {
  flex: 1;
  min-height: 44px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--card);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}
.range button.is-pick { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

.chart {
  margin-top: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 8px 4px;
}
.chart svg { display: block; width: 100%; height: auto; }
.chart p { font-size: 11px; color: var(--muted); padding: 2px 6px 6px; }

.phases { list-style: none; margin-top: 4px; }
.phases li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 7px 12px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.phases li strong { color: var(--ink); font-size: 13px; }

.exportrow { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.exportrow .start { margin-top: 0; }
.copied { font-size: 13px; font-weight: 700; color: var(--accent-ink); white-space: nowrap; }
.copied[hidden] { display: none; }
.exportbox {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 12px;
  color: var(--ink);
}
.exportbox[hidden] { display: none; }

.reclist { list-style: none; margin-top: 4px; }
.reclist li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 7px 12px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.reclist li strong { color: var(--ink); font-size: 13px; }

/* ---------- v007-sync: sync status / offer / collapsibles ---------- */
.syncstatus {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.syncstatus[hidden] { display: none; }

.offer {
  margin-top: 8px;
  background: var(--accent-soft);
  border: 1.5px solid var(--accent);
  border-radius: 14px;
  padding: 10px 14px;
}
.offer[hidden] { display: none; }
.offer strong { font-size: 14px; color: var(--accent-ink); }
.offer p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.offer-row { display: flex; gap: 8px; margin-top: 8px; }
.offer-row .ctl { min-height: 44px; font-size: 14px; }

.traffic[hidden] { display: none; }
.traffic-one, .plan-one {
  width: 100%;
  margin-top: 6px;
  min-height: 44px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--card);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  padding: 8px 12px;
  text-align: left;
}
.traffic-one[hidden], .plan-one[hidden] { display: none; }
.plan-one { border-left: 4px solid var(--accent); }
#planWrap[hidden] { display: none; }

/* ---------- v007 density: today fits 390x844 with start visible ---------- */
#screen-today .h2 { margin-top: 6px; }
#screen-today .greet h1 { font-size: 19px; }
#screen-today .yesterday { margin-top: 6px; padding: 6px 12px; }
#screen-today .dur { min-height: 50px; padding: 6px 4px; }
#screen-today .traffic button { min-height: 46px; padding: 5px 4px; }
#screen-today .locknote, #screen-today .adjustnote { margin-top: 6px; padding: 6px 12px; }
#screen-today .moves li { padding: 5px 12px; margin-top: 5px; }
#screen-today .deferred li { padding: 5px 12px; margin-top: 5px; }
#screen-today .excluded li { padding: 5px 12px; margin-top: 5px; }
#screen-today .clinic { margin-top: 6px; padding: 8px 14px; }
#screen-today .morning .scale button { min-height: 50px; }
#screen-today .start { margin-top: 8px; }
#screen-today .phasebar { margin-top: 6px; }
#screen-today .syncstatus { margin-top: 4px; }

/* ---------- v008-pwa: settings sheet / offline badge / voice-only ---------- */
.tabs .gear { margin-left: auto; border: 1px solid var(--line); background: var(--card); border-radius: 12px; min-width: 44px; min-height: 44px; font-size: 20px; }
.swbadge { align-self: center; font-size: 12px; color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.swbadge[hidden] { display: none; }
.safety .gear.small { min-width: 40px; min-height: 40px; font-size: 17px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; vertical-align: middle; }
.sheet-back { position: fixed; inset: 0; background: rgba(30, 28, 22, 0.45); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.sheet-back[hidden] { display: none; }
.sheet { background: var(--bg); border-radius: 20px 20px 0 0; padding: 16px 18px calc(20px + env(safe-area-inset-bottom)); width: 100%; max-width: 430px; max-height: 82vh; overflow-y: auto; }
.setrow { display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 10px 14px; margin-top: 8px; }
.setrow strong { display: block; font-size: 16px; }
.setrow span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.setrow[aria-pressed="true"] { border-color: var(--accent); }
.setrow[aria-pressed="true"] strong::after { content: " · 켜짐"; color: var(--accent-ink); font-weight: 600; }
.setrow[aria-pressed="false"] strong::after { content: " · 꺼짐"; color: var(--muted); font-weight: 400; }
.about { font-size: 13px; color: var(--muted); margin-top: 6px; }
/* voice-only: no demo frame, big captions + timer, high-contrast dim-safe text */
.voice-only #demoFrame { display: none; }
.voice-only #screen-session .cue { font-size: 30px; line-height: 1.4; font-weight: 700; color: #1d1a13; }
.voice-only #screen-session .meter strong { font-size: 44px; }
.voice-only #screen-session .voice { font-size: 19px; }
@media (prefers-reduced-motion: reduce) {
  .sheet-back { align-items: center; }
}

/* ---------- v009-demo: angle switcher ---------- */
.demo-angles { display: flex; gap: 8px; margin: 6px 0; }
.demo-angles[hidden] { display: none; }
.demo-angles button { flex: 1; border: 1px solid var(--line); background: var(--card); border-radius: 12px; min-height: 44px; font-size: 15px; color: var(--ink); }
.demo-angles button.is-pick { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }

/* ---------- v010-intake: first-run questions ---------- */
.islider { width: 100%; accent-color: var(--accent); height: 44px; }
.axislabels { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 2px; }
.intake-actions { display: flex; gap: 8px; margin: 16px 0 24px; align-items: stretch; }
.intake-actions .start { flex: 1; margin: 0; }
.intake-actions .ctl { flex: 0 0 auto; min-height: 52px; }

/* ---------- v011-library: catalogue browser + detail sheet + polish ---------- */
.greet-row { display: flex; align-items: flex-start; gap: 8px; }
.greet-row .greet-text { flex: 1; }
.greet-row .gear { margin-left: auto; border: 1px solid var(--line); background: var(--card); border-radius: 12px; min-width: 44px; min-height: 44px; font-size: 20px; }

.liblist { list-style: none; margin-top: 8px; }
.libcard {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 8px;
  font-family: inherit;
  color: var(--ink);
}
.libcard:active { transform: scale(0.99); }
.libcard p { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.55; }
.libcard p strong { color: var(--accent-ink); font-weight: 700; }
.lib-purpose { font-size: 13px !important; color: var(--ink) !important; }
.lib-tags { color: var(--warn-ink) !important; }
.lib-badge { font-weight: 700; border-radius: 8px; padding: 4px 8px; }
.lib-badge.lock { background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.lib-badge.cond { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); }
.lib-badge.out { background: var(--rest-bg); border: 1px solid var(--line); color: var(--warn-ink); }
.lib-badge[hidden] { display: none; }

.dtext { font-size: 13px; line-height: 1.6; margin-top: 4px; }
.dcues { list-style: none; margin-top: 4px; }
.dcues li {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  margin-top: 6px;
}
#dWhy { margin-top: 8px; }

/* screen transition: 180ms fade+slide (Sworkit-style soft cut) */
@keyframes scrIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.screen.enter { animation: scrIn 180ms ease-out; }

/* end-of-session gentle checkmark */
.done-check {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1.5px solid var(--accent);
  color: var(--accent-ink);
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
@keyframes donePop {
  0% { opacity: 0; transform: scale(0.6); }
  60% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}
.screen.enter .done-check { animation: donePop 300ms ease-out; }

/* chip pressed state */
.chips button:active, .dur:active, .scale button:active, .traffic button:active,
.traffic-one:active, .plan-one:active, .range button:active { transform: scale(0.97); }

@media screen and (prefers-reduced-motion: reduce) {
  .screen.enter { animation: none; }
  .screen.enter .done-check { animation: none; }
  .libcard:active, .chips button:active, .dur:active, .scale button:active,
  .traffic button:active, .traffic-one:active, .plan-one:active, .range button:active { transform: none; }
}
