/* ==================================================
   SecretShrine — 사주풀이 (四柱)
   동양 무드 · 먹색/한지 · 정중한 역술가 톤
   ================================================== */

:root {
  /* Light (default) — 따뜻한 크림 */
  --bg:            #efe8d6;
  --bg-2:          #e8dfc7;
  --paper:         #f5eeda;
  --ink:           #1a1612;
  --ink-2:         #2a241d;
  --ink-soft:      #4a4238;
  --ink-mute:      #7a6e5e;
  --ink-faint:     #a89a82;
  --line:          rgba(26, 22, 18, 0.18);
  --line-soft:     rgba(26, 22, 18, 0.08);
  --accent:        #8b2a1f;   /* 주묵 朱墨 */
  --accent-soft:   #b8563f;
  --gold:          #a88030;
  --shadow:        0 1px 0 rgba(26,22,18,0.04), 0 12px 28px -12px rgba(26,22,18,0.18);
  --shadow-deep:   0 2px 0 rgba(26,22,18,0.04), 0 32px 60px -24px rgba(26,22,18,0.28);
  --noise-opacity: 0.55;
  --noise-blend:   multiply;
}

[data-theme="dark"] {
  --bg:            #141210;
  --bg-2:          #1c1915;
  --paper:         #1f1c18;
  --ink:           #ebe1cc;
  --ink-2:         #d6cbb3;
  --ink-soft:      #b8ac92;
  --ink-mute:      #86795f;
  --ink-faint:     #5a4f3d;
  --line:          rgba(235, 225, 204, 0.14);
  --line-soft:     rgba(235, 225, 204, 0.06);
  --accent:        #c9533f;
  --accent-soft:   #d9745f;
  --gold:          #d4a64a;
  --shadow:        0 1px 0 rgba(0,0,0,0.3), 0 12px 32px -14px rgba(0,0,0,0.6);
  --shadow-deep:   0 2px 0 rgba(0,0,0,0.3), 0 32px 60px -20px rgba(0,0,0,0.8);
  --noise-opacity: 0.25;
  --noise-blend:   screen;
}

[data-theme="hanji"] {
  --bg:            #e6d9b8;
  --bg-2:          #dccba0;
  --paper:         #ede1bf;
  --ink:           #231a10;
  --ink-2:         #3a2d1d;
  --ink-soft:      #5a4a33;
  --ink-mute:      #8c7a5a;
  --ink-faint:     #ad9c7b;
  --line:          rgba(35, 26, 16, 0.22);
  --line-soft:     rgba(35, 26, 16, 0.1);
  --accent:        #7a2115;
  --accent-soft:   #a8432e;
  --gold:          #967128;
  --shadow:        0 1px 0 rgba(35,26,16,0.05), 0 10px 24px -12px rgba(35,26,16,0.22);
  --shadow-deep:   0 2px 0 rgba(35,26,16,0.05), 0 28px 56px -22px rgba(35,26,16,0.32);
  --noise-opacity: 0.9;
  --noise-blend:   multiply;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Noto Serif KR', 'Nanum Myeongjo', 'Source Han Serif KR', serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  font-feature-settings: 'palt';
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  letter-spacing: -0.005em;
  overflow-x: hidden;
}

[hidden] { display: none !important; }

/* Paper texture — layered grain + vignette */
.paper-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.paper-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(0,0,0,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(0,0,0,0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(0,0,0,0.08) 100%);
}
.paper-bg::after {
  content: '';
  position: absolute;
  inset: -50%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.2  0 0 0 0 0.15  0 0 0 0 0.1  0 0 0 0 0.35 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/></svg>");
  opacity: var(--noise-opacity);
  mix-blend-mode: var(--noise-blend);
}

/* Utility */
.hanja { font-family: 'Noto Serif TC', 'Noto Serif KR', serif; font-weight: 600; }
.tate { writing-mode: vertical-rl; text-orientation: upright; }

/* Seal */
.seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--accent);
  color: #f5eeda;
  font-family: 'Noto Serif TC', serif;
  font-weight: 700;
  font-size: 22px;
  border-radius: 4px;
  transform: rotate(-3deg);
  box-shadow: inset 0 0 0 2px rgba(245,238,218,0.3), 0 2px 6px rgba(26,22,18,0.2);
  letter-spacing: 0;
  line-height: 1;
}
.seal-lg { width: 56px; height: 56px; font-size: 32px; }

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 14px 28px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -8px var(--ink); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--line-soft); box-shadow: none; transform: none; }
.btn-seal {
  background: var(--accent);
  border-color: var(--accent);
  color: #f5eeda;
  padding: 16px 36px;
  font-size: 16px;
  letter-spacing: 0.18em;
}
.btn-seal:hover { background: var(--accent-soft); border-color: var(--accent-soft); }

