/* ============================================================
   gieoque.css — Cyber-Jade & Gold Modern Dark Theme
   ============================================================ */

:root {
  --font-heading: 'Be Vietnam Pro', sans-serif;
  --font-body:    'Be Vietnam Pro', sans-serif;

  --bg:           #07080c;
  --bg-surface:   rgba(20, 22, 33, 0.45);
  --bg-glass:     rgba(255, 255, 255, 0.03);
  --text:         #f3f4f6;
  --text-secondary: #d1d5db;
  --muted:        rgba(209, 213, 219, 0.45);
  --border:       rgba(255, 255, 255, 0.08);

  --jade:         #10b981; /* Glowing emerald */
  --jade-dim:     rgba(16, 185, 129, 0.15);
  --gold:         #fbbf24; /* Cyber gold */
  --gold-dim:     rgba(251, 191, 36, 0.15);

  --shadow:       0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --shadow-h:     0 12px 40px 0 rgba(0, 0, 0, 0.6);
  --radius:       20px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button, input, textarea, select, a { touch-action: manipulation; }
html { font-size: 16px; }

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 15% 0%, rgba(16, 185, 129, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 85% 100%, rgba(251, 191, 36, 0.08) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ---- Header ---- */
.gq-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 20px;
  background: rgba(7, 8, 12, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.btn-back {
  font-size: 13px;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  transition: all 0.22s ease;
  justify-self: start;
}
.btn-back:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); border-color: rgba(255,255,255,0.15); }

.gq-header-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
  color: var(--jade);
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.btn-ghost {
  font-size: 13px;
  color: var(--muted);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 10px;
  transition: all 0.22s ease;
}
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); border-color: rgba(255,255,255,0.15); }

/* ---- Screens ---- */
.screen { display: none; min-height: calc(100dvh - 58px); }
.screen.active { display: block; animation: screen-fade-in 0.4s ease forwards; }

@keyframes screen-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.screen-inner {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}
.screen-inner.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ---- Hero ---- */
.gq-hero { text-align: center; margin-bottom: 28px; }

.yin-yang-anim {
  font-size: 80px;
  display: inline-block;
  animation: yy-spin 20s linear infinite;
  filter: drop-shadow(0 0 16px rgba(16, 185, 129, 0.35));
}
@keyframes yy-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.gq-title {
  font-family: var(--font-heading);
  font-size: clamp(38px, 11vw, 56px);
  font-weight: 900;
  background: linear-gradient(135deg, #ffffff 30%, var(--jade) 70%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 10px 0 12px;
}
.gq-subtitle { font-size: 13px; color: var(--muted); letter-spacing: 0.5px; }

/* ---- Question box ---- */
.question-box {
  width: 100%;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  text-align: left;
  box-shadow: var(--shadow);
}
.question-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--jade);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.question-input {
  width: 100%;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  outline: none;
  transition: all 0.25s ease;
}
.question-input::placeholder {
  color: rgba(255, 255, 255, 0.35) !important;
  opacity: 1;
}
.question-input:focus {
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}
.suggested-questions {
  margin-top: 14px;
}
.sq-label {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}
.sq-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sq-tag {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.sq-tag:hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--text);
  transform: translateY(-1px);
}
.question-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 12px;
  text-align: right;
}

/* ---- Intro card ---- */
.intro-card {
  width: 100%;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  text-align: left;
  box-shadow: var(--shadow);
}
.intro-card-title { font-size: 14px; font-weight: 800; color: var(--gold); margin-bottom: 14px; }
.intro-steps { display: flex; flex-direction: column; gap: 12px; }
.intro-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--jade-dim);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--jade);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---- Coin legend ---- */
.coin-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-bottom: 24px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
}
.coin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}
.coin-yang     { color: var(--gold); text-shadow: 0 0 8px var(--gold-dim); }
.coin-yin      { color: #9ca3af; }
.coin-old-yang { color: #fb7185; text-shadow: 0 0 8px rgba(251,113,133,0.4); }
.coin-old-yin  { color: #f43f5e; text-shadow: 0 0 8px rgba(244,63,94,0.4); }

/* ---- Buttons ---- */
.btn-gq-primary {
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, var(--jade) 0%, #047857 100%);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.25);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}
.btn-gq-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.35);
  background: linear-gradient(135deg, #10b981 20%, #059669 100%);
}
.btn-gq-primary:active { transform: scale(0.98); }

.btn-gq-secondary {
  display: block;
  width: auto;
  min-width: 220px;
  margin: 32px auto 0;
  padding: 14px 28px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  box-shadow: var(--shadow);
}
.btn-gq-secondary:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--jade);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}
.btn-gq-secondary:active { transform: scale(0.98); }

.intro-note { font-size: 11px; color: var(--muted); margin-top: 12px; }

/* ---- Throw screen ---- */
.throw-label {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  color: var(--jade);
  margin-bottom: 4px;
  text-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}
.throw-sublabel { font-size: 12px; color: var(--muted); margin-bottom: 32px; }

.coins-display {
  display: flex;
  gap: 28px;
  margin: 40px 0;
  min-height: 120px;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
}

.coin-slot {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #3e3a47 0%, #1e1b24 70%, #0d0c10 100%);
  border: 2px solid #575266;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5), inset 0 2px 4px rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
  font-family: var(--font-heading);
  transform-style: preserve-3d;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.2);
}

