/* ==========================================================================
   고양이 도사 — 한국어 전용 사주
   짙은 밤하늘 · 금빛 붓글씨 · 보라 후드 고양이
   ========================================================================== */

:root {
  --bg: #070913;
  --bg2: #0b0f1e;
  --card: #0f1424;
  --card-inner: #151b30;
  --gold: #f59e0b;
  --gold-soft: #fbbf24;
  --gold-light: #fef08a;
  --cyan: #38bdf8;
  --rose: #fb7185;
  --emerald: #34d399;
  --purple: #c084fc;
  --text: #f6f7fb;
  --muted: #9aa4bd;
  --dim: #6b7690;
  --border: #1e2846;
  --border-gold: rgba(245, 158, 11, 0.34);
  --wood: #4ade80;
  --fire: #fb7185;
  --earth: #fbbf24;
  --metal: #e2e8f0;
  --water: #38bdf8;
  --radius: 20px;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.72;
  word-break: keep-all;
  overflow-wrap: break-word;
  min-height: 100vh;
  padding: 0 12px 168px;
  display: flex;
  justify-content: center;
  position: relative;
}
body.chat-open { padding-bottom: 340px; }

/* 밤하늘 */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 50% -8%, rgba(124, 58, 237, 0.22), transparent 62%),
    radial-gradient(600px 400px at 92% 18%, rgba(56, 189, 248, 0.10), transparent 60%),
    radial-gradient(700px 500px at 6% 62%, rgba(245, 158, 11, 0.07), transparent 62%),
    linear-gradient(180deg, #080b16 0%, #070913 40%, #05070f 100%);
}
.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 14%, rgba(255,255,255,.8), transparent),
    radial-gradient(1.2px 1.2px at 78% 9%, rgba(255,255,255,.65), transparent),
    radial-gradient(1.6px 1.6px at 34% 32%, rgba(255,255,255,.45), transparent),
    radial-gradient(1.2px 1.2px at 66% 24%, rgba(255,255,255,.55), transparent),
    radial-gradient(1.2px 1.2px at 88% 42%, rgba(255,255,255,.4), transparent),
    radial-gradient(1.4px 1.4px at 22% 56%, rgba(255,255,255,.35), transparent),
    radial-gradient(1.2px 1.2px at 54% 68%, rgba(255,255,255,.3), transparent),
    radial-gradient(1.4px 1.4px at 72% 78%, rgba(255,255,255,.28), transparent);
  opacity: .7;
}

.container {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 18px;
}

/* ── 인사 ─────────────────────────────────────────────── */
.hero { text-align: center; padding: 6px 4px 0; }

.master-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.10);
  color: var(--gold-soft);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 13px;
  border-radius: 30px;
  border: 1px solid var(--border-gold);
  letter-spacing: .3px;
}

h1 {
  margin-top: 12px;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -1.2px;
  line-height: 1.2;
  background: linear-gradient(135deg, #ffffff 34%, var(--gold-soft) 78%, #d97706);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--gold-light);
  font-weight: 700;
  letter-spacing: .2px;
  opacity: .85;
}

.hero-cat {
  margin: 16px auto 0;
  width: min(74vw, 300px);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 200deg, rgba(192,132,252,.7), rgba(245,158,11,.55), rgba(56,189,248,.45), rgba(192,132,252,.7));
  box-shadow: 0 0 44px rgba(139, 92, 246, 0.32), 0 22px 50px rgba(0,0,0,.6);
}
.hero-cat img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.voice-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 12px auto 0;
  background: rgba(19, 24, 43, .8);
  border: 1px solid #24304f;
  color: #c6d1e9;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
}
.voice-btn .vb-ico { font-size: 12px; }
.voice-btn.playing { border-color: rgba(192,132,252,.6); color: #e6d6ff; background: rgba(139,92,246,.16); }

/* 말풍선 */
.say { position: relative; margin: 18px auto 0; }
.say p {
  background: linear-gradient(180deg, rgba(30, 27, 58, .92), rgba(19, 18, 36, .92));
  border: 1px solid rgba(192, 132, 252, .34);
  border-radius: 18px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.75;
  color: #efe9ff;
  text-align: left;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.say::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 14px;
  height: 14px;
  background: rgba(30, 27, 58, .95);
  border-left: 1px solid rgba(192, 132, 252, .34);
  border-top: 1px solid rgba(192, 132, 252, .34);
}
.say-inline { margin: 0 0 14px; display: flex; gap: 10px; align-items: flex-start; }
.say-inline::before { display: none; }
.say-inline p { flex: 1; }
.say-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(192,132,252,.5);
  background: #12101f; flex: 0 0 34px; margin-top: 2px;
  object-fit: cover;
}

