:root {
  --ink: #1c1c1e; --muted: #7a7a80; --line: #e4e2dc;
  --paper: #faf9f6; --card: #ffffff; --accent: #1b7837;
}
* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system,
    "Noto Sans KR", "Malgun Gothic", sans-serif;
  background: var(--paper); color: var(--ink); font-size: 14px;
}

.top { display: flex; align-items: baseline; gap: 14px;
  padding: 16px 24px 12px; border-bottom: 1px solid var(--line); }
.top h1 { font-size: 21px; letter-spacing: -0.02em; }
.top .sub { color: var(--muted); font-size: 12.5px; flex: 1; }
.top .doclink { color: var(--muted); font-size: 12.5px; text-decoration: none; }
.top .doclink:hover { color: var(--ink); }

.layout { display: flex; min-height: calc(100vh - 54px); }
.main { flex: 1; min-width: 0; padding: 12px 16px 30px;
  display: flex; flex-direction: column; }
.panel { width: 272px; flex: none; padding: 14px 14px 40px;
  border-left: 1px solid var(--line); }

/* ── 공통 컨트롤 ── */
input, select, button {
  font: inherit; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 7px; background: #fff; color: inherit;
}
.row { display: flex; gap: 6px; }
.row > * { flex: 1; min-width: 0; }
button { cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent);
  color: #fff; font-weight: 700; }
button.wide { width: 100%; margin-top: 6px; }
.mini { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; }
.mini input, .mini select { width: 100%; margin-top: 2px; }