.coin-slot::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  background: var(--bg);
  border: 2px solid #575266;
  border-radius: 4px; /* Square hole with rounded corners */
  z-index: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}

.coin-slot::before {
  content: '';
  position: absolute;
  top: 8px;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='%23ffffff'%3E%3Cmask id='m'%3E%3Crect width='100' height='100' fill='white'/%3E%3Ccircle cx='50' cy='73' r='7' fill='black'/%3E%3C/mask%3E%3Ccircle cx='50' cy='50' r='46' fill='none' stroke='%23ffffff' stroke-width='8'/%3E%3Cpath d='M50 4A46 46 0 0 0 50 96A23 23 0 0 1 50 50A23 23 0 0 0 50 4Z' mask='url(%23m)'/%3E%3Ccircle cx='50' cy='27' r='7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.6;
}

.coin-slot.yang {
  background: radial-gradient(circle at 30% 30%, #fef08a 0%, #d97706 70%, #92400e 100%);
  border-color: var(--gold);
  color: #451a03;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.35), inset 0 2px 4px rgba(255,255,255,0.4);
}
.coin-slot.yang::before { content: '乾'; color: #451a03; opacity: 1; font-weight: 900; }
.coin-slot.yang::after { border-color: var(--gold); background: #92400e; }

.coin-slot.yin {
  background: radial-gradient(circle at 30% 30%, #e2e8f0 0%, #64748b 70%, #334155 100%);
  border-color: #cbd5e1;
  color: #0f172a;
  box-shadow: 0 0 20px rgba(100, 116, 139, 0.35), inset 0 2px 4px rgba(255,255,255,0.4);
}
.coin-slot.yin::before { content: '坤'; color: #0f172a; opacity: 1; font-weight: 900; }
.coin-slot.yin::after { border-color: #cbd5e1; background: #334155; }

.coin-slot.rolling {
  animation: coin-toss-3d 0.7s infinite cubic-bezier(0.45, 0, 0.55, 1);
  background: radial-gradient(circle at 30% 30%, #86efac 0%, var(--jade) 70%, #047857 100%);
  border-color: var(--jade);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.5);
}
.coin-slot.rolling::before { content: '宝'; color: #064e3b; opacity: 1; }
.coin-slot.rolling::after { border-color: var(--jade); background: #047857; }

@keyframes coin-toss-3d {
  0%   { transform: translateY(0)    rotateX(0deg)    rotateY(0deg)   scale(1); }
  25%  { transform: translateY(-26px) rotateX(180deg)  rotateY(180deg) scale(1.06); }
  50%  { transform: translateY(-36px) rotateX(360deg)  rotateY(360deg) scale(1.12); }
  75%  { transform: translateY(-26px) rotateX(540deg)  rotateY(540deg) scale(1.06); }
  100% { transform: translateY(0)    rotateX(720deg)  rotateY(720deg) scale(1); }
}

.coin-slot.yang, .coin-slot.yin {
  animation: coin-settle 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes coin-settle {
  0%   { transform: translateY(-15px) scale(1.15); }
  60%  { transform: translateY(3px)   scale(0.95); }
  100% { transform: translateY(0)     scale(1); }
}

.line-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  animation: fade-in 0.3s ease;
}
.line-result-symbol { font-size: 24px; }

/* ---- Hexagram preview ---- */
.hexagram-preview {
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  min-height: 130px;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 28px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  width: 170px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
}
.preview-line {
  display: flex;
  gap: 8px;
  align-items: center;
  height: 8px;
  width: 100%;
  justify-content: center;
}
.preview-line-seg {
  height: 8px;
  border-radius: 4px;
  background: var(--muted);
  transition: all 0.3s ease;
}
.preview-line-seg.yang-seg { width: 100%; }
.preview-line-seg.yin-seg  { width: 44%; }
.preview-line-seg.old-yang { background: var(--jade); box-shadow: 0 0 10px var(--jade-dim); }
.preview-line-seg.old-yin  { background: var(--jade); box-shadow: 0 0 10px var(--jade-dim); width: 44%; }

/* ---- Result Card ---- */
.hex-result-card {
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.hex-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}
.hex-symbol {
  font-size: 52px;
  line-height: 1;
  color: var(--jade);
  filter: drop-shadow(0 0 12px var(--jade-dim));
}
.hex-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 2px;
}
.hex-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
.hex-lines-display {
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  width: 120px;
  margin: 18px 0;
  padding: 10px;
  border-radius: 12px;
  background: rgba(0,0,0,0.2);
}
.result-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 8px;
  width: 100%;
}
.result-line-seg {
  height: 8px;
  border-radius: 4px;
  background: var(--text-secondary);
}
.result-line-seg.r-yang {
  width: 100%;
}
.result-line-seg.r-yin {
  width: 45%;
}
.result-line.moving .result-line-seg {
  background: var(--jade);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}
.result-line.moving-yin .result-line-seg {
  background: var(--jade);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}
.hex-meaning {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 18px;
}
.hex-advice-box {
  background: rgba(251, 191, 36, 0.05);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: 12px;
  padding: 14px 16px;
}
.hex-advice-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.hex-advice {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.moving-lines-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gold);
  margin: 24px 0 16px;
  justify-content: center;
}
.moving-dot {
  width: 8px;
  height: 8px;
  background-color: var(--gold);
  border-radius: 50%;
  display: inline-block;
  animation: pulse-gold 1.5s infinite alternate;
}
@keyframes pulse-gold {
  from { transform: scale(0.8); opacity: 0.5; box-shadow: 0 0 0 0 var(--gold-dim); }
  to   { transform: scale(1.2); opacity: 1; box-shadow: 0 0 12px 4px var(--gold-dim); }
}

.hex-changed-card {
  border-color: rgba(251, 191, 36, 0.25);
}
.hex-changed-card .hex-symbol {
  color: var(--gold);
  filter: drop-shadow(0 0 12px var(--gold-dim));
}
.hex-changed-card .hex-advice-box {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.15);
}
.hex-changed-card .hex-advice-label {
  color: var(--jade);
}

/* ---- AI Section ---- */
.ai-section {
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 24px;
  box-shadow: var(--shadow);
}
.ai-section.gemini-glow-border {
  background-image: linear-gradient(#0c0d14, #0c0d14), 
                    linear-gradient(90deg, #4285f4, #9b72ff, #d96570, #f48b36, #4285f4) !important;
}
.ai-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}
.ai-icon { font-size: 28px; }
.ai-label { font-size: 13px; font-weight: 700; color: var(--jade); }
.ai-question-display { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.ai-chat-messages {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  max-width: 85%;
  word-break: break-word;
  animation: bubble-in 0.3s ease;
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-user {
  align-self: flex-end;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: var(--text);
  border-bottom-right-radius: 4px;
}
.chat-ai {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-bottom-left-radius: 4px;
}
.chat-bubble h1, .chat-bubble h2, .chat-bubble h3, .chat-bubble .chat-heading {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--jade);
  margin-top: 14px;
  margin-bottom: 6px;
}
.chat-bubble h1:first-child, .chat-bubble h2:first-child, .chat-bubble h3:first-child, .chat-bubble .chat-heading:first-child {
  margin-top: 0;
}
.chat-bubble p, .chat-bubble .chat-p {
  margin-bottom: 8px;
  line-height: 1.65;
}
.chat-bubble p:last-child, .chat-bubble .chat-p:last-child {
  margin-bottom: 0;
}
.chat-bubble ul, .chat-bubble .chat-list {
  margin-left: 18px;
  margin-bottom: 8px;
  list-style-type: disc;
}
.chat-bubble li {
  margin-bottom: 4px;
  line-height: 1.5;
}
.chat-bubble hr, .chat-bubble .chat-hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}
.chat-bubble .chat-break {
  height: 8px;
}
.chat-bubble.chat-error {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.3);
  color: #fb7185;
}

.ai-loading {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px;
}
.ai-dot {
  width: 6px;
  height: 6px;
  background: var(--jade);
  border-radius: 50%;
  animation: pulse-dot 1.2s infinite alternate;
}
.ai-dot:nth-child(2) { animation-delay: 0.3s; }
.ai-dot:nth-child(3) { animation-delay: 0.6s; }
@keyframes pulse-dot {
  from { transform: scale(0.8); opacity: 0.4; }
  to   { transform: scale(1.3); opacity: 1; }
}
.ai-loading-text { font-size: 12px; color: var(--muted); margin-left: 8px; }

.ai-error {
  color: #f43f5e;
  background: rgba(244,63,94,0.06);
  border: 1px solid rgba(244,63,94,0.18);
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 12px;
}

.ai-chat-row {
  display: flex;
  gap: 10px;
}
.ai-chat-input {
  flex: 1;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
  font-size: 13.5px;
  outline: none;
}
.ai-chat-input::placeholder {
  color: rgba(255, 255, 255, 0.35) !important;
  opacity: 1;
}
.ai-chat-input:focus { border-color: rgba(16, 185, 129, 0.45); }
.btn-chat-send {
  background: var(--jade);
  border: none;
  color: #fff;
  border-radius: 12px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-chat-send:hover { background: #059669; transform: scale(1.05); }

/* ---- SEO Accordion ---- */
.seo-content {
  width: 100%;
  max-width: 100%;
  margin-top: 64px;
  padding: 24px;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: left;
}
.seo-section-title {
  font-family: var(--font-heading);
  color: var(--gold);
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
  position: relative;
  padding-bottom: 8px;
}
.seo-section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--jade);
  border-radius: 2px;
}
.seo-content h3 {
  font-family: var(--font-heading);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  margin-top: 24px;
  margin-bottom: 10px;
}
.seo-content p {
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.65;
  margin-bottom: 14px;
}
.seo-content ul { margin-left: 20px; margin-bottom: 14px; }
.seo-content li {
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.6;
  margin-bottom: 6px;
}
.seo-content strong { color: var(--gold); }

.faq-section {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.faq-title {
  font-family: var(--font-heading);
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 12px;
}
details.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
details.faq-item summary {
  list-style: none;
  font-family: var(--font-heading);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after {
  content: '▼';
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.25s ease;
}
details.faq-item[open] summary::after {
  transform: rotate(180deg);
  color: var(--jade);
}
details.faq-item p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* ---- History modal ---- */
.history-backdrop  { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); }
.history-modal {
  background: #0f1015;
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0,0,0,0.5);
}
.history-header { border-bottom: 1px solid var(--border); }
.history-title  { font-family: var(--font-heading); color: var(--text); }
.history-close  { color: var(--muted); }
.history-close:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.history-empty  { color: var(--muted); }
.history-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.2s ease;
}
.history-item:hover {
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateY(-1px);
}
.history-symbol { font-size: 20px; color: var(--jade); }
.history-name {
  font-family: var(--font-heading); font-weight: 700;
  font-size: 14px; color: var(--text);
}
.history-arrow    { color: var(--muted); }
.history-question { color: var(--text-secondary); }
.history-time     { color: var(--muted); }
.history-clear {
  border: 1px solid rgba(244,63,94,0.25);
  background: rgba(244,63,94,0.05);
  color: #fb7185;
}
.history-clear:hover { background: rgba(244,63,94,0.12); }

/* ---- Desktop: 2-column result grid ---- */
@media (min-width: 768px) {
  .screen-inner { max-width: 720px; }
  
  #screen-result .screen-inner {
    max-width: 900px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 32px;
    row-gap: 20px;
    align-items: start;
  }
  #screen-result #hex-primary {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 0;
  }
  #screen-result #hex-changed-section {
    grid-column: 2;
    grid-row: 1;
    margin-bottom: 0;
  }
  #screen-result #ai-section {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-bottom: 0;
  }
  #screen-result #btn-new-cast {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: center;
    margin-top: 16px !important;
  }

  #screen-result:has(#hex-changed-section.hidden) #hex-primary {
    grid-column: 1 / -1;
    grid-row: 1;
    max-width: 560px;
    justify-self: center;
    width: 100%;
  }
  #screen-result:has(#hex-changed-section.hidden) #ai-section {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  #screen-result:has(#hex-changed-section.hidden) #btn-new-cast {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: center;
    margin-top: 16px !important;
  }
}

@media (min-width: 1200px) {
  .screen-inner { max-width: 960px; }
  #screen-result .screen-inner { max-width: 1100px; column-gap: 48px; }
}
