/* ── Design tokens ── */
:root {
  --bg:          #FAFAF8;
  --surface:     #FFFFFF;
  --surface-2:   #F3F2EC;
  --border:      #D9D6CC;
  --border-soft: #E8E5DC;
  --text:        #1A1A1A;
  --text-2:      #6B6A63;
  --text-3:      #9A9890;
  --accent:      #660066;
  --accent-dark: #4d004d;
  --accent-bg:   #f9e6f9;
  --amber:       #FFB540;
  --amber-hover: #e6a030;
  --moon-fill:   #FAEEDA;
  --moon-stroke: #BA7517;
  --moon-text:   #854F0B;
  --mono:        ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  --serif:       'Instrument Serif', Georgia, serif;
  --sans:        'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --r:           12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.6; }

/* ── Nav ── */
.site-nav { background: var(--surface); border-bottom: 1px solid var(--border-soft); position: sticky; top: 0; z-index: 50; }
.site-nav-inner { max-width: 920px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; }
.site-nav-logo { color: var(--accent); font-size: 1.15rem; font-weight: 600; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.site-nav-badge { font-size: 0.62rem; font-weight: 700; background: var(--accent-bg); color: var(--accent); padding: 2px 8px; border-radius: 999px; letter-spacing: 0.03em; }
.site-nav-tagline { font-size: 0.78rem; color: var(--text-3); }

/* ── Ad bar ── */
#ad-header { background: var(--surface-2); text-align: center; font-size: 0.7rem; color: var(--text-3); padding: 6px; }

/* ── Page wrapper ── */
.page { max-width: 920px; margin: 0 auto; padding: 32px 20px 52px; }

/* ── Hero heading ── */
#hero-heading h1 { font-family: var(--serif); font-size: clamp(1.9rem, 5vw, 2.7rem); font-weight: 400; margin: 0 0 8px; color: var(--text); letter-spacing: -0.01em; }
.lede { color: var(--text-2); font-size: 0.95rem; margin: 0 0 28px; max-width: 600px; line-height: 1.65; }

/* ── Input controls ── */
.ctrl-row { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.ctrl { display: flex; flex-direction: column; gap: 5px; width: 100%; }
.ctrl-inline-row { display: flex; gap: 12px; }
.ctrl-inline-row .ctrl { flex: 1; width: auto; }
.ctrl label { font-size: 0.68rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; }
.ctrl input[type="date"],
.ctrl select {
  font-family: var(--sans); font-size: 0.88rem; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); color: var(--text); width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ctrl input[type="date"]:focus,
.ctrl select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(102,0,102,0.1); }

/* ── Time pair ── */
.time-pair { display: flex; align-items: center; gap: 6px; }
.time-pair input {
  width: 68px; text-align: center;
  font-family: var(--sans); font-size: 0.88rem; padding: 10px 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); color: var(--text);
  -moz-appearance: textfield;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.time-pair input::-webkit-outer-spin-button,
.time-pair input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.time-pair input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(102,0,102,0.1); }
.time-colon { font-size: 1.1rem; font-weight: 700; color: var(--border); line-height: 1; }
.ctrl-hint { font-size: 0.63rem; color: var(--text-3); }

/* ── Buttons ── */
.btn-primary {
  background: var(--amber); color: #fff; border: none; border-radius: var(--r);
  padding: 11px 20px; font-family: var(--sans); font-size: 0.88rem; font-weight: 600;
  cursor: pointer; white-space: nowrap; width: 100%; transition: background 0.15s;
}
.btn-primary:hover { background: var(--amber-hover); }
.btn-reset {
  background: none; border: none; color: var(--text-3);
  font-family: var(--sans); font-size: 0.78rem; cursor: pointer; padding: 4px 0;
}
.btn-reset:hover { color: var(--text-2); }

/* ── Error ── */
.field-error { color: #dc2626; font-size: 0.82rem; margin: 4px 0 0; }

/* ── Results layout ── */
.results-grid {
  display: grid; grid-template-columns: 1fr auto; gap: 24px;
  align-items: start; margin-bottom: 20px;
}
@media (max-width: 700px) {
  .results-grid { grid-template-columns: 1fr; }
  .wheel-col { display: flex; justify-content: center; }
}
.wheel-col { display: flex; flex-direction: column; align-items: center; gap: 8px; position: sticky; top: 70px; }
.wheel-caption { font-size: 0.65rem; color: var(--text-3); text-align: center; max-width: 240px; line-height: 1.4; }

/* ── Zodiac wheel SVG ── */
.whl-ring    { fill: none; stroke: var(--border-soft); stroke-width: 0.8; }
.whl-sec     { fill: var(--surface); stroke: var(--border-soft); stroke-width: 0.5; }
.whl-hi      { fill: var(--accent-bg); stroke: var(--accent); stroke-width: 0.8; }
.whl-glyph   { fill: var(--text-2); font-family: var(--sans); font-size: 17px; }
.whl-glyph-hi{ fill: var(--accent); font-family: var(--sans); font-size: 17px; font-weight: 600; }
.whl-nak     { stroke: var(--border); stroke-width: 0.5; }
.whl-moon-bg { fill: var(--moon-fill); stroke: var(--moon-stroke); stroke-width: 1.2; }
.whl-moon-sym{ fill: var(--moon-text); }
.whl-sun-hi  { fill: #fff8e6; stroke: var(--amber); stroke-width: 0.8; }
.whl-glyph-sun-hi { fill: var(--amber); font-family: var(--sans); font-size: 17px; font-weight: 600; }
.whl-sun-bg  { fill: #fff3c4; stroke: #d97706; stroke-width: 1.2; }
.whl-sun-sym { fill: #92400e; }

/* ── Sign card ── */
.sign-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r); padding: 20px 22px; margin-bottom: 14px; }
.sign-card-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.sign-symbol { width: 52px; height: 52px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; color: #fff; flex-shrink: 0; }
.sign-meta { display: flex; flex-direction: column; gap: 2px; }
.sign-label { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--accent); }
.sign-name  { font-size: 1.45rem; font-weight: 600; line-height: 1.1; }
.sign-sub   { font-size: 0.7rem; color: var(--text-3); font-family: var(--mono); }

.pills-row  { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.elem-pill  { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.elem-dot   { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }

.traits-row { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }
.trait-pill { background: var(--accent-bg); color: var(--accent); border: 1px solid #e5b3e5; border-radius: 999px; padding: 2px 10px; font-size: 0.68rem; font-weight: 600; }

/* ── Nakshatra ── */
.nakshatra-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.nak-badge { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; border-radius: 999px; padding: 3px 10px; font-size: 0.7rem; font-weight: 600; }
.nak-pada  { font-size: 0.7rem; color: var(--text-3); font-family: var(--mono); }

.sign-meaning { font-size: 0.84rem; color: var(--text-2); line-height: 1.65; margin: 0; }

/* ── Notices ── */
.notice { border-radius: 8px; padding: 9px 13px; font-size: 0.77rem; line-height: 1.5; margin-top: 12px; }
.notice-amber { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* ── Combined card ── */
.combined-card { background: linear-gradient(135deg,var(--accent),var(--accent-dark)); border-radius: var(--r); padding: 24px; color: #fff; margin-bottom: 14px; text-align: center; }
.combined-label { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.55); margin: 0 0 16px; }
.combined-signs { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 14px; flex-wrap: wrap; }
.combined-sign  { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.combined-glyph { font-size: 2.2rem; }
.combined-sign-name { font-size: 1rem; font-weight: 600; }
.combined-sign-type { font-size: 0.62rem; color: rgba(255,255,255,0.5); }
.combined-plus  { font-size: 1.4rem; opacity: 0.25; }
.combined-text  { font-size: 0.84rem; color: rgba(255,255,255,0.83); line-height: 1.65; margin: 0; }

/* ── Stats panel ── */
.stats-panel { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r); padding: 4px 20px; margin-bottom: 14px; }
.stats-title  { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-3); margin: 14px 0 2px; }
.stat-row     { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--border-soft); font-size: 0.8rem; gap: 16px; }
.stat-row:last-child { border-bottom: none; }
.stat-l { color: var(--text-2); white-space: nowrap; }
.stat-v { font-family: var(--mono); color: var(--text); text-align: right; font-size: 0.75rem; word-break: break-all; }

/* ── Share section ── */
.share-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r); padding: 20px 22px; margin-bottom: 14px; }
.share-card h2 { font-size: 0.95rem; font-weight: 600; margin: 0 0 14px; }
.share-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-share { flex: 1; min-width: 120px; border: none; border-radius: var(--r); padding: 10px 14px; font-family: var(--sans); font-size: 0.8rem; font-weight: 600; cursor: pointer; color: #fff; transition: opacity 0.15s; }
.btn-share:hover { opacity: 0.85; }
.btn-purple { background: var(--accent); }
.btn-green  { background: #16a34a; }
.btn-dark   { background: #374151; }

/* ── Ads ── */
#ad-inline { background: var(--surface-2); border-radius: var(--r); text-align: center; font-size: 0.7rem; color: var(--text-3); padding: 32px; margin-bottom: 14px; }

/* ── SEO section ── */
.seo-section { background: var(--surface); border-top: 1px solid var(--border-soft); }
.seo-inner   { max-width: 920px; margin: 0 auto; padding: 48px 20px 56px; }
.seo-section h2 { font-size: 1.25rem; font-weight: 600; margin: 0 0 10px; }
.seo-section p  { font-size: 0.88rem; color: var(--text-2); line-height: 1.7; margin: 0 0 20px; }
.seo-section ol { font-size: 0.88rem; color: var(--text-2); line-height: 1.7; padding-left: 1.2rem; margin: 0 0 24px; }
.seo-section ol li { margin-bottom: 5px; }
.seo-section details { border: 1px solid var(--border-soft); border-radius: var(--r); padding: 13px 18px; margin-bottom: 8px; }
.seo-section summary { font-size: 0.88rem; font-weight: 600; cursor: pointer; list-style: none; }
.seo-section summary::-webkit-details-marker { display: none; }
.seo-section summary::before { content: '+ '; color: var(--accent); font-weight: 700; }
.seo-section details[open] summary::before { content: '− '; }
.seo-section details p { margin: 8px 0 0; font-size: 0.84rem; }

/* ── Footer ── */
.site-footer { background: var(--surface); border-top: 1px solid var(--border-soft); padding: 18px 20px; text-align: center; font-size: 0.76rem; color: var(--text-3); }
.site-footer a { color: var(--text-3); text-decoration: underline; }
.site-footer a:hover { color: var(--text-2); }

/* ── Animation ── */
.result-reveal { animation: fadeUp 0.3s ease both; }
@keyframes fadeUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

/* ── Embed mode ── */
html:has(body.embed-mode),
body.embed-mode { background: transparent !important; }
body.embed-mode #ad-header,
body.embed-mode #ad-inline,
body.embed-mode .site-nav,
body.embed-mode .site-footer,
body.embed-mode .embed-section,
body.embed-mode #seo-section,
body.embed-mode #hero-heading { display: none !important; }
body.embed-mode .page { padding-top: 8px; }
body.embed-mode .ctrl label { color: #fff !important; }
body.embed-mode .ctrl-hint { color: rgba(255,255,255,0.6) !important; }
body.embed-mode .time-colon { color: rgba(255,255,255,0.5) !important; }

/* ── Mobile ── */
@media (max-width: 520px) {
  .ctrl-row { gap: 10px; }
  .stat-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .stat-v { text-align: left; }
  .share-btns { flex-direction: column; }
  .btn-share { min-width: unset; }
  .combined-signs { gap: 12px; }
}