/* Form inputs */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-sub {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.txt-input {
  font-family: inherit;
  font-size: 18px;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 10px 2px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.txt-input:focus { border-bottom-color: var(--ink); }
.txt-input::placeholder { color: var(--ink-faint); font-style: italic; }

/* Segment toggle */
.segment {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  background: var(--paper);
}
.segment button {
  font-family: inherit;
  font-size: 15px;
  padding: 11px 22px;
  border: none;
  background: transparent;
  color: var(--ink-mute);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
}
.segment button + button { border-left: 1px solid var(--line); }
.segment button:hover { color: var(--ink); }
.segment button.active {
  background: var(--ink);
  color: var(--paper);
}
.segment button .hanja { font-size: 16px; }
.segment button.active .hanja { color: inherit; }

/* Date */
.date-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 14px;
}

/* Card */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: var(--shadow-deep);
  position: relative;
}
.card::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid var(--line-soft);
  pointer-events: none;
  border-radius: 1px;
}

/* Dial 圓盤 */
.dial-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.dial {
  position: relative;
  width: 320px;
  height: 320px;
  user-select: none;
  touch-action: none;
}
.dial-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, transparent 52%, var(--line-soft) 52.3%, transparent 53%),
    radial-gradient(circle at center, transparent 72%, var(--line) 72.5%, transparent 73%);
}
.dial-tick {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: 0 0;
  pointer-events: auto;
}
.dial-tick-char {
  position: absolute;
  left: -16px;
  top: -155px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Serif TC', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink-mute);
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s;
}
.dial-tick:hover .dial-tick-char { color: var(--ink); transform: scale(1.15); }
.dial-tick.selected .dial-tick-char {
  color: var(--paper);
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--accent);
}
.dial-tick-minor {
  position: absolute;
  left: -0.5px;
  top: -140px;
  width: 1px;
  height: 8px;
  background: var(--line);
}
.dial-center {
  position: absolute;
  inset: 28% 28%;
  background: var(--bg-2);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--line-soft);
  text-align: center;
}
.dial-center-hanja {
  font-family: 'Noto Serif TC', serif;
  font-size: 48px;
  color: var(--ink);
  font-weight: 600;
  line-height: 1;
}
.dial-center-label {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.dial-center-time {
  font-size: 13px;
  color: var(--ink-soft);
  font-family: 'Noto Serif KR', serif;
  letter-spacing: 0.02em;
}
.dial-center.empty .dial-center-hanja { color: var(--ink-faint); font-size: 16px; letter-spacing: 0.12em; }

/* Unknown toggle */
.unknown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 10px 18px;
  border: 1px dashed var(--line);
  border-radius: 2px;
  color: var(--ink-mute);
  font-size: 13.5px;
  letter-spacing: 0.04em;
  transition: all 0.2s;
  background: transparent;
  font-family: inherit;
}
.unknown-toggle:hover { color: var(--ink); border-color: var(--ink-mute); }
.unknown-toggle.active {
  background: var(--ink);
  color: var(--paper);
  border-style: solid;
  border-color: var(--ink);
}

