/* מפת הנשמה — night-sky theme with a soft light variant.
   All colours are tokens; components never use raw colour values. */

:root {
  --bg: #0b0a1f;
  --bg-2: #15123a;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --border: rgba(214, 196, 255, 0.16);
  --text: #eeeaff;
  --muted: #a9a2d4;
  --gold: #e6c67f;
  --gold-soft: rgba(230, 198, 127, 0.16);
  --violet: #a38ff7;
  --rose: #f2a3c6;
  --teal: #7fd6c8;
  --fire: #f39a7b;
  --earth: #b9cf8a;
  --air: #9fc3f5;
  --water: #9b8cf0;
  --danger: #ff9aa8;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --font-display: 'Frank Ruhl Libre', 'David', 'Times New Roman', serif;
  --font-body: 'Heebo', 'Segoe UI', 'Arial', sans-serif;
  --font-symbol: 'Segoe UI Symbol', 'Noto Sans Symbols 2', 'Noto Sans Symbols', 'DejaVu Sans', sans-serif;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f2ff;
    --bg-2: #ece4ff;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-strong: #ffffff;
    --border: rgba(80, 60, 160, 0.14);
    --text: #241d4f;
    --muted: #6a6295;
    --gold: #9a6f1c;
    --gold-soft: rgba(154, 111, 28, 0.12);
    --violet: #5b45c7;
    --rose: #b5487b;
    --teal: #1f8a7c;
    --fire: #c4573a;
    --earth: #5d7a2a;
    --air: #2f6bbd;
    --water: #5b45c7;
    --danger: #b3261e;
    --shadow: 0 10px 30px rgba(60, 40, 140, 0.12);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font: 400 16px/1.75 var(--font-body);
  color: var(--text);
  background: radial-gradient(120% 90% at 50% -10%, var(--bg-2) 0%, var(--bg) 60%) fixed, var(--bg);
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.3; margin: 0; }
a { color: var(--violet); }
p { margin: 0; }

