/* 참가자 화면. 폰 한 손 조작 기준 — 자주 누르는 것(캡처 올리기·탭)은 엄지가 닿는 아래쪽에 둔다.
   2차 방향(2026-10-26): 깊은 남색 + 코랄 하나. 색을 늘리는 대신 남색 단계·가는 선·숫자 크기 차이로 위계를 만든다. */
body.theme-field { background: var(--bg); }
/* 위에서 비추는 은은한 조명. body 배경에 fixed 를 걸면 모바일에서 끊겨 보여서 고정 레이어로 따로 둔다 */
body.theme-field::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(120% 55% at 50% -12%, #22397F 0%, rgb(34 57 127 / 0) 62%), radial-gradient(80% 40% at 100% 100%, rgb(255 106 74 / .07), transparent 70%); }
.theme-field .demo-bar { background: var(--bg-deep); color: var(--gold); border-bottom: 1px solid var(--line); }
.theme-field #toast { background: var(--fg); color: var(--ink); }
.theme-field #toast.bad { background: var(--coral-500); color: var(--ink); }

.app { max-width: var(--col); margin: 0 auto; min-height: 100dvh; padding: 0 var(--sp-4) calc(100px + env(safe-area-inset-bottom, 0px)); }
.num { font-weight: 600; }

/* ---------- 머리 ---------- */
.board { position: sticky; top: 0; z-index: 20; margin: 0 calc(var(--sp-4) * -1); padding: calc(var(--sp-3) + env(safe-area-inset-top, 0px)) var(--sp-4) var(--sp-3); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); background: rgb(13 24 56 / .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.board-l { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.board-l > div { min-width: 0; }
.board .who { font-size: var(--fs-xs); color: var(--muted); }
.board h1 { display: flex; align-items: center; gap: var(--sp-2); font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.board h1 span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-r { text-align: right; flex: none; }
.board .day { font-size: var(--fs-xs); color: var(--muted); }
.board .day b { color: var(--fg); font-family: var(--f-num); font-weight: 600; font-size: 14px; }
.board .clock { font-family: var(--f-num); font-weight: 600; font-size: 19px; line-height: 1.2; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.board .clock.urgent { color: var(--accent-ink); }

.rank-pill { flex: none; padding: 0 7px; border-radius: var(--r-pill); border: 1px solid var(--line-2); font-family: var(--f-num); font-weight: 600; font-size: 14px; line-height: 1.5; color: var(--fg); }
.rank-pill.gold { border-color: var(--gold); color: var(--gold); }

/* 팀 문장(방패). 색은 상태만 말한다: 우리 팀=코랄, 1위=금, 나머지=남색 */
.em { flex: none; width: 34px; height: 38px; display: block; }
.em path { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1; }
.em text { fill: var(--fg); font-family: var(--f-body); font-weight: 800; font-size: 14px; }
.em.me path { fill: var(--accent); stroke: none; }
.em.me text { fill: var(--ink); }
.em.gold path { fill: none; stroke: var(--gold); stroke-width: 1.6; }
.em.gold text { fill: var(--gold); }
.em.sm { width: 26px; height: 29px; }
.em.lg { width: 48px; height: 54px; }

.delta { display: inline-flex; align-items: center; gap: 1px; justify-content: center; min-width: 30px; padding: 0 6px; border-radius: var(--r-pill); font-family: var(--f-num); font-weight: 600; font-size: 13px; line-height: 1.6; color: var(--muted); background: var(--surface-2); }
.delta.up { background: var(--up); color: var(--ink); }
.delta.down { background: var(--down); color: var(--ink); }

/* ---------- 카드 ---------- */
main { display: grid; gap: var(--sp-4); padding-top: var(--sp-4); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px; display: grid; gap: 14px; box-shadow: inset 0 1px 0 rgb(255 255 255 / .04); }
.card > h2, .card-head h2 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); }
.card-head .side { font-size: var(--fs-xs); color: var(--muted); text-align: right; }
.card-head .side .num { font-size: 22px; color: var(--fg); margin-right: 2px; }
.hint { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.hint.warn { color: var(--warn); }
.hint.center { text-align: center; }
.chip.ok { background: rgb(255 255 255 / .1); color: var(--fg); }
.chip.warn { background: rgb(245 196 81 / .16); color: var(--gold); }
.chip.bad { background: var(--accent-soft); color: var(--accent-ink); }
.chip.accent { background: var(--accent); color: var(--on-accent); }

/* ---------- 트랙 (오늘 탭 주인공) ---------- */
.hero { position: relative; padding: var(--sp-5) 0 var(--sp-2); }
.track { display: block; width: 100%; height: auto; overflow: visible; }
.track .lane { fill: none; stroke: var(--track-lane); }
.track .edge { fill: none; stroke: rgb(255 255 255 / .1); stroke-width: 1; }
.track .lane-line { fill: none; stroke: rgb(255 255 255 / .08); stroke-width: 1; stroke-dasharray: 2 5; }
.track .prog { fill: none; stroke: var(--accent); stroke-linecap: round; filter: drop-shadow(0 0 6px rgb(255 106 74 / .5)); }
.track .prog2 { fill: none; stroke: var(--gold); stroke-linecap: round; filter: drop-shadow(0 0 5px rgb(245 196 81 / .5)); }
.track .mark { stroke: rgb(255 255 255 / .28); stroke-width: 1.2; }
.track .finish { stroke: var(--fg); stroke-width: 2; }
.track .halo { fill: var(--accent); opacity: .22; }
.track .runner { fill: var(--fg); stroke: var(--accent); stroke-width: 3; }
.track .tick { fill: var(--muted); font-family: var(--f-num); font-size: 10.5px; font-weight: 600; letter-spacing: .04em; }
.hero-num { position: absolute; inset: var(--sp-5) 0 var(--sp-2); display: grid; place-content: center; justify-items: center; text-align: center; pointer-events: none; gap: 6px; }
.hero-num .big { font-family: var(--f-num); font-variant-numeric: tabular-nums; font-weight: 600; font-size: clamp(58px, 17vw, 84px); line-height: .9; letter-spacing: -0.015em; }
.hero-num .of { font-size: 13px; color: var(--muted); }
.hero-num .of .num { font-size: 15px; color: var(--fg); }

/* 트랙 아래 세 칸 — 중계 화면 아래 자막처럼 선으로만 나눈다 */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.kpis > div { padding: 12px 0 13px; text-align: center; display: grid; gap: 2px; }
.kpis > div + div { border-left: 1px solid var(--line); }
.kpis dt { font-size: 12px; color: var(--muted); }
.kpis dd { margin: 0; display: flex; align-items: baseline; justify-content: center; gap: 4px; font-family: var(--f-num); font-weight: 600; font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpis dd small { font-family: var(--f-body); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.kpis dd.hit { color: var(--accent-ink); }
.kpis .delta { align-self: center; }

.status { display: flex; justify-content: center; align-items: center; gap: var(--sp-2); flex-wrap: wrap; text-align: center; font-size: 13.5px; color: var(--muted); }
.cta { width: 100%; min-height: 56px; border-radius: 16px; font-size: 17px; font-weight: 700; box-shadow: 0 10px 28px rgb(255 106 74 / .28); }
.cta svg { width: 21px; height: 21px; }

/* ---------- 팀원 줄(오늘 우리 팀) ---------- */
.contrib { display: flex; gap: 2px; height: 8px; border-radius: var(--r-pill); overflow: hidden; background: var(--panel); }
.contrib i { display: block; min-width: 3px; background: var(--data); transition: flex-grow var(--dur-count) var(--ease); }
.mrows { display: grid; gap: 12px; }
.mrow { display: grid; grid-template-columns: 30px 1fr auto; gap: var(--sp-3); align-items: center; }
.av { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-content: center; font-size: 12.5px; font-weight: 700; background: var(--surface-2); color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--sw, var(--line-2)); }
.av.me { background: var(--accent); color: var(--ink); box-shadow: none; }
.mrow .nm { display: grid; gap: 5px; min-width: 0; font-size: 14px; }
.mrow .nm span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow .nm small { color: var(--muted); font-size: 12px; }
.meter { height: 4px; border-radius: var(--r-pill); background: var(--panel); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--sw, var(--data)); transition: width var(--dur-count) var(--ease); }
.mrow .v { font-family: var(--f-num); font-size: 20px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.mrow .v.hit { color: var(--accent-ink); }
.mrow .v.none { font-family: var(--f-body); font-size: 12.5px; color: var(--muted); font-weight: 500; }
.share { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.share b { font-family: var(--f-num); font-weight: 600; font-size: 24px; color: var(--accent-ink); }

/* 앞뒤 팀 */
.gap-rows { display: grid; }
.gap-row { display: grid; grid-template-columns: 22px 26px 1fr auto; gap: var(--sp-3); align-items: center; padding: 10px var(--sp-3); margin: 0 calc(var(--sp-3) * -1); border-radius: var(--r-m); }
.gap-row .rk { font-family: var(--f-num); font-weight: 600; font-size: 18px; color: var(--muted); text-align: center; }
.gap-row .tn { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gap-row.me { background: var(--hl); box-shadow: inset 3px 0 0 var(--accent); }
.gap-row.me .rk, .gap-row.me .tn { color: var(--fg); font-weight: 700; }
.gap-row .diff { font-family: var(--f-num); font-weight: 600; font-size: 17px; text-align: right; }
.gap-row .diff small { font-family: var(--f-body); font-size: 11.5px; color: var(--muted); font-weight: 500; margin-right: 4px; }

/* 기부 온도계 */
.thermo-nums { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); }
.thermo-nums .won { font-family: var(--f-num); font-weight: 600; font-size: 36px; line-height: 1; font-variant-numeric: tabular-nums; }
.thermo-nums .won small { font-family: var(--f-body); font-size: 14px; font-weight: 600; margin-left: 3px; color: var(--muted); }
.thermo-nums .pct { font-family: var(--f-num); font-weight: 600; font-size: 17px; color: var(--muted); }
.tube { position: relative; height: 8px; border-radius: var(--r-pill); background: var(--panel); overflow: hidden; }
.tube i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, var(--coral-500), var(--gold-500)); transition: width var(--dur-count) var(--ease); }
.tube span { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--surface); }

/* ---------- 순위 ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: var(--sp-2); padding: var(--sp-4) 0 0; }
.pod { display: grid; justify-items: center; gap: 6px; background: none; border: 0; color: inherit; padding: 0; cursor: pointer; min-width: 0; }
.pod .tn { font-size: 13.5px; font-weight: 600; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod.mine .tn { color: var(--accent-ink); }
.pod .sc { font-family: var(--f-num); font-weight: 600; font-size: 17px; color: var(--muted); }
.pod .base { width: 100%; display: grid; place-content: center; border-radius: 14px 14px 0 0; background: linear-gradient(180deg, var(--surface-2), rgb(28 44 94 / .2)); border: 1px solid var(--line); border-bottom: 0; font-family: var(--f-num); font-weight: 600; font-size: 30px; color: var(--muted); }
.pod.p1 .base { height: 84px; color: var(--gold); border-top: 2px solid var(--gold); background: linear-gradient(180deg, rgb(245 196 81 / .16), rgb(245 196 81 / 0)); }
.pod.p2 .base { height: 62px; }
.pod.p3 .base { height: 48px; }

.scoreboard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.sb-head { display: grid; grid-template-columns: 26px 26px 1fr auto 40px; gap: var(--sp-3); padding: 12px var(--sp-4) 8px; font-size: 11.5px; color: var(--muted); border-bottom: 1px solid var(--line); }
.sb-item + .sb-item { border-top: 1px solid var(--line); }
.sb-row { display: grid; grid-template-columns: 26px 26px 1fr auto 40px; gap: 3px var(--sp-3); align-items: center; width: 100%; padding: 13px var(--sp-4); background: transparent; border: 0; text-align: left; cursor: pointer; color: inherit; transition: background var(--dur-fast) var(--ease); }
.sb-row:hover { background: rgb(255 255 255 / .03); }
.sb-row .rk { font-family: var(--f-num); font-weight: 600; font-size: 22px; line-height: 1; text-align: center; color: var(--muted); }
.sb-row.top1 .rk { color: var(--gold); }
.sb-row .nm { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-row .sc { font-family: var(--f-num); font-weight: 600; font-size: 21px; text-align: right; font-variant-numeric: tabular-nums; }
.sb-row .dl { text-align: center; }
.sb-row .split { grid-column: 3 / 6; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sb-row .split b { color: var(--accent-ink); font-weight: 600; }
.sb-row.mine { background: var(--hl); box-shadow: inset 3px 0 0 var(--accent); }
.sb-row.mine .rk { color: var(--fg); }
.sb-row.moved { animation: rowIn var(--dur-count) var(--ease-spring) both; }
.sb-row.moved .delta { animation: flash 1s var(--ease) 2; }
@keyframes rowIn { from { transform: translateY(calc(var(--from, 0) * 100%)); } to { transform: none; } }
@keyframes flash { 50% { filter: brightness(1.3); } }
.members { display: grid; padding: 2px 0 8px; background: var(--panel); }
.member { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2); padding: 9px var(--sp-4) 9px 92px; background: transparent; border: 0; text-align: left; color: inherit; cursor: pointer; font-size: 14px; }
.member:hover { background: rgb(255 255 255 / .03); }
.member .meta { font-size: 12px; color: var(--muted); margin-left: 4px; }
.member .num { font-size: 16px; }

.awards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.award { background: var(--surface-2); border-radius: var(--r-m); padding: 12px; display: grid; gap: 8px; align-content: start; }
.award h3 { font-size: 12px; color: var(--muted); font-weight: 600; }
.award ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; counter-reset: a; font-size: 13.5px; }
.award li { display: grid; grid-template-columns: 14px 1fr auto; gap: 6px; counter-increment: a; }
.award li::before { content: counter(a); font-family: var(--f-num); font-weight: 600; color: var(--muted); }
.award li:first-child { font-weight: 600; }
.award li:first-child::before { color: var(--gold); }
.award li .num { color: var(--muted); font-weight: 600; }

/* ---------- 통계 네 칸 ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.stats > div { padding: 14px 18px; }
.stats > div:nth-child(even) { border-left: 1px solid var(--line); }
.stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-family: var(--f-num); font-weight: 600; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats dd small { font-family: var(--f-body); font-size: 12.5px; font-weight: 600; margin-left: 3px; color: var(--muted); }
.sheet .stats { background: var(--surface-2); }

/* ---------- 팀원 오늘 + 응원 ---------- */
.mate { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px var(--sp-3); padding: 14px 0; border-top: 1px solid var(--line); }
.mate:first-child { border-top: 0; padding-top: 2px; }
.mate .who { min-width: 0; font-size: 14px; }
.mate .who b { font-weight: 600; }
.mate .who span { display: block; font-size: 12px; color: var(--muted); }
.mate .v { font-family: var(--f-num); font-size: 22px; font-weight: 600; text-align: right; line-height: 1.1; }
.mate .v.hit { color: var(--accent-ink); }
.cheers { grid-column: 2 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.cheer { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 11px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: transparent; color: inherit; cursor: pointer; font-size: 14px; transition: transform var(--dur-fast) var(--ease-spring), background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.cheer .num { font-size: 14px; min-width: 8px; }
.cheer:hover { border-color: var(--muted); }
.cheer[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.cheer:active { transform: scale(1.15); }
.cheer.static { cursor: default; border-style: dashed; }
.cheer.pop { animation: pop 420ms var(--ease-spring); }
@keyframes pop { 40% { transform: scale(1.3); } }

/* 응원판 — 내 글은 오른쪽, 남의 글은 왼쪽 */
.wall { display: grid; gap: 10px; max-height: 360px; overflow: auto; overscroll-behavior: contain; padding-right: 2px; }
.msg { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 4px var(--sp-2); justify-self: start; max-width: 88%; }
.msg .av { grid-row: span 2; align-self: end; }
.msg .meta { font-size: 11.5px; color: var(--muted); padding-left: 4px; }
.msg .meta b { color: var(--fg); font-weight: 600; margin-right: 4px; }
.msg .text { padding: 9px 13px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); font-size: 14px; word-break: break-word; }
.msg.me { justify-self: end; grid-template-columns: minmax(0, 1fr); }
.msg.me .av { display: none; }
.msg.me .meta { text-align: right; padding: 0 4px 0 0; }
.msg.me .text { border-radius: 16px 16px 4px 16px; background: var(--hl); box-shadow: inset 0 0 0 1px rgb(255 106 74 / .45); }
.msg .del { background: none; border: 0; color: var(--muted); font-size: 11.5px; cursor: pointer; padding: 0 0 0 6px; text-decoration: underline; text-underline-offset: 2px; }
.compose { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2); }
.compose input { background: var(--panel); border-color: var(--line); border-radius: var(--r-m); }
.compose .count { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); text-align: right; margin-top: -4px; }

/* 날짜별 막대 */
.bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; }
.bars i { flex: 1; background: var(--navy-500); border-radius: 3px 3px 0 0; min-height: 2px; transition: background var(--dur-fast) var(--ease); }
.bars i.today { background: var(--accent); }
.bars i:hover { background: var(--navy-200); }
.bars-x { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.goal-line { position: relative; }
.goal-line::after { content: attr(data-label); position: absolute; z-index: 2; right: 0; bottom: var(--y); transform: translateY(-3px); font-size: 11px; font-weight: 600; color: var(--gold); background: var(--surface); padding: 0 0 0 6px; }
.goal-line .rule { position: absolute; z-index: 1; left: 0; right: 0; bottom: var(--y); border-top: 1px dashed var(--gold); }

/* ---------- 내 기록 ---------- */
.profile { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.profile .av { width: 54px; height: 54px; font-size: 20px; }
.profile h2 { font-size: 19px; font-weight: 700; }
.profile .sub { font-size: 12.5px; color: var(--muted); }
.profile .total { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--line); }
.profile .total > span { font-size: 13px; color: var(--muted); }
.profile .total b { font-family: var(--f-num); font-weight: 600; font-size: 40px; line-height: 1; }
.profile .total b small { font-family: var(--f-body); font-size: 14px; color: var(--muted); margin-left: 3px; }

.badges { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px var(--sp-2); }
.badge { display: grid; justify-items: center; gap: 6px; background: none; border: 0; color: inherit; cursor: pointer; padding: 0; text-align: center; }
.badge .hex { width: 50px; height: 56px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); display: grid; place-content: center; background: var(--panel); font-weight: 700; font-size: 13px; color: rgb(255 255 255 / .28); transition: transform var(--dur-fast) var(--ease-spring); }
.badge:active .hex { transform: scale(.92); }
.badge.got .hex { background: linear-gradient(155deg, var(--coral-400), var(--coral-500) 60%, #E8502F); color: var(--ink); }
.badge.got.rare .hex { background: linear-gradient(155deg, #FFE3A0, var(--gold-500) 60%, #D9A530); }
.badge .bn { font-size: 11px; line-height: 1.3; color: var(--muted); }
.badge.got .bn { color: var(--fg); font-weight: 600; }

/* 30일 달력 열지도 — 한 가지 색(코랄)의 진하기로 걸음 수를 나타낸다 */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal .wd { font-size: 11px; color: var(--muted); text-align: center; }
.cal .c { aspect-ratio: 1; border-radius: 9px; background: var(--panel); display: grid; place-content: center; font-family: var(--f-num); font-size: 13px; font-weight: 600; color: var(--muted); }
.cal .c.l1 { background: var(--navy-700); color: var(--fg); }
.cal .c.l2 { background: var(--navy-500); color: var(--fg); }
.cal .c.l3 { background: var(--accent); color: var(--ink); }
.cal .c.fut { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: rgb(255 255 255 / .25); }
.cal .c.today { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--fg); }
.cal .c.blank { background: transparent; }
.cal-legend { display: flex; gap: var(--sp-3); flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.cal-legend span { display: inline-flex; gap: 5px; align-items: center; }
.cal-legend i { width: 11px; height: 11px; border-radius: 3px; background: var(--panel); }

/* ---------- 이벤트: 표 모양(왼쪽 보너스 / 오른쪽 내용) ---------- */
.ticket { display: grid; grid-template-columns: 96px 1fr; padding: 0; gap: 0; overflow: hidden; }
.ticket .stub { display: grid; place-content: center; justify-items: center; gap: 2px; padding: 18px 8px; background: var(--panel); border-right: 1.5px dashed var(--line-2); text-align: center; }
.ticket .stub b { font-family: var(--f-num); font-weight: 600; font-size: 26px; line-height: 1; color: var(--accent-ink); }
.ticket .stub small { font-size: 11.5px; color: var(--muted); }
.ticket .body { display: grid; gap: 10px; padding: 16px; align-content: start; }
.ticket .body h2 { font-size: 15px; font-weight: 700; }
.upload { position: relative; display: grid; gap: 2px; justify-items: center; text-align: center; padding: 14px; border: 1.5px dashed var(--line-2); border-radius: var(--r-m); cursor: pointer; color: var(--fg); transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.upload:hover { border-color: var(--accent); background: var(--accent-soft); }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload b { font-size: 14.5px; }
.upload span { font-size: 12px; color: var(--muted); }

/* ---------- 아래 탭 ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgb(8 16 41 / .88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabs nav { max-width: var(--col); margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.tabs button { position: relative; display: grid; justify-items: center; gap: 3px; padding: 10px 0; min-height: 62px; background: none; border: 0; color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer; transition: color var(--dur-fast) var(--ease); }
.tabs button svg { width: 23px; height: 23px; transition: transform var(--dur-fast) var(--ease-spring); }
.tabs button[aria-current="page"] { color: var(--fg); }
.tabs button[aria-current="page"] svg { color: var(--accent); }
.tabs button[aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 34%; right: 34%; height: 2px; border-radius: 0 0 2px 2px; background: var(--accent); }
.tabs button:active svg { transform: scale(.88); }
.tabs .dot { position: relative; }
.tabs .dot::after { content: ""; position: absolute; top: 0; right: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg-deep); }

/* ---------- 바닥 시트(캡처 확인·신고·사람) ---------- */
dialog { border: 0; padding: 0; background: #121F4C; color: var(--fg); width: min(var(--col), 100vw); max-width: 100vw; max-height: 92dvh; margin: auto auto 0; border-radius: 24px 24px 0 0; box-shadow: var(--shadow); border-top: 1px solid var(--line-2); }
dialog[open] { animation: sheetUp var(--dur) var(--ease); }
dialog::backdrop { background: rgb(4 8 24 / .66); backdrop-filter: blur(2px); }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
.sheet { display: grid; gap: var(--sp-4); padding: var(--sp-3) 20px calc(var(--sp-5) + env(safe-area-inset-bottom, 0px)); }
.sheet::before { content: ""; justify-self: center; width: 36px; height: 4px; border-radius: 2px; background: var(--line-2); }
.sheet h2 { font-size: 19px; font-weight: 700; }
.sheet .actions { display: grid; grid-template-columns: 1fr 2fr; gap: var(--sp-2); }
.sheet .actions.one { grid-template-columns: 1fr; }
.sheet .btn:not(.primary) { background: var(--surface-2); border-color: transparent; }
.draft { display: grid; grid-template-columns: 96px 1fr; gap: var(--sp-4); align-items: start; }
.draft img { width: 96px; aspect-ratio: 9 / 19.5; object-fit: cover; object-position: top; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--panel); }
.draft .fields { display: grid; gap: var(--sp-2); }
.big-input { font-family: var(--f-num); font-size: 46px; font-weight: 600; min-height: 72px; text-align: right; background: var(--panel); border: 1.5px solid var(--line-2); border-radius: var(--r-m); letter-spacing: .02em; }
.big-input:focus { border-color: var(--accent); outline: none; }
.reading { display: grid; gap: var(--sp-2); }
.reading .bar { height: 3px; border-radius: 2px; background: var(--panel); overflow: hidden; }
.reading .bar i { display: block; width: 40%; height: 100%; background: var(--accent); animation: scan 1.1s var(--ease) infinite alternate; }
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.sheet .list { display: grid; max-height: 44dvh; overflow: auto; }
.sheet .row { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2); align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.sheet .row .right { display: flex; gap: var(--sp-2); align-items: center; }
.sheet .row .num { font-size: 18px; }
.sheet textarea, .sheet input:not(.big-input) { background: var(--panel); border-color: var(--line-2); }
.badge-detail { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-4); align-items: center; }
.big-steps { display: flex; align-items: baseline; gap: 8px; }
.big-steps .num { font-size: 48px; line-height: 1; }

/* ---------- 입구(링크 없이 들어왔을 때) ---------- */
.gate { max-width: var(--col); margin: 0 auto; padding: calc(var(--sp-6) + env(safe-area-inset-top, 0px)) var(--sp-4) var(--sp-7); display: grid; gap: var(--sp-5); }
.gate .mark { width: 100%; max-width: 260px; }
.gate .title { font-size: 13px; color: var(--muted); }
.gate h1 { font-size: 27px; font-weight: 700; line-height: 1.3; letter-spacing: -0.02em; }
.gate .lead { margin: 0; color: var(--muted); font-size: 14.5px; }
.pick-team { display: grid; gap: var(--sp-2); }
.pick-team + .pick-team { padding-top: 14px; border-top: 1px solid var(--line); }
.pick-team h3 { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: var(--sp-2); }
.pick .btn { justify-content: space-between; min-height: 46px; background: var(--surface-2); border-color: transparent; font-weight: 600; }
.pick .btn:hover { border-color: var(--line-2); }
.pick .btn small { color: var(--muted); font-weight: 500; font-size: 12px; }

/* 만보 축하 종이 조각 */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; }

/* 내 기록: 확인 중·반려된 날 목록 */
.issues { display: grid; }
.issue { display: grid; grid-template-columns: 1fr auto auto; gap: var(--sp-3); align-items: center; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.issue:first-child { border-top: 0; }
.issue small { display: block; font-size: 12px; color: var(--muted); }
.issue .num { font-size: 20px; font-weight: 600; }

/* 홈 화면 앱 안내. 매일 보는 오늘 탭에 끼므로 다른 카드보다 낮게, 아이콘이 무엇을 추가하는지 보여 준다 */
.install { grid-template-columns: 44px 1fr; align-items: center; gap: var(--sp-2) var(--sp-3); }
.install img { border-radius: var(--r-m); }
.install h2 { font-size: 15px; font-weight: 700; }
.install .install-act { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: var(--sp-2); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); counter-reset: st; }
.steps li { counter-increment: st; display: grid; grid-template-columns: 44px 1fr; gap: var(--sp-3); align-items: center; font-size: 15px; }
.steps .ico { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-m); background: var(--surface-2); color: var(--sky-500); }
.steps .ico svg { width: 24px; height: 24px; }
.steps .ico img { border-radius: var(--r-s); }
.steps .ico::after { content: counter(st); position: absolute; top: -6px; left: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 700 11px/18px var(--f-num); text-align: center; }
.steps b { color: var(--fg); }
.steps small { display: block; margin-top: 2px; font-size: var(--fs-xs); color: var(--muted); }
.link-form input { background: var(--panel); border-color: var(--line-2); }
.link-act { display: grid; grid-template-columns: 1fr 2fr; gap: var(--sp-2); }
.offline { margin: var(--sp-3) 0 0; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-m); background: var(--surface-2); color: var(--warn); font-size: var(--fs-xs); text-align: center; }
