:root {
  --bg: #fbf7f2;
  --surface: #ffffff;
  --surface-2: #f4ede4;
  --text: #2b2622;
  --muted: #6e645b;
  --line: #e7ddd1;
  --accent: #c8553d;
  --accent-ink: #ffffff;
  --accent-soft: #fbe3db;
  --sage: #4f7a63;
  --sage-soft: #e1eee6;
  --warn: #8a5a00;
  --warn-soft: #fbefd2;
  --alert: #b3261e;
  --alert-soft: #fbe0de;
  --focus: #2a5bd7;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 4px 16px rgba(60, 40, 20, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1816; --surface: #26221f; --surface-2: #312c28; --text: #f3ede7; --muted: #b7ada3; --line: #3d3631;
    --accent: #f08e74; --accent-ink: #2b1510; --accent-soft: #4a2a22; --sage: #8fc3a5; --sage-soft: #213a2d;
    --warn: #f1c46b; --warn-soft: #3d3016; --alert: #ff9a92; --alert-soft: #4a2220; --focus: #8fb0ff;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1816; --surface: #26221f; --surface-2: #312c28; --text: #f3ede7; --muted: #b7ada3; --line: #3d3631;
  --accent: #f08e74; --accent-ink: #2b1510; --accent-soft: #4a2a22; --sage: #8fc3a5; --sage-soft: #213a2d;
  --warn: #f1c46b; --warn-soft: #3d3016; --alert: #ff9a92; --alert-soft: #4a2220; --focus: #8fb0ff;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  word-break: keep-all; overflow-wrap: anywhere;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
h1, h2 { margin: 0; line-height: 1.3; }
h2 { font-size: 18px; margin-bottom: 10px; }
p { margin: 4px 0; }
.loading { padding: 40vh 16px; text-align: center; color: var(--muted); }

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar h1 { flex: 1; font-size: 19px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; outline: none; }
.spacer { width: 44px; flex: none; }
.icon-btn {
  position: relative; width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center;
  border: 0; background: transparent; font-size: 26px; border-radius: 12px; cursor: pointer;
}
.content { padding: 16px; display: flex; flex-direction: column; gap: 14px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.big { font-size: 20px; font-weight: 700; }
.muted { color: var(--muted); }
.tiny { font-size: 13px; }
.center { text-align: center; }
.pre { white-space: pre-wrap; }
.clamp { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.link { color: var(--accent); font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.row-btns > * { flex: 1 1 auto; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 360px) { .two { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 18px;
  border-radius: 14px; border: 1.5px solid transparent; font-weight: 700; cursor: pointer; text-align: center; width: 100%;
}
.btn.small { min-height: 40px; padding: 0 12px; font-size: 15px; width: auto; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.secondary { background: var(--accent-soft); color: var(--text); border-color: var(--accent); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.danger { background: var(--alert); color: #fff; }
.btn:disabled { opacity: .55; cursor: progress; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--surface-2); color: var(--text); white-space: nowrap;
}
.chip.ok, .chip.st-attended, .chip.st-reserved { background: var(--sage-soft); color: var(--sage); }
.chip.warn, .chip.st-absent { background: var(--warn-soft); color: var(--warn); }
.chip.alert, .chip.st-late_cancelled { background: var(--alert-soft); color: var(--alert); }
.chip.st-cancelled, .chip.st-studio_cancelled, .chip.st-excused { background: var(--surface-2); color: var(--muted); }
.chip.kind { font-size: 12px; padding: 0 8px; vertical-align: middle; }
.chip-btn {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface);
  font-weight: 600; cursor: pointer; white-space: nowrap;
}
.chip-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip-btn:disabled { opacity: .5; cursor: not-allowed; }
.chip-check { display: inline-flex; }
.chip-check input { position: absolute; opacity: 0; }
.chip-check span { min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); font-weight: 600; cursor: pointer; }
.chip-check input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip-check input:focus-visible + span { outline: 3px solid var(--focus); }

.dot { position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.dot.inline { position: static; display: inline-block; flex: none; margin-right: 6px; }
.chev { margin-left: auto; color: var(--muted); font-size: 24px; }

.hello { display: flex; align-items: center; gap: 12px; }
.char { display: inline-flex; flex: none; }
.char-svg { display: block; }
.next-class { display: block; padding: 4px 0; }
.list-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 0; border: 0; border-top: 1px solid var(--line);
  background: transparent; text-align: left; cursor: pointer;
}
.card > .list-item:first-of-type, .card h2 + .list-item { border-top: 0; }
.list-item > div { flex: 1; min-width: 0; }
.list-item.unread strong::before { content: "● "; color: var(--accent); }
.block-link { display: block; padding: 6px 0; }
.block-link + .block-link { border-top: 1px solid var(--line); }

.pass { padding: 4px 0; }
.pass-head { display: flex; gap: 8px; align-items: center; }
.pass-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.pass-nums div { background: var(--surface-2); border-radius: 12px; padding: 8px; text-align: center; display: flex; flex-direction: column; }
.pass-nums b { font-size: 22px; }
.pass-nums span { font-size: 13px; color: var(--muted); }

.video-row { display: flex; gap: 12px; align-items: center; padding: 8px 0; width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; }
.video-row .thumb { width: 112px; flex: none; }
.thumb { aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: var(--surface-2); display: block; width: 100%; }
.video-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.video-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.video-card .thumb { border-radius: 0; }
.video-card > div { padding: 8px 10px 10px; }
.video-card strong { font-size: 15px; display: block; line-height: 1.35; }
.video-card p { font-size: 13px; }
.star { position: absolute; top: 6px; right: 8px; color: #f5b400; font-size: 20px; text-shadow: 0 0 3px rgba(0,0,0,.5); }
.player { position: relative; border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.player .thumb { border-radius: 0; height: 100%; opacity: .85; }
.player iframe { width: 100%; height: 100%; border: 0; }
.play {
  display: grid; place-items: center;
  position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; border-radius: 50%; border: 0;
  background: rgba(200, 85, 61, .95); color: #fff; font-size: 30px; cursor: pointer;
}
.char-row { display: flex; align-items: center; gap: 12px; }

.choice-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.choice { min-height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; cursor: pointer; }

.week-nav { display: flex; align-items: center; justify-content: space-between; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day { display: flex; flex-direction: column; align-items: center; padding: 8px 0; border-radius: 14px; border: 1.5px solid transparent; min-height: 60px; }
.day span { font-size: 13px; color: var(--muted); }
.day b { font-size: 18px; }
.day.today { border-color: var(--line); }
.day.on { background: var(--accent); color: var(--accent-ink); }
.day.on span { color: inherit; }
.rules { font-size: 14px; color: var(--muted); background: var(--surface-2); padding: 10px 12px; border-radius: 12px; }

.class-row, .class-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.class-card.cancelled { opacity: .6; }
.time { display: flex; flex-direction: column; min-width: 64px; }
.time b { font-size: 18px; }
.time span { font-size: 13px; color: var(--muted); }
.info { flex: 1; min-width: 0; }
.pill { flex: none; padding: 8px 12px; border-radius: 12px; font-weight: 700; font-size: 15px; }
.pill.primary { background: var(--accent); color: var(--accent-ink); }
.pill.disabled { background: var(--surface-2); color: var(--muted); }
.pill.done { background: var(--sage-soft); color: var(--sage); }
.warn-text { color: var(--warn); font-size: 14px; font-weight: 600; }
.alert-text { color: var(--alert); font-weight: 700; font-size: 15px; }
.quote { border-left: 3px solid var(--accent); padding-left: 10px; margin-top: 6px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 8px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.notice { background: var(--sage-soft); border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.notice.warn { background: var(--warn-soft); }
.label { font-weight: 700; display: block; margin: 8px 0 6px; }
.hint { font-size: 13px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field .label { margin: 0; }
input[type=text], input[type=tel], input[type=password], input[type=search], input[type=url], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 50px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
}
textarea { resize: vertical; }
input[type=range] { width: 100%; accent-color: var(--accent); min-height: 40px; }
.radio, .check { display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; }
.radio input, .check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }

.condition { display: flex; flex-direction: column; gap: 14px; }
.condition fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0; background: var(--surface); }
.condition legend { font-weight: 700; padding: 0 6px; }
.req { font-size: 12px; color: var(--accent-ink); background: var(--accent); padding: 1px 6px; border-radius: 6px; vertical-align: middle; }
.opt { font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 0 6px; border-radius: 6px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label { flex: 1 1 auto; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 12px; border-radius: 12px;
  border: 1.5px solid var(--line); font-weight: 600; cursor: pointer; text-align: center; background: var(--surface);
}
.seg.big span { min-height: 60px; font-size: 18px; }
.seg.small span { min-height: 40px; font-size: 14px; }
.seg input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); }
.range-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.range-row span { flex: none; }
output { font-weight: 700; }
.range { display: grid; grid-template-columns: auto 1fr 28px; gap: 8px; align-items: center; }
.area { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }

.done { text-align: center; padding: 40px 0; display: flex; flex-direction: column; gap: 12px; }
.done-mark { width: 80px; height: 80px; border-radius: 50%; background: var(--sage-soft); color: var(--sage); font-size: 44px; display: grid; place-items: center; margin: 0 auto; }
.empty { text-align: center; padding: 20px 8px; color: var(--muted); display: flex; flex-direction: column; gap: 12px; align-items: stretch; }

/* 놀이터: 작은 공원. 풍경 색은 낮·밤 모두 같은 그림으로 쓰고, 글자는 흰 이름표 위에 올린다 */
.park {
  --sky-top: #bfe3f5; --sky-bottom: #e8f6f4; --grass: #a8d59b; --grass-dark: #8cc47f; --path: #efe2c8;
  --wood: #b98a5e; --leaf: #6fae6a; --leaf-dark: #5a9656; --tag-bg: rgba(255, 255, 255, .94); --tag-ink: #2b2622;
  position: relative; height: 400px; max-width: 100%; border-radius: 22px; overflow: hidden; border: 1px solid var(--line);
  cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .park { --sky-top: #2a3d5c; --sky-bottom: #4d5f78; --grass: #5f8a58; --grass-dark: #52794c; --path: #8f8069; }
}
:root[data-theme="dark"] .park { --sky-top: #2a3d5c; --sky-bottom: #4d5f78; --grass: #5f8a58; --grass-dark: #52794c; --path: #8f8069; }
.park .sky { position: absolute; inset: 0 0 58% 0; background: linear-gradient(var(--sky-top), var(--sky-bottom)); }
.park .grass { position: absolute; inset: 40% 0 0 0; background: radial-gradient(circle at 20% 30%, var(--grass-dark) 0 2px, transparent 3px) 0 0 / 28px 22px, var(--grass); }
.park .path { position: absolute; left: 30%; right: 30%; top: 40%; bottom: 0; background: var(--path); clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%); opacity: .8; }
.park .sun { position: absolute; top: 18px; right: 26px; width: 44px; height: 44px; border-radius: 50%; background: #ffd97a; box-shadow: 0 0 28px #ffe9a8; }
.park .cloud { position: absolute; height: 18px; width: 60px; background: #fff; border-radius: 20px; opacity: .85; animation: drift 38s linear infinite; }
.park .cloud::before { content: ""; position: absolute; left: 12px; top: -10px; width: 28px; height: 24px; background: #fff; border-radius: 50%; }
.park .cloud.c1 { top: 34px; left: -70px; }
.park .cloud.c2 { top: 70px; left: -70px; animation-delay: -19s; transform: scale(.8); }
@keyframes drift { to { left: 110%; } }
.park .house { position: absolute; left: 14px; top: 23%; width: 104px; height: 66px; background: #fff7ee; border-radius: 6px; box-shadow: 0 3px 0 #e2d2bf; }
.park .house::before { content: ""; position: absolute; left: -8px; right: -8px; top: -30px; height: 34px; background: #e07a5f; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.park .house span { position: absolute; inset: auto 4px 6px; text-align: center; font-size: 11px; font-weight: 700; color: #6e645b; line-height: 1.2; }
.park .tree { position: absolute; width: 58px; height: 80px; }
.park .tree::before { content: ""; position: absolute; left: 24px; bottom: 0; width: 10px; height: 28px; background: var(--wood); border-radius: 3px; }
.park .tree::after { content: ""; position: absolute; left: 0; top: 0; width: 58px; height: 58px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--leaf), var(--leaf-dark)); }
.park .tree.t1 { right: 12px; top: 26%; }
.park .tree.t2 { right: 78px; top: 20%; transform: scale(.75); }
.park .bench { position: absolute; right: 22px; bottom: 16px; width: 70px; height: 12px; background: var(--wood); border-radius: 4px; box-shadow: 0 10px 0 -4px var(--wood); }
.park .mat-spot { position: absolute; left: 16px; bottom: 14px; width: 96px; height: 34px; border-radius: 10px; background: #8fbfa8; opacity: .9; display: grid; place-items: center; }
.park .mat-spot span { font-size: 11px; font-weight: 700; color: #fff; }
.park .flowers { position: absolute; width: 40px; height: 12px; background: radial-gradient(circle, #f6a5b5 0 3px, transparent 4px) 0 0 / 12px 12px; }
.park .flowers.f1 { left: 44%; top: 47%; }
.park .flowers.f2 { left: 18%; top: 60%; }
.walkers { position: absolute; inset: 0; }
.walker {
  position: absolute; width: 17%; min-width: 60px; max-width: 84px; padding: 0; border: 0; background: none; cursor: pointer;
  transition-property: left, top; transition-timing-function: linear; display: flex; justify-content: center;
}
.walker .bob { display: flex; flex-direction: column; align-items: center; position: relative; }
.walker .char { filter: drop-shadow(0 3px 2px rgba(40, 30, 20, .18)); }
.walker.face-left .char-svg { transform: scaleX(-1); }
.walker.walking .bob { animation: hop .45s ease-in-out infinite; }
.walker.p-away { opacity: .8; }
.walker.me .char { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 4px rgba(255,255,255,.9)); }
@keyframes hop { 50% { transform: translateY(-5px); } }
.walker .tag {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100px; margin-top: -4px; padding: 1px 8px; border-radius: 999px;
  background: var(--tag-bg); color: var(--tag-ink); font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.walker.me .tag { background: var(--accent); color: var(--accent-ink); }
.walker .bubble {
  position: absolute; top: -14px; right: -6px; width: 28px; height: 28px; border-radius: 50%; background: var(--tag-bg);
  display: grid; place-items: center; font-size: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.walker:focus-visible { outline: 3px solid var(--focus); border-radius: 12px; }
i.online { width: 8px; height: 8px; border-radius: 50%; background: #3fb56b; display: inline-block; flex: none; }
.park.still .cloud, .park.still .walker .bob { animation: none; }
@media (prefers-reduced-motion: reduce) { .park .cloud, .walker .bob { animation: none !important; } .walker { transition: none !important; } }

.profile-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.profile-card .presence { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.profile-card .presence.p-online { color: var(--sage); font-weight: 700; }
.profile-card .mood { font-size: 18px; font-weight: 700; }
.status-bubble { position: relative; background: var(--surface-2); padding: 10px 16px; border-radius: 16px; max-width: 100%; }
.status-bubble::before { content: ""; position: absolute; top: -8px; left: 50%; margin-left: -8px; border: 8px solid transparent; border-top: 0; border-bottom-color: var(--surface-2); }
.center-chips { justify-content: center; }
.cheer-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.cheer-row .btn { padding: 0 6px; font-size: 15px; }
.profile-card .row-btns { width: 100%; }
.progress { height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.progress span { display: block; height: 100%; background: var(--sage); border-radius: 999px; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; font-size: 13px; }
.medal { width: 52px; height: 52px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe9a8, #e8b84a); display: grid; place-items: center; font-weight: 800; color: #6b4a00; border: 3px solid #f3d27a; }
.preview { display: flex; justify-content: center; background: var(--surface-2); border-radius: 20px; padding: 16px; }
.colors { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.swatch.on { border-color: var(--text); }

.menu { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.menu > * { padding: 16px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; font-weight: 600; min-height: 54px; }
.menu > *:first-child { border-top: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 10px; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.msg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; padding: 14px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.msg-head strong { flex: 1 1 60%; }
.msg-body { display: none; padding: 0 14px 14px; }
.msg.open .msg-body { display: block; }

/* 강사 화면 */
.att { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.att-btn { min-height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; cursor: pointer; }
.att-btn.on { background: var(--sage); border-color: var(--sage); color: #fff; }
.profile-mini { background: var(--surface-2); border-radius: 12px; padding: 8px 12px; font-size: 15px; margin: 6px 0; }
.cond { margin: 6px 0; }
.hist { padding: 10px 0; border-top: 1px solid var(--line); }
.hist:first-of-type { border-top: 0; }
.day-group { display: flex; flex-direction: column; gap: 8px; }
.day-title { font-size: 16px; color: var(--muted); margin: 8px 0 0; }
.code { font-size: 32px; font-weight: 800; letter-spacing: 2px; text-align: center; }
.share { white-space: pre-wrap; background: var(--surface-2); padding: 12px; border-radius: 12px; font: inherit; font-size: 15px; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr);
  max-width: 560px; margin: 0 auto; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 64px; font-size: 13px; color: var(--muted); font-weight: 600; }
.tabs .ic { font-size: 22px; line-height: 1.1; }
.tabs a.on { color: var(--accent); }

.sheet-wrap { position: fixed; inset: 0; z-index: 20; background: rgba(20, 12, 6, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--bg); border-radius: 22px 22px 0 0;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); animation: up .18s ease-out;
}
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: -8px; background: var(--bg); padding: 8px 0; z-index: 1; }
.sheet-head h2 { margin: 0; font-size: 19px; }
.sheet-body { display: flex; flex-direction: column; gap: 12px; }
.sheet-msg { font-size: 16px; }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 30; max-width: 528px; margin: 0 auto;
  background: #2b2622; color: #fff; padding: 14px 16px; border-radius: 14px; font-weight: 600;
  opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }
.toast.error { background: var(--alert); }

.auth { padding: 48px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.brand { text-align: center; margin-bottom: 10px; }
.brand h1 { font-size: 28px; }
.logo { font-size: 48px; }

/* 설치 없는 체험판 */
.demo-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  padding: 8px 16px; background: var(--sage-soft); color: var(--text); font-size: 14px; text-align: center;
}
.demo-bar strong { color: var(--sage); }
.demo-bar button { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--sage); background: var(--surface); font-weight: 700; cursor: pointer; font-size: 14px; }
.demo-login { display: flex; flex-direction: column; gap: 8px; }
.demo-login h2 { margin: 0; }
.demo .topbar { padding-top: 10px; }
.thumb.placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--sage-soft); color: var(--sage); font-weight: 700; font-size: 14px;
}
.thumb.placeholder span:first-child { font-size: 22px; }