/* ── 카드 ─────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 17px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 16px; }
.card-head h2 { font-size: 17px; font-weight: 800; letter-spacing: -.4px; }
.step-dot {
  flex: 0 0 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(245,158,11,.12);
  border: 1px solid var(--border-gold);
  color: var(--gold-soft);
  font-size: 12px; font-weight: 900; margin-top: 1px;
}
.hint { font-size: 12px; color: var(--muted); line-height: 1.65; margin-top: 4px; }
.opt { color: var(--dim); font-weight: 500; }

/* ── 입력 ─────────────────────────────────────────────── */
.field { margin-bottom: 15px; }
.field:last-of-type { margin-bottom: 12px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: .5px;
  margin-bottom: 7px;
}
input[type="text"], select {
  width: 100%;
  background: #0a0e1b;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 12px;
  border-radius: 11px;
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) calc(50% + 1px), calc(100% - 10px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 26px;
}
input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,158,11,.12); }
.date-row { display: grid; grid-template-columns: 1.15fr 0.9fr 0.9fr; gap: 7px; }
.time-row { display: grid; grid-template-columns: 0.85fr 0.85fr 0.85fr 0.85fr; gap: 7px; }

.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 6px;
  background: #0a0e1b;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 4px;
}
.seg-wide { width: 100%; }
.seg-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 8px 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .16s, color .16s;
}
.seg-btn.on {
  background: linear-gradient(180deg, rgba(245,158,11,.22), rgba(245,158,11,.10));
  color: var(--gold-light);
  box-shadow: inset 0 0 0 1px rgba(245,158,11,.4);
}

.btn-ghost {
  background: #141a2c;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 11px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 4px;
}
.btn-ghost.on { color: var(--gold-light); border-color: var(--border-gold); background: rgba(245,158,11,.12); }
.btn-ghost:disabled { opacity: .45; cursor: default; }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0;
  margin: 10px 0 0;
  cursor: pointer;
}
.check input { width: 16px; height: 16px; accent-color: var(--gold); }

.btn-main {
  width: 100%;
  margin-top: 18px;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -.2px;
  color: #1a1206;
  background: linear-gradient(135deg, #fcd34d, #f59e0b 55%, #d97706);
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.32);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-main:active { transform: translateY(1px); }
.btn-main .btn-cat { filter: saturate(1.4); }
.under-btn { text-align: center; font-size: 11.5px; color: var(--dim); margin-top: 10px; }

.saved-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(56, 189, 248, .08);
  border: 1px solid rgba(56, 189, 248, .26);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.saved-bar p { font-size: 12.5px; color: #cfe8ff; flex: 1; line-height: 1.5; }
.btn-mini {
  background: rgba(56,189,248,.18);
  border: 1px solid rgba(56,189,248,.4);
  color: #e0f2fe;
  border-radius: 9px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 11px;
  cursor: pointer;
  white-space: nowrap;
}

/* ── 사주 표 ───────────────────────────────────────────── */
.pillar-grid {
  display: grid;
  grid-template-columns: 52px repeat(4, 1fr);
  gap: 6px;
  font-size: 12px;
  text-align: center;
}
.pg-head {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: .6px;
  padding-bottom: 2px;
}
.pg-head.is-day { color: var(--gold-soft); }
.pg-label {
  display: grid;
  place-items: center;
  font-size: 10.5px;
  color: var(--dim);
  font-weight: 700;
  letter-spacing: .3px;
}
.pg-cell {
  background: #0b1020;
  border: 1px solid #182142;
  border-radius: 11px;
  padding: 7px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-height: 40px;
  justify-content: center;
}
.pg-cell.day { border-color: rgba(245,158,11,.38); background: rgba(245,158,11,.06); }
.pg-ss { font-size: 10px; color: var(--dim); font-weight: 700; letter-spacing: -.2px; }
.pg-gan, .pg-zhi {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 1px;
}
.pg-han { font-size: 10px; color: var(--dim); letter-spacing: 0; }
.pg-stack { display: flex; flex-direction: column; gap: 3px; align-items: center; }
.pg-hide { font-size: 10.5px; color: #8d97b4; letter-spacing: 1px; }
.pg-nayin { font-size: 10.5px; color: var(--muted); font-weight: 700; }

.el-목 { color: var(--wood); text-shadow: 0 0 16px rgba(74,222,128,.3); }
.el-화 { color: var(--fire); text-shadow: 0 0 16px rgba(251,113,133,.3); }
.el-토 { color: var(--earth); text-shadow: 0 0 16px rgba(251,191,36,.3); }
.el-금 { color: var(--metal); text-shadow: 0 0 16px rgba(226,232,240,.25); }
.el-수 { color: var(--water); text-shadow: 0 0 16px rgba(56,189,248,.3); }

.chart-note { font-size: 11.5px; color: var(--dim); line-height: 1.7; margin-top: 12px; }
.chart-note b { color: var(--muted); font-weight: 700; }

/* ── 오행 그래프 ───────────────────────────────────────── */
.mini-title { font-size: 13px; font-weight: 800; color: var(--muted); letter-spacing: .3px; margin-bottom: 10px; }
.elements { display: flex; flex-direction: column; gap: 8px; }
.el-row { display: grid; grid-template-columns: 54px 1fr 34px; align-items: center; gap: 9px; }
.el-name { font-size: 12.5px; font-weight: 800; }
.el-track { height: 9px; background: #0a0e1b; border-radius: 6px; overflow: hidden; border: 1px solid #151d34; }
.el-fill { height: 100%; border-radius: 6px; width: 0; transition: width .7s cubic-bezier(.2,.8,.2,1); }
.el-count { font-size: 11px; color: var(--dim); font-weight: 700; text-align: right; }

/* ── 6장 ──────────────────────────────────────────────── */
.chapters { display: flex; flex-direction: column; gap: 12px; }
.chapter {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.chapter > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 17px;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}
.chapter > summary::-webkit-details-marker { display: none; }
.ch-num {
  flex: 0 0 30px; height: 30px; border-radius: 10px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 900;
  color: #1a1206;
  background: linear-gradient(135deg, #fcd34d, #f59e0b);
}
.ch-titles { flex: 1; min-width: 0; }
.ch-titles h3 { font-size: 15.5px; font-weight: 800; letter-spacing: -.3px; }
.ch-titles p { font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.ch-arrow { color: var(--dim); font-size: 12px; transition: transform .2s; }
.chapter[open] .ch-arrow { transform: rotate(180deg); }
.ch-body { padding: 2px 17px 18px; }
.ch-body p { font-size: 14px; line-height: 1.85; color: #dbe1f0; margin-bottom: 12px; }
.ch-body p:last-child { margin-bottom: 0; }
.ch-body p.quote {
  background: rgba(192,132,252,.07);
  border-left: 2px solid rgba(192,132,252,.55);
  border-radius: 0 10px 10px 0;
  padding: 11px 13px;
  color: #ebe2ff;
  font-size: 13.5px;
}
.ch-body strong { color: var(--gold-light); font-weight: 800; }
.ch-body em { color: #c9d4f0; font-style: normal; font-weight: 700; }
.ch-body ul { margin: 0 0 12px 2px; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ch-body li { font-size: 13.5px; color: #d3dbec; padding-left: 16px; position: relative; line-height: 1.75; }
.ch-body li::before { content: "·"; position: absolute; left: 4px; color: var(--gold); font-weight: 900; }
.kv { display: grid; grid-template-columns: 74px 1fr; gap: 6px 10px; margin-bottom: 14px; }
.kv dt { font-size: 11.5px; color: var(--dim); font-weight: 700; padding-top: 2px; }
.kv dd { font-size: 13px; color: #dbe1f0; }

/* ── 도구 그리드 ──────────────────────────────────────── */
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.tool {
  background: var(--card-inner);
  border: 1px solid #1d2542;
  border-radius: 14px;
  padding: 13px 12px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 86px;
  transition: border-color .16s, background .16s, transform .16s;
}
.tool:hover { border-color: var(--border-gold); background: #1a2138; }
.tool:active { transform: scale(.985); }
.tool-ico { font-size: 19px; line-height: 1.2; }
.tool-name { font-size: 13.5px; font-weight: 800; letter-spacing: -.2px; }
.tool-desc { font-size: 11px; color: var(--dim); line-height: 1.5; }
.tool.wide { grid-column: span 2; flex-direction: row; align-items: center; gap: 12px; min-height: 0; }
.tool.wide .tool-ico { font-size: 26px; }

/* ── 패널 ─────────────────────────────────────────────── */
.panel { display: flex; flex-direction: column; gap: 14px; animation: rise .28s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.panel-top {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 2px 0;
}
.back-btn {
  background: #121830;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 10px;
  padding: 7px 12px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.panel-tag { font-size: 11.5px; color: var(--dim); font-weight: 700; letter-spacing: .5px; }

.panel-hero {
  text-align: center;
  padding: 22px 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    radial-gradient(420px 180px at 50% 0%, rgba(245,158,11,.16), transparent 70%),
    var(--card);
  box-shadow: var(--shadow);
}
.panel-hero .ph-ico { font-size: 30px; line-height: 1; }
.panel-hero h2 { font-size: 22px; font-weight: 900; letter-spacing: -.7px; margin-top: 6px; }
.panel-hero p { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 17px;
  box-shadow: var(--shadow);
}
.block h3 { font-size: 15px; font-weight: 800; letter-spacing: -.3px; margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.block h3 .n {
  width: 21px; height: 21px; border-radius: 7px;
  display: inline-grid; place-items: center;
  background: rgba(245,158,11,.14);
  border: 1px solid var(--border-gold);
  color: var(--gold-soft);
  font-size: 10.5px; font-weight: 900;
}
.block p { font-size: 14px; line-height: 1.85; color: #dbe1f0; margin-bottom: 11px; }
.block p:last-child { margin-bottom: 0; }
.block strong { color: var(--gold-light); font-weight: 800; }
.block .quote {
  background: rgba(192,132,252,.07);
  border-left: 2px solid rgba(192,132,252,.55);
  border-radius: 0 10px 10px 0;
  padding: 11px 13px;
  color: #ebe2ff;
  font-size: 13.5px;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag {
  font-size: 11.5px; font-weight: 800;
  padding: 4px 10px; border-radius: 20px;
  background: rgba(56,189,248,.1);
  border: 1px solid rgba(56,189,248,.3);
  color: #bfe6ff;
}
.tag.gold { background: rgba(245,158,11,.1); border-color: var(--border-gold); color: var(--gold-light); }
.tag.purple { background: rgba(192,132,252,.1); border-color: rgba(192,132,252,.35); color: #e2ccff; }

/* 표(세운) */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th, .tbl td { padding: 8px 6px; border-bottom: 1px solid #182142; text-align: left; }
.tbl th { font-size: 11px; color: var(--dim); font-weight: 800; letter-spacing: .3px; }
.tbl td { color: #d5dcee; }
.tbl tr:last-child td { border-bottom: none; }
.tbl td.m { color: var(--gold-light); font-weight: 800; white-space: nowrap; }

/* 2027 달력 */
.m-list { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.m-item {
  background: var(--card-inner);
  border: 1px solid #1d2542;
  border-radius: 12px;
  padding: 10px 12px;
}
.m-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.m-month { font-size: 13px; font-weight: 900; color: var(--gold-light); min-width: 34px; }
.m-gz { font-size: 12px; font-weight: 700; color: #bfe6ff; letter-spacing: .5px; }
.m-ss {
  font-size: 10.5px; font-weight: 800; color: #e2ccff;
  background: rgba(192,132,252,.12); border: 1px solid rgba(192,132,252,.3);
  border-radius: 20px; padding: 1px 8px;
}
.m-item p { font-size: 12.5px; color: #c2cbe0; line-height: 1.65; margin: 0; }

/* 채팅 접기 */
.dock-tools { display: flex; align-items: center; gap: 6px; }
.dock-tools .dock-chips { flex: 1; min-width: 0; }
.dock-mini {
  flex: 0 0 auto;
  background: rgba(19, 24, 43, .95);
  border: 1px solid #24304f;
  color: var(--muted);
  font-family: inherit; font-size: 11px; font-weight: 800;
  border-radius: 20px; padding: 6px 11px; cursor: pointer;
  display: none;
}
body.chat-open .dock-mini { display: block; }

/* ── 궁합 입력 ────────────────────────────────────────── */
.compat-form { display: grid; gap: 8px; }
.compat-form .row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; }
.compat-result { display: flex; flex-direction: column; gap: 12px; }
.score-ring {
  display: flex; align-items: center; gap: 14px;
  background: var(--card-inner); border: 1px solid #1d2542;
  border-radius: 14px; padding: 14px;
}
.score-num { font-size: 32px; font-weight: 900; color: var(--gold-soft); line-height: 1; letter-spacing: -1px; }
.score-num small { font-size: 13px; color: var(--dim); font-weight: 700; }
.score-desc { font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* ── 꿈해몽 ───────────────────────────────────────────── */
.dream-step { margin-bottom: 16px; }
.dream-step[hidden] { display: none; }
.ds-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.ds-num {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 900;
  background: rgba(192,132,252,.14);
  border: 1px solid rgba(192,132,252,.4);
  color: #e2ccff;
}
.ds-title { font-size: 13.5px; font-weight: 800; letter-spacing: -.2px; }
.ds-title span { color: var(--dim); font-weight: 600; font-size: 11.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  background: #0a0e1b;
  border: 1px solid #1d2542;
  color: #c8d2e8;
  border-radius: 20px;
  padding: 8px 13px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}
.chip:hover { border-color: rgba(192,132,252,.5); color: #fff; }
.chip.on {
  background: linear-gradient(180deg, rgba(192,132,252,.24), rgba(139,92,246,.14));
  border-color: rgba(192,132,252,.68);
  color: #fff;
  box-shadow: 0 0 16px rgba(139,92,246,.25);
}
.dream-free { margin-top: 6px; }
.dream-free input { font-size: 13.5px; }
.dream-go { margin-top: 4px; }

.dream-out { display: flex; flex-direction: column; gap: 12px; }
.dream-out .block h3 { color: var(--gold-light); }
.dream-out .one-line {
  font-size: 19px; font-weight: 900; letter-spacing: -.5px; line-height: 1.55;
  background: linear-gradient(135deg, #fff 30%, var(--gold-soft));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* ── 채팅 도크 ────────────────────────────────────────── */
.dock {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(100%, 540px);
  padding: 16px 10px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(7,9,19,0) 0%, rgba(7,9,19,.97) 16%, #070913 42%, #070913 100%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.dock-log {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 25vh;
  overflow-y: auto;
  padding: 2px 2px 0;
  scrollbar-width: thin;
}
.dock-log:empty { display: none; }
body.chat-open .dock-log {
  background: rgba(8, 11, 22, .88);
  border: 1px solid #1b2440;
  border-radius: 16px;
  padding: 9px 9px 10px;
}
.msg {
  max-width: 88%;
  font-size: 13px;
  line-height: 1.7;
  padding: 9px 12px;
  border-radius: 14px;
  animation: pop .22s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.cat {
  align-self: flex-start;
  background: linear-gradient(180deg, rgba(30,27,58,.96), rgba(22,20,40,.96));
  border: 1px solid rgba(192,132,252,.32);
  color: #efe9ff;
  border-bottom-left-radius: 5px;
}
.msg.me {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(245,158,11,.2), rgba(217,119,6,.14));
  border: 1px solid rgba(245,158,11,.38);
  color: #ffe9b8;
  border-bottom-right-radius: 5px;
}
.msg .jump {
  display: inline-block;
  margin: 7px 5px 0 0;
  background: rgba(245,158,11,.14);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  border-radius: 20px;
  padding: 5px 11px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--purple); animation: blink 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

.dock-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.dock-chips::-webkit-scrollbar { display: none; }
.qchip {
  flex: 0 0 auto;
  background: rgba(19, 24, 43, .92);
  border: 1px solid #24304f;
  color: #c6d1e9;
  border-radius: 20px;
  padding: 7px 12px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.qchip:active { background: rgba(192,132,252,.18); }

.dock-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(13, 17, 31, .96);
  border: 1px solid #24304f;
  border-radius: 30px;
  padding: 6px 6px 6px 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.dock-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(192,132,252,.5);
  flex: 0 0 32px; object-fit: cover;
}
.dock-bar input {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  color: var(--text); font-family: inherit; font-size: 14px;
  padding: 6px 2px;
}
.dock-bar input::placeholder { color: var(--dim); }
.dock-send {
  flex: 0 0 34px; height: 34px; border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #fcd34d, #f59e0b);
  color: #1a1206; font-size: 16px; font-weight: 900;
  cursor: pointer; font-family: inherit;
}

.dock-open {
  position: fixed; right: 14px; bottom: 18px; z-index: 41;
  width: 54px; height: 54px; border-radius: 50%;
  border: 1px solid rgba(192,132,252,.55);
  background: #12101f;
  padding: 0; cursor: pointer;
  box-shadow: 0 10px 26px rgba(0,0,0,.6), 0 0 22px rgba(139,92,246,.35);
}
.dock-open img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

footer { text-align: center; padding: 10px 8px 4px; }
.foot-line { font-size: 12px; font-weight: 800; color: var(--muted); }
.foot-small { font-size: 10.5px; color: #4d5670; line-height: 1.7; margin-top: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (min-width: 760px) {
  body { padding-top: 10px; }
  .container { max-width: 560px; }
  h1 { font-size: 40px; }
  .hero-cat { width: 320px; }
}

@media (max-width: 350px) {
  .pillar-grid { grid-template-columns: 44px repeat(4, 1fr); gap: 4px; }
  .pg-gan, .pg-zhi { font-size: 19px; }
  .field-row { grid-template-columns: 1fr; }
}
