/* RunWay MPC 시연 콘솔 — 프로젝터용 어두운 중계 화면. 빌드 없는 정적 CSS. */
@font-face { font-family: "Archivo Expanded"; font-weight: 400; font-display: swap; src: url("fonts/ArchivoExpanded-Regular.ttf") format("truetype"); }
@font-face { font-family: "Archivo Expanded"; font-weight: 600; font-display: swap; src: url("fonts/ArchivoExpanded-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Archivo Expanded"; font-weight: 700 900; font-display: swap; src: url("fonts/ArchivoExpanded-Bold.ttf") format("truetype"); }
/* 747-3: 글자 굵기 한 단계 낮춤(큰 숫자 700→600, 라벨 500→400). 강조는 굵기 대신 크기·색으로 */
h2, h3, b, strong, th { font-weight: 600; }

/* 앱(frontend/src/theme, DESIGN.md)과 같은 톤: 미스트 배경 위 흰 카드, 큰 숫자·차트는 어두운 비네트 카드.
   강조는 색이 아니라 밝기 반전(밝은 카드에는 검정, 어두운 카드에는 흰색). 빨강은 앱의 한 가지 #D44A4A.
   글자: 한글 Noto Sans KR, 숫자·영문 Archivo 폭 125(앱 fonts/ArchivoExpanded-*.ttf, OFL).
   844: 색·카드·글자는 파일 맨 아래 '844' 구역에서 랜딩페이지 톤(네이비·민트·어두운 유리, Pretendard)으로 덮어쓴다. */
:root {
  color-scheme: light;
  --ink: #02050E;               /* k1.night */
  --ice: #E8EEF4;               /* k1.ice */
  --red: #D44A4A;               /* k1.coral — 앱의 유일한 빨강 */
  --red-light: #E79B9B;         /* k1.redLight — 어두운 카드 위 선·숫자 */
  --steel: #3A5A6C; --mist: #7DA0B2; --mist-pale: #C4D4DC; --teal: #182E3D;
  --card-bg: #FFFFFF;
  --card-edge: rgb(2 5 14 / 6%);
  --radius-card: 1.6rem;        /* radius.card 28 */
  --radius-inner: .85rem;
  --num: "Archivo Expanded", "Archivo", "Segoe UI", sans-serif;
  --ui: "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  font-family: var(--ui);
  /* 1920×1080에서 16px, 1280×720에서 11px. 모든 크기는 rem으로 따라 줄어든다 */
  font-size: max(11px, min(1.5vh, 0.84vw));
  color: var(--text);
}
/* 밝은 톤(앱 lightTheme): 페이지·흰 카드 */
:root, .tone-light {
  --text: #02050E;
  --text-2: rgb(2 5 14 / 78%);
  --muted: rgb(2 5 14 / 60%);
  --dim: rgb(2 5 14 / 42%);
  --panel-line: rgb(2 5 14 / 12%);
  --grid: rgb(2 5 14 / 8%);
  --fg-rgb: 2 5 14;
  --accent: #02050E; --accent-rgb: 2 5 14; --on-accent: #E8EEF4;
  --accent-glow: rgb(2 5 14 / 25%);
  --warn: #D44A4A; --warn-rgb: 212 74 74; --warn-text: #D44A4A;
  --caution: #3A5A6C; --caution-rgb: 58 90 108; --caution-text: #182E3D;
  --neutral: #8096AF; --neutral-rgb: 128 150 175;
  --field: #EDF1F5;
  --surface-bg: #FFFFFF;
}
/* 어두운 톤(앱 darkTheme): 비네트·코스 카드 안, 대기 화면 */
.tone-dark {
  --text: #E8EEF4;
  --text-2: rgb(232 238 244 / 82%);
  --muted: rgb(232 238 244 / 62%);
  --dim: rgb(232 238 244 / 42%);
  --panel-line: rgb(var(--fg-rgb) / 14%);
  --grid: rgb(232 238 244 / 8%);
  --fg-rgb: 232 238 244;
  --accent: #E8EEF4; --accent-rgb: 232 238 244; --on-accent: #02050E;
  --accent-glow: rgb(232 238 244 / 40%);
  --warn: #E79B9B; --warn-rgb: 212 74 74; --warn-text: #E79B9B;
  --caution: #A4BDC9; --caution-rgb: 164 189 201; --caution-text: #C4D4DC;
  --neutral: #7DA0B2; --neutral-rgb: 125 160 178;
  --field: rgb(232 238 244 / 8%);
  --surface-bg: #0A111D;
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden; color: var(--text);
  background: linear-gradient(180deg, #F8FAFB 0%, #F0F5F5 10%, #E9EFF2 20%, #E2E9EE 30%, #D8E2E8 40%, #CDDBE1 50%,
    #C3D2DB 60%, #B3C4CD 70%, #A3B6BF 80%, #93A8B3 90%, #8399A5 100%) fixed;
}
@media (max-width: 960px), (max-height: 560px) { body { overflow: auto; } }
button, input, select { font: inherit; color: inherit; }
button { border: 1px solid var(--panel-line); background: rgb(var(--fg-rgb) / 5%); border-radius: .5rem; padding: .35rem .9rem; cursor: pointer; }
button:hover { border-color: var(--accent); }
select { background: var(--field); border: 1px solid var(--panel-line); border-radius: .5rem; padding: .3rem .5rem; }
input[type="range"] { accent-color: var(--accent); }
.hidden { display: none !important; }

.console {
  position: relative; height: 100vh; min-height: 540px; padding: 1.1rem 1.5rem .7rem;
  display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 1rem;
}

/* ── 머리글 ───────────────────────────── */
.topbar { display: flex; align-items: center; gap: 1.4rem; }
.brand { display: flex; align-items: center; gap: .85rem; flex: none; }
.stage-badge, .mode-chip { flex: none; }
.brand-mark { width: 2.5rem; height: 2.5rem; border-radius: .7rem; position: relative;
  background: linear-gradient(135deg, var(--accent), var(--accent)); box-shadow: 0 0 1.4rem rgb(var(--accent-rgb) / 30%); }
.brand-mark::after { content: ""; position: absolute; inset: .55rem .5rem; border-radius: 2px;
  background: linear-gradient(115deg, transparent 0 30%, var(--on-accent) 30% 44%, transparent 44% 56%, var(--on-accent) 56% 70%, transparent 70%); }
.brand-name { font-family: var(--num); font-weight: 600; letter-spacing: .32em; font-size: .78rem; color: var(--muted); }
.brand-name em { font-style: normal; color: var(--accent); }
h1 { margin: .1rem 0 0; font-size: 1.55rem; font-weight: 600; letter-spacing: -.02em; }
.stage-badge { display: inline-flex; align-items: center; gap: .55rem; padding: .4rem .95rem; border-radius: 999px;
  font-family: var(--num); font-weight: 600; font-size: 1rem; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--panel-line); background: rgb(var(--fg-rgb) / 4%); color: var(--muted); white-space: nowrap; }
.stage-badge i { width: .62rem; height: .62rem; border-radius: 50%; background: var(--dim); }
.stage-badge[data-kind="live"] { color: var(--red); border-color: rgb(var(--warn-rgb) / 55%); background: rgb(var(--warn-rgb) / 12%); }
.stage-badge[data-kind="live"] i { background: var(--warn); box-shadow: 0 0 0 0 var(--warn); animation: live-dot 1.6s infinite; }
.stage-badge[data-kind="replay"] { color: var(--text); border-color: rgb(var(--neutral-rgb) / 40%); }
.stage-badge[data-kind="replay"] i { background: var(--neutral); }
@keyframes live-dot { 0% { box-shadow: 0 0 0 0 rgb(var(--warn-rgb) / 70%); } 70% { box-shadow: 0 0 0 .6rem rgb(var(--warn-rgb) / 0%); } 100% { box-shadow: 0 0 0 0 rgb(var(--warn-rgb) / 0%); } }
.runner-label { color: var(--muted); font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28rem; min-width: 0; flex: 0 1 auto; }
.version-block { margin-left: auto; text-align: right; flex: none; }
.banner:not(.hidden) + .version-block { margin-left: 0; }
.model-label { font-size: 1.05rem; font-weight: 600; }
.policy-label { margin-top: .2rem; display: inline-block; font-family: var(--num); font-size: .82rem; letter-spacing: .06em;
  color: var(--muted); border: 1px solid var(--panel-line); border-radius: .35rem; padding: .1rem .5rem; }

/* 프로토타입: 지도·라이브 화면(.context)이 목표 페이스 줄까지 올라와 오른쪽 전체 높이를 쓴다.
   왼쪽 열(목표 페이스 위, 페이스 후보·그래프 아래)과 오른쪽 열(지도·라이브 화면, 두 줄 모두 세로로 이어짐)로 나눈다 */
.stage-wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
  gap: 1rem; min-height: 0; }
.stage-wrap > .hero { grid-column: 1; grid-row: 1; }
.stage-wrap > .stage { grid-column: 1; grid-row: 2; }
.stage-wrap > .context { grid-column: 2; grid-row: 1 / 3; }

/* ── 상단 큰 숫자 ─────────────────────── */
/* 프로토타입: stage-wrap이 이미 왼쪽 열 너비를 페이스 후보와 같게 만들어서, guide-card는 그 안에서 한 칸만 쓰면 된다
   (오른쪽 숫자 카드(stat)는 747에서 숨김 처리) */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.guide-card, .stat { position: relative; border: 1px solid var(--panel-line); border-radius: 1rem; background: var(--panel); overflow: hidden; }
.guide-card { padding: .9rem 1.4rem 1rem; border-color: rgb(var(--accent-rgb) / 28%);
  background: transparent; }
.guide-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: .35rem; background: var(--accent); box-shadow: 0 0 1.2rem var(--accent-glow); }
.kicker { display: flex; align-items: center; gap: .6rem; color: var(--accent); font-weight: 600; font-size: .9rem; letter-spacing: .04em; }
.delivery { color: var(--muted); font-weight: 500; font-size: .8rem; border: 1px solid var(--panel-line); border-radius: 999px; padding: .05rem .55rem; }
.guide-main { display: flex; align-items: baseline; gap: .5rem; margin-top: .1rem; }
.guide-pace { font-family: var(--num); font-weight: 600; font-size: 5.6rem; line-height: .95; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.guide-unit { font-family: var(--num); font-size: 1.6rem; color: var(--muted); }
.action-pill { white-space: nowrap; margin-left: .8rem; align-self: center; font-weight: 600; font-size: 1.35rem; padding: .3rem 1rem; border-radius: .6rem;
  background: rgb(var(--fg-rgb) / 6%); color: var(--muted); border: 1px solid var(--panel-line); }
.action-pill::before { margin-right: .4rem; }
.action-pill[data-action="up"] { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.action-pill[data-action="up"]::before { content: "▲"; }
.action-pill[data-action="hold"] { color: var(--text); background: rgb(var(--fg-rgb) / 9%); }
.action-pill[data-action="hold"]::before { content: "■"; font-size: .8em; }
.action-pill[data-action="down"] { color: var(--on-accent); background: var(--caution); border-color: var(--caution); }
.action-pill[data-action="down"]::before { content: "▼"; }
.action-pill[data-action="ease"] { color: #FFFFFF; background: var(--warn); border-color: var(--warn); }
.action-pill[data-action="ease"]::before { content: "▼▼"; }
.guide-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1.5rem; }
.guide-card > .kicker, .guide-card > .guide-main, .guide-card > .actual-line, .guide-card > .reason-line { grid-column: 1; }
.guide-side { grid-column: 2; grid-row: 1 / span 4; align-self: center; text-align: right; padding-left: 1.5rem; border-left: 1px solid var(--panel-line); }
.guide-side-label { color: var(--muted); font-size: .85rem; font-weight: 600; }
.guide-side-value { font-family: var(--num); font-weight: 600; font-size: 3.2rem; line-height: 1.05; color: var(--accent); font-variant-numeric: tabular-nums; }
.guide-side-value small { font-size: .38em; color: var(--muted); margin-left: .2rem; }
.guide-side-allow { font-family: var(--num); font-size: 1.05rem; color: var(--muted); }
.guide-side-allow b { color: var(--warn); }
.guide-side.over .guide-side-value { color: var(--warn); }
.reason-line { margin: .45rem 0 0; color: var(--text-2); font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guide-card.flash::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgb(var(--accent-rgb) / 18%), transparent);
  animation: sweep .9s ease-out forwards; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.stat { padding: .85rem 1.1rem; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr auto; column-gap: .4rem; align-content: start; }
.stat-label { grid-column: 1 / -1; color: var(--muted); font-size: .9rem; font-weight: 600; display: flex; align-items: center; gap: .45rem; }
.stat-value { font-family: var(--num); font-weight: 600; font-size: 3.6rem; line-height: 1.05; letter-spacing: -.01em; font-variant-numeric: tabular-nums; align-self: end; transition: color .4s; }
.stat-unit { font-family: var(--num); color: var(--muted); font-size: 1.15rem; align-self: end; padding-bottom: .55rem; }
.stat-sub { grid-column: 1 / -1; color: var(--muted); font-size: .85rem; margin-top: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-hr .stat-value { color: var(--text); }
.stat-hr.over .stat-value { color: var(--warn); text-shadow: 0 0 1.4rem rgb(var(--warn-rgb) / 45%); }
.stat-hr.over { border-color: rgb(var(--warn-rgb) / 45%); }
.heart { display: inline-block; color: var(--warn); font-style: normal; font-size: 1.05em; line-height: 1; transform-origin: center; animation: beat var(--beat, 0s) infinite; }
.heart::before { content: "♥"; }
@keyframes beat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.35); } 24% { transform: scale(1); } }
.stat-value.bump { animation: bump .5s ease-out; }
@keyframes bump { 0% { transform: translateY(.25rem); opacity: .3; } 100% { transform: none; opacity: 1; } }