.tabs { display: flex; gap: 4px; }
.tabs button { padding: 5px 12px; border-radius: 7px;
  background: #f2f1ed; border-color: transparent; }
.tabs button.on { background: var(--ink); color: #fff; }
.tabs button:disabled { opacity: 0.35; cursor: default; }
.tabs.mini button { padding: 3px 9px; font-size: 12px; }
.tabs.small { margin-bottom: 8px; }
.tabs.small button { padding: 4px 10px; font-size: 12px; }

/* ── 툴바 ── */
.toolbar { display: flex; align-items: center; gap: 14px;
  margin-bottom: 10px; flex-wrap: wrap; }
/* 알람 (툴바) */
.alarmctl { position: relative; }
.alarmctl > button { font-size: 13px; }
.dropdown { position: absolute; top: 34px; right: 0; z-index: 30;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 22px rgba(0,0,0,.1); padding: 10px; width: 290px; }
.alarm-add { margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--line); display: flex;
  flex-direction: column; gap: 6px; }

/* 로그인 영역 + 모달 */
.prefsbtn { padding: 4px 10px; font-size: 12px; border-radius: 999px;
  background: #f2f1ed; border-color: transparent; color: var(--muted); }
.prefsbtn:hover { color: var(--ink); background: #eceae4; }
.pf-sec { font-size: 12.5px; margin-top: 4px; }
.chkline { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.chkline input { width: auto; }
.mestar { border: 0; background: none; font-size: 16px; color: #d5d2c8;
  padding: 0 2px; cursor: pointer; }
.mestar.on { color: #f1c40f; }
.authbar { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.authbar .badge { padding: 2px 9px; border-radius: 999px; font-size: 11px;
  background: var(--accent); color: #fff; white-space: nowrap; }
.authbar button { padding: 4px 10px; font-size: 12px; }
.authbar .nick b { color: var(--accent); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-box { background: #fff; border-radius: 12px; padding: 18px;
  width: 300px; display: flex; flex-direction: column; gap: 8px; }
.modal-box.wide { width: 480px; max-height: 78vh; }
.pm-head { display: flex; align-items: center; gap: 8px; }
.pm-head b { font-size: 15px; flex: 1; }
.pm-list { overflow-y: auto; display: flex; flex-direction: column;
  gap: 5px; min-height: 120px; }
.pm-list .pitem .ilgan { min-width: 20px; text-align: center; }
.pm-list .pitem .ilgan .ch { width: 19px; height: 19px; line-height: 19px;
  font-size: 11.5px; }
.autherr { color: #c0392b; font-size: 12px; min-height: 1.1em; }
.status { font-size: 12px; color: var(--muted); }
.status.err { color: #c0392b; }

/* ── 그래프 패널 ── */
.pane { background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.pane-head { display: flex; align-items: center; gap: 10px;
  padding: 8px 12px 2px; flex-wrap: wrap; }
.pane-head > b { font-size: 12.5px; }
.pane-head .chk { font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 4px; border: 0; padding: 0;
  background: none; }
.pane-head .ptitle { font-size: 11.5px; color: var(--muted);
  margin-left: auto; }
.plegend { display: flex; flex-wrap: wrap; gap: 4px; }
.plegend .chip { display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 7px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 11px; cursor: pointer; user-select: none; background: #fff; }
.plegend .chip .sw { width: 11px; height: 3px; border-radius: 2px; }
.plegend .chip.off { opacity: 0.32; }
.plegend .pgap { width: 14px; }
.plegend .chip.preset { border-style: dashed; font-weight: 700;
  color: var(--muted); }
.plegend .chip.preset.onp { background: var(--ink); color: #fff;
  border-style: solid; }
.pane .scroll { overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; }
.pane .scroll::-webkit-scrollbar { display: none; }
.pane canvas { display: block; }

/* 패널 사이 커스텀 스크롤/줌 바: 드래그=이동, 양끝 핸들=확대/축소 */
.xbar { position: relative; height: 18px; margin: 0 0 10px;
  background: #efede8; border-radius: 9px; user-select: none; }
.xbar .thumb { position: absolute; top: 0; height: 100%;
  background: #cfcbc0; border-radius: 9px; cursor: grab;
  display: flex; justify-content: space-between; min-width: 36px; }
.xbar .thumb:active { cursor: grabbing; }
.xbar .hd { width: 10px; height: 100%; cursor: ew-resize;
  border-radius: 9px; background: #a8a294; }

/* 범례 전체 선택/해제 팝다운 */
.legend-all { position: relative; }
.legend-all .allbtn { padding: 1px 8px; font-size: 11px;
  border-radius: 999px; background: #f2f1ed; border-color: transparent; }
.legend-all .allmenu { position: absolute; top: 22px; left: 0; z-index: 10;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,.08); display: flex;
  flex-direction: column; min-width: 90px; }
.legend-all .allmenu button { border: 0; background: none;
  padding: 6px 10px; font-size: 12px; text-align: left; }
.legend-all .allmenu button:hover { background: #f2f1ed; }

/* ── 하단 정보 + 변운 ── */
.bottom { margin-top: 2px; }
.bottom-main { min-width: 0; }
/* 알람 예정: 사이드바 폭에 맞춰 화면 우측 하단 고정 */
.digest-side { position: fixed; right: 14px; bottom: 12px; width: 244px;
  max-height: 34vh; overflow-y: auto; margin: 0; z-index: 45;
  box-shadow: 0 6px 22px rgba(0,0,0,.12); }
body.has-digest .panel { padding-bottom: calc(34vh + 30px); }
.dg-pill { position: fixed; right: 14px; bottom: 12px; z-index: 45;
  border: 0; border-radius: 999px; padding: 9px 16px; cursor: pointer;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 700;
  box-shadow: 0 5px 16px rgba(0,0,0,.2); }
.dg-pill:hover { background: var(--accent); }
.info { font-size: 12.5px; color: var(--muted); margin-bottom: 8px;
  line-height: 1.55; }
.info b { color: var(--ink); }
/* 변운: 그룹 순서 고정 — 시일월년 | 체대운·체중운·대운 | 현운 | 장운·지운 */
.byeonun { display: flex; flex-direction: column; gap: 8px; }
.brow { display: flex; gap: 40px; align-items: flex-start; flex-wrap: wrap; }
.bgroup { display: flex; gap: 5px; }
.bsub { font-size: 11px; color: var(--muted); align-self: center;
  min-width: 44px; }
.bcol { display: flex; flex-direction: column; align-items: center;
  gap: 3px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; padding: 4px 6px 6px; }
.bcol .src { font-size: 10px; color: var(--muted); white-space: nowrap; }
.ch { display: inline-block; width: 22px; height: 22px; line-height: 22px;
  border-radius: 5px; font-size: 13px; font-weight: 700; text-align: center; }

/* ── 사이드: 현재 정보 ── */
.box { background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.box h2 { font-size: 12.5px; font-weight: 700; margin-bottom: 8px;
  display: flex; align-items: baseline; gap: 8px; }
.inline-time { font-variant-numeric: tabular-nums; font-weight: 600;
  font-size: 12px; }

/* 작은 아이콘 버튼 (박스 헤더용) */
.iconbtn-sm { padding: 1px 7px; font-size: 12px; border-radius: 999px;
  background: #f2f1ed; border-color: transparent; color: var(--muted);
  margin-left: auto; }
.iconbtn-sm:hover { color: var(--ink); background: #eceae4; }
.loc-row { margin-top: 8px; margin-bottom: 0; }

/* 토글 버튼 (충적용 / 전체 선택·해제) */
.tglbtn { padding: 3px 10px; font-size: 12px; border-radius: 999px;
  background: #e8e6e0; border-color: transparent; color: #8a8a8a; }
.tglbtn:hover { color: var(--ink); }
/* 토글별 활성 색상: 궁합=분홍 / 충=적색 / 전체=청색 */
.gung.on { background: #d63384; color: #fff; }
.chung.on { background: #c0392b; color: #fff; }
.allsel.on { background: #1f4e9c; color: #fff; }
#lineMode.on { background: var(--accent); color: #fff; }

/* 알람 무장 상태: 십자선 대기 */
.pane.arming canvas { cursor: crosshair; }
.alarmctl .hint { color: var(--muted); margin: 6px 0; }
.aitem .badge { display: inline-block; padding: 0 7px; border-radius: 999px;
  font-size: 10.5px; margin-left: 4px; background: #f2f1ed; }
.aitem .badge.valid { background: var(--accent); color: #fff; }
.aitem .badge.false { background: #c0392b; color: #fff; }
.aitem .ev { border: 0; background: none; font-size: 11px;
  color: var(--muted); padding: 0 3px; cursor: pointer; }
.aitem .ev:hover { color: var(--ink); }

/* 아이콘 버튼 줄 */
.iconrow { display: flex; gap: 5px; margin-top: 8px; }
.iconbtn { flex: 1; position: relative; font-size: 15px; padding: 7px 0;
  border-radius: 8px; background: #fff; border: 1.5px solid var(--accent);
  line-height: 1; }
.iconbtn:hover { background: var(--accent); }
.iconbtn:disabled { border-color: var(--line); opacity: .45;
  background: #fff; }
.iconbtn .cnt { position: absolute; top: -6px; right: -4px;
  background: var(--accent); color: #fff; font-size: 10px;
  border-radius: 999px; padding: 1px 5px; }
.kv { display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
  font-size: 12.5px; }
.kv span { color: var(--muted); flex: none; width: 58px; }
.kv b { font-variant-numeric: tabular-nums; }
.kv select { flex: 1; min-width: 0; padding: 4px 6px; font-size: 12.5px; }

.hyeonun-wrap { margin-top: 8px; }
.hlabel { font-size: 12px; color: var(--muted); margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px; }
.reset { padding: 1px 8px; font-size: 11px; border-radius: 999px;
  background: #f2f1ed; border-color: transparent; color: var(--muted); }
.reset:hover { color: var(--ink); background: #eceae4; }

/* 사주정보 인물 상세 (궁합 시 A·B 두 블록) */
.pmeta { font-size: 12px; color: var(--muted); line-height: 1.6;
  margin-bottom: 6px; display: flex; align-items: center; gap: 5px;
  flex-wrap: wrap; }
.pmeta b { color: var(--ink); }
.pmeta .iconbtn-sm { margin-left: 0; }
.pd-block { margin-bottom: 8px; }
.pd-block + .pd-block { border-top: 1px dashed var(--line);
  padding-top: 8px; }
.pd-actions { margin-top: 8px; }
.pd-actions button { font-size: 12px; padding: 5px; }
.hyeonun { display: flex; gap: 6px; justify-content: center; }
.hcol { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.hcol .cap { font-size: 10px; color: var(--muted); }
.hcol .step { width: 30px; padding: 0; height: 18px; line-height: 15px;
  font-size: 10px; color: var(--muted); background: #f6f5f1;
  border: 1px solid var(--line); border-radius: 5px; }
.hcol .step:hover { color: var(--ink); background: #eceae4; }
.hcol .step.ghost { visibility: hidden; }
.hyeonun .fend { align-self: center; min-width: 30px; height: 26px;
  padding: 0 5px; border: 1.5px solid var(--accent); border-radius: 999px;
  background: #fff; color: var(--accent); font-size: 11px; line-height: 1;
  letter-spacing: -1px; margin-left: 2px; }
.hyeonun .fend:hover { background: var(--accent); color: #fff; }
.hcol .ch { width: 30px; height: 30px; line-height: 30px; font-size: 16px;
  border-radius: 6px; }

/* ── 사이드: 사주정보 ── */
.selinfo { font-size: 12.5px; margin-bottom: 8px; padding: 7px 9px;
  background: #f6f5f1; border-radius: 7px; display: flex;
  align-items: center; gap: 6px; flex-wrap: wrap; }
.selinfo b { color: var(--accent); }
.selinfo .clear { margin-left: auto; border: 0; background: none;
  color: var(--muted); font-size: 11px; padding: 0 2px; }
.selinfo #btnSwap { border: 1px solid var(--line); background: #fff;
  border-radius: 999px; padding: 0 8px; font-size: 12px; }
.selinfo #btnSwap:hover { border-color: var(--accent); }
.selinfo .siico { margin-left: auto; display: flex; gap: 4px; }
.selinfo .ico { width: 22px; height: 22px; padding: 0; line-height: 20px;
  text-align: center; border: 1px solid var(--line); background: #fff;
  border-radius: 999px; font-size: 12px; color: var(--muted);
  font-style: italic; font-weight: 700; }
.selinfo .ico:hover { border-color: var(--accent); color: var(--ink); }
.selinfo .clear.ico { font-style: normal; margin-left: 0; }
.selinfo select { flex: none; width: auto; padding: 2px 6px;
  font-size: 12px; border-radius: 6px; }
.selinfo .clear:hover { color: #c0392b; }
.sub-block { margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed var(--line); display: flex;
  flex-direction: column; gap: 6px; }
.pitem { display: flex; align-items: center; gap: 6px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 7px; cursor: pointer;
  font-size: 12.5px; background: #fff; }
.pitem:hover { border-color: var(--accent); }
.pitem .meta { color: var(--muted); font-size: 11px; flex: 1; }
.pitem .del { border: 0; background: none; color: var(--muted);
  padding: 0 3px; font-size: 12px; }
.pitem .del:hover { color: #c0392b; }
.empty { font-size: 12px; color: var(--muted); text-align: center;
  padding: 4px 0; }

/* ── 모바일: 3페이지 슬라이드 (정보 / 그래프1 / 그래프2) ── */
.pagenav { display: none; position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 60; background: #fff; border-top: 1px solid var(--line);
  justify-content: space-around; padding: 7px 0
    calc(7px + env(safe-area-inset-bottom)); }
.pagenav button { flex: 1; margin: 0 6px; padding: 8px 0; font-size: 13px;
  border-radius: 8px; background: #f2f1ed; border-color: transparent;
  color: var(--muted); }
.pagenav button.on { background: var(--ink); color: #fff; font-weight: 700; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .panel { width: 100%; border-left: 0; padding: 12px 12px 74px;
    display: none; }
  .main { padding: 8px 8px 74px; display: none; }
  body[data-page="0"] .panel { display: block; }
  body[data-page="1"] .main, body[data-page="2"] .main { display: flex; }
  body[data-page="1"] #pane1 { display: none !important; }
  body[data-page="2"] #pane0 { display: none !important; }
  body[data-page="1"] .pane, body[data-page="2"] .pane { margin-bottom: 6px; }
  #paneTabs { display: none; }
  .pagenav { display: flex; }
  .top { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
  .top .sub { display: none; }
  .toolbar { gap: 8px; }
  .modal-box, .modal-box.wide { width: min(92vw, 480px); }
  .hyeonun { justify-content: flex-start; }
  .byeonun { overflow-x: auto; }
  .brow { flex-wrap: nowrap; gap: 24px; }
  /* 모바일: 정보 페이지 안에 일반 배치 (하단 탭바와 충돌 방지) */
  .digest-side { position: static; width: 100%; max-height: none;
    box-shadow: none; margin-bottom: 12px; }
  body.has-digest .panel { padding-bottom: 74px; }
  .dg-pill { position: static; width: 100%; margin-bottom: 12px; }
}

/* 사주정보 상세·상담 기록 모달 */
.consult-head { display: flex; align-items: baseline; gap: 8px;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed var(--line); }
.consult-list { overflow-y: auto; max-height: 32vh; display: flex;
  flex-direction: column; gap: 6px; }
.citem { border: 1px solid var(--line); border-radius: 8px;
  background: #fff; padding: 8px 10px; font-size: 12.5px; }
.citem .cdate { font-size: 11px; color: var(--muted); margin-bottom: 3px;
  display: flex; }
.citem .cdel { margin-left: auto; border: 0; background: none;
  color: var(--muted); font-size: 11px; padding: 0 2px; }
.citem .cdel:hover { color: #c0392b; }
.citem .ctext { white-space: pre-wrap; line-height: 1.6; }

/* T3: 알람 예정 다이제스트 */
.digest-list { display: flex; flex-direction: column; gap: 5px; }
.dgitem { border: 1px solid var(--line); border-radius: 8px; background: #fff;
  padding: 7px 9px; font-size: 12.5px; cursor: pointer; }
.dgitem:hover { border-color: var(--accent); }
.dgitem b { color: var(--accent); }
.dgitem .when { color: #c0392b; font-weight: 700; }
.dgitem .what { color: var(--muted); font-size: 11.5px; margin-top: 2px; }

/* T4: 만세력 클래식 탭 */
#iTabs { margin-bottom: 4px; }
.classic-grid { display: flex; gap: 8px; justify-content: center;
  margin: 8px 0; }
.classic-grid .hcol .cap { font-size: 11px; }
.classic-jj { font-size: 11.5px; color: var(--muted); text-align: center; }
.daeun-strip { display: flex; gap: 4px; overflow-x: auto; padding: 6px 0; }
.daeun-cell { flex: none; text-align: center; border: 1px solid var(--line);
  border-radius: 7px; padding: 5px 7px; background: #fff; }
.daeun-cell .age { font-size: 10.5px; color: var(--muted); }
.classic-meta { font-size: 12.5px; margin: 6px 0; }

/* T9: 공유 링크 박스 */
.sharebox { background: #eef5ee; border: 1px solid #cfe3cf;
  border-radius: 8px; padding: 9px 11px; font-size: 12.5px;
  word-break: break-all; }
.sharebox input { width: 100%; margin-top: 5px; font-size: 12px; }

/* T8: 소개 배너 */
.intro-banner { background: #1c1c1e; color: #fff; border-radius: 10px;
  padding: 10px 14px; margin-bottom: 10px; font-size: 13px;
  display: flex; align-items: center; gap: 8px; }
.intro-banner a { color: #ffd66b; font-weight: 700; }
.intro-banner button { margin-left: auto; border: 0; background: none;
  color: #999; font-size: 13px; }

/* T7: 쉬운 모드 — 필수 버튼만 크게 */
body.easy .kind, body.easy .chung, body.easy .allsel,
body.easy #paneTabs, body.easy .plegend .chip:not(.preset),
body.easy #lineMode { display: none !important; }
body.easy .plegend .chip.preset { font-size: 14px; padding: 6px 14px; }
body.easy .tabs button { font-size: 15px; padding: 9px 6px; }
body.easy .iconbtn { font-size: 19px; padding: 10px 0; }
body.easy .pane-head > b { font-size: 15px; }

/* ── 알람 ── */
.alarm-list { display: flex; flex-direction: column; gap: 5px; }
.aitem { border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px;
  font-size: 12px; background: #fff; }
.aitem .cond b { color: var(--accent); }
.aitem .next { color: var(--muted); font-size: 11px; margin-top: 2px; }
.aitem .del { float: right; border: 0; background: none;
  color: var(--muted); padding: 0 2px; font-size: 12px; }
.aitem .del:hover { color: #c0392b; }

/* ── 궁합 매칭 탭 (정규회원) ─────────────────────────────── */
.mt-consent { display: flex; flex-direction: column; gap: 5px;
  padding: 8px 10px; background: #f7f6f2; border-radius: 8px;
  font-size: 12.5px; }
.mt-consent label { display: flex; align-items: center; gap: 6px; }
.mt-consent button { align-self: flex-start; margin-top: 2px; }
.mt-cand { padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 8px; margin: 5px 0; font-size: 13px;
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.mt-score { font-weight: 700; font-size: 12px; padding: 2px 7px;
  border-radius: 10px; }
.mt-score.love { background: #fdeef2; color: #c2416b; }
.mt-score.mar { background: #eef3fd; color: #3a63b8; }
.mt-cand .mt-go { margin-left: auto; }
.mt-prop { padding: 6px 9px; border-left: 3px solid #7c5cd6;
  background: #faf9fd; border-radius: 0 8px 8px 0; margin: 5px 0;
  font-size: 12.5px; }
.mt-prop .mt-resp { margin-left: 4px; padding: 2px 10px; }
.mt-contact { margin-top: 4px; padding: 5px 8px; background: #eafaf0;
  border-radius: 6px; font-size: 13px; }
.dgitem.mtalert { border-left: 3px solid #c2416b; padding-left: 6px; }

/* ── 기준일 찾기 위저드 ─────────────────────────────────── */
.bd-q { font-size: 15px; line-height: 1.7; padding: 14px 16px;
  background: #f7f6f2; border-radius: 10px; margin: 10px 0; }
.bd-progress { margin: 4px 0 2px; }
.bd-cand { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px;
  margin: 6px 0; font-size: 13px; }
.bd-rank { font-weight: 700; color: var(--accent); min-width: 30px; }
.bd-sync { flex: 1; min-width: 60px; height: 8px; background: #eee;
  border-radius: 5px; overflow: hidden; }
.bd-sync i { display: block; height: 100%; background: var(--accent); }
.bd-cand .bd-apply { margin-left: auto; padding: 3px 12px; }
.bd-kind { display: inline-block; font-size: 11.5px; font-weight: 700;
  padding: 1px 9px; border-radius: 999px; margin-bottom: 6px; }
.bd-kind.ev { background: #eef3fd; color: #3a63b8; }
.bd-kind.rh { background: #f4f0e6; color: #a5762a; }
.bd-kind.dy { background: #eaf6ee; color: #2f7d4f; }

/* ── 현실정보 입력 팔레트 ─────────────────────────────────── */
.bottom-row { display: flex; gap: 14px; align-items: flex-start;
  flex-wrap: wrap; }
.bottom-row .byeonun { flex: 1; min-width: 0; }
.reallog-box { flex: none; width: 210px; border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px; background: var(--card); }
.reallog-box .rl-head { font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.reallog-box .rl-hint { display: block; font-weight: 400; font-size: 11px;
  color: var(--muted); margin-top: 2px; }
.rl-icons { display: flex; flex-wrap: wrap; gap: 4px; }
.rl-ic { width: 34px; height: 34px; padding: 0; font-size: 17px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  cursor: pointer; line-height: 1; }
.rl-ic:hover { background: #eef5ef; border-color: var(--accent); }
@media (max-width: 760px) { .reallog-box { width: 100%; } }

/* ── 상담 채팅 (사주정보 상세 — 회원관리 상담하기와 동일 대화방) ── */
.ch-msgs { height: 30vh; overflow-y: auto; background: #f4f2ec;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 9px;
  display: flex; flex-direction: column; gap: 6px; margin: 4px 0 6px; }
.ch-b { max-width: 80%; padding: 6px 10px; border-radius: 12px;
  font-size: 13px; line-height: 1.5; white-space: pre-wrap;
  word-break: break-word; }
.ch-b.me { align-self: flex-end; background: var(--accent); color: #fff;
  border-bottom-right-radius: 4px; }
.ch-b.them { align-self: flex-start; background: #fff;
  border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ch-t { font-size: 10px; color: var(--muted); margin-top: 2px; }
.ch-b.me .ch-t { color: rgba(255,255,255,.75); text-align: right; }
.ch-day { align-self: center; font-size: 11px; color: var(--muted);
  background: #e9e6dd; border-radius: 999px; padding: 1px 10px; margin: 3px 0; }
.ch-empty { align-self: center; color: var(--muted); font-size: 12px;
  margin: auto; }
.ch-input { display: flex; gap: 6px; align-items: flex-end; }
.ch-input select { flex: 0 0 auto; width: auto; }
.ch-input textarea { flex: 1; resize: none; max-height: 90px; }
.ch-input button { flex: 0 0 auto; }

/* ── xbar 좌우 시간 이동 버튼 ─────────────────────────────── */
.xbar-row { display: flex; gap: 5px; align-items: center; margin: 0 0 10px; }
.xbar-row .xbar { flex: 1; margin: 0; }
.xbtn { flex: none; height: 18px; min-width: 24px; padding: 0 6px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
  font-size: 11px; font-weight: 700; line-height: 1; color: #55524b;
  letter-spacing: -1px; }
.xbtn:hover:not(:disabled) { background: var(--accent);
  border-color: var(--accent); color: #fff; }
.xbtn:disabled { opacity: .35; cursor: default; }

/* ── 헤더 아이콘화 + 미래보기 상태 줄 (2026-07-09 모바일 정리) ── */
.iconlink { display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; font-size: 15px; line-height: 1;
  text-decoration: none; cursor: pointer; flex: none; }
.iconlink:hover { border-color: var(--accent); background: #eef5ef; }
.authbar { flex-wrap: nowrap; }
.authbar .nick { display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap; }
.authbar .pts { color: var(--muted); font-size: 12px; }
.gateline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  justify-content: flex-end;   /* 우측 정렬 — 로그인 영역 아래 (2026-07-09) */
  padding: 5px 24px; font-size: 12.5px; background: #f4f7f3;
  border-bottom: 1px solid var(--line); }
.gateline .g-ok { color: var(--accent); font-weight: 700; }
.gateline .g-no { color: var(--muted); font-weight: 700; }
.gateline .g-sub { color: var(--muted); font-size: 11.5px; }
.gateline .g-dday { font-weight: 800; padding: 0 8px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 11.5px; }
.gateline .g-dday.warn { background: #c0392b; }
.gateline button { padding: 2px 10px; font-size: 12px; }

/* 모달 제목 세로 깨짐 방지 + 내용 스크롤 */
.pm-head b { white-space: nowrap; flex: none; }
.pm-head .mini { flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; margin-top: 0; }
.modal-box { max-height: 90vh; overflow-y: auto; }
.modal-box.wide { max-width: 94vw; }
.ch-input select { max-width: 88px; }
.ch-input textarea { min-width: 0; }

@media (max-width: 900px) {
  .top { padding: 8px 12px; gap: 6px; }
  .top h1 { font-size: 18px; }
  .prefsbtn { padding: 3px 8px; }
  .authbar { margin-left: auto; gap: 5px; }
  .authbar .nick b { max-width: 74px; overflow: hidden;
    text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }
  .gateline { padding: 5px 12px; }
  .modal-box, .modal-box.wide { width: min(94vw, 480px); max-height: 88vh; }
  .ch-msgs { height: 26vh; }
}
.daeun-cell { display: flex; flex-direction: column; align-items: center;
  gap: 2px; }
.daeun-cell.cur { border-color: var(--accent); border-width: 2px;
  background: #eef5ef; }
.daeun-cell.cur .age { color: var(--accent); font-weight: 700; }

/* ── 단색 SVG 아이콘 (Material 스타일 통일, 2026-07-09) ────── */
.iconlink svg, .iconbtn svg { width: 18px; height: 18px; fill: none;
  stroke: currentColor; stroke-width: 1.7; stroke-linecap: round;
  stroke-linejoin: round; display: block; }
.iconbtn svg { width: 21px; height: 21px; }
.iconbtn { display: inline-flex; align-items: center;
  justify-content: center; color: #55524b; }
.iconbtn:hover { color: var(--accent); }
.btn-login { display: inline-block; padding: 5px 14px; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 13px;
  text-decoration: none; white-space: nowrap; }
#btnShortcut svg { stroke: #e0a13c; }
#btnShortcut:hover svg { fill: #f1c40f; stroke: #e0a13c; }

/* ── 3D 지구본 위치 선택 ──────────────────────────────────── */
.globe-box { width: min(560px, 94vw); }
.gl-wrap { position: relative; }
#glCanvas { width: 100%; height: 380px; display: block; cursor: grab;
  border: 1px solid var(--line); border-radius: 12px;
  background: radial-gradient(circle at 35% 30%, #ffffff, #eef3f7);
  touch-action: none; }
#glCanvas:active { cursor: grabbing; }
.gl-zoom { position: absolute; right: 10px; top: 10px; display: flex;
  flex-direction: column; gap: 4px; }
.gl-zoom button { width: 30px; height: 30px; padding: 0; border-radius: 8px;
  font-size: 15px; background: #fff; }
.gl-tip { position: absolute; pointer-events: none; background: #26241f;
  color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 6px; }
.gl-form { border-top: 1px dashed var(--line); padding-top: 8px;
  display: flex; flex-direction: column; gap: 6px; }
.glbtn svg { width: 17px; height: 17px; fill: none; stroke: currentColor;
  stroke-width: 1.6; display: block; }
.glbtn { color: #55524b; }
.glbtn:hover { color: var(--accent); }
@media (max-width: 900px) { #glCanvas { height: 300px; } }