/* Chat */
.chat-shell {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 28px 220px;
  position: relative;
  z-index: 1;
}
.msg {
  margin-bottom: 36px;
  animation: fade-up 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.msg-user { display: flex; justify-content: flex-end; }
.msg-user-bubble {
  background: var(--ink);
  color: var(--paper);
  padding: 18px 22px;
  border-radius: 2px;
  max-width: 80%;
  font-size: 15.5px;
  line-height: 1.55;
  box-shadow: var(--shadow);
  position: relative;
  white-space: pre-wrap;
}
.msg-user-bubble .user-meta {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 6px;
}
.msg-ai {
  position: relative;
  padding-left: 58px;
  min-height: 48px;
}
.msg-ai-seal {
  position: absolute;
  left: 0;
  top: 2px;
}
.msg-ai-body {
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink-2);
  letter-spacing: -0.003em;
}
.msg-ai-body h4 {
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin: 28px 0 10px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
.msg-ai-body h4::before {
  content: '';
  width: 16px;
  height: 1px;
  background: var(--ink-mute);
}
.msg-ai-body h4 .hanja { color: var(--ink-soft); font-size: 15px; letter-spacing: 0; }
.msg-ai-body p { margin: 0 0 12px; white-space: pre-wrap; }
.msg-ai-body em { color: var(--accent); font-style: normal; font-weight: 500; }
.msg-ai-body strong { color: var(--ink); font-weight: 600; }

/* 4 pillars */
.pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0 28px;
}
.pillar {
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 18px 10px 16px;
  text-align: center;
  position: relative;
  border-radius: 2px;
}
.pillar.is-day {
  border-color: var(--accent);
  border-width: 1.5px;
}
.pillar::after {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid var(--line-soft);
  pointer-events: none;
  border-radius: 1px;
}
.pillar-label {
  font-size: 10.5px;
  letter-spacing: 0.3em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.pillar-char {
  font-family: 'Noto Serif TC', serif;
  font-weight: 600;
  font-size: 44px;
  line-height: 1.05;
  color: var(--ink);
  display: block;
  margin: 2px 0;
}
.pillar-char.stem { color: var(--accent); }
.pillar-char.unknown { color: var(--ink-faint); font-size: 28px; }
.pillar-name {
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.1em;
  margin-top: 6px;
}
.pillar-name.unknown { color: var(--ink-faint); }
.pillar-sep {
  font-size: 10px;
  color: var(--ink-faint);
  margin: 4px 0;
  letter-spacing: 0.2em;
}

/* Five elements bar */
.elements {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 8px 0 24px;
  padding: 16px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
}
.elem {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.elem-char {
  font-family: 'Noto Serif TC', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}
.elem-bar {
  height: 60px;
  width: 6px;
  background: var(--line-soft);
  position: relative;
  overflow: hidden;
  border-radius: 1px;
}
.elem-bar-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--ink);
  transition: height 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.elem-mu .elem-bar-fill { background: #4a7a3a; }
.elem-hwa .elem-bar-fill { background: #b84a2e; }
.elem-to .elem-bar-fill { background: #a88030; }
.elem-geum .elem-bar-fill { background: #8a8a8a; }
.elem-su .elem-bar-fill { background: #2a4a6a; }
[data-theme="dark"] .elem-mu .elem-bar-fill { background: #7aae6a; }
[data-theme="dark"] .elem-hwa .elem-bar-fill { background: #e07a5e; }
[data-theme="dark"] .elem-to .elem-bar-fill { background: #d4a64a; }
[data-theme="dark"] .elem-geum .elem-bar-fill { background: #cacaca; }
[data-theme="dark"] .elem-su .elem-bar-fill { background: #6a9ac8; }
.elem-name {
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.1em;
}
.elem-pct {
  font-size: 10px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

/* Typing indicator */
.typing {
  display: inline-flex;
  gap: 5px;
  padding: 4px 0;
  align-items: center;
}
.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-mute);
  animation: typing 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing {
  0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Input dock */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, var(--bg) 22%);
  padding: 44px 20px 28px;
  z-index: 10;
  pointer-events: none;
}
.dock-inner {
  max-width: 760px;
  margin: 0 auto;
  pointer-events: auto;
}
.chips {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.chip {
  font-family: inherit;
  font-size: 13.5px;
  padding: 9px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.02em;
}
.chip:hover {
  color: var(--ink);
  border-color: var(--ink-mute);
  background: var(--bg-2);
}
.chip .hanja { font-size: 13px; color: var(--ink-mute); }
.composer {
  display: flex;
  gap: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 8px 8px 8px 18px;
  border-radius: 2px;
  box-shadow: var(--shadow);
  align-items: flex-end;
}
.composer textarea {
  flex: 1;
  font-family: inherit;
  font-size: 15.5px;
  line-height: 1.5;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--ink);
  padding: 10px 0;
  min-height: 24px;
  max-height: 140px;
}
.composer textarea::placeholder { color: var(--ink-faint); }
.composer-send {
  font-family: inherit;
  width: 44px;
  height: 44px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  cursor: pointer;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.composer-send:hover { background: var(--accent); }
.composer-send:disabled { opacity: 0.3; cursor: not-allowed; }

/* Topbar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 20px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 20;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink);
}
.brand-sub {
  font-size: 10.5px;
  letter-spacing: 0.32em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-top: 2px;
}
.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.reset-btn, .theme-btn {
  font-family: inherit;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 9px 14px 9px 12px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  letter-spacing: 0.04em;
}
.reset-btn:hover, .theme-btn:hover {
  color: var(--ink);
  border-color: var(--ink-mute);
  background: var(--bg-2);
}
.theme-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
}
.theme-btn .hanja { font-size: 16px; }

/* Stage (form landing) */
.stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 88px 20px 60px;
  position: relative;
  z-index: 1;
}
.form-card {
  width: 100%;
  max-width: 680px;
  padding: 52px 52px 48px;
  position: relative;
}
.form-card .ornament {
  position: absolute;
  right: 44px;
  top: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.form-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin: 0 0 4px;
}
.form-subtitle {
  font-size: 13.5px;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  margin-bottom: 34px;
}
.form-section {
  border-top: 1px solid var(--line-soft);
  padding: 22px 0 2px;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  align-items: start;
}
.form-section:first-of-type { border-top: 1px solid var(--line); padding-top: 28px; }
.form-section .sec-label {
  font-family: 'Noto Serif TC', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.04em;
  padding-top: 4px;
}
.form-section .sec-label-sub {
  font-family: 'Noto Serif KR', serif;
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--ink-faint);
  text-transform: uppercase;
  font-weight: 400;
  margin-top: 4px;
  display: block;
}
.form-footer {
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}
.form-footer .note {
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  flex: 1;
}

/* Loading / WebGPU warning */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 88px 20px 60px;
  z-index: 5;
}
.screen[hidden] { display: none !important; }

.loading-card {
  width: 100%;
  max-width: 480px;
  padding: 44px 40px 36px;
  text-align: center;
}
.loading-card .seal-lg { margin-bottom: 16px; }
.loading-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink);
  margin: 0 0 4px;
}
.loading-sub {
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-bottom: 28px;
}
.loading-text {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 18px 0 10px;
  letter-spacing: 0.02em;
}
.loading-progress {
  width: 100%;
  height: 3px;
  background: var(--line-soft);
  overflow: hidden;
  border-radius: 1px;
  margin: 4px 0 6px;
}
.loading-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.3s ease;
}
.loading-progress-fill.indeterminate {
  width: 40%;
  animation: indeterminate 1.5s ease-in-out infinite;
}
@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
.loading-progress-text {
  font-size: 11px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  min-height: 14px;
}
.loading-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 22px;
  flex-wrap: wrap;
}
.loading-hint {
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  margin-top: 18px;
}

.warning-card {
  width: 100%;
  max-width: 480px;
  padding: 40px;
  text-align: center;
}
.warning-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 18px;
  color: var(--accent);
  margin: 10px 0 8px;
  letter-spacing: 0.05em;
}
.warning-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.warning-list {
  text-align: left;
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.warning-list li {
  padding: 6px 0;
  font-size: 13px;
  color: var(--ink-mute);
  border-top: 1px solid var(--line-soft);
}
.warning-list li:first-child { border-top: 0; }

/* Transition states */
.view-enter { animation: fade-up 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.view-exit { animation: fade-out 0.4s cubic-bezier(0.4, 0, 0.2, 1) both; }
@keyframes fade-out {
  to { opacity: 0; transform: translateY(-20px); filter: blur(4px); }
}

/* Caret for typing */
.caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: caret 0.9s steps(2) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* Responsive */
@media (max-width: 720px) {
  .form-card { padding: 36px 24px 28px; }
  .form-card .ornament { right: 24px; top: 24px; }
  .form-section {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 18px 0;
  }
  .form-section .sec-label { padding-top: 0; }
  .date-grid { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .dial { width: 280px; height: 280px; }
  .dial-tick-char { top: -138px; }
  .dial-tick-minor { top: -124px; }
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .pillar-char { font-size: 38px; }
  .form-title { font-size: 24px; }
  .chat-shell { padding: 80px 16px 220px; }
  .msg-ai { padding-left: 48px; }
  .topbar { padding: 14px 18px; }
  .form-footer { flex-direction: column; align-items: stretch; }
  .form-footer .btn-seal { width: 100%; justify-content: center; }
  .loading-card { padding: 32px 24px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }
