* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #0c0d11; }
::selection { background: rgba(216,162,74,0.28); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: #0c0d11; }
::-webkit-scrollbar-thumb { background: #262a34; border-radius: 6px; border: 3px solid #0c0d11; }
::-webkit-scrollbar-thumb:hover { background: #333846; }
input::placeholder { color: #565c68; }

@keyframes jy-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes jy-spin { to { transform: rotate(360deg); } }

.page {
  min-height: 100vh;
  background: #0c0d11;
  color: #e7e8ec;
  font-family: 'IBM Plex Sans', sans-serif;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  padding: 0 24px 120px;
}

.wrap { max-width: 1000px; margin: 0 auto; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 26px;
  border-bottom: 1px solid #1b1e26;
  margin-bottom: 40px;
}
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand-name { font-family: 'Spectral', serif; font-weight: 500; font-size: 21px; letter-spacing: 0.01em; color: #f1e9d8; }
.brand-sub { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: #6a707c; }
.brand-tag { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #565c68; }

.screen { animation: jy-fade 0.4s ease both; }
.hidden { display: none !important; }

/* ---- form ---- */
.form-card { max-width: 540px; margin: 36px auto 0; }
.form-card h1 {
  font-family: 'Spectral', serif; font-weight: 400; font-size: 34px; line-height: 1.15;
  margin: 0 0 10px; color: #f4efe4; text-wrap: balance;
}
.lede { margin: 0 0 34px; color: #8a909c; font-size: 15px; line-height: 1.55; max-width: 44ch; }

.field-stack { display: flex; flex-direction: column; gap: 24px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: #8a909c; font-weight: 600; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.input {
  background: #15171e; border: 1px solid #2a2e39; border-radius: 8px; padding: 13px 15px;
  color: #e7e8ec; font-family: 'IBM Plex Mono', monospace; font-size: 15px; color-scheme: dark;
  outline: none; width: 100%; font-family: inherit;
}
.input[type="date"], .input[type="time"] { font-family: 'IBM Plex Mono', monospace; }
.input:focus { border-color: #d8a24a; }

.toggle-btn {
  display: flex; align-items: center; gap: 9px; background: none; border: none; cursor: pointer;
  padding: 2px; color: #8a909c; font-family: inherit; font-size: 12.5px;
}
.toggle-track {
  width: 34px; height: 19px; border-radius: 11px; background: #2a2e39; position: relative;
  transition: background .18s; flex: none; display: inline-block;
}
.toggle-track.on { background: #d8a24a; }
.toggle-knob {
  position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%;
  background: #e7e8ec; transition: left .18s;
}
.toggle-track.on .toggle-knob { left: 17px; }

.note {
  background: #101218; border: 1px dashed #2a2e39; border-radius: 8px; padding: 13px 15px;
  color: #6a707c; font-size: 13.5px; line-height: 1.4;
}
.accent-soft { color: #9aa0ac; }
.accent-warn { color: #e0b6a6; }

.btn-primary {
  margin-top: 6px; background: #d8a24a; color: #161009; border: none; border-radius: 8px;
  padding: 15px; font-family: inherit; font-weight: 600; font-size: 15px; letter-spacing: 0.02em;
  cursor: pointer; transition: background .15s; width: 100%;
}
.btn-primary:hover:not(:disabled) { background: #e4b25e; }
.btn-primary:disabled {
  background: #191b22; color: #565c68; border: 1px solid #23262f; cursor: not-allowed;
}

.hint { margin: 2px 0 0; font-size: 12.5px; color: #565c68; line-height: 1.5; }

.form-error {
  margin-top: 4px; padding: 12px 15px; border-radius: 8px; background: #1a1013;
  border: 1px solid #4a2530; color: #e59a9a; font-size: 13.5px; line-height: 1.5;
}

/* ---- loading ---- */
.loading-box {
  max-width: 540px; margin: 90px auto 0; display: flex; flex-direction: column; align-items: center;
  gap: 20px; color: #8a909c; font-size: 14px;
}
.spinner {
  width: 30px; height: 30px; border-radius: 50%; border: 3px solid #23262f; border-top-color: #d8a24a;
  animation: jy-spin 0.8s linear infinite;
}

/* ---- results summary ---- */
.summary-bar {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-bottom: 44px;
}
.summary-place { font-family: 'Spectral', serif; font-size: 26px; color: #f4efe4; line-height: 1.2; }
.summary-meta {
  display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px;
  font-family: 'IBM Plex Mono', monospace; font-size: 13.5px; color: #8a909c;
}
.summary-meta .dot { color: #33cccc; opacity: 0.55; }

.btn-ghost {
  background: #15171e; color: #c3c8d1; border: 1px solid #2a2e39; border-radius: 8px;
  padding: 11px 16px; font-family: inherit; font-size: 13.5px; cursor: pointer; white-space: nowrap;
}
.btn-ghost:hover { border-color: #3a3f4b; color: #e7e8ec; }

/* ---- sections ---- */
.section { margin-bottom: 56px; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.section-num { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: #d8a24a; letter-spacing: 0.05em; }
.section-head h2 { font-family: 'Spectral', serif; font-weight: 500; font-size: 22px; margin: 0; color: #f1ece0; }
.rule { flex: 1; height: 1px; background: #1b1e26; }
.now-label { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: #565c68; }

.notice {
  background: #141017; border: 1px solid #33262a; border-radius: 8px; padding: 12px 16px;
  margin-bottom: 16px; font-size: 13px; color: #c99a8c; line-height: 1.5;
}

/* ---- tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid #1e2129; border-radius: 10px; }
.jy-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.jy-table thead tr { background: #13151b; }
.jy-table th {
  font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: #767c88; font-weight: 600;
  border-bottom: 1px solid #262a34; padding: 11px 16px;
}
.jy-table th.al, .jy-table td.al { text-align: left; }
.jy-table th.ar, .jy-table td.ar { text-align: right; }
.jy-table th.ac, .jy-table td.ac { text-align: center; }
.jy-table td { padding: 12px 16px; border-bottom: 1px solid #191c23; white-space: nowrap; }
.jy-table tbody tr:hover { background: #15171e; }

.col-house.hide-house { display: none; }

.body-cell { display: inline-flex; align-items: baseline; gap: 10px; }
.glyph { font-family: 'IBM Plex Mono', monospace; font-size: 15px; width: 18px; display: inline-block; }
.body-names { display: inline-flex; flex-direction: column; line-height: 1.25; }
.body-sanskrit { color: #ecedf1; font-weight: 500; }
.body-polish { color: #6a707c; font-size: 12px; }

.sign-s { color: #e7e8ec; }
.sign-p { color: #6a707c; font-size: 12.5px; }
.deg-cell { font-family: 'IBM Plex Mono', monospace; color: #cfd3da; font-variant-numeric: tabular-nums; text-align: right; }
.house-cell { font-family: 'IBM Plex Mono', monospace; color: #a7adb8; text-align: center; }
.nak-cell { color: #c3c8d1; }

.retro-badge {
  display: inline-block; min-width: 22px; padding: 2px 7px; border-radius: 5px;
  background: rgba(199,107,84,0.15); color: #d98a6f; font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; font-weight: 600;
}
.direct-mark { color: #565c68; font-family: 'IBM Plex Mono', monospace; font-size: 12px; }

/* ---- interpretation toggles ---- */
.interp { margin-top: 14px; }
.interp-toggle {
  display: flex; align-items: center; gap: 9px; background: none; border: none; cursor: pointer;
  color: #8a909c; font-family: inherit; font-size: 13px; padding: 6px 0;
}
.interp-toggle:hover { color: #c3c8d1; }
.interp-toggle .caret { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: #d8a24a; }
.interp-body {
  border-left: 2px solid #262a34; padding: 12px 0 4px 18px; margin-top: 4px; color: #6a707c;
  font-size: 13.5px; line-height: 1.65; font-style: italic;
}

/* ---- dasha hero ---- */
.dasha-card {
  border: 1px solid #40331d; border-radius: 14px;
  background: linear-gradient(160deg,#1a1710 0%,#141118 62%);
  padding: 30px 32px;
  box-shadow: 0 0 0 1px rgba(216,162,74,0.06), 0 24px 60px -30px rgba(216,162,74,0.25);
}
.dasha-live { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: #d8a24a; box-shadow: 0 0 10px #d8a24a; }
.dasha-live span:last-child { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: #c99f5e; }

.dasha-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 40px; }
.dasha-kicker { font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: #8a7f66; margin-bottom: 10px; }
.dasha-row { display: flex; align-items: baseline; gap: 14px; }
.dasha-glyph { font-family: 'IBM Plex Mono', monospace; font-size: 30px; color: #e8b866; }
.dasha-name { font-family: 'Spectral', serif; font-size: 33px; line-height: 1; color: #f6ecd8; }
.dasha-name-pl { color: #9a8f78; font-size: 13.5px; margin-top: 5px; }
.dasha-range { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: #a99a7c; margin-top: 14px; }

.dasha-progress-wrap { margin-top: 26px; padding-top: 22px; border-top: 1px solid #322817; }
.dasha-progress-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dasha-progress-label { font-size: 13px; color: #9a8f78; }
.dasha-progress-pct { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: #a99a7c; }
.progress-track { margin-top: 12px; height: 6px; border-radius: 4px; background: #241d12; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg,#c99044,#e8b866); border-radius: 4px; transition: width .3s; }

@media (max-width: 560px) {
  .dasha-grid { grid-template-columns: 1fr; }
}

/* ---- transit badges ---- */
.badges { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.badge {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 9px;
  border: 1px solid #23262f; background: #121319;
}
.badge.active { border-color: #4d3a1c; background: rgba(216,162,74,0.07); }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: #3a3f4b; flex: none; }
.badge.active .badge-dot { background: #e0b25c; }
.badge-text { display: flex; flex-direction: column; line-height: 1.3; }
.badge-title { font-size: 13.5px; font-weight: 600; color: #8a909c; }
.badge.active .badge-title { color: #e8c37a; }
.badge-detail { font-size: 12px; color: #767c88; }

/* ---- interpretation hero sections ---- */
.interp-hero { margin-bottom: 48px; }
.interp-prose {
  font-family: 'Spectral', serif; font-size: 17px; line-height: 1.75; color: #dcdee3;
  max-width: 68ch; white-space: pre-line;
}
.interp-loading {
  display: flex; align-items: center; gap: 10px; color: #8a909c; font-size: 14px; padding: 6px 0;
}
.interp-error {
  padding: 12px 15px; border-radius: 8px; background: #1a1013; border: 1px solid #4a2530;
  color: #e59a9a; font-size: 13.5px; line-height: 1.5;
}
.dot-pulse {
  width: 7px; height: 7px; border-radius: 50%; background: #d8a24a;
  animation: dot-pulse 1s ease-in-out infinite;
}
@keyframes dot-pulse { 0%,100% { opacity: 0.25; } 50% { opacity: 1; } }

/* ---- collapsible details section ---- */
.details-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%; background: #13151b;
  border: 1px solid #1e2129; border-radius: 10px; padding: 14px 18px; cursor: pointer;
  color: #c3c8d1; font-family: inherit; font-size: 14px;
}
.details-toggle:hover { border-color: #2a2e39; }
.details-toggle .caret { font-family: 'IBM Plex Mono', monospace; font-size: 14px; color: #d8a24a; }
.details-body { margin-top: 20px; display: flex; flex-direction: column; gap: 32px; }
.detail-block .detail-h {
  font-family: 'Spectral', serif; font-weight: 500; font-size: 17px; margin: 0 0 14px; color: #e2ddd0;
}

/* ---- transit table toggle ---- */
.transit-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%; background: #13151b;
  border: 1px solid #1e2129; border-radius: 10px; padding: 14px 18px; cursor: pointer;
  color: #c3c8d1; font-family: inherit; font-size: 14px;
}
.transit-toggle:hover { border-color: #2a2e39; }
.transit-toggle .caret { font-family: 'IBM Plex Mono', monospace; font-size: 14px; color: #d8a24a; }
.tt-title { font-weight: 500; }
.tt-sub { color: #565c68; font-size: 12.5px; }
.transit-wrap { border-top: none; border-radius: 0 0 10px 10px; margin-top: -1px; }
