/* =========================================================
   별빛 나침반 (星光羅針盤) — 학생용(밤하늘 별빛 네이비) / 선생님용(서재 골드)
   ========================================================= */
:root,
body[data-mode="student"] {
    --bg: #0b1120;
    --surface: #131c31;
    --surface-2: #1b2742;
    --line: #2c3e66;
    --text: #f0f4fc;
    --muted: #94a6c8;
    --gold: #ffd166;
    --gold-deep: #d4a024;
    --seal: #e05347;
    --love: #ff8fab;
    --money: #ffd166;
    --work: #5ce1e6;
    --wood: #6ee7b7;
    --fire: #ff7b6b;
    --earth: #f6c467;
    --metal: #dce4f2;
    --water: #68b5ff;
    --tabbar-bg: rgba(11, 17, 32, 0.94);
    --toast-bg: #1b2742;
    --score-bg: #243354;
    --serif: 'Gowun Batang', 'Nanum Myeongjo', serif;
    --sans: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

body[data-mode="teacher"] {
    --bg: #0f0d0b;
    --surface: #1a1714;
    --surface-2: #231f1b;
    --line: #3a332b;
    --text: #f3ede2;
    --muted: #a39a8c;
    --gold: #d4af37;
    --gold-deep: #a8872a;
    --seal: #b3261e;
    --love: #e98aa6;
    --money: #e6c14f;
    --work: #6fa8dc;
    --wood: #6fae7e;
    --fire: #e0664c;
    --earth: #cfa75c;
    --metal: #cfd3d8;
    --water: #5b8fd0;
    --tabbar-bg: rgba(15, 13, 11, 0.94);
    --toast-bg: #2b251f;
    --score-bg: #2f2923;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--sans);
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse at top, rgba(255, 209, 102, 0.11), transparent 60%),
        radial-gradient(circle at 20% 15%, rgba(92, 225, 230, 0.06), transparent 35%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    color: var(--text);
    min-height: 100vh;
    word-break: keep-all;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.25s ease, color 0.25s ease;
}

body[data-mode="teacher"] {
    background-image:
        radial-gradient(ellipse at top, rgba(212, 175, 55, 0.07), transparent 60%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.container {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: 24px 16px 110px;
}

/* ---------- 헤더 & 모드 스위치 ---------- */
.brand { text-align: center; margin-bottom: 22px; }
.top-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin: -8px 0 14px; flex-wrap: wrap;
}
.mode-switch {
    display: inline-flex; background: var(--surface-2); border: 1px solid var(--line);
    border-radius: 999px; padding: 3px; gap: 2px;
}
.mode-switch button {
    background: none; border: none; color: var(--muted);
    font-family: var(--sans); font-size: 0.78rem; font-weight: 800;
    padding: 5px 11px; border-radius: 999px; cursor: pointer;
    transition: all 0.18s ease;
}
.mode-switch button.on {
    background: var(--gold); color: #16120a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.brand-seal {
    display: inline-flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; border-radius: 10px;
    background: var(--seal); color: #fbe9e4;
    font-family: var(--serif); font-size: 1.35rem; font-weight: 700;
    transform: rotate(-4deg); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    margin-bottom: 10px;
}
.brand h1 {
    font-family: var(--serif); color: var(--gold);
    font-size: 1.85rem; margin: 0; letter-spacing: 0.04em;
}
.brand h1 small { font-size: 0.52em; color: var(--muted); letter-spacing: 0.16em; margin-left: 6px; }
.brand p { color: var(--muted); font-size: 0.88rem; margin: 6px 0 0; line-height: 1.45; }
.brand-actions { display: flex; justify-content: flex-end; gap: 6px; margin: 0; }
.brand-install {
    margin-top: 0; padding: 5px 11px; border-radius: 999px; cursor: pointer;
    background: rgba(255, 209, 102, 0.12); border: 1px solid var(--gold-deep);
    color: var(--gold); font: inherit; font-size: 0.78rem; font-weight: 700; line-height: 1.3;
}
.brand-install:hover { background: rgba(255, 209, 102, 0.22); }

/* ---------- 폼 ---------- */
.field { margin-bottom: 12px; }
.field .cap { display: block; font-size: 0.8rem; color: var(--muted); margin: 0 0 6px 2px; }
.flex-row { display: flex; gap: 10px; }
.flex-row > * { flex: 1; min-width: 0; }

input[type="text"], input[type="time"], select, textarea {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    font-size: 1rem;
    font-family: var(--sans);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); }
input::placeholder, textarea::placeholder { color: #6f675c; }
input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(0.8); }
input[type="time"]:disabled { opacity: 0.4; }

.check { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: #cfc6b8; cursor: pointer; margin: 4px 0 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }
.hint { font-size: 0.78rem; color: var(--muted); margin: -4px 2px 12px; line-height: 1.5; }
.form-error { color: #ff8b7b; font-size: 0.85rem; min-height: 1.2em; margin: 0 2px 8px; }

.btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 1.02rem;
    font-weight: 800;
    font-family: var(--sans);
    cursor: pointer;
    transition: transform 0.15s, background 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-gold { background: var(--gold); color: #1a1408; }
.btn-gold:hover { background: #c29f2f; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--gold); }
.btn-kakao { background: #fee500; color: #191600; }
.btn-sm { width: auto; padding: 9px 14px; font-size: 0.85rem; border-radius: 20px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* ---------- 결과 공통 ---------- */
#resultView { display: none; }
.who {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 18px; gap: 10px;
}
.who-name { font-family: var(--serif); font-size: 1.25rem; color: var(--gold); }
.who-meta { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

.tone-toggle {
    display: flex; background: var(--surface-2); border: 1px solid var(--line);
    border-radius: 20px; padding: 3px; flex-shrink: 0;
}
.tone-toggle button {
    background: none; border: none; color: var(--muted);
    font-size: 0.78rem; font-weight: 700; padding: 6px 10px; border-radius: 16px;
    cursor: pointer; font-family: var(--sans);
}
.tone-toggle button.on { background: var(--gold); color: #1a1408; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px 18px;
    margin-bottom: 16px;
}
.card-title {
    font-family: var(--serif);
    color: var(--gold);
    font-size: 1.08rem;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.card-title .sub { font-family: var(--sans); font-size: 0.75rem; color: var(--muted); font-weight: 400; }
.lead { line-height: 1.75; font-size: 1rem; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; line-height: 1.6; }
.center { text-align: center; }

.pill {
    display: inline-block; padding: 3px 9px; border-radius: 12px;
    background: var(--surface-2); border: 1px solid var(--line);
    font-size: 0.78rem; color: var(--text); margin: 0 4px 4px 0;
}
.pill.gold { background: var(--gold); color: #1a1408; border-color: var(--gold); font-weight: 800; }

/* 오늘의 성격 (십신) 헤드 */
.day-head { text-align: center; margin-bottom: 14px; }
.day-head .hanja { font-family: var(--serif); font-size: 2.3rem; color: var(--gold); letter-spacing: 0.1em; }
.day-head .name { font-weight: 800; font-size: 1.05rem; margin-top: 2px; }
.day-head .kw { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }

/* 테마별 운세 */
.theme-list { display: flex; flex-direction: column; gap: 10px; }
.theme-box { background: var(--surface-2); border-radius: 10px; padding: 14px; border-left: 4px solid var(--gold); }
.theme-box.love { border-left-color: var(--love); }
.theme-box.money { border-left-color: var(--money); }
.theme-box.work { border-left-color: var(--work); }
.theme-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; margin-bottom: 8px; }
.theme-box.love .theme-head { color: var(--love); }
.theme-box.money .theme-head { color: var(--money); }
.theme-box.work .theme-head { color: var(--work); }
.score { background: var(--score-bg); color: var(--text); padding: 3px 9px; border-radius: 12px; font-size: 0.82rem; }
.bar { height: 5px; background: var(--score-bg); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.bar i { display: block; height: 100%; border-radius: 3px; transition: width 0.8s ease; }
.theme-box.love .bar i { background: var(--love); }
.theme-box.money .bar i { background: var(--money); }
.theme-box.work .bar i { background: var(--work); }
.theme-text { font-size: 0.92rem; line-height: 1.6; color: var(--text); opacity: 0.92; }

.mbti-box { background: var(--surface-2); border-radius: 10px; padding: 14px; line-height: 1.65; border-left: 4px solid var(--gold); }
.mbti-badge { background: var(--gold); color: #1a1408; padding: 2px 8px; border-radius: 4px; font-weight: 800; font-size: 0.78rem; margin-right: 6px; }

/* 전화위복 */
.reframe { margin-top: 14px; text-align: center; }
.reframe-text {
    display: none; text-align: left; margin-top: 12px; padding: 14px;
    border: 1px dashed var(--gold-deep); border-radius: 10px; line-height: 1.7;
    background: rgba(255, 209, 102, 0.06);
}

/* 개운 요소 */
.gaewun { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gaewun div { background: var(--surface-2); border-radius: 10px; padding: 12px; }
.gaewun b { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 400; margin-bottom: 4px; }
.gaewun span { font-weight: 700; font-size: 0.95rem; }
.color-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; border: 1px solid rgba(255,255,255,0.3); }
.mission { margin-top: 10px; background: var(--surface-2); border-radius: 10px; padding: 12px; font-size: 0.92rem; line-height: 1.6; }

/* 부적 */
.amulet {
    margin: 4px auto 0; width: 158px; padding: 14px 10px;
    background: linear-gradient(#f2d45c, #e9c440);
    color: var(--seal); text-align: center; border-radius: 6px;
    font-family: var(--serif); box-shadow: 0 4px 14px rgba(0,0,0,0.4);
    border: 2px solid #c79b1c;
}
.amulet .big { font-size: 2.6rem; font-weight: 700; line-height: 1.1; }
.amulet .line { border-top: 2px solid var(--seal); border-bottom: 2px solid var(--seal); margin: 8px 0; padding: 4px 0; font-size: 0.85rem; font-weight: 700; }
.amulet .desc { font-size: 0.72rem; line-height: 1.4; }

/* 고전 한 구절 */
.quote { text-align: center; }
.quote .hanmun { font-family: var(--serif); font-size: 1.25rem; color: var(--gold); line-height: 1.6; letter-spacing: 0.08em; }
.quote .src { font-size: 0.78rem; color: var(--muted); margin: 6px 0 10px; }
.quote .kor { line-height: 1.7; font-size: 0.95rem; }
.quote-tip {
    margin-top: 12px; padding: 10px 12px; border-radius: 10px;
    background: var(--surface-2); font-size: 0.83rem; color: var(--muted);
    line-height: 1.55; text-align: left;
}
.quote-tip b { color: var(--gold); }

/* ---------- 사주 원국 ---------- */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.pillar-cap { font-size: 0.72rem; color: var(--muted); margin-bottom: 4px; }
.pillar-cell {
    border-radius: 8px; padding: 8px 0 6px; margin-bottom: 6px;
    font-family: var(--serif); font-size: 1.7rem; font-weight: 700; line-height: 1.1;
    border: 1px solid transparent;
}
.pillar-cell small { display: block; font-family: var(--sans); font-size: 0.62rem; font-weight: 600; margin-top: 3px; opacity: 0.9; }
.pillar-cell.me { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.pillar-cell.empty { background: var(--surface-2); color: var(--muted); opacity: 0.55; }
.pillar-god { font-size: 0.68rem; color: var(--muted); min-height: 1em; }
.el-wood { background: rgba(111, 174, 126, 0.18); color: var(--wood); }
.el-fire { background: rgba(224, 102, 76, 0.18); color: var(--fire); }
.el-earth { background: rgba(207, 167, 92, 0.18); color: var(--earth); }
.el-metal { background: rgba(207, 211, 216, 0.14); color: var(--metal); }
.el-water { background: rgba(91, 143, 208, 0.2); color: var(--water); }

.ilgan { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.ilgan-hanja {
    width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--serif); font-size: 2.2rem; font-weight: 700;
}
.ilgan-title { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; }
.ilgan-sub { font-size: 0.82rem; color: var(--muted); margin-top: 3px; }

/* 오행 차트 */
.ohaeng { display: flex; gap: 14px; align-items: center; }
.ohaeng svg { width: 150px; height: 150px; flex-shrink: 0; }
.ohaeng-bars { flex: 1; }
.oh-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 0.85rem; }
.oh-row .nm { width: 30px; font-family: var(--serif); font-weight: 700; }
.oh-row .track { flex: 1; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.oh-row .track i { display: block; height: 100%; border-radius: 4px; }
.oh-row .ct { width: 22px; text-align: right; color: var(--muted); font-size: 0.78rem; }

/* 대운 타임라인 */
.daewoon { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.dw {
    flex: 0 0 58px; text-align: center; border-radius: 8px; padding: 8px 0;
    background: var(--surface-2); border: 1px solid var(--line);
}
.dw.now { border-color: var(--gold); background: rgba(255, 209, 102, 0.12); }
.dw .age { font-size: 0.7rem; color: var(--muted); }
.dw .gz { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; margin: 3px 0; line-height: 1.2; }
.dw .god { font-size: 0.65rem; color: var(--muted); }
.dw-now-label { font-size: 0.65rem; color: var(--gold); font-weight: 800; }

/* ---------- 궁합 / 우정 케미 ---------- */
.gh-score { text-align: center; margin: 4px 0 14px; }
.gh-score .num { font-family: var(--serif); font-size: 3rem; color: var(--gold); font-weight: 700; line-height: 1; }
.gh-score .grade { font-weight: 800; margin-top: 6px; }
.gh-pair { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 12px; }
.gh-pair .p { text-align: center; }
.gh-pair .p .ilgan-hanja { width: 58px; height: 58px; font-size: 1.7rem; margin: 0 auto 4px; }
.gh-pair .p .nm { font-size: 0.85rem; }
.gh-pair .amp { font-family: var(--serif); color: var(--seal); font-size: 1.6rem; }
.gh-item { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.gh-item .hd { display: flex; justify-content: space-between; font-weight: 800; font-size: 0.92rem; margin-bottom: 6px; }
.gh-item .tx { font-size: 0.88rem; line-height: 1.6; color: var(--text); opacity: 0.92; }
.invite-banner {
    background: rgba(224, 83, 71, 0.14); border: 1px solid rgba(224, 83, 71, 0.5);
    border-radius: 12px; padding: 14px; margin-bottom: 18px; line-height: 1.6; font-size: 0.92rem;
}
.invite-banner b { color: var(--gold); }

/* ---------- 타로 / 상징 카드 ---------- */
.spread-select { display: flex; gap: 6px; margin-bottom: 12px; }
.spread-select button {
    flex: 1; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
    border-radius: 10px; padding: 10px 4px; font-size: 0.8rem; font-weight: 700; cursor: pointer; font-family: var(--sans);
}
.spread-select button.on { border-color: var(--gold); color: var(--gold); background: rgba(255, 209, 102, 0.08); }

.deck-fan {
    position: relative; height: 176px; margin: 10px 0 0; overflow: hidden;
    touch-action: manipulation;
}
.deck-card {
    position: absolute; bottom: 76px; left: 50%;
    width: 52px; height: 86px; margin-left: -26px;
    border-radius: 6px; cursor: pointer;
    background:
        repeating-linear-gradient(45deg, var(--surface), var(--surface) 6px, var(--surface-2) 6px, var(--surface-2) 12px);
    border: 1px solid var(--gold-deep);
    transform-origin: 50% 190%;
    transition: transform 0.25s, opacity 0.3s, box-shadow 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.deck-card::after {
    content: '✦'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    color: var(--gold-deep); font-size: 0.9rem;
}
.deck-card:hover { box-shadow: 0 0 10px rgba(255, 209, 102, 0.6); }
.deck-card.picked { opacity: 0; pointer-events: none; }
.deck-guide { text-align: center; font-size: 0.85rem; color: var(--muted); min-height: 1.3em; }

.tarot-slots { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.card-wrapper { width: 31%; max-width: 124px; aspect-ratio: 1 / 1.65; perspective: 1000px; cursor: pointer; }
.card-inner { width: 100%; height: 100%; position: relative; transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275); transform-style: preserve-3d; }
.card-wrapper.flipped .card-inner { transform: rotateY(180deg); }
.card-front, .card-back {
    position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
    border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 6px; border: 1px solid var(--line); box-shadow: 0 4px 8px rgba(0,0,0,0.35);
}
.card-front {
    background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 8px, var(--surface-2) 8px, var(--surface-2) 16px);
    color: var(--gold); font-weight: 800; font-size: 0.95rem;
}
.card-front small { font-weight: 400; font-size: 0.7rem; color: var(--muted); margin-top: 4px; }
.card-back { background: linear-gradient(160deg, var(--surface-2), var(--bg)); transform: rotateY(180deg); border-color: var(--gold); }
.card-back .sym { font-size: 1.9rem; line-height: 1; margin-bottom: 6px; }
.card-back .num { font-family: var(--serif); color: var(--gold); font-size: 0.8rem; }
.card-back .nm { font-size: 0.78rem; font-weight: 800; margin-top: 2px; }
.card-back .rev { font-size: 0.65rem; color: #ff8b7b; margin-top: 3px; }
.card-back.reversed .sym { transform: rotate(180deg); }
.tarot-reading { margin-top: 16px; }
.tarot-item { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; line-height: 1.6; }
.tarot-item .hd { font-weight: 800; margin-bottom: 4px; }
.tarot-item .hd .pos { color: var(--gold); margin-right: 6px; }
.tarot-item .kw { font-size: 0.78rem; color: var(--muted); margin-bottom: 4px; }
.tarot-item .tx { font-size: 0.9rem; color: var(--text); opacity: 0.92; }

/* ---------- 기록(일지) ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head button { background: none; border: 1px solid var(--line); color: var(--text); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1rem; }
.cal-head .ym { font-family: var(--serif); font-size: 1.1rem; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal .dow { font-size: 0.7rem; color: var(--muted); padding-bottom: 4px; }
.cal .d {
    aspect-ratio: 1; border-radius: 8px; background: var(--surface-2); position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 0.8rem; cursor: default; border: 1px solid transparent;
}
.cal .d.blank { background: transparent; }
.cal .d.today { border-color: var(--gold); }
.cal .d.has { cursor: pointer; }
.cal .d.sel { background: rgba(255, 209, 102, 0.15); }
.cal .d.has .dn { position: absolute; top: 3px; left: 5px; font-size: 0.6rem; color: var(--muted); }
.cal .stamp {
    position: absolute; inset: 18% 14% 10%; border: 2px solid var(--seal); color: var(--seal);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-family: var(--serif); font-weight: 700; font-size: 1rem; transform: rotate(-12deg);
    opacity: 0.88; background: rgba(224, 83, 71, 0.08);
}
.streak { display: flex; justify-content: space-around; text-align: center; margin-bottom: 14px; }
.streak .v { font-family: var(--serif); font-size: 1.6rem; color: var(--gold); font-weight: 700; }
.streak .l { font-size: 0.75rem; color: var(--muted); }
.memo-area textarea { min-height: 76px; resize: vertical; line-height: 1.5; margin-bottom: 8px; }
.log-detail { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin-top: 12px; font-size: 0.88rem; line-height: 1.6; display: none; }
.rating { display: flex; gap: 6px; margin-bottom: 8px; }
.rating button {
    flex: 1; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
    border-radius: 10px; padding: 8px 0; cursor: pointer; font-size: 0.8rem; font-family: var(--sans);
}
.rating button.on { border-color: var(--gold); color: var(--gold); }

/* ---------- 별빛 도감 카드 ---------- */
.keepsake-wrap { text-align: center; }
#keepsakeCanvas {
    width: 100%; max-width: 300px; border-radius: 10px;
    box-shadow: 0 8px 26px rgba(0,0,0,0.55); cursor: crosshair; touch-action: manipulation;
}
.seal-palette { display: flex; justify-content: center; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.seal-btn {
    width: 42px; height: 42px; border-radius: 6px; border: 2px solid var(--seal);
    background: transparent; color: var(--seal); font-family: var(--serif); font-weight: 700; font-size: 1.05rem;
    cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
    line-height: 1; padding: 2px;
}
.seal-btn small { font-family: var(--sans); font-size: 0.58rem; font-weight: 600; margin-top: 2px; opacity: 0.85; }
.seal-btn.on { background: var(--seal); color: #fbe9e4; }

/* ---------- 하단 탭 ---------- */
.tabbar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
    display: none; justify-content: center;
    background: var(--tabbar-bg); backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-inner { display: flex; width: 100%; max-width: 460px; }
.tabbar button {
    flex: 1; background: none; border: none; color: var(--muted); padding: 9px 0 10px;
    font-family: var(--sans); font-size: 0.72rem; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tabbar button .ic { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; }
.tabbar button.on { color: var(--gold); }
.tab-panel { display: none; }
.tab-panel.on { display: block; animation: fadeUp 0.35s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.footer-note { text-align: center; font-size: 0.72rem; color: var(--muted); opacity: 0.75; margin-top: 26px; line-height: 1.6; }

.toast {
    position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px);
    background: var(--toast-bg); color: var(--text); border: 1px solid var(--gold-deep);
    padding: 10px 16px; border-radius: 20px; font-size: 0.85rem; opacity: 0; pointer-events: none;
    transition: opacity 0.25s, transform 0.25s; z-index: 50; max-width: 90%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================
   쉽고 재미있게 — 입력 간소화, 점괘, 용어 풀이, 교사용 코칭 카드
   ========================================================= */

/* 결과 화면에서는 큰 로고를 접어 첫 화면에 내용이 더 보이게 */
body.result-mode .brand { margin-bottom: 14px; }
body.result-mode .brand-seal { width: 30px; height: 30px; font-size: 0.95rem; margin: 0 8px 0 0; vertical-align: middle; }
body.result-mode .brand h1 { display: inline-block; font-size: 1.25rem; vertical-align: middle; }
body.result-mode .brand p { display: none; }

/* 오늘의 기운 (입력 전) */
.teaser {
    display: flex; align-items: center; gap: 14px;
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.12), rgba(255, 209, 102, 0.02));
    border: 1px solid rgba(255, 209, 102, 0.35); border-radius: 14px;
    padding: 14px 16px; margin-bottom: 20px;
}
.teaser-gz {
    font-family: var(--serif); font-size: 1.6rem; font-weight: 700; color: var(--gold);
    line-height: 1.1; text-align: center; flex-shrink: 0; width: 44px;
}
.teaser-date { font-size: 0.78rem; color: var(--muted); }
.teaser-text { font-size: 0.9rem; line-height: 1.5; margin-top: 2px; }

/* 다시 온 사람 */
.welcome { text-align: center; }
.welcome-hi { font-family: var(--serif); font-size: 1.15rem; margin: 0; }
.welcome-hi b { color: var(--gold); }
.link-btn {
    display: block; margin: 12px auto 0; background: none; border: none; color: var(--muted);
    font-size: 0.85rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-family: var(--sans);
}
.link-btn.inline { display: inline; margin: 0 0 0 6px; font-size: 0.78rem; color: var(--gold); padding: 0; }

.field-note { font-size: 0.8rem; color: var(--gold); margin: 6px 2px 0; min-height: 1em; }
.field-note.err { color: #ff8b7b; }

/* 두 개 중 고르기 버튼 */
.seg { display: flex; gap: 6px; }
.seg button {
    flex: 1; padding: 12px 6px; border-radius: 10px; border: 1px solid var(--line);
    background: var(--surface-2); color: var(--muted); font-size: 0.95rem; font-weight: 700;
    font-family: var(--sans); cursor: pointer; transition: all 0.15s;
}
.seg button small { font-weight: 400; font-size: 0.72rem; margin-left: 2px; }
.seg button.on { border-color: var(--gold); color: #1a1408; background: var(--gold); }
.mbti-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mbti-pick .seg button { padding: 10px 4px; font-size: 0.9rem; }

/* MBTI 간이 문항 */
.mbti-quiz { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.mbti-quiz .qn { font-size: 0.75rem; color: var(--muted); }
.mbti-quiz .qq { font-weight: 800; margin: 4px 0 10px; }
.mbti-quiz .qa { display: flex; flex-direction: column; gap: 6px; }
.mbti-quiz .qa button {
    text-align: left; padding: 12px; border-radius: 10px; border: 1px solid var(--line);
    background: var(--surface); color: var(--text); font-size: 0.92rem; cursor: pointer; font-family: var(--sans);
}
.mbti-quiz .qa button:hover { border-color: var(--gold); }

/* 태어난 시간 접기 */
details.more { margin: 4px 0 12px; border: 1px dashed var(--line); border-radius: 10px; padding: 0 12px; }
details.more summary { cursor: pointer; padding: 12px 0; font-size: 0.9rem; color: var(--text); list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: '＋ '; color: var(--gold); }
details.more[open] summary::before { content: '－ '; }
.more-body { padding-bottom: 12px; }

/* 오늘의 점괘 */
.omi-stage { text-align: center; padding: 6px 0 2px; }
.omi-cup {
    position: relative; width: 92px; height: 132px; margin: 8px auto 6px; display: block;
    background: none; border: none; cursor: pointer; padding: 0;
}
.omi-sticks { position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: 60px; height: 50px; }
.omi-sticks i {
    position: absolute; bottom: 0; width: 6px; height: 46px; border-radius: 3px 3px 0 0;
    background: linear-gradient(#e8d6a4, #b89a55);
}
.omi-sticks i:nth-child(1) { left: 8px; transform: rotate(-12deg); height: 40px; }
.omi-sticks i:nth-child(2) { left: 19px; transform: rotate(-5deg); }
.omi-sticks i:nth-child(3) { left: 29px; height: 50px; }
.omi-sticks i:nth-child(4) { left: 39px; transform: rotate(6deg); height: 42px; }
.omi-sticks i:nth-child(5) { left: 49px; transform: rotate(13deg); height: 38px; }
.omi-body {
    position: absolute; left: 0; right: 0; bottom: 0; height: 90px;
    background: linear-gradient(90deg, #7a1c16, var(--seal) 45%, #8c2019);
    border-radius: 10px 10px 14px 14px; border: 2px solid var(--gold-deep);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--serif); font-size: 2rem; font-weight: 700; color: #f2d45c;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}
.omi-cup.shake { animation: omiShake 0.9s ease-in-out; }
@keyframes omiShake {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(-14deg); }
    30% { transform: rotate(12deg); }
    45% { transform: rotate(-10deg); }
    60% { transform: rotate(8deg); }
    75% { transform: rotate(-4deg); }
}
.omi-guide { font-size: 0.88rem; color: var(--muted); margin: 6px 0 4px; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

.omi-result { text-align: center; animation: fadeUp 0.5s ease; }
.omi-stick {
    width: 64px; margin: 4px auto 10px; padding: 14px 0; border-radius: 6px;
    background: linear-gradient(#f0e2b6, #cfb06a); color: var(--seal);
    font-family: var(--serif); font-weight: 700; font-size: 1.7rem; line-height: 1.15;
    min-height: 90px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5); animation: rise 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.omi-grade { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; color: var(--gold); }
.omi-grade small { display: block; font-family: var(--sans); font-size: 0.85rem; font-weight: 400; color: var(--muted); margin-top: 2px; }
.omi-plain { margin: 8px 0 12px; line-height: 1.6; }
.omi-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.omi-chips span {
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px;
    padding: 5px 10px; font-size: 0.8rem;
}

.day-head .plain {
    display: inline-block; margin-top: 10px; padding: 6px 12px; border-radius: 14px;
    background: rgba(255, 209, 102, 0.1); color: var(--text); font-size: 0.88rem;
}

/* 용어 풀이 버튼과 시트 */
.qm {
    width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--gold-deep);
    background: transparent; color: var(--gold); font-size: 0.72rem; font-weight: 800;
    cursor: pointer; margin-left: 4px; vertical-align: 2px; padding: 0; font-family: var(--sans);
}
.sheet-dim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 60; display: none; }
.sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; margin: 0 auto; max-width: 460px;
    background: var(--surface); border: 1px solid var(--line); border-bottom: none;
    border-radius: 18px 18px 0 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
    transform: translateY(105%); visibility: hidden; transition: transform 0.28s ease, visibility 0.28s;
}
.sheet.show { transform: none; visibility: visible; }
.sheet-dim.show { display: block; }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 14px; }
.sheet h4 { font-family: var(--serif); color: var(--gold); font-size: 1.15rem; margin: 0 0 10px; }
.sheet p { line-height: 1.75; margin: 0 0 16px; font-size: 0.95rem; }
.mbti-pick .seg { padding: 3px; border: 1px solid var(--line); border-radius: 12px; gap: 3px; }
.mbti-pick .seg button { border-color: transparent; }

/* 선생님용: 학생 코칭 & 수업 자료 카드 */
.teacher-only { display: none; }
body[data-mode="teacher"] .teacher-only { display: block; }
.student-only { display: block; }
body[data-mode="teacher"] .student-only { display: none; }

.coach-list { display: flex; flex-direction: column; gap: 10px; }
.coach-item {
    background: var(--surface-2); border-radius: 10px; padding: 12px 14px;
    border-left: 3px solid var(--gold); line-height: 1.6; font-size: 0.9rem;
}
.coach-item b { display: block; color: var(--gold); font-size: 0.82rem; margin-bottom: 4px; }

.edu-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.edu-tabs button {
    flex: 1; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
    border-radius: 8px; padding: 8px 4px; font-size: 0.78rem; font-weight: 700; cursor: pointer; font-family: var(--sans);
}
.edu-tabs button.on { border-color: var(--gold); color: var(--gold); background: rgba(212, 175, 55, 0.1); }
.edu-body {
    background: var(--surface-2); border-radius: 10px; padding: 14px;
    font-size: 0.88rem; line-height: 1.65;
}
.edu-body h4 { margin: 0 0 6px; color: var(--gold); font-size: 0.95rem; }
.edu-body p { margin: 0 0 8px; }
.edu-body p:last-child { margin-bottom: 0; }

/* 공통 하단 저작권 */
.site-footer { margin-top: 26px; }
.site-footer .footer-note { margin-top: 0; }
.site-footer .copyright { margin-top: 8px; }
.site-footer a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* 양력/음력 선택 */
.seg-cal { margin-bottom: 8px; }
.seg-cal button { padding: 8px 6px; font-size: 0.85rem; }