#sky {
  position: fixed; top: 0; left: 0; width: 1px; height: 1px; border-radius: 50%;
  pointer-events: none; z-index: 0; opacity: 0.9;
  animation: twinkle 7s ease-in-out infinite alternate;
}
.nebula {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(40% 30% at 85% 15%, rgba(163, 143, 247, 0.14), transparent 70%),
    radial-gradient(35% 30% at 10% 70%, rgba(242, 163, 198, 0.08), transparent 70%);
}
@media (prefers-color-scheme: light) { #sky { opacity: 0.12; filter: invert(1); } }
@keyframes twinkle { from { opacity: 0.55; } to { opacity: 0.95; } }

.container { position: relative; z-index: 1; max-width: 920px; margin: 0 auto; padding: 24px 16px 40px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ------------------------------------------------------------ language switch */
.lang-select {
  font: 500 13px var(--font-body); color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 12px; cursor: pointer;
}
.lang-select option { color: #111; background: #fff; }
.lang-globe { align-self: center; font-size: 15px; opacity: 0.8; }
.lang-switch { position: relative; z-index: 2; display: flex; justify-content: flex-end; gap: 6px; max-width: 920px; margin: 0 auto; padding: 12px 16px 0; }
.lang-btn {
  font: 500 13px var(--font-body); color: var(--muted); background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 12px; cursor: pointer;
}
.lang-btn.is-active { color: var(--text); border-color: var(--gold); }

/* ------------------------------------------------------------ settings */
.settings { position: relative; }
.settings-open {
  font: 500 15px var(--font-body); color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; width: 32px; height: 32px; cursor: pointer; line-height: 1;
}
.settings-open[aria-expanded="true"] { border-color: var(--gold); }
.settings-panel {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 5; width: min(300px, calc(100vw - 32px));
  background: var(--bg, #0b0a1f); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.settings-panel[hidden] { display: none; }
.settings-title { font-family: var(--font-display); color: var(--gold); font-size: 16px; margin-bottom: 10px; }
.settings-row { display: flex; gap: 8px; align-items: center; cursor: pointer; font-size: 14.5px; }
.settings-hint { font-size: 12.5px; margin: 8px 0 0; }

/* ------------------------------------------------------------ side menu */
.menu { margin-inline-end: auto; } /* at the start of the bar, apart from the language and settings */
.side-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(5, 4, 20, 0.45); }
.side-backdrop[hidden], .side-menu[hidden] { display: none; }
.side-menu {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 21; width: min(290px, 86vw); overflow-y: auto;
  background: var(--bg-2, #0b0a1f); border-inline-end: 1px solid var(--border); box-shadow: 0 0 40px rgba(0, 0, 0, 0.45); padding: 16px;
}
.side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.side-title { font-family: var(--font-display); color: var(--gold); font-size: 18px; }
.side-close { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.side-close:hover { color: var(--text); background: var(--surface); }
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.side-item {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 11px 12px; border-radius: 12px; border: 0;
  background: none; color: var(--text); font: 500 15.5px var(--font-body); text-align: start; text-decoration: none; cursor: pointer;
}
.side-item:hover, .side-item:focus-visible { background: var(--surface-strong); }
.side-icon { width: 22px; text-align: center; flex: none; }
.side-label { display: grid; gap: 2px; }
.side-sub { font-size: 12.5px; color: var(--muted); font-weight: 400; }

/* ------------------------------------------------------------ feedback */
.feedback { max-width: 640px; margin-inline: auto; }
.feedback > .muted { margin-top: 0; }
.fb-form { margin-top: 14px; }
.fb-form select, .fb-form textarea, .fb-form input[type="email"], .fb-form input[type="text"] {
  width: 100%; font: inherit; color: var(--text); background: var(--surface-strong); border: 1px solid var(--border);
  border-radius: 12px; padding: 11px 14px; outline: none;
}
.fb-form textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
.fb-form select:focus, .fb-form textarea:focus, .fb-form input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(163, 143, 247, 0.25); }
.fb-form [aria-invalid="true"] { border-color: var(--danger); }
.fb-count { display: block; font-size: 12px; text-align: end; margin-top: 4px; }
.fb-trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.fb-note { font-size: 13px; }
.fb-note a { color: var(--gold); }
.fb-status p { margin: 8px 0; }
.fb-status .btn { display: inline-block; text-decoration: none; margin-bottom: 8px; }
.fb-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.fb-actions .btn-primary { width: auto; flex: 1 1 200px; }
.fb-sent { font-size: 18px; margin: 14px 0; }

/* ------------------------------------------------------------ hero */
.hero { text-align: center; padding: 28px 0 26px; }
.hero h1 {
  font-size: clamp(38px, 8vw, 58px); letter-spacing: 0.5px;
  background: linear-gradient(90deg, var(--gold), var(--rose), var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline { color: var(--muted); margin-top: 6px; font-size: 17px; }
.orbit { position: relative; width: 110px; height: 110px; margin: 0 auto 14px; }
.orbit-ring { position: absolute; inset: 0; border: 1px solid var(--border); border-radius: 50%; }
.orbit-ring::after {
  content: ''; position: absolute; top: -4px; left: 50%; width: 7px; height: 7px; margin-left: -3.5px;
  border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold);
}
.orbit-ring.r1 { animation: spin 14s linear infinite; }
.orbit-ring.r2 { inset: 16px; animation: spin 9s linear infinite reverse; }
.orbit-ring.r2::after { background: var(--violet); box-shadow: 0 0 12px var(--violet); }
.orbit-ring.r3 { inset: 32px; animation: spin 6s linear infinite; }
.orbit-ring.r3::after { background: var(--rose); box-shadow: 0 0 10px var(--rose); width: 5px; height: 5px; }
.orbit-core { position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold); font-size: 22px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .orbit-ring, #sky { animation: none; } }

/* ------------------------------------------------------------ cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-bottom: 18px;
}
.card h3 { font-size: 22px; margin-bottom: 10px; }
.error { border-color: var(--danger); color: var(--danger); }

/* ------------------------------------------------------------ form */
.form-title { font-size: 24px; margin-bottom: 16px; color: var(--gold); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; gap: 0; } }
.field { display: block; margin-bottom: 14px; position: relative; }
.field-label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.field-hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.field-error { display: block; font-size: 13px; color: var(--danger); min-height: 0; }
.field input[type="text"], .field input:not([type]), .field input[type="date"], .field input[type="time"] {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface-strong); border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 14px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.field input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(163, 143, 247, 0.25); }
.field input:disabled { opacity: .45; }
.field.has-error input { border-color: var(--danger); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); margin-top: 8px; cursor: pointer; }
.check input { accent-color: var(--violet); width: 16px; height: 16px; }
.combo { position: relative; }
.suggestions {
  position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 10; list-style: none; margin: 0; padding: 6px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
  max-height: 300px; overflow-y: auto;
}
.suggestions li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.suggestions li:hover, .suggestions li.is-active { background: var(--surface-strong); }
.sugg-country { color: var(--muted); font-size: 13.5px; }
.privacy { font-size: 13px; color: var(--muted); text-align: center; margin-top: 12px; }

.btn {
  font: 500 16px var(--font-body); border-radius: 999px; padding: 10px 20px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: transform .15s, background .2s;
}
.btn:hover { background: var(--surface-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary {
  width: 100%; padding: 14px 20px; font-size: 18px; border: 0; color: #1a1430;
  background: linear-gradient(90deg, var(--gold), #f0d9a4 45%, var(--rose));
  box-shadow: 0 6px 24px rgba(230, 198, 127, 0.25);
}
.btn-primary:hover { background: linear-gradient(90deg, #f0d39a, var(--gold) 55%, var(--rose)); }
.btn-ghost { font-size: 14px; padding: 8px 14px; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; padding: 8px; border-radius: 8px; }
.icon-btn:hover { color: var(--danger); background: var(--surface); }
.edit-btn { font-size: 18px; color: var(--gold); margin-inline-start: 8px; vertical-align: middle; }
.edit-btn:hover { color: var(--text); }

/* ------------------------------------------------------------ saved profiles */
.saved h2 { font-size: 20px; margin-bottom: 10px; }
.saved-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.saved-list li { display: flex; align-items: center; gap: 6px; }
.saved-open {
  flex: 1; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; text-align: start;
  font: inherit; color: var(--text); background: var(--surface-strong); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 14px; cursor: pointer;
}
.saved-open:hover { border-color: var(--violet); }
.saved-name { font-weight: 500; }
.saved-meta { color: var(--muted); font-size: 14px; }
.about { font-size: 14px; text-align: center; max-width: 640px; margin: 10px auto 0; }

/* ------------------------------------------------------------ a landing page's description, under the form */
.seo { position: relative; z-index: 1; max-width: 920px; margin: 0 auto; padding: 8px 16px 32px; }
body[data-screen="reading"] .seo { display: none; }
.seo h1 { font-family: var(--font-display); font-size: clamp(22px, 4vw, 30px); text-align: center; margin: 8px 0 8px; }
.seo .seo-intro { color: var(--muted); text-align: center; max-width: 640px; margin: 0 auto 8px; }
.seo h2 { font-family: var(--font-display); color: var(--gold); font-size: 19px; margin: 28px 0 12px; }
.seo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.seo-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.seo-card h3 { margin: 0 0 4px; font-size: 16px; }
.seo-card p { margin: 0; color: var(--muted); font-size: 14.5px; }
.seo-faq { display: grid; gap: 8px; }
.seo-faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0 16px; }
.seo-faq summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.seo-faq summary::-webkit-details-marker { display: none; }
.seo-faq summary::after { content: '+'; margin-inline-start: auto; color: var(--gold); font-size: 20px; line-height: 1; }
.seo-faq details[open] summary::after { content: '−'; }
.seo-faq summary h3 { margin: 0; font-size: 16px; font-weight: 500; }
.seo-faq details p { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; line-height: 1.65; }
.seo-langs { text-align: center; color: var(--muted); font-size: 13.5px; margin-top: 28px; }
.seo-langs a { color: var(--muted); margin: 0 6px; }
@media print { .seo { display: none; } }

/* ------------------------------------------------------------ reading */
.reading-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.reading-head h2 { font-size: 28px; color: var(--gold); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding: 10px 2px; margin-bottom: 8px; background: linear-gradient(var(--bg) 70%, transparent);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs[hidden] { display: none; }
.tab {
  flex: 0 0 auto; font: 500 15px var(--font-body); color: var(--muted); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; padding: 8px 16px; cursor: pointer;
}
.tab.is-active { color: #1a1430; background: var(--gold); border-color: var(--gold); }
.section-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.section-nav a {
  font-size: 13.5px; text-decoration: none; color: var(--muted); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 12px; background: var(--surface);
}
.section-nav a:hover { color: var(--text); border-color: var(--violet); }
@media (max-width: 560px) {
  .section-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .section-nav::-webkit-scrollbar { display: none; }
  .section-nav a { flex: 0 0 auto; }
  .card { padding: 18px 16px; }
  .reading-head h2 { font-size: 24px; }
}

.section { scroll-margin-top: 70px; }
.section-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.section-icon {
  flex: 0 0 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  font: 22px var(--font-symbol); color: var(--gold); background: var(--gold-soft); border: 1px solid var(--border);
}
.section-head h3 { margin: 0; font-size: 24px; }
.lead { color: var(--muted); margin-top: 2px; }
.para { margin: 0 0 12px; font-size: 16.5px; }
.note {
  font-size: 13.5px; color: var(--muted); border-inline-start: 3px solid var(--violet);
  padding: 6px 12px; margin-top: 12px; background: var(--surface);
  border-start-end-radius: 10px; border-end-end-radius: 10px;
}
.blessing {
  margin-top: 16px; text-align: center; font-family: var(--font-display); font-size: 18.5px; color: var(--gold);
}
.blessing::before, .blessing::after { content: ' \2726 '; opacity: .6; font-size: 12px; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 16px; }
.fact { background: var(--surface-strong); border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px; }
.fact dt { font-size: 13px; color: var(--muted); }
.fact dd { margin: 2px 0 0; display: flex; flex-direction: column; }
.fact-value { font-family: var(--font-display); font-size: 21px; color: var(--text); }
.fact-hint { font-size: 13px; color: var(--violet); }

.lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 8px; }
.list { border-radius: 14px; padding: 14px 16px; background: var(--surface-strong); border: 1px solid var(--border); }
.list h4 { font-size: 17px; margin-bottom: 6px; }
.list-lead { font-size: 13.5px; color: var(--muted); margin-bottom: 6px; }
.list ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.list li { position: relative; padding-inline-start: 22px; font-size: 15px; }
.list li::before { position: absolute; inset-inline-start: 0; top: 0; font-family: var(--font-symbol); }
.list-strengths h4, .list-strengths li::before { color: var(--teal); }
.list-strengths li::before { content: '\2726'; }
.list-challenges h4, .list-challenges li::before { color: var(--rose); }
.list-challenges li::before { content: '\25C7'; }
.list-tips h4, .list-tips li::before { color: var(--gold); }
.list-tips li::before { content: '\27A4'; display: inline-block; }
[dir="rtl"] .list-tips li::before { transform: scaleX(-1); }

.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.item {
  display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: 14px;
  background: var(--surface-strong); border: 1px solid var(--border);
}
.item.is-current { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.item.tag-harmony { border-inline-start: 3px solid var(--teal); }
.item.tag-tension { border-inline-start: 3px solid var(--rose); }
.badge {
  flex: 0 0 auto; min-width: 46px; height: 46px; padding: 0 8px; display: grid; place-items: center; border-radius: 12px;
  font: 500 18px var(--font-display); color: var(--gold); background: var(--gold-soft);
}
.item-title { font-weight: 500; font-size: 16.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.item-title a { color: var(--text); text-decoration: none; border-bottom: 1px dotted var(--muted); }
.item-sub { font-size: 13px; color: var(--muted); text-align: start; }
.item-text { font-size: 15px; color: var(--muted); margin-top: 2px; }
.inspiration { font-size: 15px; margin-top: 6px; color: var(--text); font-style: italic; }
.pill { font-size: 12px; background: var(--gold); color: #1a1430; border-radius: 999px; padding: 1px 10px; }

/* ------------------------------------------------------------ chart tab */
.chart-tab { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 800px) { .chart-tab { grid-template-columns: 1fr; } }
.wheel-card { padding: 14px; }
.wheel { width: 100%; height: auto; display: block; }
.ring-outer { fill: none; stroke: var(--border); stroke-width: 1.2; }
.ring { fill: none; stroke: var(--border); }
.ring-inner { fill: rgba(255, 255, 255, 0.02); }
.sign-seg { stroke: var(--border); stroke-width: .8; }
.sign-seg.el-fire { fill: rgba(243, 154, 123, 0.08); }
.sign-seg.el-earth { fill: rgba(185, 207, 138, 0.08); }
.sign-seg.el-air { fill: rgba(159, 195, 245, 0.08); }
.sign-seg.el-water { fill: rgba(155, 140, 240, 0.10); }
.sign-glyph { font: 22px var(--font-symbol); }
.sign-glyph.el-fire { fill: var(--fire); }
.sign-glyph.el-earth { fill: var(--earth); }
.sign-glyph.el-air { fill: var(--air); }
.sign-glyph.el-water { fill: var(--water); }
.tick { stroke: var(--muted); stroke-width: .6; opacity: .5; }
.tick-major { opacity: .9; }
.cusp { stroke: var(--muted); stroke-width: .7; opacity: .55; }
.cusp-angle { stroke: var(--gold); stroke-width: 1.6; opacity: 1; }
.angle-line { stroke: var(--gold); stroke-width: 1.6; }
.angle-label { fill: var(--gold); font: 700 13px var(--font-body); }
.house-num { fill: var(--muted); font: 12px var(--font-body); opacity: .8; }
.aspect { stroke-width: 1.1; }
.aspect-harmony { stroke: var(--teal); }
.aspect-tension { stroke: var(--rose); }
.planet-tick { stroke: var(--text); stroke-width: 1.4; }
.planet-leader { stroke: var(--muted); stroke-width: .5; opacity: .6; }
.planet-glyph { font: 23px var(--font-symbol); fill: var(--text); }
.planet-glyph.p-sun, .planet-glyph.p-moon { fill: var(--gold); }
.legend { display: flex; gap: 16px; justify-content: center; font-size: 13px; color: var(--muted); margin-top: 6px; }
.lg::before { content: ''; display: inline-block; width: 18px; height: 2px; vertical-align: middle; margin-inline-end: 6px; }
.lg-harmony::before { background: var(--teal); }
.lg-tension::before { background: var(--rose); }

.positions { width: 100%; border-collapse: collapse; font-size: 15px; margin-bottom: 18px; }
.positions th { font: 400 13px var(--font-body); color: var(--muted); text-align: start; padding: 4px 6px; }
.positions td { padding: 6px; border-top: 1px solid var(--border); }
.positions .glyph { font: 18px var(--font-symbol); color: var(--gold); width: 34px; text-align: center; }
.positions .angle-row .glyph { font: 700 12px var(--font-body); }
.positions .retro { font-size: 12.5px; color: var(--rose); white-space: nowrap; }

.bars { display: grid; gap: 8px; margin-bottom: 14px; }
.bar { display: grid; grid-template-columns: 56px 1fr 42px; gap: 10px; align-items: center; font-size: 14px; }
.bar-track { height: 8px; background: var(--surface-strong); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; }
.bar.el-fire .bar-fill { background: var(--fire); }
.bar.el-earth .bar-fill { background: var(--earth); }
.bar.el-air .bar-fill { background: var(--air); }
.bar.el-water .bar-fill { background: var(--water); }
.bar-value { color: var(--muted); text-align: end; }

/* ------------------------------------------------------------ report hero (e.g. the Hebrew date) */
.hero-line { text-align: center; padding: 18px 16px; }
.hero-title { font-family: var(--font-display); font-size: clamp(28px, 6vw, 40px); color: var(--gold); line-height: 1.2; }
.hero-sub { margin-top: 4px; font-size: 15px; }

/* ------------------------------------------------------------ Vedic chart (South Indian) */
.vgrid { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, minmax(64px, auto)); gap: 4px; max-width: 520px; margin: 0 auto; }
.vcell { position: relative; border: 1px solid var(--border); border-radius: 10px; padding: 4px 6px 6px; background: var(--surface-strong); display: flex; flex-direction: column; gap: 2px; }
.vcell.is-lagna { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.vsign { font: 15px var(--font-symbol); color: var(--muted); }
.vlagna { position: absolute; top: 4px; right: 6px; font: 700 11px var(--font-body); color: var(--gold); }
.vgrahas { display: flex; flex-wrap: wrap; gap: 2px 6px; font: 500 13.5px var(--font-body); }
.vg-sun, .vg-moon { color: var(--gold); }
.vg-rahu, .vg-ketu { color: var(--violet); }
.vcenter { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-family: var(--font-display); font-size: 17px; color: var(--muted); border-radius: 10px; }
.vcenter-sub { font-size: 14px; color: var(--text); margin-top: 4px; }
.vlegend { text-align: center; margin-top: 10px; }

/* ------------------------------------------------------------ main tabs: reading / forecast / compatibility */
.main-tabs {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin: 14px 0 6px;
  border: 1px solid var(--border); border-radius: 16px; padding: 4px; background: var(--surface);
}
.main-tab {
  font: 600 16.5px var(--font-display); color: var(--muted); background: none; border: 0; border-radius: 12px;
  padding: 11px 10px; cursor: pointer; transition: background .15s, color .15s;
}
.main-tab:hover { color: var(--text); }
.main-tab.is-active { background: var(--gold); color: #1a1430; }
.tab-top:empty { display: none; }
.tab-top { margin: 10px 0 2px; }
.tab-top .forecast-head { margin: 4px 0 0; }
.forecast-head { flex-direction: column; }
.period-range { margin: 6px 0 0; font: 600 18px var(--font-display); color: var(--gold); text-align: center; }
.period-guide { margin: 2px auto 0; max-width: 680px; font-size: 14.5px; color: var(--muted); text-align: center; }
@media (max-width: 480px) { .main-tab { font-size: 14.5px; padding: 10px 4px; } }

/* ------------------------------------------------------------ forecast card */
.forecast { border-color: var(--gold); }
.forecast-head { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.forecast-head h3 { margin: 0; color: var(--gold); }
.periods { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; background: var(--surface); }
.period { font: 500 14px var(--font-body); color: var(--muted); background: none; border: 0; border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.period.is-active { background: var(--gold); color: #1a1430; }
.forecast-body .card { background: transparent; border: 0; box-shadow: none; backdrop-filter: none; padding: 12px 0 4px; margin: 0; border-top: 1px solid var(--border); border-radius: 0; }
.forecast-body .card:first-child { border-top: 0; }
.forecast-body .section-head h3 { font-size: 19px; }
.forecast-body .section-icon { flex-basis: 34px; width: 34px; height: 34px; font-size: 17px; }

/* ------------------------------------------------------------ misc */
.loading { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 120px 0; color: var(--muted); font-family: var(--font-display); font-size: 20px; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--gold); animation: spin 1s linear infinite; }
.foot { position: relative; z-index: 1; text-align: center; font-size: 12.5px; padding: 18px 16px 30px; display: grid; gap: 4px; }
.credits { opacity: .75; }
.foot-link { color: var(--muted); }
.foot-link:hover { color: var(--gold); }
/* ------------------------------------------------------------ privacy policy page (privacy/*.html) */
.legal { max-width: 720px; line-height: 1.7; }
.legal h1 { color: var(--gold); font-size: 30px; margin: 6px 0 4px; }
.legal h2 { color: var(--gold); font-size: 19px; margin: 26px 0 6px; }
.legal p { margin: 0 0 10px; }
.legal a { color: var(--gold); }
.legal-back { font-size: 14px; }
.legal-back a { text-decoration: none; }
.legal-updated { color: var(--muted); font-size: 13px; }
.legal-summary { background: var(--gold-soft); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.legal-langs { margin-top: 30px !important; font-size: 13px; color: var(--muted); }
.legal-langs a { margin-inline-end: 10px; }
/* ------------------------------------------------------------ today's inspiration */
.daily-card .card { border-color: var(--gold); background: linear-gradient(135deg, var(--gold-soft), var(--surface)); margin-bottom: 4px; }
.daily-card .para { font-family: var(--font-display); font-size: 20px; line-height: 1.5; text-align: center; margin: 4px 0 10px; }
.daily-card .items { margin-top: 6px; }
.tab-top .daily-card { margin-top: 12px; }

/* ------------------------------------------------------------ print / PDF
   The same night-sky direction on a page that prints well: a deep-navy band
   with the name in gold, navy headings, gold hairlines and star ornaments, soft
   lavender panels — and each system on its own page. Background colours print
   only where they carry the design (the band, the icons), so the ink stays light. */
.print-title { display: none; }
@page { margin: 14mm 13mm; }

@media print {
  /* Dark enough to read on a phone screen, where a PDF page is shown small.
     !important: the design themes (styles/themes/*.css) load after this file
     and set their own tokens on :root[data-design] — light text on a dark sky,
     which on white paper is almost invisible. Print overrides every design. */
  :root, :root[data-design], :root:not([data-theme]) {
    --text: #0c0a22 !important; --muted: #2a2550 !important; --gold: #6e4e10 !important; --gold-soft: #f4ecd9 !important;
    --surface: #ffffff !important; --surface-strong: #f7f4ff !important; --border: #cfc6ea !important; --violet: #4a38b0 !important;
    --rose: #9c3566 !important; --teal: #17695e !important;
    color-scheme: light;
  }
  html, body { background: #fff !important; color: var(--text) !important; }
  body { font-size: 17px; line-height: 1.6; }
  .para { font-size: 17px; color: var(--text) !important; }
  .item-text, .fact-label, li { color: var(--text) !important; }
  .item-text { font-size: 16px; }
  .item-sub, .fact-hint, .list-lead, .lead, .note { font-size: 14.5px; color: var(--muted) !important; }
  .item-title { font-size: 17px; font-weight: 600; color: var(--text) !important; }
  /* gradient-filled text (the aurora design) prints as nothing once backgrounds drop */
  .fact-value, .hero-title, .hero h1 {
    background: none !important; color: var(--text) !important; -webkit-text-fill-color: currentColor !important;
  }
  #sky, .nebula, .no-print, .foot, .section-nav { display: none !important; }
  .printing-compat .reading-head { display: none !important; }

  /* the name band */
  .reading-head.card {
    background: linear-gradient(120deg, #0b0a1f, #1d1950 70%, #2a2366) !important;
    color: #eeeaff !important; border: 0 !important; border-radius: 14px !important; padding: 18px 22px !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; break-inside: avoid;
  }
  .reading-head h2 { color: #e6c67f !important; }
  .reading-head h2::before { content: '\2726  '; font-size: .6em; vertical-align: middle; }
  .reading-head .muted { color: #c9c2ee !important; }

  /* each system opens a page, under a navy title with a gold rule */
  .print-part + .print-part { break-before: page; }
  /* the match is short system by system: they follow one another, not a page each */
  .printing-compat .print-part + .print-part { break-before: auto; margin-top: 14px; }
  /* a title never ends a page alone */
  .print-title, .section-head { break-after: avoid; }
  .print-title {
    display: block; font: 600 25px var(--font-display); color: #1d1846; margin: 6px 0 14px;
    padding-bottom: 8px; border-bottom: 2px solid #c9a24f;
  }
  .print-title::before { content: '\2726'; color: #c9a24f; margin-inline-end: 10px; font-size: .7em; vertical-align: middle; }

  .card {
    box-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
    background: #fff !important; border: 1px solid var(--border) !important; border-inline-start: 3px solid #c9a24f !important;
    border-radius: 12px !important; padding: 14px 16px !important; margin-bottom: 12px !important;
  }
  /* a section may split across pages (kept whole, a long one left its title alone on an
     empty page); its single items and facts stay whole */
  .item, .fact, .section-head { break-inside: avoid; }
  .section-head h3 { color: #1d1846 !important; font-size: 20px; }
  .section-icon {
    background: #1d1950 !important; color: #e6c67f !important; border-color: #1d1950 !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .fact { background: #f7f4ff !important; }
  .item { border-color: var(--border) !important; }
  .blessing { color: #7a5714 !important; }
  .daily-card .card { background: #faf6ec !important; }
  .reading-head.card { border-inline-start: 0 !important; }
  a { color: inherit; text-decoration: none; }
}

/* Hebrew has no true italic (browsers slant it artificially) and does not take
   wide letter-spacing; designs may use both for Latin text only. */
html:is([lang="he"], [lang="ar"], [lang="zh"], [lang="ja"]) :is(.lead, .tagline, .blessing, .inspiration, .hero-sub) { font-style: normal !important; }
html:is([lang="he"], [lang="ar"], [lang="zh"], [lang="ja"]) :is(.tab, .main-tab, .btn-primary, .hero h1, h1, h2, h3) { letter-spacing: normal !important; }
/* Scripts the Hebrew/Latin web fonts do not cover: the system's own fonts. */
html[lang="ar"] { --font-display: 'Amiri', 'Noto Naskh Arabic', 'Traditional Arabic', 'Times New Roman', serif; --font-body: 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif; }
html[lang="zh"] { --font-display: 'Noto Serif SC', 'Songti SC', 'SimSun', serif; --font-body: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif; }
html[lang="ja"] { --font-display: 'Noto Serif JP', 'Hiragino Mincho ProN', 'Yu Mincho', serif; --font-body: 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo', 'Noto Sans JP', sans-serif; }

/* ------------------------------------------------------------ compatibility (second person) */
.premium-badge {
  font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--gold);
  border: 1px solid var(--gold); border-radius: 999px; padding: 1px 8px; margin-inline-start: 4px;
}
.partner { border: 1px dashed var(--border); border-radius: 14px; padding: 12px 14px 4px; margin: 6px 0 14px; }
.compat-intro-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.compat-intro-head h3 { margin: 0; }
.compat-intro .partner-form { margin-top: 10px; }
/* the date finder's form, and the share button of the day view */
.dates-form { margin-top: 12px; }
.select {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface-strong); border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 14px; outline: none;
}
.select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(163, 143, 247, 0.25); }
.select option { color: #111; background: #fff; }
.share-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.share-panel { margin-top: 12px; }
.shared-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 14.5px; }
.share-status { font-size: 13px; }
.gender { border: 0; padding: 0; margin: 0 0 14px; }
.gender-options { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0; }
.partner-title { color: var(--gold); padding: 0 6px; font-family: var(--font-display); font-size: 17px; }

/* ---------------------------------------------------------------- panel (ui/panelView.js) */
/* the menu's pages over the page: centred on a wide screen, rising from the bottom on a phone */
.panel { width: min(680px, calc(100% - 24px)); max-height: min(86vh, 900px); padding: 0; border: 1px solid var(--border); border-radius: 18px; background: var(--bg-2); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); overflow: hidden; }
.panel[open] { display: flex; flex-direction: column; }
.panel::backdrop { background: rgba(5, 4, 20, 0.55); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.panel-title { margin: 0; font-family: var(--font-display); color: var(--gold); font-size: 21px; }
.panel-body { overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px 22px; }
.panel-legal { max-width: none; }
.panel-legal h2 { font-size: 17px; margin: 20px 0 4px; }
.panel .feedback { max-width: none; }
body:has(dialog.panel[open]) { overflow: hidden; }
@media (max-width: 560px) {
  .panel { width: 100%; max-width: 100%; max-height: 90vh; margin: auto 0 0; border-radius: 18px 18px 0 0; border-bottom: 0; }
}
