:root {
  --sky: #cfe6f5;
  --frame: #5fa3d6;
  --frame-dark: #3a7fb7;
  --paper: #ffffff;
  --line: #c9d9e6;
  --ink: #3b3340;
  --muted: #8a8392;
  --orange: #ff8a00;
  --fire: #e8452c;
  --water: #3d8bd6;
  --pink: #ff6f91;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Galmuri11', 'Apple SD Gothic Neo', sans-serif;
  color: var(--ink);
  background: var(--sky);
  background-image: radial-gradient(#ffffff 1.5px, transparent 1.6px);
  background-size: 18px 18px;
  min-height: 100vh;
  display: flex; justify-content: center;
  -webkit-font-smoothing: none;
}
button { font: inherit; cursor: pointer; }
.phone {
  width: 100%; max-width: 440px; min-height: 100vh;
  background: #eef4f9;
  border-left: 3px solid var(--frame); border-right: 3px solid var(--frame);
  display: flex; flex-direction: column; position: relative;
}
@media (min-width: 520px) {
  .phone { margin: 20px 0; min-height: calc(100vh - 40px); border: 3px solid var(--frame); border-radius: 18px; overflow: hidden; box-shadow: 0 6px 0 var(--frame-dark); }
}

.mh-top {
  background: linear-gradient(#7dbbe6, var(--frame));
  color: #fff; padding: 10px 16px 12px; border-bottom: 3px dotted #fff;
}
.counter { font-family: 'Galmuri9', sans-serif; font-size: 11px; opacity: .95; }
.counter b { color: #ffe066; }
.counter i { opacity: .6; margin: 0 4px; font-style: normal; }
.mh-title { font-size: 18px; margin-top: 4px; text-shadow: 1px 1px 0 var(--frame-dark); }
.mh-sub { font-family: 'Galmuri9', sans-serif; font-size: 11px; margin-top: 3px; opacity: .95; }

.mh-body { flex: 1; overflow-y: auto; padding: 12px 12px 84px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.box {
  background: var(--paper); border: 2px solid var(--line); border-radius: 10px;
  margin-bottom: 12px; overflow: hidden;
}
.box-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 7px 10px; background: #f4f9fd; border-bottom: 1px dashed var(--line);
  font-size: 13px; color: var(--frame-dark);
}
.chip { font-family: 'Galmuri9', sans-serif; font-size: 10px; background: var(--orange); color: #fff; padding: 2px 7px; border-radius: 10px; white-space: nowrap; }
.chip.ghost { background: #e6f0f8; color: var(--frame-dark); }
.chip.fire { background: var(--fire); }
.chip.water { background: var(--water); }

.room-wrap { position: relative; width: 100%; aspect-ratio: 360 / 270; background: linear-gradient(#fdfbf5, #f3ecdf); }
#room { width: 100%; height: 100%; display: block; image-rendering: pixelated; cursor: pointer; }
#overlay { position: absolute; inset: 0; pointer-events: none; }
.nametag {
  position: absolute; transform: translate(-50%, 0); pointer-events: auto; cursor: pointer;
  font-family: 'Galmuri9', sans-serif; font-size: 10px; white-space: nowrap;
  background: rgba(255,255,255,.92); border: 1px solid #b9c9d6; border-radius: 6px; padding: 1px 4px;
}
.nametag.me { border-color: var(--orange); color: #c25e00; }
.nametag.guest { border-color: #9b8bd6; color: #6a55b8; }
.bubble {
  position: absolute; transform: translate(-50%, -100%); max-width: 62%;
  background: #fff; border: 2px solid var(--ink); border-radius: 10px; padding: 5px 8px;
  font-size: 11px; line-height: 1.35; box-shadow: 2px 2px 0 rgba(0,0,0,.15);
  animation: pop .18s ease-out;
}
.bubble::after {
  content: ''; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--ink);
}
@keyframes pop { from { transform: translate(-50%, -90%) scale(.8); opacity: 0; } }
.room-caption { margin: 0; padding: 7px 10px; font-size: 11px; color: var(--muted); border-top: 1px dashed var(--line); }

.scale { padding: 10px 12px 12px; }
.scale + .scale { border-top: 1px dashed var(--line); }
.scale-title { font-size: 12px; margin-bottom: 6px; display: flex; justify-content: space-between; }
.scale-bar { position: relative; height: 14px; border-radius: 8px; border: 2px solid var(--ink); overflow: visible; }
.scale-bar .mk { position: absolute; top: 50%; width: 14px; height: 14px; border: 2px solid var(--ink); border-radius: 50%; transform: translate(-50%, -50%); background: #fff; }
.scale-bar .mk.now { background: #ffe066; width: 18px; height: 18px; }
.scale-bar .mid { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; background: rgba(0,0,0,.25); }
.scale-ends { display: flex; justify-content: space-between; font-family: 'Galmuri9', sans-serif; font-size: 10px; margin-top: 5px; color: var(--muted); }
.scale-legend { font-family: 'Galmuri9', sans-serif; font-size: 10px; color: var(--muted); margin-top: 6px; }
.advice { margin-top: 8px; font-size: 12px; line-height: 1.5; background: #fff8e6; border: 1px dashed #f0c76a; border-radius: 8px; padding: 7px 9px; }

.log { list-style: none; margin: 0; padding: 4px 10px 8px; max-height: 210px; overflow-y: auto; }
.log li { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; border-bottom: 1px dotted #e3ebf2; font-size: 12px; line-height: 1.4; }
.log img { width: 22px; height: 28px; image-rendering: pixelated; flex: none; }
.log .who { color: var(--frame-dark); font-family: 'Galmuri9', sans-serif; font-size: 10px; display: block; }

.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px; }
.cat-card { border: 2px solid var(--line); border-radius: 10px; padding: 10px 8px; text-align: center; background: #fbfdff; }
.cat-card:hover { border-color: var(--frame); }
.cat-card img { width: 56px; height: 70px; image-rendering: pixelated; }
.cat-card .nm { font-size: 13px; margin-top: 4px; }
.cat-card .rl { font-family: 'Galmuri9', sans-serif; font-size: 10px; color: var(--muted); margin-top: 2px; }
.cat-card .tg { font-size: 11px; margin-top: 6px; color: var(--frame-dark); }
.note { font-size: 11px; color: var(--muted); padding: 0 12px 10px; margin: 0; line-height: 1.5; }

.tabs {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 4px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--frame); border-top: 3px solid var(--frame-dark);
}
@media (max-width: 519px) { .tabs { position: fixed; max-width: 440px; margin: 0 auto; } }
.tabs button {
  flex: 1; border: 2px solid var(--frame-dark); background: #8ec5ec; color: #fff; padding: 9px 0; border-radius: 8px 8px 4px 4px;
  font-size: 13px; text-shadow: 1px 1px 0 var(--frame-dark);
}
.tabs button.active { background: #fff; color: var(--frame-dark); text-shadow: none; }

.sheet-back { position: absolute; inset: 0; background: rgba(40,50,70,.35); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 10; }
.sheet-back.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 86%; overflow-y: auto; z-index: 11;
  background: #fff; border-top: 3px solid var(--frame); border-radius: 16px 16px 0 0; padding: 14px 16px 24px;
  transform: translateY(105%); transition: transform .25s ease-out;
}
@media (max-width: 519px) { .sheet, .sheet-back { position: fixed; max-width: 440px; margin: 0 auto; } }
.sheet.on { transform: translateY(0); }
.sheet-close { position: absolute; right: 12px; top: 8px; border: none; background: none; font-size: 24px; color: var(--muted); }
.sh-head { display: flex; gap: 12px; align-items: center; }
.sh-head img { width: 64px; height: 80px; image-rendering: pixelated; border: 2px solid var(--line); border-radius: 10px; background: #f6fafd; }
.sh-name { font-size: 16px; }
.sh-role { font-family: 'Galmuri9', sans-serif; font-size: 10px; color: var(--muted); margin-top: 3px; }
.names { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.sec { margin-top: 14px; }
.sec h4 { margin: 0 0 6px; font-size: 12px; color: var(--frame-dark); font-weight: normal; border-bottom: 1px dashed var(--line); padding-bottom: 4px; }
.sec p { margin: 4px 0; font-size: 12px; line-height: 1.6; }
.sec.todo { background: #fff8e6; border: 1px dashed #f0c76a; border-radius: 10px; padding: 8px 10px; }
.building { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 12px; }
.building dt { color: var(--muted); }
.building dd { margin: 0; }
.small { font-family: 'Galmuri9', sans-serif; font-size: 10px; color: var(--muted); line-height: 1.5; }

.pad { padding: 10px 12px; }
.guest-row { display: flex; gap: 12px; align-items: center; }
.guest-row img { width: 56px; height: 70px; image-rendering: pixelated; }
.big { font-size: 16px; }
.hits { list-style: none; margin: 0; padding: 0; }
.hits li { font-size: 12px; line-height: 1.5; padding: 5px 0; border-bottom: 1px dotted #e3ebf2; }
.tag { font-family: 'Galmuri9', sans-serif; font-size: 10px; padding: 1px 5px; border-radius: 6px; margin-right: 4px; background: #e6f0f8; color: var(--frame-dark); }
.tag.pub { background: #ffe9d6; color: #b45a00; }
.tag.pri { background: #ffe1ea; color: #c23a63; }
.push { background: #2c2f3a; border-radius: 14px; padding: 10px; display: grid; gap: 8px; margin: 10px 12px 12px; }
.push .n { background: rgba(255,255,255,.92); border-radius: 10px; padding: 7px 9px; font-size: 11px; line-height: 1.45; }
.push .n b { font-family: 'Galmuri9', sans-serif; font-weight: normal; color: var(--muted); font-size: 10px; display: block; }

table.mj { width: 100%; border-collapse: collapse; font-size: 12px; text-align: center; }
table.mj th, table.mj td { border: 1px solid var(--line); padding: 5px 2px; }
table.mj th { background: #f4f9fd; color: var(--frame-dark); font-weight: normal; }
table.mj .gz { font-size: 18px; }
.daeun { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.daeun div { flex: none; min-width: 46px; border: 2px solid var(--line); border-radius: 8px; padding: 4px 2px; text-align: center; font-size: 13px; }
.daeun div small { display: block; font-family: 'Galmuri9', sans-serif; font-size: 9px; color: var(--muted); }
.daeun .cur { border-color: var(--orange); background: #fff3e0; }
.daeun .bor { border-style: dashed; border-color: #9b8bd6; background: #f3f0ff; }
.form { display: grid; gap: 8px; font-size: 12px; }
.form input[type=date] { font: inherit; padding: 6px; border: 2px solid var(--line); border-radius: 8px; }
.form .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn { border: 2px solid var(--frame-dark); background: var(--frame); color: #fff; border-radius: 8px; padding: 7px 12px; font-size: 12px; }
.btn.ghost { background: #fff; color: var(--frame-dark); }
input[type=range] { width: 100%; }
.checks { font-size: 11px; line-height: 1.7; }

/* ---- v2: 저울 접기, 기록 별 ---- */
.scale.main { cursor: pointer; }
.scale.main:focus-visible { outline: 2px dashed var(--frame); outline-offset: -4px; }
.fold { font-family: 'Galmuri9', sans-serif; font-size: 10px; color: var(--frame-dark); background: #e6f0f8; border-radius: 6px; padding: 1px 5px; margin-left: 4px; }
.scale-bar .mk.star { background: none; border: none; width: auto; height: auto; color: #27a35a; font-size: 16px; text-shadow: 0 0 2px #fff, 0 0 2px #fff; transition: left 1.2s cubic-bezier(.2,.8,.2,1); top: -10px; transform: translate(-50%, 0); }

/* ---- 방명록 ---- */
.jform { padding: 10px; border-bottom: 1px dashed var(--line); }
.jform textarea { width: 100%; font: inherit; font-size: 12px; line-height: 1.5; border: 2px solid var(--line); border-radius: 8px; padding: 7px 8px; resize: vertical; }
.jform textarea:focus { outline: none; border-color: var(--frame); }
.jrow { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.jlist { list-style: none; margin: 0; padding: 0 10px 6px; max-height: 420px; overflow-y: auto; }
.jentry { padding: 10px 0; border-bottom: 1px dotted #dbe6ef; }
.jmeta { font-family: 'Galmuri9', sans-serif; font-size: 10px; color: var(--muted); }
.jtext { font-size: 13px; line-height: 1.5; margin: 3px 0 5px; white-space: pre-wrap; }
.jchips { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 6px; }
.jreply { display: flex; gap: 8px; background: #f6fafd; border: 1px solid #dbe6ef; border-radius: 10px; padding: 7px 8px; }
.jreply img { width: 26px; height: 32px; image-rendering: pixelated; flex: none; }
.jreply p { margin: 2px 0; font-size: 11px; line-height: 1.5; }
.jreply p.good { color: #1f8a4c; }
.jreply p.tip { background: #fff8e6; border-radius: 6px; padding: 3px 6px; margin-top: 4px; }
.jreply .who { font-family: 'Galmuri9', sans-serif; font-size: 10px; color: var(--frame-dark); }
.tag.el-fire { background: #ffe1da; color: #b8321c; }
.tag.el-water { background: #dceafa; color: #2a5f9e; }
.tag.el-metal { background: #eceff3; color: #5d6673; }
.tag.el-wood { background: #e0f2da; color: #3c7a32; }
.tag.el-earth { background: #fbefcf; color: #8f6a12; }

/* ---- 타이틀 ---- */
.title-chip { display: inline-block; font-family: 'Galmuri9', sans-serif; font-size: 10px; padding: 1px 6px; border-radius: 8px; background: linear-gradient(#fff4c2, #ffd76a); border: 1px solid #e0a526; color: #6b4a00; margin: 2px 2px 0 0; }
.title-chip.locked { background: #f0f0f0; border-color: #d4d4d4; color: #a0a0a0; }
.cat-card .titles { margin-top: 6px; min-height: 18px; }
.tlist { list-style: none; margin: 0; padding: 0; }
.tlist li { padding: 6px 0; border-bottom: 1px dotted #e3ebf2; }
.bar { height: 6px; background: #e8eef4; border-radius: 4px; overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd76a, var(--orange)); }
.bar.big { height: 10px; }
.nametag .ttl { display: inline-block; font-size: 9px; background: #ffd76a; color: #6b4a00; border-radius: 4px; padding: 0 3px; margin-right: 3px; }
.nametag.spouse { border-color: var(--pink); color: #c23a63; }

/* ---- 토스트 ---- */
.toasts { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 50; display: grid; gap: 6px; width: min(400px, calc(100% - 32px)); pointer-events: none; }
.toast { background: #2c2f3a; color: #fff; font-size: 12px; padding: 9px 12px; border-radius: 10px; border: 2px solid #ffd76a; box-shadow: 0 3px 0 rgba(0,0,0,.2); animation: tin .25s ease-out; transition: opacity .4s, transform .4s; }
.toast.out { opacity: 0; transform: translateY(-6px); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }

/* ---- 오늘: 도감 ---- */
.dex { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.dex span { font-family: 'Galmuri9', sans-serif; font-size: 9px; text-align: center; padding: 4px 0; border-radius: 4px; background: #eef2f6; color: #b5bec8; }
.dex span.on { background: #fff3e0; color: #b45a00; border: 1px solid #ffc680; }
.row2 { display: flex; gap: 8px; margin: 8px 0; }
.row2 .btn { flex: 1; }

/* ---- 아카데미 ---- */
.lessons { list-style: none; margin: 0; padding: 0 10px 10px; display: grid; gap: 6px; }
.lessons button { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; background: #fbfdff; border: 2px solid var(--line); border-radius: 10px; padding: 9px 10px; color: var(--ink); }
.lessons button:hover { border-color: var(--frame); }
.lessons button.done { background: #fff8e6; border-color: #f0c76a; }
.licon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; background: var(--frame); color: #fff; border-radius: 8px; font-size: 15px; }
.done .licon { background: var(--orange); }
.ltitle { flex: 1; font-size: 12px; }
.lstate { font-family: 'Galmuri9', sans-serif; font-size: 10px; color: var(--muted); white-space: nowrap; }
.lcard { margin-top: 12px; background: #f6fafd; border: 2px solid var(--line); border-radius: 12px; padding: 14px; font-size: 13px; line-height: 1.7; min-height: 110px; }
.dots { display: flex; gap: 4px; margin-top: 8px; }
.dots i { width: 18px; height: 4px; border-radius: 2px; background: #dbe6ef; }
.dots i.on { background: var(--frame); }
.quiz { display: grid; gap: 6px; margin-top: 10px; }
.quiz .btn { text-align: left; }
.btn.right { background: #e3f6e9; border-color: #27a35a; color: #1f6b3d; }
.btn.wrong { background: #fde7e3; border-color: var(--fire); color: #a3301c; }
.btn:disabled { opacity: .4; cursor: default; }

.tabs button { font-size: 12px; padding: 9px 0; }

/* ---- v3: 홈 연결 버튼 ---- */
.more { display: block; width: 100%; border: none; border-top: 1px dashed var(--line); background: #f8fbfe; color: var(--frame-dark); font-size: 12px; padding: 9px; text-align: center; }
.box-head.as-btn { width: 100%; border: none; border-bottom: 1px dashed var(--line); cursor: pointer; font: inherit; font-size: 13px; text-align: left; }
.box-head.as-btn:hover { background: #eaf3fb; }
.sh-name small { font-family: 'Galmuri9', sans-serif; font-size: 11px; color: var(--muted); }
.sheet .cat-grid { padding: 10px 0; }

/* ---- 일기장: 이중 저울 ---- */
.dual-row { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px; margin: 8px 0; }
.dual-row .dl { font-family: 'Galmuri9', sans-serif; font-size: 10px; color: var(--muted); }
.dual-row .dl.prog { color: #1f8a4c; }
.dual-row .dv { font-family: 'Galmuri9', sans-serif; font-size: 10px; white-space: nowrap; }
.scale-bar .mk.ghost { background: transparent; border-style: dashed; border-color: rgba(0,0,0,.35); }
.dual-note { margin: 6px 0 0; font-size: 12px; line-height: 1.5; background: #eefaf2; border: 1px dashed #8fd1a7; border-radius: 8px; padding: 6px 8px; }
.dual-note b { color: #1f8a4c; font-weight: normal; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; text-align: center; }
.stats div { background: #f6fafd; border: 1px solid var(--line); border-radius: 8px; padding: 6px 2px; }
.stats b { display: block; font-size: 16px; color: var(--frame-dark); font-weight: normal; }
.stats small { font-family: 'Galmuri9', sans-serif; font-size: 9px; color: var(--muted); }

/* 달력 */
.cal-head { font-size: 12px; color: var(--frame-dark); margin-bottom: 6px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-w { font-family: 'Galmuri9', sans-serif; font-size: 9px; text-align: center; color: var(--muted); }
.cal-d { border: 1px solid #e3ebf2; background: #fff; border-radius: 6px; padding: 3px 0; display: flex; flex-direction: column; align-items: center; color: var(--ink); cursor: default; }
.cal-d[data-jump] { cursor: pointer; }
.cal-d b { font-size: 11px; font-weight: normal; }
.cal-d small { font-family: 'Galmuri9', sans-serif; font-size: 8px; color: var(--muted); }
.cal-d.lv1 { background: #e6f4ea; border-color: #b6e0c3; }
.cal-d.lv2 { background: #c9ebd4; border-color: #86cc9d; }
.cal-d.lv3 { background: #9bd9b0; border-color: #4fb377; }
.cal-d.today { outline: 2px solid var(--orange); }

/* 성취 */
.ach { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 10px; }
.ach .a { border: 2px solid #e3e8ee; border-radius: 10px; padding: 7px 8px; background: #fafbfc; display: grid; gap: 2px; color: #9aa3ae; }
.ach .a.done { border-color: #f0c76a; background: #fff8e6; color: var(--ink); }
.ach .ai { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; background: #e3e8ee; color: #fff; font-size: 14px; }
.ach .done .ai { background: var(--orange); }
.ach b { font-size: 12px; font-weight: normal; }
.ach small { font-family: 'Galmuri9', sans-serif; font-size: 9px; line-height: 1.4; }
.ach small.ok { color: #c25e00; }

/* 지난 기록 (하루 카드) */
.dayc { border-top: 1px dashed var(--line); padding: 8px 10px 4px; }
.dayh { display: flex; align-items: center; gap: 8px; }
.dayh img { width: 30px; height: 38px; image-rendering: pixelated; }
.dayh b { display: block; font-size: 13px; font-weight: normal; }
.dayh small { font-family: 'Galmuri9', sans-serif; font-size: 10px; color: var(--muted); }
.dmove { margin-left: auto; font-family: 'Galmuri9', sans-serif; font-size: 10px; background: #eefaf2; color: #1f8a4c; border-radius: 8px; padding: 2px 6px; white-space: nowrap; }
.daytip { margin: 4px 0; }
.jlist.inner { max-height: none; padding: 0; }
.jreply details summary { cursor: pointer; font-size: 11px; color: var(--ink); list-style: none; }
.jreply details summary::after { content: ' 더 보기'; color: var(--frame-dark); font-family: 'Galmuri9', sans-serif; font-size: 10px; }
.jreply details[open] summary::after { content: ' 접기'; }
.jmeta .good { color: #1f8a4c; }

/* ---- 명식 (만세력) ---- */
.birth { font-size: 12px; line-height: 1.6; margin-bottom: 8px; }
.birth small { font-family: 'Galmuri9', sans-serif; font-size: 10px; color: var(--muted); }
table.mset { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
table.mset th { font-family: 'Galmuri9', sans-serif; font-size: 10px; color: var(--muted); font-weight: normal; width: 42px; }
table.mset tr:first-child th { color: var(--frame-dark); font-size: 11px; width: auto; }
table.mset tr:first-child th:first-child { width: 42px; }
table.mset td { text-align: center; vertical-align: middle; }
table.mset td.ten { font-size: 11px; color: var(--frame-dark); }
table.mset td.hid { font-size: 11px; letter-spacing: 1px; }
table.mset td.ani { font-family: 'Galmuri9', sans-serif; font-size: 10px; color: var(--muted); }
.gzc { border-radius: 10px; padding: 6px 0 4px; font-size: 28px; line-height: 1.1; font-family: 'Noto Serif KR', 'Apple SD Gothic Neo', serif; border: 1px solid rgba(0,0,0,.12); }
.gzc small { display: block; font-family: 'Galmuri9', sans-serif; font-size: 9px; margin-top: 2px; opacity: .9; }
.gzc.sm { font-size: 17px; padding: 3px 0 2px; border-radius: 7px; margin: 2px 0; }
.gzc.sm small { font-size: 8px; }
.gzc.unk { background: repeating-linear-gradient(45deg, #f4f6f8, #f4f6f8 6px, #eceff3 6px, #eceff3 12px); color: #b5bdc7; }
.elbar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 12px; }
.elbar > div { text-align: center; }
.eln { display: inline-block; width: 22px; height: 22px; line-height: 22px; border-radius: 6px; font-size: 12px; }
.elbar b { display: block; font-size: 15px; font-weight: normal; margin: 2px 0; }
.chips-row { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 4px; }
.luckrow { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 4px; }
.lk { flex: none; width: 52px; border: 2px solid var(--line); border-radius: 9px; padding: 4px 3px; text-align: center; background: #fff; }
.lk small { display: block; font-family: 'Galmuri9', sans-serif; font-size: 9px; color: var(--muted); }
.lk .t { display: block; font-size: 9px; color: var(--frame-dark); font-family: 'Galmuri9', sans-serif; }
.lk.cur { border-color: var(--orange); background: #fff3e0; }
.lk.bor { border-style: dashed; border-color: #9b8bd6; background: #f3f0ff; }

/* ---- v4: 동양풍 현판·청사초롱 ---- */
.hyeonpan { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; background: linear-gradient(#3a2418, #22140d); border: 2px solid #1a0f0a; box-shadow: inset 0 0 0 2px #d4a63a, inset 0 0 0 4px #22140d, inset 0 0 0 5px rgba(212,166,58,.5), 0 0 12px rgba(242,193,78,.35); }
.hyeonpan b { font-family: "AppleMyungjo", "Noto Serif KR", serif; font-size: 26px; letter-spacing: 6px; color: #f2c14e; text-shadow: 0 1px 0 #6b4a1a; padding: 0 4px; }
.hyeonpan .hp-end { width: 10px; align-self: stretch; background: linear-gradient(#2f8f7a 0 22%, #d64b3a 22% 40%, #f2c14e 40% 60%, #d64b3a 60% 78%, #2f8f7a 78%); }
.hyeonpan i { position: absolute; left: 0; right: 0; bottom: -18px; font-style: normal; font-size: 10px; color: #7a5235; text-align: center; white-space: nowrap; }
.hyeonpan::before, .hyeonpan::after { content: ''; position: absolute; bottom: -14px; width: 3px; height: 12px; background: linear-gradient(#f2c14e 0 25%, #d64b3a 25%); }
.hyeonpan::before { left: 14px; } .hyeonpan::after { right: 14px; background: linear-gradient(#f2c14e 0 25%, #2c4f9e 25%); }
.hyeonpan.sm { padding: 3px 5px; margin-left: 10px; box-shadow: inset 0 0 0 1px #e9c46a; background: #6b4a30; }
.hyeonpan.sm b { font-size: 15px; letter-spacing: 3px; color: #f6e3b0; }
.hyeonpan.sm .hp-end { width: 5px; }
.chorong { display: inline-flex; flex-direction: column; align-items: center; animation: sway 3.2s ease-in-out infinite; transform-origin: 50% -10px; }
.chorong .cr-top { width: 2px; height: 10px; background: #3b2a1e; box-shadow: 0 10px 0 4px #d4a63a; }
.chorong .cr-body { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 46px; height: 58px; margin-top: 4px; border-radius: 22px 22px 18px 18px; background: linear-gradient(#c0392b 0 52%, #2c4f9e 52%); box-shadow: 0 0 22px rgba(255,200,120,.6), inset 0 0 10px rgba(255,230,170,.35); }
.chorong .cr-body b { font-family: "AppleMyungjo", "Noto Serif KR", serif; font-size: 18px; line-height: 1.15; color: #fff6d8; }
.chorong .cr-tassel { width: 3px; height: 16px; margin-top: 2px; background: linear-gradient(#d4a63a 0 25%, #c0392b 25%); }
@keyframes sway { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@media (prefers-reduced-motion: reduce) { .chorong { animation: none; } }
.luck-stage { display: flex; justify-content: space-around; align-items: flex-end; gap: 8px; padding: 10px 0 6px; background: repeating-linear-gradient(90deg, rgba(122,82,53,.06) 0 1px, transparent 1px 18px), #fbf5e6; border: 1px solid #e3d3b0; border-radius: 6px; margin-bottom: 8px; }
.luck-btn { display: flex; flex-direction: column; align-items: center; gap: 22px; background: none; border: 0; padding: 6px; cursor: pointer; font: inherit; }
.luck-btn .small { margin-top: 2px; }
.luck-hero { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 14px 0 26px; margin: 6px 0 4px; background: radial-gradient(circle at 50% 40%, #fff6dc, #f3e5c2); border: 1px solid #e3d3b0; border-radius: 6px; }
.jdetail { margin-top: 6px; border-top: 1px dashed #e3d3b0; padding-top: 4px; }
.jdetail summary { cursor: pointer; font-size: 12px; color: #8a5a2b; font-weight: bold; }
.jdetail p { font-size: 12px; line-height: 1.65; margin: 5px 0; }
.ai-wrap { margin-top: 6px; }
.ai-btn { font-size: 12px; padding: 5px 10px; }
.ai-read { position: relative; margin-top: 4px; padding: 10px 10px 6px; background: #fbf5e6; border: 1px solid #e3d3b0; border-left: 4px solid #c0392b; border-radius: 4px; }
.ai-read b { display: block; color: #8a3a22; font-size: 11px; margin-bottom: 1px; }
.ai-badge { position: absolute; top: -8px; right: 8px; font-size: 10px; padding: 1px 6px; background: #2c4f9e; color: #fff; border-radius: 8px; }
.ai-wait { animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .4; } }

/* ---- 첫 화면: 생년월일 입력 ---- */
.onboard { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(circle at 50% 30%, #fff6dc, #ecd9ae); overflow-y: auto; }
.ob-card { width: 100%; max-width: 360px; padding: 26px 22px 18px; background: #fffdf7; border: 2px solid #5a3a24; border-radius: 10px; box-shadow: 0 0 0 4px #f2c14e, 0 0 0 6px #5a3a24, 0 12px 30px rgba(90,58,36,.25); text-align: center; }
.ob-card h1 { font-size: 22px; margin: 8px 0 6px; color: #3b2a1e; }
.ob-mark { display: flex; justify-content: center; gap: 6px; }
.ob-mark span { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; font-family: "AppleMyungjo", "Noto Serif KR", serif; font-weight: bold; color: #f2c14e; background: #2b1a12; box-shadow: inset 0 0 0 2px #d4a63a; }
.ob-lead { font-size: 13px; line-height: 1.7; color: #5a4636; margin-bottom: 14px; }
.ob-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0; font-size: 13px; text-align: left; }
.ob-row input[type=date] { flex: 1; max-width: 190px; padding: 6px; font: inherit; border: 1px solid #c9b48a; border-radius: 4px; background: #fff; }
.ob-g { display: flex; gap: 14px; }
.ob-card .small { text-align: left; margin: 10px 0 14px; line-height: 1.6; }
.ob-card .btn { width: 100%; padding: 10px; font-size: 14px; }
.ob-foot { margin-top: 12px; font-size: 10px; color: #a08a6a; letter-spacing: 1px; }