/* ── 본문 ─────────────────────────────── */
/* 프로토타입: 지도(.context)가 stage-wrap의 오른쪽 열로 옮겨가서 .stage는 분석 영역(후보·그래프) 한 칸만 쓴다.
   #waiting은 지도·라이브 화면까지 함께 가려야 해서 stage-wrap을 기준으로 깔린다(아래 .stage-wrap 참고) */
.stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; min-height: 0; }
.analysis, .context { display: grid; gap: 1rem; min-height: 0; }
.analysis { grid-template-rows: minmax(0, 1.08fr) minmax(0, 1fr); }
/* 프로토타입: 지도·라이브 화면 반반 */
.context { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
.panel { position: relative; border: 1px solid var(--panel-line); border-radius: 1rem; background: var(--panel); padding: .8rem 1.1rem .9rem;
  display: flex; flex-direction: column; min-height: 0; backdrop-filter: blur(6px); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .55rem; }
.panel-head h2 { margin: 0; font-size: 1.15rem; font-weight: 600; white-space: nowrap; }
.panel-head h2 small { margin-left: .5rem; color: var(--muted); font-weight: 500; font-size: .82rem; }
.meta { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta b { color: var(--text); font-family: var(--num); font-size: 1.05rem; }
.legend { display: flex; gap: 1rem; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.legend span::before { content: ""; display: inline-block; width: .8rem; height: .8rem; border-radius: .2rem; margin-right: .35rem; vertical-align: -.1rem; }
.lg-chosen::before { background: var(--accent); box-shadow: 0 0 .5rem var(--accent-glow); }
.lg-pass::before { background: var(--neutral); opacity: .7; }
.lg-reject::before { background: repeating-linear-gradient(135deg, var(--warn) 0 2px, transparent 2px 5px); }
.lg-allow::before { height: 0 !important; border-top: 2px dashed var(--warn); border-radius: 0 !important; }

/* 후보 카드: 막대 높이 = 2분 뒤 예측 심박, 옅은 위 칸 = 상한(예측 + 여유), 가로 점선 = 허용선 */
.candidate-list { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .8rem; }
.candidate-list:empty::after { content: "후보 대기"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-size: 1.1rem; }
.cand { position: relative; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; min-height: 0; padding: .6rem .7rem .6rem;
  border-radius: .8rem; border: 1px solid var(--panel-line); background: rgb(var(--fg-rgb) / 2.5%);
  transition: opacity .45s ease, filter .45s ease, border-color .45s ease, background .45s ease, transform .45s ease; }
.cand-top { display: flex; align-items: baseline; justify-content: space-between; gap: .3rem; }
.cand-delta { font-family: var(--num); font-weight: 600; font-size: 1.05rem; color: var(--muted); }
.cand-tag { font-size: .78rem; font-weight: 600; padding: .08rem .45rem; border-radius: .3rem; color: var(--muted); background: rgb(var(--fg-rgb) / 6%); white-space: nowrap; }
.cand-pace { font-family: var(--num); font-weight: 600; font-size: 2.05rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cand-pace small { font-size: .55em; color: var(--muted); margin-left: .1rem; }
.gauge { position: relative; min-height: 3rem; margin: .35rem 0 .3rem; border-radius: .45rem; background: rgb(var(--fg-rgb) / 3%); overflow: hidden; }
.bar-pred, .bar-band { position: absolute; left: 10%; right: 52%; bottom: 0; border-radius: .35rem .35rem 0 0; transform-origin: bottom; }
.bar-pred { background: linear-gradient(180deg, var(--neutral), rgb(var(--neutral-rgb) / 35%)); }
.bar-band { background: repeating-linear-gradient(0deg, rgb(var(--neutral-rgb) / 30%) 0 2px, transparent 2px 5px); border-radius: .35rem; }
.allow-line { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed var(--warn); z-index: 2; }
.gauge-hr { position: absolute; left: 52%; right: 0; padding-left: .45rem; text-align: left; font-family: var(--num); font-weight: 600; font-size: 1.9rem; line-height: 1; z-index: 3;
  transform: translateY(50%); white-space: nowrap; }
.gauge-hr::before { content: ""; position: absolute; left: -.1rem; top: 50%; width: .35rem; border-top: 2px solid currentColor; opacity: .6; }
.gauge-hr small { font-size: .5em; color: var(--muted); margin-left: .15rem; }
.cand-foot { font-size: .88rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.2em; }
.cand-foot b { font-family: var(--num); color: var(--text); }

.cand.chosen { border-color: var(--accent); background: linear-gradient(180deg, rgb(var(--accent-rgb) / 14%), rgb(var(--accent-rgb) / 3%));
  box-shadow: 0 0 0 1px var(--accent), 0 0 2rem rgb(var(--accent-rgb) / 20%); transform: translateY(-.25rem); }
.cand.chosen .cand-delta, .cand.chosen .cand-pace { color: var(--accent); }
.cand.chosen .cand-tag { background: var(--accent); color: var(--on-accent); }
.cand.chosen .bar-pred { background: linear-gradient(180deg, var(--accent), rgb(var(--accent-rgb) / 35%)); box-shadow: 0 0 1.2rem rgb(var(--accent-rgb) / 35%); }
.cand.chosen .bar-band { background: repeating-linear-gradient(0deg, rgb(var(--accent-rgb) / 35%) 0 2px, transparent 2px 5px); }
.cand.chosen .gauge-hr { color: var(--accent); }
.cand.rejected { opacity: .42; filter: saturate(.5); }
.cand.rejected .bar-pred { background: repeating-linear-gradient(135deg, rgb(var(--warn-rgb) / 55%) 0 3px, rgb(var(--warn-rgb) / 18%) 3px 7px); }
.cand.rejected .bar-band { background: repeating-linear-gradient(0deg, rgb(var(--warn-rgb) / 30%) 0 2px, transparent 2px 5px); }
.cand.rejected .cand-tag { color: #FFFFFF; background: rgb(var(--warn-rgb) / 55%); }
.cand.rejected .cand-foot { color: var(--warn-text); }
.cand.rejected .cand-pace { text-decoration: line-through; text-decoration-color: rgb(var(--warn-rgb) / 70%); text-decoration-thickness: 2px; }
.cand.over .gauge-hr { color: var(--warn); }

/* 새 판단 전환: 카드가 차례로 올라오고 막대가 자란 뒤, 판정(탈락 흐림·선택 강조)이 붙는다 */
.candidate-list.animating .cand { animation: cand-in .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 90ms); }
.candidate-list.animating .bar-pred, .candidate-list.animating .bar-band { animation: bar-grow .75s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 90ms + 180ms); }
.candidate-list.animating .gauge-hr { animation: fade-up .5s ease both; animation-delay: calc(var(--i) * 90ms + 500ms); }
.candidate-list.pending .cand { opacity: 1 !important; filter: none !important; transform: none !important; }
.candidate-list.pending .cand-tag { opacity: 0; }
.candidate-list.pending .cand .bar-pred { background: linear-gradient(180deg, var(--neutral), rgb(var(--neutral-rgb) / 35%)); box-shadow: none; }
.candidate-list.pending .cand .bar-band { background: repeating-linear-gradient(0deg, rgb(var(--neutral-rgb) / 30%) 0 2px, transparent 2px 5px); }
.candidate-list.pending .cand .cand-pace, .candidate-list.pending .cand .cand-delta, .candidate-list.pending .cand .gauge-hr { color: var(--text); text-decoration: none; }
.candidate-list.pending .cand .cand-foot { color: var(--muted); }
.cand-tag { transition: opacity .35s ease; }
.candidate-list.pending .cand.chosen { border-color: var(--panel-line); background: rgb(var(--fg-rgb) / 2.5%); box-shadow: none; }
.cand.chosen.pulse { animation: chosen-pulse 1.1s ease-out 2; }
@keyframes cand-in { from { opacity: 0; transform: translateY(1.2rem) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes bar-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes fade-up { from { opacity: 0; } to { opacity: 1; } }
@keyframes chosen-pulse {
  0% { box-shadow: 0 0 0 1px var(--accent), 0 0 0 0 rgb(var(--accent-rgb) / 60%); }
  100% { box-shadow: 0 0 0 1px var(--accent), 0 0 0 1.4rem rgb(var(--accent-rgb) / 0%); }
}

/* 후보가 많을 때(그룹 AI10 9개 등): 카드가 좁아지므로 글자를 줄이고 탈락 이유는 아래 줄로 */
.candidate-list[data-density="many"] { gap: .45rem; }
.candidate-list[data-density="many"] .cand { padding: .45rem .4rem; border-radius: .6rem; }
.candidate-list[data-density="many"] .cand-delta { font-size: .95rem; }
.candidate-list[data-density="many"] .cand-pace { font-size: 1.35rem; }
.candidate-list[data-density="many"] .cand-pace small { display: none; }
.candidate-list[data-density="many"] .cand-tag { font-size: .66rem; padding: .05rem .3rem; }
.candidate-list[data-density="many"] .gauge-hr { font-size: 1.3rem; padding-left: .3rem; }
.candidate-list[data-density="many"] .gauge-hr small { display: none; }
.candidate-list[data-density="many"] .bar-pred, .candidate-list[data-density="many"] .bar-band { left: 8%; right: 50%; }
.candidate-list[data-density="many"] .cand-foot { font-size: .72rem; white-space: normal; line-height: 1.25; min-height: 2.5em; }

.mode-chip { font-size: .85rem; font-weight: 600; padding: .3rem .7rem; border-radius: .45rem; white-space: nowrap;
  color: var(--text); background: rgb(var(--fg-rgb) / 6%); border: 1px solid var(--panel-line); }
.mode-chip[data-kind="group"] { color: var(--on-accent); background: var(--caution); border-color: var(--caution); }

/* 그룹 판정판: 행 = 멤버, 열 = 후보, 칸 = 허용선까지 남은 bpm */
.group-board { flex: 1; min-height: 0; display: grid; grid-template-columns: 9.5rem repeat(var(--cols, 9), minmax(0, 1fr)); gap: .3rem; align-content: start; overflow: hidden; }
.gb-head { font-family: var(--num); font-weight: 600; font-size: .95rem; color: var(--muted); text-align: center; padding: .2rem 0; border-radius: .35rem; }
.gb-head small { display: block; font-size: .75rem; color: var(--dim); }
.gb-head.chosen { color: var(--on-accent); background: var(--accent); }
.gb-head.chosen small { color: rgb(var(--accent-rgb) / 70%); }
.gb-name { font-size: .9rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb-cell { font-family: var(--num); font-weight: 600; font-size: 1rem; text-align: center; padding: .35rem 0; border-radius: .35rem;
  background: rgb(var(--neutral-rgb) / 12%); color: var(--text); }
.gb-cell.fail { background: repeating-linear-gradient(135deg, rgb(var(--warn-rgb) / 35%) 0 3px, rgb(var(--warn-rgb) / 15%) 3px 7px); color: var(--warn-text); }
.gb-cell.tight { background: rgb(var(--caution-rgb) / 22%); color: var(--caution-text); }
.gb-cell.col-chosen { outline: 2px solid var(--accent); outline-offset: -2px; }
.gb-name.gb-row-worst { color: var(--warn); font-weight: 600; }
.gb-name.gb-row-worst::before { content: "▶"; font-size: .7em; }
.gb-cell.gb-row-worst { box-shadow: inset 0 0 0 1px rgb(var(--warn-rgb) / 45%); }

/* 심박 그래프 */
.check-block { display: flex; gap: 1.1rem; align-items: baseline; color: var(--muted); font-size: .88rem; white-space: nowrap; overflow: hidden; }
.check-line { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.chart-wrap, .map-wrap, .elev-wrap { position: relative; min-height: 0; }
.chart-wrap { flex: 1; }
.map-wrap { flex: 1; }
.elev-wrap { height: 22%; min-height: 3rem; border-top: 1px solid var(--panel-line); margin-top: .35rem; }
.chart-wrap > svg, .map-wrap > svg, .elev-wrap > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }

/* 프로토타입: 고도 단면 패널 제거, 지도 패널 아래 빈 자리는 라이브 화면 박스가 따로 자기 영역(아래 절반)을 쓴다 */
.live-screen-panel { display: flex; flex-direction: column; min-height: 0; }
.live-screen-box { flex: 1; min-height: 6rem; border: 1px dashed var(--panel-line); border-radius: .6rem;
  background: rgb(0 0 0 / 18%); }
.svg-grid { stroke: var(--grid); stroke-width: 1; }
.svg-axis { fill: var(--muted); font-family: var(--num); font-size: .85rem; }
.svg-actual { fill: none; stroke: var(--mist); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.svg-actual-area { fill: url(#actual-fill); }
.svg-pred { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 6px rgb(var(--accent-rgb) / 55%)); }
.svg-band { fill: rgb(var(--accent-rgb) / 14%); stroke: rgb(var(--accent-rgb) / 35%); stroke-width: 1; stroke-dasharray: 3 4; }
.svg-alt { fill: none; stroke: var(--neutral); stroke-opacity: .28; stroke-width: 1.6; }
.svg-alt.rejected { stroke: var(--warn); stroke-opacity: .32; stroke-dasharray: 4 5; }
.svg-allow { stroke: var(--warn); stroke-width: 2.4; stroke-dasharray: 9 7; }
.svg-danger-zone { fill: url(#danger-fill); }
.svg-allow-label { fill: var(--warn); font-family: var(--num); font-weight: 600; font-size: 1.05rem; }
.svg-now { stroke: rgb(var(--fg-rgb) / 30%); stroke-width: 1.2; stroke-dasharray: 2 4; }
.svg-now-label { fill: var(--muted); font-size: .75rem; font-weight: 600; letter-spacing: .1em; }
.svg-dot { fill: var(--accent); stroke: var(--surface-bg); stroke-width: 3; }
.svg-pred-dot { fill: var(--surface-bg); stroke: var(--accent); stroke-width: 3; }
.svg-pred-label { fill: var(--accent); font-family: var(--num); font-weight: 600; font-size: 1.4rem; }
.svg-past-pred { fill: none; stroke: var(--accent); stroke-opacity: .55; stroke-width: 1.6; }
.svg-empty { fill: var(--dim); font-size: 1.05rem; }
.svg-legend { fill: var(--muted); font-size: .78rem; }

/* 코스 */
.svg-course-shadow { fill: none; stroke: rgb(var(--neutral-rgb) / 18%); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.svg-course { fill: none; stroke: rgb(var(--neutral-rgb) / 55%); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.svg-course-done { fill: none; stroke: var(--accent); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 5px rgb(var(--accent-rgb) / 60%)); }
.svg-start { fill: var(--surface-bg); stroke: var(--text); stroke-width: 3; }
.svg-runner { fill: var(--accent); stroke: var(--on-accent); stroke-width: 3; }
.svg-runner-ring { fill: none; stroke: var(--accent); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: ring 1.8s ease-out infinite; }
@keyframes ring { from { transform: scale(.6); opacity: .9; } to { transform: scale(2.6); opacity: 0; } }
.svg-elev { fill: url(#elev-fill); stroke: rgb(var(--neutral-rgb) / 70%); stroke-width: 1.6; }
.svg-elev-done { fill: none; stroke: var(--accent); stroke-width: 2.2; }
.svg-elev-now { stroke: var(--accent); stroke-width: 1.5; }

/* 판단 기록 */
.record-list { list-style: none; margin: 0; padding: 0 .2rem 0 0; flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: .35rem;
  mask-image: linear-gradient(180deg, #000 70%, transparent); }
.record-item { display: grid; grid-template-columns: 3.6rem 1.4rem 4.7rem minmax(0, 1fr) auto; align-items: center; gap: .55rem;
  padding: .38rem .6rem; border-radius: .55rem; background: rgb(var(--fg-rgb) / 3%); border: 1px solid transparent; font-size: .9rem; }
.record-item time { font-family: var(--num); color: var(--muted); font-variant-numeric: tabular-nums; }
.record-item .rec-act { text-align: center; font-size: .85rem; color: var(--muted); }
.record-item .rec-act[data-action="up"] { color: var(--accent); }
.record-item .rec-act[data-action="down"] { color: var(--caution); }
.record-item .rec-act[data-action="ease"] { color: var(--warn); }
.record-item strong { font-family: var(--num); font-size: 1.12rem; font-variant-numeric: tabular-nums; }
.record-item .rec-hr { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.record-item .rec-hr b { font-family: var(--num); color: var(--text); }
.record-item .rec-status { font-size: .72rem; font-weight: 600; padding: .05rem .4rem; border-radius: .3rem; color: var(--caution); background: rgb(var(--caution-rgb) / 13%); }
.record-item .rec-status:empty { display: none; }
.record-item.latest { border-color: rgb(var(--accent-rgb) / 35%); background: rgb(var(--accent-rgb) / 6%); }
.record-item.latest strong { color: var(--accent); }
.record-item.enter { animation: rec-in .55s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rec-in { from { opacity: 0; transform: translateX(-1rem); max-height: 0; } to { opacity: 1; transform: none; max-height: 4rem; } }
.restart-marker { border-left: 3px solid var(--caution); padding: .3rem .6rem; color: var(--caution); font-size: .85rem; }

/* 배너: 레이아웃을 밀지 않게 본문 위에 띄운다 */
.banner { margin-left: auto; z-index: 20; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  padding: .55rem 1.4rem; border-radius: 999px; font-weight: 600; font-size: 1.15rem; white-space: nowrap;
  color: var(--ice); background: var(--ink); border: 1px solid var(--ink); animation: banner-in .35s ease-out; }
.banner.disconnected, .banner.insufficient, .banner.paused, .banner.stale, .banner.clock { color: var(--ink); background: var(--ice); border-color: var(--steel); }
.banner.safety { color: #FFFFFF; background: var(--red); border-color: var(--warn); animation: banner-in .35s ease-out, alarm 1.2s ease-in-out infinite; }
@keyframes banner-in { from { opacity: 0; transform: translateY(-.6rem); } to { opacity: 1; transform: none; } }
@keyframes alarm { 50% { box-shadow: 0 0 2.2rem rgb(var(--warn-rgb) / 55%); } }

/* 대기 화면 */
.waiting { position: absolute; inset: 0; z-index: 10; display: none; place-items: center; border-radius: 1rem;
  background: radial-gradient(ellipse at 50% 55%, rgb(0 0 0 / 92%) 32%, rgb(2 5 14 / 90%) 58%, rgb(37 54 73 / 86%) 86%, rgb(128 150 175 / 80%));
  backdrop-filter: blur(6px); border-radius: var(--radius-card); }
body.is-waiting .waiting { display: grid; }
.waiting-card { display: flex; flex-direction: column; align-items: center; gap: .7rem; padding: 2rem 3rem; text-align: center; }
.radar { position: relative; width: 9rem; height: 9rem; margin-bottom: .6rem; }
.radar span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; animation: radar 2.7s ease-out infinite; }
.radar span:nth-child(2) { animation-delay: .9s; }
.radar span:nth-child(3) { animation-delay: 1.8s; }
.radar i { position: absolute; inset: 37%; border-radius: 50%; background: var(--accent); box-shadow: 0 0 2rem var(--accent-glow); }
@keyframes radar { 0% { transform: scale(.35); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }
.waiting-title { font-size: 2.6rem; font-weight: 600; letter-spacing: -.02em; }
.waiting-sub { color: var(--muted); font-size: 1.1rem; }
.auth-panel { margin-top: 1rem; display: flex; flex-direction: column; gap: .45rem; align-items: stretch; min-width: 26rem; text-align: left; }
.auth-panel label { font-weight: 600; }
.auth-panel span { color: var(--muted); font-size: .85rem; }
.auth-row { display: flex; gap: .5rem; }
.auth-row input { flex: 1; background: var(--field); border: 1px solid var(--panel-line); border-radius: .5rem; padding: .55rem .7rem; }
.auth-row button { background: var(--accent); color: var(--on-accent); font-weight: 600; border: 0; padding: .55rem 1.3rem; }

/* 바닥줄 */
.footer-row { display: flex; align-items: center; gap: 1.2rem; color: var(--muted); font-size: .85rem; min-height: 2rem; }
.conn { display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap; }
.conn-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--dim); }
.conn-dot.on { background: var(--accent); box-shadow: 0 0 .5rem var(--accent-glow); }
.conn-dot.off { background: var(--warn); }
.replay-controls { margin-left: auto; display: flex; align-items: center; gap: .6rem; flex: 0 1 50rem; padding: .3rem .4rem .3rem .9rem;
  border: 1px solid var(--panel-line); border-radius: 999px; background: var(--card-bg); color: var(--text); }
.replay-controls select { font-size: .85rem; padding: .25rem .55rem; }
#play-toggle { font-size: .95rem; font-weight: 600; padding: .35rem 1.1rem; border-radius: 999px; border: 0; background: var(--accent); color: var(--on-accent); white-space: nowrap; }
#play-toggle::before { content: "▶"; margin-right: .4rem; font-size: .8em; }
#play-toggle[data-playing="true"] { background: rgb(var(--fg-rgb) / 12%); color: var(--text); }
#play-toggle[data-playing="true"]::before { content: "❚❚"; letter-spacing: -.15em; }
.waiting-play { margin-top: 1rem; font-size: 1.3rem; font-weight: 600; padding: .7rem 2.2rem; border-radius: 999px; border: 0;
  background: var(--accent); color: var(--on-accent); box-shadow: 0 0 2rem rgb(var(--accent-rgb) / 35%); }
.waiting-play::before { content: "▶"; margin-right: .6rem; }
.waiting-hint { color: var(--dim); font-size: .85rem; }
#recording-select { max-width: 14rem; }
#progress { flex: 1; min-width: 6rem; }
.replay-controls output { font-family: var(--num); white-space: nowrap; }
.debug-metrics { color: var(--caution); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── 그룹 공동 페이스(AI10) 화면 ───────── */
.group-board { grid-template-rows: auto repeat(var(--rows, 3), minmax(0, 1fr)); align-content: stretch; gap: .35rem; }
.gb-head { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .05rem; padding: .3rem 0; }
.gb-head.gb-corner { align-items: flex-start; padding-left: .2rem; font-family: var(--ui); font-size: .8rem; }
.gb-head.current { box-shadow: inset 0 -2px 0 rgb(var(--fg-rgb) / 35%); color: var(--text); }
.gb-head.col-fail { color: var(--warn-text); }
.gb-mark { font-style: normal; font-size: .72rem; font-weight: 600; min-height: 1em; }
.gb-head.chosen .gb-mark { color: var(--on-accent); }
.gb-name { flex-direction: row; align-items: baseline; gap: .45rem; padding: 0 .3rem; border-radius: .35rem; }
.gb-name .gb-who { font-weight: 600; color: var(--text); }
.gb-name .gb-hr { font-family: var(--num); font-size: 1.55rem; color: var(--text); }
.gb-name small { color: var(--muted); font-size: .75rem; }
.gb-name.gb-row-worst { background: rgb(var(--warn-rgb) / 10%); }
.gb-name.gb-row-worst .gb-who, .gb-name.gb-row-worst .gb-hr { color: var(--warn); }
.gb-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; padding: .2rem 0; }
.gb-cell b { font-family: var(--num); font-size: 1.45rem; line-height: 1; }
.gb-cell small { font-family: var(--ui); font-size: .68rem; color: var(--muted); font-weight: 500; }
.gb-cell.fail small { color: var(--warn-text); }
.gb-cell.col-chosen { background: rgb(var(--accent-rgb) / 14%); }
.gb-cell.col-chosen b { color: var(--accent); }
.gb-cell.col-chosen.fail b { color: var(--warn-text); }
.group-board.animating .gb-cell { animation: fade-up .35s ease both; animation-delay: calc(var(--i, 0) * 12ms); }
.group-board.animating .gb-head.chosen { animation: chosen-head 1.1s ease-out 1.1s 2; }
@keyframes chosen-head { 0% { box-shadow: 0 0 0 0 rgb(var(--accent-rgb) / 70%); } 100% { box-shadow: 0 0 0 .9rem rgb(var(--accent-rgb) / 0%); } }
.guide-from { font-family: var(--num); font-weight: 600; font-size: 2.2rem; color: var(--muted); margin-right: .4rem; align-self: center; }
.svg-member { fill: none; stroke: var(--neutral); stroke-opacity: .55; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.svg-member.worst { stroke: var(--mist-pale); stroke-opacity: 1; stroke-width: 3; }
.svg-member-pred { fill: none; stroke: var(--neutral); stroke-opacity: .6; stroke-width: 1.8; stroke-dasharray: 5 4; }
.svg-member-dot { fill: var(--surface-bg); stroke: var(--neutral); stroke-width: 2; }
.svg-member-label { fill: var(--muted); font-family: var(--num); font-weight: 600; font-size: .95rem; }
.guide-from { white-space: nowrap; font-size: 1.9rem; }
.guide-main { flex-wrap: nowrap; min-width: 0; }
.gb-name { flex-wrap: wrap; row-gap: 0; align-content: center; }
.gb-name small { flex-basis: 100%; }
/* 코스 데이터가 없으면 지도 칸을 접고 판단 기록에 자리를 준다 */
.context.no-course { grid-template-rows: minmax(0, 1fr); }
.context.no-course .map-panel { display: none; }
.guide-card.has-from .guide-pace { font-size: 4.3rem; }
.guide-card.has-from .guide-from { font-size: 1.6rem; margin-right: .2rem; }
.guide-card.has-from .guide-unit { font-size: 1.2rem; }
.guide-card.has-from .action-pill { margin-left: .4rem; font-size: 1.15rem; padding: .25rem .7rem; }

/* ── 앱 카드 모양 (681): Card glass/solid · vignette · deep · course ── */
.guide-card, .stat, .panel {
  background: var(--card-bg); border: 1px solid var(--card-edge); border-radius: var(--radius-card);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 12%); backdrop-filter: none;
}
.stat { padding: 1rem 1.3rem; }
.panel { padding: 1rem 1.3rem 1.1rem; }
/* 6.5 공동 페이스와 같은 비네트: 가운데 검정에서 가장자리 청회색으로 */
.guide-card.tone-dark {
  border-color: rgb(255 255 255 / 14%);
  background: radial-gradient(ellipse 70% 120% at 50% 55%, rgb(0 0 0 / 96%) 32%, rgb(2 5 14 / 92%) 58%, rgb(37 54 73 / 88%) 86%, rgb(128 150 175 / 80%) 100%), var(--ink);
}
.guide-card::before { display: none; }
.guide-card .kicker { color: var(--text); }
/* 차트·지도 박스: 앱 deep(어두운 유리)·course(코스 카드) */
.panel.tone-dark { border-color: rgb(255 255 255 / 14%); background: linear-gradient(170deg, rgb(128 150 175 / 66%), rgb(2 5 14 / 94%) 70%), var(--ink); }
.map-panel.tone-dark { background: radial-gradient(ellipse 75% 75% at 50% 45%, #02050E 40%, #253649 80%, #8096AF 100%); }

/* 글자: 제목은 Noto Sans KR Medium/Black, 숫자는 Archivo 폭 125 */
h1 { font-weight: 700; font-size: 1.45rem; letter-spacing: -.01em; }
.panel-head h2 { font-weight: 600; }
.brand-name { font-family: var(--num); font-weight: 600; letter-spacing: .18em; color: var(--muted); }
.brand-name em { color: var(--text); }
.brand-mark { width: 2.7rem; height: 2.7rem; border-radius: 0; background: none; box-shadow: none; color: var(--ink); display: block; }
.brand-mark::after { display: none; }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.guide-pace { font-weight: 500; font-size: 4.8rem; letter-spacing: -.03em; }
.guide-card.has-from .guide-pace { font-size: 3.7rem; }
.guide-side-value { font-weight: 500; font-size: 2.8rem; }
.stat-value { font-weight: 400; font-size: 3rem; letter-spacing: -.02em; }
.stat-unit { font-size: 1rem; }
.cand-pace { font-weight: 500; font-size: 1.75rem; }
.gauge-hr { font-weight: 500; font-size: 1.6rem; }
.gb-cell b { font-weight: 500; font-size: 1.25rem; }
.gb-name .gb-hr { font-weight: 500; font-size: 1.35rem; }
.record-item strong { font-weight: 500; font-size: 1rem; }

/* 칩·버튼: 앱 칩(선 외곽선)·주 버튼(반전색 알약) */
.stage-badge, .mode-chip, .policy-label, .delivery { border-radius: 999px; }
.stage-badge { background: var(--card-bg); border-color: var(--panel-line); font-size: .9rem; }
.mode-chip { background: transparent; border-color: var(--panel-line); color: var(--text); font-weight: 600; padding: .35rem .9rem; }
.mode-chip[data-kind="group"] { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.action-pill { border-radius: 999px; font-weight: 600; }
.action-pill[data-action="hold"] { background: rgb(var(--fg-rgb) / 12%); }
.action-pill[data-action="down"] { color: var(--ink); background: var(--mist-pale); border-color: var(--mist-pale); }
.action-pill[data-action="ease"] { background: var(--red); border-color: var(--red); }
button { border-radius: 999px; }
select { border-radius: 999px; background: var(--field); }
.footer-row { color: var(--ink); }
.footer-row .conn { background: rgb(255 255 255 / 55%); padding: .3rem .8rem; border-radius: 999px; }
.conn-dot.on { background: var(--ink); box-shadow: none; }
.conn-dot.off { background: var(--red); }
.replay-controls { border-color: var(--card-edge); }
input[type="range"] { accent-color: var(--ink); }

/* 후보 카드·판정판: 흰 카드 안의 칩 바탕 칸, 선택은 반전색(검정 바탕) */
.cand { border-radius: var(--radius-inner); background: var(--field); border-color: transparent; }
.cand.chosen { background: var(--ink); border-color: var(--ink); box-shadow: none; }
.cand.chosen, .cand.chosen .cand-delta, .cand.chosen .cand-pace, .cand.chosen .gauge-hr { color: var(--ice); }
.cand.chosen .cand-pace small, .cand.chosen .cand-foot, .cand.chosen .gauge-hr small { color: rgb(232 238 244 / 62%); }
.cand.chosen .cand-foot b { color: var(--ice); }
.cand.chosen .cand-tag { background: var(--ice); color: var(--ink); }
.cand.chosen .gauge { background: rgb(232 238 244 / 8%); }
.cand.chosen .bar-pred { background: linear-gradient(180deg, var(--ice), rgb(232 238 244 / 35%)); box-shadow: none; }
.cand.chosen .bar-band { background: repeating-linear-gradient(0deg, rgb(232 238 244 / 35%) 0 2px, transparent 2px 5px); }
.cand.chosen .allow-line { border-top-color: var(--red-light); }
.gauge { background: rgb(2 5 14 / 4%); }
.bar-pred { background: linear-gradient(180deg, var(--mist), rgb(125 160 178 / 35%)); }
.candidate-list.pending .cand.chosen { background: var(--field); border-color: transparent; }
.candidate-list.pending .cand.chosen .cand-pace, .candidate-list.pending .cand.chosen .cand-delta, .candidate-list.pending .cand.chosen .gauge-hr { color: var(--text); }
@keyframes chosen-pulse { 0% { box-shadow: 0 0 0 0 rgb(2 5 14 / 45%); } 100% { box-shadow: 0 0 0 1.2rem rgb(2 5 14 / 0%); } }
.gb-head { border-radius: 999px; }
.gb-head.chosen { color: var(--ice); background: var(--ink); }
.gb-head.chosen small, .gb-head.chosen .gb-mark { color: rgb(232 238 244 / 70%); }
.gb-head.current { box-shadow: inset 0 -2px 0 rgb(2 5 14 / 35%); }
.gb-cell { border-radius: var(--radius-inner); background: var(--field); }
.gb-cell.col-chosen { background: var(--ink); outline: none; }
.gb-cell.col-chosen b { color: var(--ice); }
.gb-cell.col-chosen small { color: rgb(232 238 244 / 62%); }
.gb-cell.fail { background: repeating-linear-gradient(135deg, rgb(212 74 74 / 22%) 0 3px, rgb(212 74 74 / 8%) 3px 7px); color: var(--red); }
.gb-cell.col-chosen.fail { background: repeating-linear-gradient(135deg, rgb(212 74 74 / 70%) 0 3px, rgb(2 5 14 / 95%) 3px 7px); }
.gb-cell.col-chosen.fail b, .gb-cell.col-chosen.fail small { color: #FFFFFF; }
.gb-cell.tight { background: rgb(212 74 74 / 10%); color: var(--red); }
.gb-name { border-radius: var(--radius-inner); }
.gb-name.gb-row-worst { background: rgb(212 74 74 / 8%); }
@keyframes chosen-head { 0% { box-shadow: 0 0 0 0 rgb(2 5 14 / 45%); } 100% { box-shadow: 0 0 0 .9rem rgb(2 5 14 / 0%); } }
.lg-chosen::before { box-shadow: none; }
.record-item { border-radius: var(--radius-inner); background: var(--field); }
.record-item.latest { background: var(--ink); border-color: var(--ink); color: var(--ice); }
.record-item.latest strong, .record-item.latest .rec-hr b, .record-item.latest .rec-act { color: var(--ice); }
.record-item.latest time, .record-item.latest .rec-hr { color: rgb(232 238 244 / 62%); }

/* 심박: 앱처럼 빨강 #D44A4A(어두운 카드 위는 옅은 빨강) */
.heart { color: var(--red); }
.stat-hr.over .stat-value { color: var(--red); text-shadow: none; }
.stat-hr.over { border-color: rgb(212 74 74 / 50%); }
.svg-pred { stroke: var(--ice); filter: drop-shadow(0 0 5px rgb(232 238 244 / 45%)); }
.svg-band { fill: rgb(232 238 244 / 12%); stroke: rgb(232 238 244 / 35%); }
.svg-course-done { filter: none; }
.radar span { border-color: var(--ice); }
.radar i { background: var(--ice); box-shadow: 0 0 2rem rgb(232 238 244 / 40%); }
.waiting-play, .auth-row button { background: var(--ice); color: var(--ink); box-shadow: none; }
#play-toggle { background: var(--ink); color: var(--ice); }
#play-toggle[data-playing="true"] { background: var(--field); color: var(--ink); }
.gb-cell.col-chosen.tight { background: var(--ink); color: var(--red-light); }
.gb-cell.col-chosen.tight b { color: var(--red-light); }
/* 프로토타입: stage-wrap이 hero 너비를 이미 고정해서 여기서는 1열 유지(숫자 카드는 747에서 숨김) */
.hero { grid-template-columns: minmax(0, 1fr); }
.guide-card { column-gap: 1.1rem; }
.guide-main { overflow: hidden; }
.guide-pace { font-size: 4.4rem; }
.guide-card.has-from .guide-pace { font-size: 3.4rem; }
.guide-unit { font-size: 1.3rem; }
.action-pill { font-size: 1.1rem; padding: .3rem .85rem; margin-left: .5rem; flex: none; }
.guide-card.has-from .action-pill { font-size: 1rem; padding: .25rem .65rem; }
.guide-side { padding-left: 1.1rem; }
.guide-side-value { font-size: 2.4rem; }
.stat-value { font-size: 2.7rem; }

/* 보기 토큰 입력(718): 앱 입력란(높이 46·모서리 15, 옅은 바탕 + 외곽선)과 주 버튼(반전색 알약) */
.auth-panel { margin-top: 1.4rem; gap: .6rem; min-width: 30rem; padding: 1.3rem 1.4rem 1.2rem; border-radius: var(--radius-card);
  background: rgb(232 238 244 / 6%); border: 1px solid rgb(255 255 255 / 14%); box-shadow: inset 0 1px 0 rgb(255 255 255 / 12%); }
.auth-panel label { font-weight: 400; font-size: 1.05rem; }
.auth-row { gap: .6rem; }
.auth-row input { height: 2.9rem; border-radius: .95rem; padding: 0 1rem; font-size: 1rem; letter-spacing: .08em;
  background: rgb(232 238 244 / 8%); border: 1px solid rgb(232 238 244 / 22%); color: var(--ice); }
.auth-row input::placeholder { color: rgb(232 238 244 / 42%); letter-spacing: 0; }
.auth-row input:focus { outline: none; border: 1.5px solid var(--ice); }
.auth-row button { height: 2.9rem; padding: 0 1.6rem; border-radius: 999px; font-weight: 400; font-size: 1rem; }
.auth-panel .auth-error { color: var(--red-light); font-size: .9rem; }
.auth-panel:has(.auth-error:not(.hidden)) .auth-row input { border: 1.5px solid var(--red-light); }

/* 패널 확대 모달(736): 발표장 큰 화면용. 열린 동안 루트 글자 크기를 키워 rem 기준 글자·그래프가 함께 커진다 */
html.zoom-open { font-size: calc(max(11px, min(1.5vh, 0.84vw)) * var(--zoom-scale, 1.6)); }
.zoomable { cursor: zoom-in; }
.zoomable:hover { box-shadow: inset 0 1px 0 rgb(255 255 255 / 12%), 0 0 0 2px rgb(77 255 210 / 55%); }
.zoom-open-btn { flex: none; margin-left: .5rem; width: 1.9rem; height: 1.9rem; padding: 0; border-radius: 999px; font-size: 1rem; line-height: 1;
  background: rgb(var(--fg-rgb) / 8%); color: var(--text); border: 1px solid var(--panel-line); }
.zoom-open-btn:hover, .zoom-open-btn:focus-visible { background: #4DFFD2; color: #02050E; border-color: #4DFFD2; outline: none; }
.guide-card .kicker .zoom-open-btn { margin-left: auto; }
.zoom-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgb(2 5 14 / 72%); backdrop-filter: blur(4px); }
.zoom-dialog { width: 94vw; height: 90vh; display: flex; flex-direction: column; gap: .6rem; padding: .9rem 1.1rem 1.1rem;
  border-radius: var(--radius-card); border: 1px solid rgb(255 255 255 / 14%);
  background: linear-gradient(170deg, #253649, #02050E 70%); box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 50%); }
.zoom-head { display: flex; align-items: flex-start; gap: 1rem; }
.zoom-head-text { flex: 1; min-width: 0; }
.zoom-head h2 { margin: 0; font-size: 1.15rem; font-weight: 600; color: var(--ice); }
.zoom-head p { margin: .25rem 0 0; font-size: .95rem; line-height: 1.45; color: rgb(232 238 244 / 82%); }
.zoom-close { flex: none; font-size: .9rem; padding: .35rem .9rem; background: var(--ice); color: var(--ink); border: 0; }
.zoom-close:focus-visible { outline: 3px solid #4DFFD2; outline-offset: 2px; }
.zoom-body { flex: 1; min-height: 0; display: flex; }
.zoom-body > .is-zoomed { flex: 1; width: 100%; height: 100%; min-height: 0; cursor: default; }
.zoom-body > .is-zoomed:hover { box-shadow: inset 0 1px 0 rgb(255 255 255 / 12%); }
.zoom-body > .is-zoomed .zoom-open-btn { display: none; }
.zoom-body > .tone-light { color: var(--text); }
.zoom-body > .guide-card.is-zoomed { align-content: center; }
.record-age { font-size: .78rem; margin-left: auto; margin-right: .6rem; }
.record-age.late { color: var(--red); font-weight: 600; }
/* 선두·후미(727): 점 이름표 배지와 지도 아래 간격 줄. 오래된 위치는 흐리게 */
.live-map .tip-badge { font-style: normal; font-family: var(--ui); font-size: .68rem; font-weight: 600; margin-left: .35rem;
  padding: .02rem .4rem; border-radius: 999px; }
.live-map .tip-badge.lead { background: #4DFFD2; color: #02050E; }
.live-map .tip-badge.tail { background: #E8EEF4; color: #02050E; }
.live-map .tip-badge.side { background: #4D9BFF; color: #02050E; }
.live-map .tip-stale { font-style: normal; font-family: var(--ui); font-size: .66rem; margin-left: .35rem; color: rgb(232 238 244 / 60%); }
.live-map .route-tip.is-stale { opacity: .6; }
.map-standings { position: absolute; left: .6rem; bottom: 1.7rem; z-index: 2; max-width: calc(100% - 1.2rem); padding: .3rem .8rem;
  border-radius: 999px; background: rgb(2 5 14 / 82%); color: var(--ice); font-size: .82rem; font-weight: 400;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1px solid rgb(255 255 255 / 14%); }
/* 실시간 경로 지도(722): 앱 지도처럼 어두운 바탕에 민트 경로. OSM 타일을 어둡게 뒤집어 카드 톤에 맞춘다 */
.live-map { position: absolute; inset: 0; border-radius: var(--radius-inner); overflow: hidden; background: #0B1522; z-index: 1; }
.live-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.82) contrast(.92) saturate(.35); }
.live-map .leaflet-control-attribution { font-family: var(--ui); font-size: .7rem; background: rgb(2 5 14 / 70%); color: rgb(232 238 244 / 70%); }
.live-map .leaflet-control-attribution a { color: var(--ice); }
.live-map .leaflet-bar a { background: rgb(2 5 14 / 80%); color: var(--ice); border-color: rgb(255 255 255 / 14%); }
.live-map .route-tip { font-family: var(--num); font-weight: 500; font-size: .75rem; padding: .1rem .45rem; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--ice); box-shadow: none; }
.live-map .route-tip::before { display: none; }
.map-follow { position: absolute; right: .6rem; top: .6rem; z-index: 2; font-size: .85rem; font-weight: 400; padding: .35rem .9rem;
  background: rgb(2 5 14 / 80%); color: var(--ice); border: 1px solid rgb(255 255 255 / 18%); }
.map-follow[aria-pressed="true"] { background: #4DFFD2; color: #02050E; border-color: #4DFFD2; }
body.has-live-map #course-map { visibility: hidden; }
body.has-live-map .elev-wrap { display: none; }
/* 그룹 화면처럼 계획 코스가 없어도 실시간 경로가 있으면 지도 칸을 보인다 */
body.has-live-map .context.no-course { grid-template-rows: minmax(0, 1.15fr) minmax(0, 1fr); }
body.has-live-map .context.no-course .map-panel { display: flex; }

/* 안내 vs 실제 페이스(724): 큰 숫자는 안내, 그 아래 줄에 실제 측정 페이스. 정지는 글자로 */
.actual-line { margin: .35rem 0 0; display: flex; align-items: baseline; gap: .5rem; white-space: nowrap; overflow: hidden; min-width: 0; }
.actual-tag { flex: none; font-size: .78rem; font-weight: 600; padding: .08rem .55rem; border-radius: 999px; background: #4DFFD2; color: #02050E; }
#actual-text { font-family: var(--num); font-weight: 500; font-size: 1.35rem; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#actual-text .actual-stopped { color: var(--mist-pale); font-family: var(--ui); font-weight: 600; }
#actual-text .actual-none { color: var(--muted); }
#actual-note { flex: none; color: var(--muted); font-size: .72rem; }
.reason-line { margin-top: .25rem; font-size: .95rem; }
.gb-name .gb-actual { font-family: var(--num); font-weight: 500; color: var(--text); font-size: .78rem; }
.gb-name .gb-actual.actual-stopped { color: var(--steel); font-family: var(--ui); }
.gb-name .gb-actual.actual-none { color: var(--muted); }

/* ── 청중용 정리(747) ─────────────────────────────────────────
   위: 큰 안내(말로 된 한 줄) + 최근 판단 흐름 / 아래: 왼쪽 후보·심박 그래프, 오른쪽 큰 지도.
   숫자 카드(stat)는 숨기고, 보조 숫자는 확대 모달에서만 보인다. */
.hero > .stat { display: none; }
/* 프로토타입: 지도·라이브 화면(.context)이 stage-wrap 오른쪽 열로 올라가 목표 페이스 줄까지 포함한 전체 높이를 쓴다.
   stage-wrap이 왼쪽 열 너비를 이미 고정하므로 .hero·.stage 자체는 1열만 쓰면 된다(위 선언대로) */
/* 프로토타입: 지도·라이브 화면 반반 */
.context, .context.no-course, body.has-live-map .context.no-course { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
.context.no-course .map-panel { display: flex; }

/* 큰 안내 한 줄: 색으로 방향을 바로 알게 */
.reason-line { font-size: 1.45rem; font-weight: 600; white-space: normal; line-height: 1.3; margin-top: .45rem; color: var(--ice); }
.reason-line[data-tone="up"]::before { content: "▲ "; color: #4DFFD2; }
.reason-line[data-tone="down"]::before { content: "▼ "; color: #FFD84D; }
.reason-line[data-tone="danger"]::before { content: "▼▼ "; color: var(--red-light); }
.reason-line[data-tone="hold"]::before { content: "■ "; color: var(--mist-pale); }
.reason-line[data-tone="wait"] { color: rgb(232 238 244 / 62%); font-weight: 400; }
.reason-detail { display: none; margin: .3rem 0 0; font-size: .9rem; color: rgb(232 238 244 / 70%); }
.guide-card > .reason-detail { grid-column: 1; }

/* 최근 판단 흐름(판단 기록을 위로): 가로 카드, 최신이 왼쪽 */
.hero > .records-panel { padding: .8rem 1rem .9rem; }
.hero > .records-panel .panel-head { margin-bottom: .45rem; }
.hero > .records-panel .record-list { flex-direction: row; gap: .55rem; overflow: hidden;
  mask-image: linear-gradient(90deg, #000 78%, transparent); }
.hero > .records-panel .record-item { flex: 0 0 11.5rem; display: grid; grid-template-columns: auto 1fr;
  grid-template-areas: "time status" "act pace" "hr hr"; align-content: start; row-gap: .15rem; column-gap: .45rem; padding: .55rem .7rem; }
.hero > .records-panel .record-item time { grid-area: time; font-size: .8rem; }
.hero > .records-panel .record-item .rec-act { grid-area: act; font-size: 1.1rem; }
.hero > .records-panel .record-item strong { grid-area: pace; font-size: 1.5rem; }
.hero > .records-panel .record-item .rec-hr { grid-area: hr; font-size: .8rem; white-space: normal; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hero > .records-panel .record-item .rec-status { grid-area: status; justify-self: end; }
.hero > .records-panel .restart-marker { flex: 0 0 auto; }

/* 숫자 줄이기: 평소엔 색·✓/✕, 확대 모달(.zoom-body)에서만 숫자 */
.gb-cell .gb-ok { font-style: normal; font-family: var(--ui); font-weight: 600; font-size: 1.6rem; line-height: 1; }
.gb-cell.fail .gb-ok { color: var(--red); }
.gb-cell.col-chosen .gb-ok { color: var(--ice); }
.gb-cell.col-chosen.fail .gb-ok, .gb-cell.col-chosen.tight .gb-ok { color: var(--red-light); }
.stage .gb-cell b, .stage .gb-cell small { display: none; }
.stage .gb-name small:not(.gb-actual) { display: none; }
.stage #candidate-meta, .stage .check-block, .stage .cand-foot, .stage .gauge-hr { display: none; }
.zoom-body .gb-cell .gb-ok { font-size: .9rem; }
.zoom-body .gb-cell b, .zoom-body .gb-cell small { display: block; }
.zoom-body .gb-name small { display: block; }
.zoom-body #candidate-meta, .zoom-body .cand-foot { display: initial; }
.zoom-body .gauge-hr { display: block; }
.zoom-body .check-block { display: flex; }
.zoom-body .reason-detail { display: block; }

/* 747-2: 글을 줄이고 색·아이콘으로. 판단 흐름 크게, 새 판단은 맨 앞에서 잠깐 강조 */
.panel-tag { margin-left: .5rem; padding: .08rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 500;
  background: rgb(var(--fg-rgb) / 8%); color: var(--muted); vertical-align: .15em; }
.hero > .records-panel .record-item { flex-basis: 12.5rem; grid-template-columns: auto auto 1fr;
  grid-template-areas: "time time tag" "act pace pace"; padding: .6rem .8rem; }
.hero > .records-panel .record-item time { font-size: 1rem; }
.hero > .records-panel .record-item .rec-act { font-size: 1.6rem; }
.hero > .records-panel .record-item strong { font-size: 2.1rem; }
.hero > .records-panel .record-item .rec-hr, .hero > .records-panel .record-item .rec-status { display: none; }
.rec-tag { display: none; }
.hero > .records-panel .rec-tag { display: inline-block; grid-area: tag; justify-self: end; font-size: .85rem; font-weight: 600;
  padding: .05rem .55rem; border-radius: 999px; background: rgb(var(--fg-rgb) / 8%); }
.hero > .records-panel .rec-tag[data-tone="up"] { background: #4DFFD2; color: #02050E; }
.hero > .records-panel .rec-tag[data-tone="down"] { background: #FFD84D; color: #02050E; }
.hero > .records-panel .rec-tag[data-tone="danger"] { background: var(--red); color: #FFFFFF; }
.hero > .records-panel .rec-tag[data-tone="hold"] { background: var(--mist-pale); color: #02050E; }
.hero > .records-panel .record-item.enter { animation: rec-in .55s cubic-bezier(.2, .8, .2, 1) both, rec-flash 1.6s ease-out both; }
@keyframes rec-flash { 0%, 30% { box-shadow: 0 0 0 3px #4DFFD2, 0 0 1.4rem rgb(77 255 210 / 55%); } 100% { box-shadow: 0 0 0 0 rgb(77 255 210 / 0%); } }
.reason-line { font-size: 1.7rem; }
/* 확대 모달: 화면의 약 75%, 뒤 화면이 비쳐 어디를 키웠는지 보이게 */
.zoom-modal { background: rgb(2 5 14 / 45%); backdrop-filter: blur(1.5px); }
.zoom-dialog { width: 78vw; height: 76vh; }
/* 747-2: 판단 흐름 카드(고정 폭)가 grid 칸을 넓혀 화면이 가로로 넘치지 않게 */
.hero > *, .stage > *, .analysis > *, .context > * { min-width: 0; }
.hero > .records-panel { overflow: hidden; }
/* 747-4: 빈 상태 — 판단 흐름 자리에 짧은 안내(빈 흰 칸 대신) */
.hero > .records-panel .record-list:empty { align-items: center; justify-content: center; min-height: 6rem; }
.hero > .records-panel .record-list:empty::after { content: "첫 판단을 기다리는 중"; color: var(--muted); font-size: 1.15rem; }

/* 747-5: 안내 카드는 청중이 한눈에 볼 세 가지만 — 목표 페이스 / 지금(실제) / 지금 판단 한 줄.
   워치 전달·이전 페이스·러너별 실제·60초 평균·2분 뒤 예측은 확대 모달에서만 */
.hero > .guide-card .delivery, .hero > .guide-card .guide-from, .hero > .guide-card .action-pill,
.hero > .guide-card .actual-line, .hero > .guide-card .guide-side { display: none; }
.actual-sum { display: none; }
.hero > .guide-card .actual-sum { display: flex; grid-column: 2; grid-row: 2; align-self: end; flex-direction: column; align-items: flex-end;
  gap: .1rem; padding-bottom: .45rem; }
.hero > .guide-card .actual-sum span { font-size: .85rem; color: rgb(232 238 244 / 62%); }
.hero > .guide-card .actual-sum b { font-family: var(--num); font-weight: 500; font-size: 2rem; color: rgb(232 238 244 / 88%); line-height: 1; }
.hero > .guide-card .guide-main { grid-row: 2; }
.hero > .guide-card .reason-line { grid-column: 1 / -1; }
/* 빈 상태: 줄·기호 대신 짧은 안내 한 줄 */
.hero > .guide-card.is-empty .guide-main, .hero > .guide-card.is-empty .actual-sum { display: none; }
.hero > .guide-card.is-empty { align-content: center; }
.hero > .guide-card.is-empty .reason-line { font-size: 2.2rem; color: rgb(232 238 244 / 70%); margin-top: .6rem; }
.hero > .guide-card.is-empty .reason-line::after { content: "첫 판단이 오면 목표 페이스가 여기에 나옵니다"; display: block;
  margin-top: .35rem; font-size: 1rem; font-weight: 400; color: rgb(232 238 244 / 50%); }
/* 판단 흐름: 목록은 카드 높이만큼(잘리지 않게), 빈 상태는 점선 칸 하나 */
.hero > .records-panel .record-list { flex: none; align-items: flex-start; padding: .2rem .2rem .3rem; }
.hero > .records-panel.is-empty .panel-head .meta { display: none; }
.hero > .records-panel .record-list:empty { min-height: 0; justify-content: flex-start; }
.hero > .records-panel .record-list:empty::after { content: "첫 판단을 기다리는 중"; display: grid; place-items: center;
  width: 12.5rem; height: 5.6rem; border: 2px dashed rgb(var(--fg-rgb) / 18%); border-radius: var(--radius-inner, .8rem);
  color: var(--muted); font-size: 1rem; }
.hero > .guide-card .kicker { grid-column: 1 / -1; }

/* 747-6: 청중에게 보여 줄 것만.
   안내 카드 = [지금 6'14"] → [AI 목표 6'04"] 한 줄 흐름 + 판단 한 줄. 오른쪽 여백 없음 */
.hero > .guide-card { grid-template-columns: auto minmax(0, 1fr); column-gap: 1.4rem; }
.hero > .guide-card .kicker { grid-column: 1 / -1; grid-row: 1; }
.hero > .guide-card .actual-sum { grid-column: 1; grid-row: 2; align-self: end; display: grid; grid-template-columns: auto auto;
  column-gap: 1.2rem; align-items: end; padding-bottom: .55rem; }
.hero > .guide-card .actual-sum span { grid-column: 1; grid-row: 1; font-size: .95rem; color: rgb(232 238 244 / 62%); }
.hero > .guide-card .actual-sum b { grid-column: 1; grid-row: 2; font-size: 2.6rem; font-weight: 500; color: rgb(232 238 244 / 82%); }
.hero > .guide-card .actual-sum i { grid-column: 2; grid-row: 2; font-style: normal; font-size: 2.2rem; color: rgb(232 238 244 / 55%); }
.hero > .guide-card .guide-main { grid-column: 2; grid-row: 2; flex-wrap: wrap; align-items: baseline; }
.hero > .guide-card .guide-main::before { content: "AI 목표"; flex: 0 0 100%; font-family: var(--ui); font-size: .95rem; font-weight: 600;
  color: #4DFFD2; margin-bottom: .1rem; }
.hero > .guide-card .reason-line { grid-column: 1 / -1; grid-row: 3; }
/* 오른쪽 위 예측기·정책 이름은 청중용 화면에서 숨김 */
.model-label, .policy-label { display: none; }
/* 판단 기록 보조 글(마지막 판단 N초 전)은 숨기고, 건수는 작게 */
.hero > .records-panel .record-age { display: none; }
.hero > .records-panel .panel-head .meta { font-size: .8rem; }
/* 판단 흐름 카드: 높이·글자 크기 고정, 새 카드 애니메이션은 높이를 건드리지 않는다(예전 rec-in의 max-height 4rem이 맨 앞 카드를 잘랐다) */
.hero > .records-panel .record-list { height: 6.2rem; flex: none; align-items: stretch; padding: .25rem .2rem; }
.hero > .records-panel .record-item { flex: 0 0 12.5rem; height: 5.6rem; box-sizing: border-box; align-content: center; overflow: hidden; }
.hero > .records-panel .record-item time { font-size: 1rem; line-height: 1.2; }
.hero > .records-panel .record-item .rec-act { font-size: 1.6rem; line-height: 1; }
.hero > .records-panel .record-item strong { font-size: 2.1rem; line-height: 1.05; }
.hero > .records-panel .record-item.enter { animation: rec-slide .55s cubic-bezier(.2, .8, .2, 1) both, rec-flash 1.6s ease-out both; }
@keyframes rec-slide { from { opacity: 0; transform: translateX(-1rem); } to { opacity: 1; transform: none; } }
.hero > .records-panel .record-list:empty { height: 6.2rem; }
.hero > .records-panel .record-list:empty::after { height: 5.6rem; box-sizing: border-box; }
/* 후보 표: 색은 선택(검정)·통과(연회색 ✓)·탈락(빨강 ✕ 줄무늬) 세 가지만. 빠듯함(tight)·기준 러너 줄 분홍은 없앤다 */
.stage .gb-cell.tight { background: var(--field); color: var(--text); }
.stage .gb-cell.col-chosen.tight { background: var(--ink); color: var(--ice); }
.stage .gb-cell.col-chosen.tight .gb-ok { color: var(--ice); }
.stage .gb-cell.gb-row-worst { box-shadow: none; }
.stage .gb-name.gb-row-worst { background: transparent; color: var(--text); }
.stage .gb-name.gb-row-worst::before { content: none; }
.stage .gb-name.gb-row-worst .gb-who, .stage .gb-name.gb-row-worst .gb-hr { color: var(--text); }
.gb-ref { display: inline-block; margin-left: .35rem; padding: .02rem .45rem; border-radius: 999px; font-style: normal; font-size: .72rem;
  font-weight: 600; background: var(--ink); color: var(--ice); vertical-align: .15em; }
/* 심박 그래프: 러너별 색(선·예측·허용선·라벨), 큰 빨간 영역은 아주 옅게 */
.svg-danger-zone { opacity: .18; }
.svg-allow.member { stroke-width: 1.8; stroke-dasharray: 6 6; stroke-opacity: .9; }
.svg-allow-label.member { font-size: .9rem; font-weight: 500; }
.svg-pred.member { filter: none; stroke-width: 3.2; }
.svg-member { stroke-opacity: .8; }
.svg-member.worst { stroke-opacity: 1; }
.svg-member-pred { stroke-opacity: .85; }

/* 747-7: 청중용 5차 — 러너 크게, 칸 = 후보 페이스, 그래프 민트, 여백 줄이기 */
/* 지도 러너 이름표 크게 */
.live-map .route-tip { font-size: 1.1rem; font-weight: 600; padding: .2rem .7rem; }
.live-map .tip-badge { font-size: .85rem; padding: .05rem .5rem; }
/* 표 러너 이름·심박 한 단계 크게 */
.stage .gb-name .gb-who { font-size: 1.15rem; }
.stage .gb-name .gb-hr { font-size: 1.75rem; }
.stage .gb-name .gb-actual { font-size: .9rem; }
.stage .gb-ref { font-size: .8rem; }
/* 후보 칸: 가운데 큰 페이스. 통과=연회색 칸, 선택=검정 칸 흰 페이스, 탈락=흐린 페이스 + 취소선 + 작은 ✕ */
.gb-pace { display: none; }
.stage .gb-cell { position: relative; }
.stage .gb-cell .gb-pace { display: block; font-family: var(--num); font-weight: 500; font-size: 1.45rem; line-height: 1; color: var(--text);
  font-variant-numeric: tabular-nums; }
.stage .gb-cell .gb-ok { display: none; }
.stage .gb-cell.col-chosen .gb-pace { color: var(--ice); font-weight: 600; }
.stage .gb-cell.fail .gb-pace { color: rgb(212 74 74 / 55%); text-decoration: line-through; text-decoration-thickness: 2px; }
.stage .gb-cell.fail .gb-ok { display: block; position: absolute; top: .3rem; right: .45rem; font-size: .85rem; color: var(--red); }
.stage .gb-cell.col-chosen.fail .gb-pace { color: rgb(255 255 255 / 60%); }
/* 열 머리: 차이(−30, +10)만. 머리의 페이스 줄과 ✓/✕ 줄은 숨김 */
.stage .gb-head small, .stage .gb-head .gb-mark { display: none; }
.stage .gb-head { font-size: 1.05rem; }
/* 심박 그래프: 흰 선 → 앱 민트 */
.svg-actual { stroke: #4DFFD2; stroke-opacity: .75; }
.svg-pred { stroke: #4DFFD2; filter: drop-shadow(0 0 5px rgb(77 255 210 / 45%)); }
.svg-pred-label { fill: #4DFFD2; }
.svg-dot { fill: #4DFFD2; }
.svg-pred-dot { stroke: #4DFFD2; }
.svg-band { fill: rgb(77 255 210 / 10%); stroke: rgb(77 255 210 / 35%); }
.svg-member.other { stroke-dasharray: 6 5; stroke-width: 2.2; }
.svg-member-pred { stroke-dasharray: 5 4; }
/* 여백 줄이기: 화면 가장자리·카드 사이·카드 안쪽 */
.console { padding: .6rem .9rem .45rem; gap: .6rem; }
.hero, .stage, .analysis, .context { gap: .6rem; }
.panel { padding: .6rem .85rem .65rem; }
.panel-head { margin-bottom: .35rem; }
.hero > .guide-card { padding: .65rem 1rem .7rem; }
.hero > .records-panel { padding: .6rem .85rem .6rem; }
.stage .group-board { grid-template-columns: 11.5rem repeat(var(--cols, 9), minmax(0, 1fr)); }

/* ── 844: 랜딩페이지(frontend/landing)와 같은 디자인 ─────────────────────
   랜딩의 Live 메뉴로 들어오는 화면이라 랜딩과 같은 톤으로 맞춘다.
   배경 = 진한 네이비(#010207 → #02050E → #031019) + 바닥에서 올라오는 민트 빛, 강조 = 민트 #4DFFD2(위 글자는 #02050E),
   카드 = 랜딩 다운로드·리더보드 카드와 같은 어두운 유리(옅은 흰 그라데이션 + 1px 흰 테두리 + 안쪽 민트 빛),
   글자 = 한글 Pretendard, 숫자·영문 Archivo Expanded. 작은 표시·버튼은 캡슐 대신 글자·아이콘으로 두고,
   주 버튼과 LIVE 표시만 랜딩처럼 민트 알약으로 쓴다. 빨강(허용선·탈락·안전 경고)은 기존 의미 그대로 둔다. */
:root, .tone-light, .tone-dark {
  color-scheme: dark;
  --mint: #4DFFD2; --mint-hover: #86FFE2; --mint-ink: #CFFFF2;
  --navy: #02050E;
  --text: #FFFFFF;
  --text-2: rgb(255 255 255 / 82%);
  --muted: rgb(255 255 255 / 62%);
  --dim: rgb(255 255 255 / 40%);
  --panel-line: rgb(255 255 255 / 10%);
  --grid: rgb(255 255 255 / 7%);
  --fg-rgb: 255 255 255;
  --accent: #4DFFD2; --accent-rgb: 77 255 210; --on-accent: #02050E;
  --accent-glow: rgb(77 255 210 / 35%);
  --red-light: #FF8F8F;
  --warn: #FF8F8F; --warn-rgb: 255 107 107; --warn-text: #FF8F8F;
  --caution: #A4BDC9; --caution-rgb: 164 189 201; --caution-text: #C4D4DC;
  --neutral: #7DA0B2; --neutral-rgb: 125 160 178;
  --field: rgb(255 255 255 / 5%);
  --surface-bg: #02050E;
  --card-bg: linear-gradient(180deg, rgb(255 255 255 / 8%), rgb(255 255 255 / 2.5%) 60%, rgb(255 255 255 / 4%));
  --card-edge: rgb(255 255 255 / 8%);
  --card-shadow: inset 0 0 0 1px rgb(255 255 255 / 8%), inset 0 0 24px rgb(77 255 210 / 5%), 0 18px 48px rgb(0 0 0 / 30%);
  --radius-card: 1.4rem;
  --radius-inner: .9rem;
  --ui: "Pretendard", "Pretendard Variable", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  font-family: var(--ui);
}
body {
  background:
    radial-gradient(ellipse 70% 28% at 50% 112%, rgb(77 255 210 / 22%), rgb(77 255 210 / 0%) 70%),
    radial-gradient(ellipse 120% 55% at 50% 125%, rgb(31 184 154 / 20%), rgb(31 184 154 / 0%) 70%),
    radial-gradient(ellipse 60% 45% at 35% 45%, rgb(77 255 210 / 5%), rgb(77 255 210 / 0%) 70%),
    linear-gradient(180deg, #010207 0%, #02050E 50%, #031019 100%) fixed;
  background-color: #02050E;
}
::selection { background: rgb(77 255 210 / 35%); color: #FFFFFF; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

/* 기본 컨트롤: 어두운 입력란, 마우스를 올리면 민트 테두리 */
button { border-color: var(--panel-line); background: rgb(255 255 255 / 5%); color: var(--text); }
button:hover { border-color: var(--mint); }
select { background: rgb(255 255 255 / 6%); border: 1px solid rgb(255 255 255 / 14%); color: var(--text); }
select option { background: #0A1420; color: #FFFFFF; }
input[type="range"] { accent-color: var(--mint); }

/* 머리글: 랜딩 상단 메뉴처럼 민트 심볼 + 흰 글자, 상태는 글자·점으로만 */
.brand-mark { color: var(--mint); filter: drop-shadow(0 0 .6rem rgb(77 255 210 / 45%)); }
.brand-name { font-family: var(--num); letter-spacing: .14em; color: rgb(255 255 255 / 70%); }
.brand-name em { color: var(--mint); }
h1 { font-weight: 700; color: #FFFFFF; letter-spacing: -.01em; }
.stage-badge { background: none; border-color: transparent; padding-left: 0; padding-right: 0; color: var(--muted); }
.stage-badge i { background: var(--dim); }
/* LIVE는 랜딩 Team의 LIVE 배지와 같은 민트 알약 */
.stage-badge[data-kind="live"] { padding: .4rem 1rem; color: var(--navy); background: var(--mint); border-color: var(--mint);
  box-shadow: 0 0 1.5rem rgb(77 255 210 / 35%); letter-spacing: .12em; }
.stage-badge[data-kind="live"] i { background: var(--navy); box-shadow: none; animation: live-blink 1.6s ease-in-out infinite; }
@keyframes live-blink { 50% { opacity: .25; } }
.stage-badge[data-kind="replay"] { color: var(--text); border-color: transparent; }
.stage-badge[data-kind="replay"] i { background: var(--mint); }
.mode-chip, .mode-chip[data-kind="group"] { background: none; border-color: transparent; padding-left: 0; padding-right: 0; color: var(--muted); font-weight: 600; }
.mode-chip[data-kind="group"] { color: var(--mint); }
.runner-label { color: var(--muted); }
/* 상태 배너: 정보 = 민트 글자, 연결 문제 = 흰 글자, 안전 경고 = 빨강(그대로) */
.banner { color: var(--mint-ink); background: rgb(4 18 24 / 92%); border: 0; box-shadow: inset 0 0 0 1px rgb(77 255 210 / 40%), 0 .8rem 2rem rgb(0 0 0 / 40%); }
.banner.disconnected, .banner.insufficient, .banner.paused, .banner.stale, .banner.clock {
  color: #FFFFFF; background: rgb(10 18 28 / 94%); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 22%), 0 .8rem 2rem rgb(0 0 0 / 40%); }
.banner.safety { color: #FFFFFF; background: var(--red); box-shadow: none; }

/* 카드: 랜딩 다운로드·리더보드 카드와 같은 어두운 유리 */
.guide-card, .stat, .panel, .guide-card.tone-dark, .panel.tone-dark, .map-panel.tone-dark {
  background: var(--card-bg); border: 0; border-radius: var(--radius-card); box-shadow: var(--card-shadow);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
/* 큰 안내 카드: 랜딩 Team 코스 판처럼 가운데에서 은은한 민트 빛 */
.guide-card.tone-dark {
  background: radial-gradient(ellipse 70% 90% at 30% 60%, rgb(77 255 210 / 10%), rgb(77 255 210 / 0%) 70%),
    linear-gradient(180deg, rgb(255 255 255 / 7%), rgb(255 255 255 / 2%));
  box-shadow: inset 0 0 0 1px rgb(77 255 210 / 18%), inset 0 0 32px rgb(77 255 210 / 6%), 0 18px 48px rgb(0 0 0 / 30%);
}
.map-panel.tone-dark { background: radial-gradient(ellipse 60% 55% at 50% 50%, rgb(77 255 210 / 6%), rgb(77 255 210 / 0%) 70%), var(--card-bg); }
.panel-head h2 { color: #FFFFFF; }
.panel-tag { background: none; padding: 0; color: var(--mint); font-weight: 500; letter-spacing: .02em; }
.hero > .guide-card .guide-main::before { color: var(--mint); }
.guide-card .kicker { color: rgb(255 255 255 / 78%); }
.reason-line { color: #FFFFFF; }
.stat-hr.over { box-shadow: inset 0 0 0 1px rgb(255 107 107 / 55%), var(--card-shadow); }
.stat-hr.over .stat-value { color: var(--warn); }
.zoomable:hover { box-shadow: var(--card-shadow), 0 0 0 2px rgb(77 255 210 / 55%); }
.guide-card.tone-dark.zoomable:hover { box-shadow: inset 0 0 0 1px rgb(77 255 210 / 18%), 0 0 0 2px rgb(77 255 210 / 55%); }
/* 확대 버튼: 원형 캡슐 없이 아이콘만 */
.zoom-open-btn { background: none; border-color: transparent; color: rgb(255 255 255 / 55%); }
.zoom-open-btn:hover, .zoom-open-btn:focus-visible { background: none; border-color: transparent; color: var(--mint); }

/* 후보·판정판·판단 기록: 선택은 랜딩 리더보드의 선택 줄처럼 민트 테두리 + 옅은 민트 바탕 */
.cand { background: var(--field); border-color: transparent; }
.gauge { background: rgb(255 255 255 / 4%); }
.cand.chosen { background: linear-gradient(180deg, rgb(77 255 210 / 18%), rgb(77 255 210 / 6%)); border-color: var(--mint);
  box-shadow: inset 0 0 0 1px var(--mint), 0 0 1.6rem rgb(77 255 210 / 18%); }
.cand.chosen, .cand.chosen .cand-delta, .cand.chosen .cand-pace, .cand.chosen .gauge-hr { color: var(--mint); }
.cand.chosen .cand-pace small, .cand.chosen .cand-foot, .cand.chosen .gauge-hr small { color: rgb(255 255 255 / 62%); }
.cand.chosen .cand-foot b { color: #FFFFFF; }
.cand.chosen .cand-tag { background: var(--mint); color: var(--navy); }
.cand.chosen .gauge { background: rgb(77 255 210 / 6%); }
.cand.chosen .bar-pred { background: linear-gradient(180deg, var(--mint), rgb(77 255 210 / 30%)); box-shadow: 0 0 1rem rgb(77 255 210 / 35%); }
.cand.chosen .bar-band { background: repeating-linear-gradient(0deg, rgb(77 255 210 / 35%) 0 2px, transparent 2px 5px); }
.cand.chosen .allow-line { border-top-color: var(--red-light); }
.cand.rejected .cand-tag { color: #FFFFFF; background: rgb(212 74 74 / 70%); }
.candidate-list.pending .cand.chosen { background: var(--field); border-color: transparent; box-shadow: none; }
.candidate-list.pending .cand.chosen .cand-pace, .candidate-list.pending .cand.chosen .cand-delta, .candidate-list.pending .cand.chosen .gauge-hr { color: var(--text); }
@keyframes chosen-pulse { 0% { box-shadow: inset 0 0 0 1px var(--mint), 0 0 0 0 rgb(77 255 210 / 55%); } 100% { box-shadow: inset 0 0 0 1px var(--mint), 0 0 0 1.2rem rgb(77 255 210 / 0%); } }
.lg-chosen::before { background: var(--mint); }
.gb-head.chosen { color: var(--navy); background: var(--mint); }
.gb-head.chosen small, .gb-head.chosen .gb-mark { color: rgb(2 5 14 / 70%); }
.gb-head.current { box-shadow: inset 0 -2px 0 rgb(255 255 255 / 35%); }
@keyframes chosen-head { 0% { box-shadow: 0 0 0 0 rgb(77 255 210 / 60%); } 100% { box-shadow: 0 0 0 .9rem rgb(77 255 210 / 0%); } }
.gb-cell { background: var(--field); }
.gb-cell.col-chosen, .stage .gb-cell.col-chosen.tight { background: rgb(77 255 210 / 14%); box-shadow: inset 0 0 0 1.5px var(--mint); color: var(--mint); }
.gb-cell.col-chosen b, .gb-cell.col-chosen .gb-ok, .stage .gb-cell.col-chosen.tight .gb-ok, .stage .gb-cell.col-chosen .gb-pace { color: var(--mint); }
.gb-cell.col-chosen small { color: rgb(255 255 255 / 62%); }
.stage .gb-cell.col-chosen.gb-row-worst { box-shadow: inset 0 0 0 1.5px var(--mint); }
.gb-cell.fail { background: repeating-linear-gradient(135deg, rgb(212 74 74 / 30%) 0 3px, rgb(212 74 74 / 10%) 3px 7px); color: var(--warn-text); }
.gb-cell.col-chosen.fail { background: repeating-linear-gradient(135deg, rgb(212 74 74 / 55%) 0 3px, rgb(77 255 210 / 12%) 3px 7px); }
.gb-cell.fail .gb-ok, .stage .gb-cell.fail .gb-ok { color: var(--warn-text); }
.stage .gb-cell.fail .gb-pace { color: rgb(255 143 143 / 65%); }
.stage .gb-cell.col-chosen.fail .gb-pace { color: rgb(255 255 255 / 70%); }
.gb-cell.tight { background: rgb(212 74 74 / 12%); color: var(--warn-text); }
.stage .gb-cell.tight { background: var(--field); color: var(--text); }
.gb-name.gb-row-worst { background: rgb(212 74 74 / 10%); }
.gb-ref { background: var(--mint); color: var(--navy); }
.gb-name .gb-actual.actual-stopped { color: var(--caution-text); }
.record-item { background: var(--field); }
.record-item.latest { background: rgb(77 255 210 / 10%); border-color: transparent; color: #FFFFFF; box-shadow: inset 0 0 0 1.5px var(--mint); }
.record-item.latest strong, .record-item.latest .rec-act { color: var(--mint); }
.record-item.latest .rec-hr b { color: #FFFFFF; }
.record-item.latest time, .record-item.latest .rec-hr { color: rgb(255 255 255 / 62%); }
.hero > .records-panel .rec-tag { background: rgb(255 255 255 / 10%); color: var(--text); }
.hero > .records-panel .rec-tag[data-tone="up"] { background: var(--mint); color: var(--navy); }
.hero > .records-panel .rec-tag[data-tone="down"] { background: #FFD84D; color: var(--navy); }
.hero > .records-panel .rec-tag[data-tone="danger"] { background: var(--red); color: #FFFFFF; }
.hero > .records-panel .rec-tag[data-tone="hold"] { background: var(--mist-pale); color: var(--navy); }
.hero > .records-panel .record-list:empty::after { border-color: rgb(77 255 210 / 22%); color: var(--muted); }
.svg-course-done { stroke: var(--mint); filter: drop-shadow(0 0 5px rgb(77 255 210 / 50%)); }
.svg-elev-done, .svg-elev-now { stroke: var(--mint); }

/* 대기·토큰 입력: 랜딩 첫 화면 배경 위에 다운로드 카드와 같은 카드, 민트 주 버튼 */
.waiting { border-radius: var(--radius-card); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  background:
    radial-gradient(ellipse 60% 30% at 50% 108%, rgb(77 255 210 / 26%), rgb(77 255 210 / 0%) 70%),
    radial-gradient(ellipse 55% 50% at 50% 42%, rgb(77 255 210 / 7%), rgb(77 255 210 / 0%) 70%),
    linear-gradient(180deg, rgb(1 2 7 / 94%) 0%, rgb(2 5 14 / 94%) 55%, rgb(3 16 25 / 94%) 100%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 8%); }
.radar span { border-color: var(--mint); }
.radar i { background: var(--mint); box-shadow: 0 0 2rem rgb(77 255 210 / 55%); }
.waiting-title { color: #FFFFFF; font-weight: 700; }
.waiting-sub { color: rgb(255 255 255 / 70%); }
.waiting-hint { color: rgb(255 255 255 / 45%); }
.waiting-play, .auth-row button, #play-toggle, .zoom-close {
  background: var(--mint); color: var(--navy); border: 0; font-weight: 700; box-shadow: 0 0 1.5rem rgb(77 255 210 / 28%);
  transition: background-color .2s ease, box-shadow .2s ease; }
.waiting-play:hover, .auth-row button:hover, #play-toggle:hover, .zoom-close:hover { background: var(--mint-hover); box-shadow: 0 0 2rem rgb(77 255 210 / 42%); }
#play-toggle[data-playing="true"] { background: none; color: var(--text); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 22%); }
#play-toggle[data-playing="true"]:hover { box-shadow: inset 0 0 0 1px var(--mint); }
.auth-panel { min-width: 0; width: min(30rem, 100%); padding: 1.5rem; border: 0; border-radius: 1.25rem;
  background: linear-gradient(180deg, rgb(255 255 255 / 10%), rgb(255 255 255 / 3%) 60%, rgb(255 255 255 / 5%));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 8%), inset 0 0 24px rgb(77 255 210 / 6%), 0 10px 30px rgb(0 0 0 / 35%); }
.auth-panel label { font-weight: 600; color: #FFFFFF; }
.auth-panel span { color: rgb(255 255 255 / 62%); }
.auth-row input { background: rgb(255 255 255 / 6%); border: 1px solid rgb(255 255 255 / 16%); color: #FFFFFF; min-width: 0; }
.auth-row input::placeholder { color: rgb(255 255 255 / 40%); }
.auth-row input:focus { outline: none; border: 1.5px solid var(--mint); box-shadow: 0 0 0 3px rgb(77 255 210 / 15%); }
.auth-row button { flex: none; }
.auth-panel .auth-error { color: var(--warn-text); }
.auth-panel:has(.auth-error:not(.hidden)) .auth-row input { border: 1.5px solid var(--warn-text); }

/* 바닥줄: 연결 상태는 글자·점만, 재생 조작은 테두리 없는 줄 */
.footer-row { color: var(--muted); }
.footer-row .conn { background: none; padding: 0; }
.conn-dot.on { background: var(--mint); box-shadow: 0 0 .5rem rgb(77 255 210 / 60%); }
.conn-dot.off { background: var(--warn); }
.replay-controls { background: none; border: 0; padding: 0; color: var(--text); }
.debug-metrics { color: var(--caution-text); }

/* 확대 모달: 랜딩 Team 소개 카드와 같은 판 */
.zoom-modal { background: rgb(1 2 7 / 60%); }
.zoom-dialog { border: 0; background: linear-gradient(180deg, rgb(10 30 40 / 97%), rgb(4 12 20 / 98%));
  box-shadow: inset 0 0 0 1px rgb(77 255 210 / 30%), 0 0 60px rgb(77 255 210 / 12%), 0 30px 80px rgb(0 0 0 / 55%); }
.zoom-head h2 { color: #FFFFFF; }
.zoom-head p { color: rgb(255 255 255 / 78%); }
.zoom-body > .is-zoomed:hover { box-shadow: var(--card-shadow); }
.live-map { background: #050B14; }
.live-map .route-tip { background: rgb(2 5 14 / 88%); color: #FFFFFF; box-shadow: inset 0 0 0 1px rgb(77 255 210 / 35%); }
.map-standings { background: rgb(2 5 14 / 85%); border-color: rgb(77 255 210 / 25%); }
.map-follow { background: rgb(2 5 14 / 85%); }
.map-follow[aria-pressed="true"] { background: var(--mint); color: var(--navy); border-color: var(--mint); }

/* 844: 랜딩과 같은 상단 메뉴(frontend/landing의 .nav와 같은 크기·유리·글자). 콘솔 맨 위 한 줄에 가운데 정렬하고,
   지금 화면(Live)은 랜딩에서 선택된 메뉴처럼 굵게 표시한다. 크기는 rem이 아니라 랜딩과 같은 px·vw로 맞춘다 */
/* 프로토타입: hero+stage+context를 .stage-wrap 하나로 묶어서 nav·topbar·stage-wrap·footer 4줄이 됐다 */
.console { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.site-nav {
  justify-self: center; display: flex; justify-content: space-between; align-items: center;
  width: clamp(420px, 34vw, 600px); height: clamp(40px, 3.2vw, 56px); padding: 0 1.8em;
  font-family: var(--num); font-size: clamp(12px, .85vw, 14px); color: #FFFFFF; border-radius: 999px;
  background: linear-gradient(180deg, rgb(255 255 255 / 10%), rgb(255 255 255 / 3%) 60%, rgb(255 255 255 / 5%));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 8%), inset 0 0 16px rgb(77 255 210 / 6%), 0 10px 30px rgb(0 0 0 / 35%);
  -webkit-backdrop-filter: blur(24px) saturate(130%); backdrop-filter: blur(24px) saturate(130%);
}
.site-nav a { color: inherit; text-decoration: none; }
.site-nav .nav-home { display: block; }
.site-nav .wordmark { display: block; height: .92em; width: auto; }
.site-nav ul { display: contents; list-style: none; }
.site-nav ul a { font-weight: 400; opacity: .85; transition: opacity .2s ease; }
.site-nav ul a:hover, .site-nav ul a.is-current { opacity: 1; }
.site-nav ul a.is-current { font-weight: 600; }
.site-nav .nav-mark { display: block; height: 1.9em; aspect-ratio: 730 / 520; color: var(--mint); filter: drop-shadow(0 0 6px rgb(77 255 210 / 45%)); }
.site-nav .nav-mark svg { display: block; width: 100%; height: 100%; }
html.zoom-open .site-nav { font-size: clamp(12px, .85vw, 14px); }
/* 브랜드 심볼은 위 메뉴에 있으므로 머리글에서는 빼고 화면 이름만 둔다 */
.topbar .brand-mark { display: none; }

/* 844: 휴대폰·좁은 화면. 한 화면 고정 대신 세로로 쌓아 스크롤하고, 칸이 화면 밖으로 넘치지 않게 한다.
   후보 칸이 많으면 패널 안에서만 가로로 밀어 본다(페이지 가로 넘침 없음) */
@media (max-width: 767px) {
  :root { font-size: 13px; }
  html.zoom-open { font-size: 13px; }
  html, body { height: auto; }
  body { overflow-x: hidden; overflow-y: auto; }
  .console { height: auto; min-height: 100svh; padding: 12px 16px 16px; grid-template-rows: none; gap: 12px; }
  .site-nav { width: 100%; height: 44px; padding: 0 1.2em; font-size: 11px; }
  .topbar { flex-wrap: wrap; gap: .4rem 1rem; }
  .brand { flex: 1 0 100%; }
  .runner-label { flex: 1 1 100%; max-width: 100%; order: 5; }
  .banner { flex: 1 1 100%; margin-left: 0; white-space: normal; border-radius: 1rem; font-size: 1rem; }
  .hero, .stage, .hero > .guide-card { grid-template-columns: minmax(0, 1fr); }
  .analysis, .context { grid-template-rows: none; }
  .hero > .guide-card .actual-sum { grid-column: 1; grid-row: 2; justify-content: start; }
  .hero > .guide-card .guide-main { grid-column: 1; grid-row: 3; }
  .hero > .guide-card .reason-line { grid-row: 4; font-size: 1.35rem; }
  .hero > .guide-card.is-empty .reason-line { font-size: 1.6rem; }
  .guide-pace { font-size: 3.6rem; }
  .candidate-list { display: flex; overflow-x: auto; min-height: 15rem; padding-bottom: .4rem; scroll-snap-type: x proximity; }
  .candidate-list .cand { flex: 0 0 6.8rem; scroll-snap-align: start; }
  .group-board, .stage .group-board { overflow-x: auto; grid-template-columns: 7.5rem repeat(var(--cols, 9), minmax(4rem, 1fr)); min-height: 12rem; }
  .chart-panel { height: 18rem; }
  .map-panel { height: 22rem; }
  .panel-head { flex-wrap: wrap; row-gap: .2rem; }
  .panel-head h2 { white-space: normal; }
  .legend { flex-wrap: wrap; }
  .waiting { position: fixed; inset: 0; border-radius: 0; z-index: 30; overflow-y: auto; padding-top: 56px; }
  /* 대기·토큰 화면이 전체를 덮어도 상단 메뉴는 위에 남겨 다른 화면으로 갈 수 있게 한다 */
  .site-nav { position: relative; z-index: 31; }
  .waiting-card { padding: 1.5rem 16px; width: 100%; }
  .waiting-title { font-size: 2rem; }
  .radar { width: 6.5rem; height: 6.5rem; }
  .auth-row { flex-wrap: wrap; }
  .auth-row input { flex: 1 1 12rem; }
  .auth-row button { flex: 1 1 auto; }
  .footer-row { flex-wrap: wrap; gap: .6rem; }
  .replay-controls { margin-left: 0; flex: 1 1 100%; flex-wrap: wrap; }
  #recording-select { max-width: 100%; flex: 1 1 100%; }
  .zoom-dialog { width: calc(100vw - 24px); height: calc(100svh - 48px); }
}

/* ── 844-2: 디자인 검토 반영 ───────────────────────────────────────────
   1) 머리글: 랜딩 Team 머리(왼쪽 큰 제목 + 아래 한 줄 설명, 오른쪽 LIVE 배지)처럼 한 덩어리로 묶는다.
      제목 줄 아래에 모드·러너를 '·'로 잇고, 오른쪽 끝에 상태(LIVE/재생)·배너를 모은다. 'RUNWAY AI'는 위 메뉴와 겹쳐 뺀다.
   2) 민트는 'AI가 고른 것'(목표 페이스·선택 후보·예측선)과 주 버튼에만. 최신 기록·모드·실측선·지도 진행선은 흰색 계열.
   3) 회색 알약 태그(통과·유지 등)는 바탕 없이 글자색만. 작은 글자는 12px 아래로 내려가지 않게. */
.topbar {
  display: grid; align-items: end; column-gap: .6rem; row-gap: .25rem; padding: .1rem .35rem 0;
  grid-template-columns: minmax(0, 1fr) auto auto; align-items: center;
  grid-template-areas: "brand banner badge";
}
.topbar .brand { grid-area: brand; }
.topbar .brand-name { display: none; }
.topbar h1 { margin: 0; font-size: 1.7rem; line-height: 1.15; }
.topbar .mode-chip { grid-area: mode; padding: 0; font-size: max(12px, .95rem); font-weight: 500; color: var(--text-2); }
.topbar .mode-chip[data-kind="group"] { color: var(--text-2); }
.topbar .runner-label { grid-area: runner; max-width: none; font-size: max(12px, .95rem); color: var(--muted); }
.topbar .runner-label::before { content: "·"; margin-right: .6rem; color: var(--dim); }
.topbar .banner, .topbar .stage-badge { margin-left: .6rem; }
.topbar .banner { grid-area: banner; justify-self: end; align-self: center; margin-left: 0; }
.topbar .stage-badge { grid-area: badge; align-self: center; font-size: max(12px, .95rem); }
.topbar .version-block { display: none; }
/* 844-3: 모드(개인 페이스 · AI04)·러너/기록 이름은 청중에게 필요 없어 머리글에서 뺀다. 그룹이면 안내 카드 제목이 '공동 목표 페이스'로 알려 준다 */
.topbar .mode-chip, .topbar .runner-label { display: none; }
.stage-badge[data-kind="replay"] i { background: #FFFFFF; }

/* 민트 절제: 청중이 2초 안에 볼 하나 = AI 목표 페이스 */
.guide-pace { color: var(--mint); text-shadow: 0 0 2.2rem rgb(77 255 210 / 28%); }
.guide-unit { color: rgb(77 255 210 / 60%); }
.hero > .guide-card .actual-sum b { color: rgb(255 255 255 / 78%); }
.panel-tag { color: var(--muted); font-size: max(12px, .75rem); }
.record-item.latest { background: rgb(255 255 255 / 8%); box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 70%); }
.record-item.latest strong, .record-item.latest .rec-act { color: #FFFFFF; }
@keyframes rec-flash { 0%, 30% { box-shadow: 0 0 0 3px rgb(255 255 255 / 85%), 0 0 1.4rem rgb(255 255 255 / 30%); } 100% { box-shadow: 0 0 0 0 rgb(255 255 255 / 0%); } }
.conn-dot.on { background: #FFFFFF; box-shadow: none; }
.zoomable:hover { box-shadow: var(--card-shadow), 0 0 0 2px rgb(255 255 255 / 45%); }
.guide-card.tone-dark.zoomable:hover { box-shadow: inset 0 0 0 1px rgb(77 255 210 / 18%), 0 0 0 2px rgb(255 255 255 / 45%); }
.svg-actual { stroke: #FFFFFF; stroke-opacity: .55; }
.svg-dot { fill: #FFFFFF; }
.svg-course-done { stroke: rgb(255 255 255 / 85%); filter: none; }
.svg-elev-done, .svg-elev-now { stroke: rgb(255 255 255 / 75%); }
.svg-runner { fill: #FFFFFF; stroke: var(--navy); }
.svg-runner-ring { stroke: #FFFFFF; }
/* '느리게' 노랑은 뜻이 있어 남기되 채도를 낮춰 네이비·민트 톤에 맞춘다 */
.reason-line[data-tone="down"]::before { color: #EBCF74; }

/* 알약 태그 → 글자색만 */
.cand-tag, .candidate-list[data-density="many"] .cand-tag { background: none; padding: 0; font-size: max(12px, .78rem); color: var(--muted); }
.cand.chosen .cand-tag { background: none; color: var(--mint); }
.cand.rejected .cand-tag { background: none; color: var(--warn-text); }
.hero > .records-panel .rec-tag { background: none; padding: 0; font-size: max(12px, .9rem); color: var(--muted); }
.hero > .records-panel .rec-tag[data-tone="up"] { background: none; color: var(--mint); }
.hero > .records-panel .rec-tag[data-tone="down"] { background: none; color: #EBCF74; }
.hero > .records-panel .rec-tag[data-tone="danger"] { background: none; color: var(--warn-text); }
.hero > .records-panel .rec-tag[data-tone="hold"] { background: none; color: var(--muted); }
.record-item .rec-status { background: none; padding: 0; color: var(--caution-text); }
.gb-ref, .stage .gb-ref { background: none; padding: 0; color: var(--mint-ink); font-size: max(12px, .8rem); }
/* 작은 글자 하한 */
.legend, .meta, .hero > .records-panel .panel-head .meta { font-size: max(12px, .85rem); }
.svg-axis { font-size: max(12px, .85rem); }
/* 확대 버튼: 아이콘은 더 밝게 */
.zoom-open-btn { color: rgb(255 255 255 / 75%); }
/* 판단 기록 건수는 머리 줄 가운데에 뜨지 않게 확대 버튼 바로 앞(오른쪽)으로 */
.records-panel .panel-head > .meta:last-of-type { margin-left: auto; }

@media (max-width: 767px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; column-gap: .8rem;
    grid-template-areas: "brand badge" "banner banner"; }
  .topbar .runner-label::before { content: none; }
  /* 범례는 아래 줄로 보내 확대 버튼이 제목 줄에 남게 한다 */
  .panel-head .legend { order: 3; flex: 1 0 100%; }
  .topbar .banner { justify-self: stretch; }
  .topbar h1 { font-size: 1.45rem; }
  /* 세로로 쌓이면 '→'가 빈 곳을 가리키므로 뺀다('지금'·'AI 목표' 이름표로 충분하다) */
  .hero > .guide-card .actual-sum i { display: none; }
  .group-board, .stage .group-board { position: relative; }
  /* 판정판을 옆으로 밀어도 러너 이름 열은 왼쪽에 붙어 있게 한다 */
  .stage .gb-name, .stage .gb-head.gb-corner { position: sticky; left: 0; z-index: 2; background: #0B141C; box-shadow: .4rem 0 .6rem rgb(11 20 28 / 90%); }
  .group-board, .stage .group-board { grid-template-columns: 8.6rem repeat(var(--cols, 9), minmax(4.2rem, 1fr)); }
  .stage .gb-name, .stage .gb-name.gb-row-worst { overflow: hidden; padding-left: .3rem; background: #0B141C; }
  .stage .gb-head.gb-corner { padding-left: .3rem; }
  .stage .gb-name, .stage .gb-head.gb-corner { border-radius: 0; }
  .stage .gb-name .gb-who { font-size: 1rem; }
  .stage .gb-name .gb-hr { font-size: 1.4rem; }
  .stage .gb-head.gb-corner { white-space: normal; line-height: 1.2; font-size: max(12px, .8rem); }
  /* 확대 버튼: 아이콘 크기는 그대로, 누르는 영역만 44px */
  .zoom-open-btn { width: 44px; height: 44px; margin: -10px -10px -10px 0; }
}

/* 900: 고른 후보가 탈락일 때 이유 칩(FLOOR·WARMUP_CAP·COOLDOWN) */
.chosen-why { display: inline-block; margin-left: .6rem; padding: .1rem .55rem; border-radius: 999px; font-size: max(12px, .8rem);
  font-weight: 600; color: var(--warn-text); background: rgb(var(--warn-rgb) / 16%); border: 1px solid rgb(var(--warn-rgb) / 45%);
  white-space: nowrap; vertical-align: middle;
  max-width: 24rem; overflow: hidden; text-overflow: ellipsis; }
.chosen-why.hidden { display: none; }

/* 909: 페이스 변경 카드·뒤처짐 알림(그룹). 목표 페이스 카드 오른쪽 위에 겹쳐 둔다(후보 표·심박 그래프는 가리지 않음) */
.guide-alerts { position: absolute; top: .8rem; right: 3rem; z-index: 3; display: flex; flex-direction: column; align-items: flex-end;
  gap: .5rem; max-width: 48%; pointer-events: none; }
.pace-change { padding: .6rem 1.1rem .7rem; border-radius: .8rem; background: rgb(2 5 14 / 90%); border: 2px solid #E05A5A;
  box-shadow: 0 0 1.6rem rgb(224 90 90 / 35%); transition: opacity .6s ease; text-align: left; }
.pace-change[data-action="up"] { border-color: #4DFFD2; box-shadow: 0 0 1.6rem rgb(77 255 210 / 30%); }
.pace-change.is-out { opacity: 0; }
.pace-change.enter { animation: pace-change-in .6s ease-out; }
@keyframes pace-change-in { from { transform: translateY(-.6rem) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.pc-title { font-weight: 700; font-size: max(13px, 1.05rem); color: #FFFFFF; }
.pc-pace { font-family: var(--num); font-weight: 700; font-size: 2.3rem; line-height: 1.1; color: #FF8A8A; font-variant-numeric: tabular-nums; }
.pace-change[data-action="up"] .pc-pace { color: #4DFFD2; }
.pc-reason { font-weight: 600; font-size: max(13px, 1.05rem); color: #DCE6EB; }
.lag-alert { display: flex; flex-direction: column; gap: .35rem; align-items: flex-end; }
.lag-row { padding: .35rem .9rem; border-radius: .6rem; background: #F2B33D; color: #1B1300; font-weight: 800;
  font-size: max(14px, 1.2rem); white-space: nowrap; box-shadow: 0 0 1.2rem rgb(242 179 61 / 40%); }
.guide-alerts .hidden { display: none; }
