/* Ratnayog Kundli — palette from the Ratnayog brand mock (to be aligned with the final logo). */
:root {
    /* Palette taken from the Ratnayog logo: deep maroon, gold, near-black. */
    --ink: #140407;
    --ink-2: #2b0912;
    --gold: #d9a441;
    --gold-light: #f6e3bb;
    --maroon: #8c0d2f;
    --maroon-dark: #6d0724;
    --cream: #fdf8f1;
    --paper: #ffffff;
    --text: #23161a;
    --muted: #6b5b60;
    --line: #ecdfd2;
    --good: #1f7a4d;
    --bad: #b3261e;
    --radius: 14px;
    --shadow: 0 6px 24px rgba(20, 4, 7, .10);
    --font: "Inter", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-hi: "Noto Sans Devanagari", "Inter", system-ui, sans-serif;
    --font-display: "Cormorant Garamond", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--cream);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
}

html[lang="hi"] body { font-family: var(--font-hi); }

a { color: var(--maroon); }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
h1:focus { outline: none; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 640px; }
.section { margin-top: 28px; margin-bottom: 28px; }
.section-title { margin-bottom: 14px; }
.small { font-size: .85rem; }
.muted { color: var(--muted); }

/* Header */
.site-header { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20; }
.header-row { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand-logo { height: 54px; width: auto; display: block; }
.footer-logo { height: 54px; width: auto; margin-bottom: 8px; }
.brand-mark { font-size: 1.8rem; color: var(--gold); line-height: 1; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--font-display), var(--font-hi); font-size: 1.45rem; font-weight: 700; color: var(--gold-light); }
.brand-sub { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); border-left: 1px solid rgba(217,164,65,.5); padding-left: 10px; }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.main-nav a { color: #e9ecf5; text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: .95rem; }
.main-nav a:hover { background: var(--ink-2); color: #fff; }
.main-nav .nav-ask { color: var(--gold); font-weight: 600; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.lang-switch, .shop-link { color: #fff; text-decoration: none; font-size: .9rem; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); }
.shop-link { background: var(--gold); color: var(--ink); border-color: var(--gold); font-weight: 600; }

@media (max-width: 860px) {
    .header-row { padding: 8px 16px; }
    .brand-logo { height: 34px; }
    .brand-sub { font-size: .7rem; padding-left: 6px; }
    .main-nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; }
    .main-nav a { white-space: nowrap; }
    .header-actions { margin-left: auto; }
}

/* Hero */
.hero { background: radial-gradient(circle at 78% 12%, #45101f 0, var(--ink) 58%); color: #fff; padding: 40px 0; }
.hero h1, .page-hero h1 { color: #fff; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: center; }
.hero .lead, .page-hero .lead { color: #d8dcea; font-size: 1.05rem; }
.eyebrow { color: var(--gold); font-weight: 600; letter-spacing: .04em; margin: 0 0 6px; }
.ticks { list-style: none; padding: 0; margin: 16px 0 0; }
.ticks li { padding-left: 26px; position: relative; margin: 6px 0; }
.ticks li::before { content: "✦"; color: var(--gold); position: absolute; left: 0; }
.hero .form-card h2 { color: var(--ink); }
.page-hero { background: var(--ink); color: #fff; padding: 28px 0; }
.page-hero.compact { padding: 22px 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.score-big { font-size: 1.2rem; color: var(--gold-light); margin: 4px 0; }
.score-big span { font-size: 2.6rem; font-weight: 700; color: var(--gold); }

@media (max-width: 860px) {
    .hero-grid { grid-template-columns: 1fr; }
}

/* Cards and grids */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.flush { padding: 0; }
.card.note { margin-top: 16px; background: #fffaf0; }
.card.flag { border-left: 5px solid var(--bad); }
.card.ok { border-left: 5px solid var(--good); }
.card.alert { margin-top: 28px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.split { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
@media (max-width: 900px) {
    .grid-3 { grid-template-columns: 1fr; }
    .split { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 700px) {
    .grid-2 { grid-template-columns: 1fr; }
}

.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.tile:hover { border-color: var(--gold); }
.tile strong { color: var(--ink); }
.tile span:last-child { color: var(--muted); font-size: .9rem; }
.tile-icon { font-size: 1.6rem; }
.tile.highlight { background: var(--ink); }
.tile.highlight strong { color: var(--gold); }
.tile.highlight span:last-child { color: #d8dcea; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Forms */
.form-card { margin-top: 20px; }
.form-card.wide { max-width: none; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
legend { font-weight: 700; color: var(--ink); margin-bottom: 8px; font-size: 1.05rem; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; position: relative; min-width: 0; }
.field label, .field .label { font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type=text], input[type=date], input[type=time], select, textarea {
    width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #cfc7b4; border-radius: 10px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.radio-row { display: flex; gap: 16px; }
.radio-row label { font-weight: 500; display: flex; gap: 6px; align-items: center; }
.hint { color: var(--muted); }
.form-note { color: var(--muted); font-size: .85rem; margin: 10px 0 0; text-align: center; }
details.options { margin: 4px 0 14px; }
details.options > summary { cursor: pointer; color: var(--maroon); font-weight: 600; margin-bottom: 10px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 12px; }
.inline-form .field { margin: 0; min-width: 220px; }
.inline-form label { color: var(--gold-light); }

.place-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 30; list-style: none; margin: 2px 0 0; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 280px; overflow-y: auto; }
.place-list li { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--text); }
.place-list .place-name { display: flex; align-items: center; gap: 8px; }
.place-list .place-coords { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.place-list .place-empty { cursor: default; color: var(--muted); font-size: .85rem; }
.place-list .place-empty:hover { background: none; }
.link-btn { margin-inline-start: 8px; padding: 0; border: 0; background: none; font: inherit; font-size: .8rem; font-weight: 600; color: var(--maroon); cursor: pointer; text-decoration: underline; }
.place-list li[aria-selected=true], .place-list li:hover { background: var(--gold-light); }
.place-field.invalid input[data-place-input] { border-color: var(--bad); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 999px; border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--maroon); color: #fff; }
.btn-primary:hover { background: var(--maroon-dark); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-light { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-block { width: 100%; }

/* Tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-top: 12px; padding-bottom: 4px; position: sticky; top: 64px; z-index: 10; background: var(--cream); }
.tabs a { white-space: nowrap; padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .9rem; }
@media (max-width: 860px) { .tabs { top: 104px; } }
section[id] { scroll-margin-top: 130px; }

/* Key-value lists */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: .9rem; }
.kv dd { margin: 0; font-weight: 500; }
.kv .line { display: block; }
.good-text { color: var(--good) !important; }
.bad-text { color: var(--bad) !important; }

/* Tables */
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.data th { background: #f7ece0; color: var(--ink); font-weight: 600; }
table.data tr.lagna-row td { background: #fffaf0; font-weight: 600; }
table.data tr.outer td { color: var(--muted); }
table.data tr.current td, li.current { background: #fff3cd; font-weight: 600; }
table.data tr.good td:nth-child(4) { color: var(--good); }
table.data tr.bad td:nth-child(4) { color: var(--bad); }
table.data tr.total td { background: #f7ece0; }
table.data.compact th, table.data.compact td { padding: 6px 10px; }
.pill { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: #e8ecf7; color: var(--ink-2); margin-right: 4px; }
.pill.warn { background: #fde8e6; color: var(--bad); }

/* Charts */
.chart { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.chart svg { width: 100%; height: auto; display: block; }
.chart figcaption { text-align: center; font-weight: 600; color: var(--ink); margin-top: 6px; font-size: .95rem; }
.chart-frame { fill: #fffdf7; stroke: var(--gold); stroke-width: 2; }
.chart-line { stroke: var(--gold); stroke-width: 1.5; }
.chart-cell { fill: none; stroke: var(--gold); stroke-width: 1.2; }
.chart-sign { font-size: 13px; fill: var(--muted); text-anchor: middle; dominant-baseline: middle; }
.chart-sign.start { text-anchor: start; font-size: 11px; }
.chart-asc { font-size: 11px; fill: var(--maroon); text-anchor: middle; font-weight: 700; }
.chart-asc.end { text-anchor: end; }
.chart-planet { font-size: 13px; fill: var(--ink); text-anchor: middle; dominant-baseline: middle; font-weight: 600; }
.chart-planet.node { fill: var(--maroon); }
.chart-center { font-size: 16px; fill: var(--ink-2); text-anchor: middle; font-weight: 700; }
.legend { color: var(--muted); font-size: .85rem; margin-top: 8px; }
.grid-varga { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.varga-note { text-align: center; font-size: .82rem; color: var(--muted); margin: 6px 0 0; }
@media (max-width: 1000px) { .grid-varga { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid-varga { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Dasha */
.dasha-list { display: flex; flex-direction: column; gap: 8px; }
details.dasha { background: #fff; border: 1px solid var(--line); border-radius: 10px; }
details.dasha > summary { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; cursor: pointer; font-weight: 600; }
details.dasha > summary.current { background: #fff3cd; border-radius: 10px; }
details.dasha table { margin: 0 0 8px; }
.dasha-dates { color: var(--muted); font-weight: 500; }
.running { background: #fff3cd; padding: 8px 12px; border-radius: 10px; display: inline-block; }
ul.pratyantar { list-style: none; padding: 0; margin: 6px 0 0; white-space: normal; }
ul.pratyantar li { padding: 2px 4px; }

/* Gems and verdicts */
.gem-role { color: var(--maroon); font-weight: 700; margin: 0; text-transform: uppercase; font-size: .78rem; letter-spacing: .06em; }
.caution { background: #fff3cd; padding: 8px 10px; border-radius: 8px; font-size: .9rem; }
.verdict { font-size: 1.15rem; font-weight: 700; margin: 0 0 6px; }
.day-nav { display: flex; justify-content: space-between; margin-top: 16px; }

.prose h2 { margin-top: 1.4em; }
.prose p, .prose li { color: var(--text); }

/* Footer */
.site-footer { background: var(--ink); color: #cfd4e4; margin-top: 48px; padding: 32px 0 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.footer-grid a { display: block; color: #e9ecf5; text-decoration: none; margin: 4px 0; }
.footer-grid a:hover { color: var(--gold); }
.footer-brand { font-family: var(--font-display), var(--font-hi); font-size: 1.5rem; color: var(--gold-light); }
.footer-title { color: var(--gold); font-weight: 600; margin-bottom: 6px; }
.footer-note { border-top: 1px solid var(--ink-2); margin-top: 20px; padding-top: 12px; font-size: .85rem; }
.footer-note a { color: var(--gold-light); }
@media (max-width: 800px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Blazor */
#blazor-error-ui { background: #fff3cd; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { background: #b32121; padding: 1rem; color: white; }
.blazor-error-boundary::after { content: "An error has occurred." }

/* Chat */
.chat-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.chat-side { display: flex; flex-direction: column; gap: 12px; }
.chat-main { display: flex; flex-direction: column; min-height: 60vh; }
.chat-head { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 8px; }
.chat-head h1 { font-size: 1.3rem; margin: 0; }
.quota { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.profile-select { margin-bottom: 8px; }
.thread-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.thread-list button { width: 100%; text-align: left; background: none; border: 1px solid transparent; border-radius: 8px; padding: 8px; cursor: pointer; font: inherit; display: flex; flex-direction: column; }
.thread-list button:hover, .thread-list button.active { background: var(--gold-light); border-color: var(--gold); }
.thread-list small { color: var(--muted); }
.chat-messages { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 8px 0; max-height: 62vh; overflow-y: auto; }
.msg { display: flex; }
.msg.user { justify-content: flex-end; }
.msg .bubble { max-width: 76%; padding: 10px 14px; border-radius: 14px; background: #f3efe4; }
.msg.user .bubble { background: var(--ink); color: #fff; }
.msg .bubble p { margin: 0 0 .6em; }
.msg .bubble p:last-child { margin-bottom: 0; }
.cursor { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.chat-empty { color: var(--muted); }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; font: inherit; }
.chip:hover { border-color: var(--gold); }
.chat-input { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 10px; }
.chat-input textarea { flex: 1; resize: vertical; }
@media (max-width: 900px) { .chat-layout { grid-template-columns: 1fr; } }

/* Feedback + admin */
details.feedback { margin-top: 16px; }
details.feedback > summary { cursor: pointer; font-weight: 600; color: var(--maroon); }
details.feedback form { margin-top: 10px; }
.resend { margin-top: 8px; }
.logout-form { display: inline; }
.logout-form button { cursor: pointer; }
.admin-tabs a { background: #fff; }
.admin-tabs a.active { background: var(--gold); border-color: var(--gold); }
.wrap-cell { white-space: normal; max-width: 420px; }
table.data td input[type=text] { min-width: 120px; padding: 6px 8px; }

/* Muhurat */
.muhurat-list { display: flex; flex-direction: column; gap: 14px; }
.muhurat-day h2 { font-size: 1.05rem; color: var(--maroon); margin-bottom: 10px; }
.muhurat-window { border-top: 1px solid var(--line); padding: 10px 0; }
.muhurat-window:first-of-type { border-top: 0; }
.muhurat-window.best { background: #fffaf0; border-radius: 10px; padding: 10px; }
.muhurat-time { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.muhurat-time strong { font-size: 1.05rem; }
.muhurat-meta { color: var(--muted); margin-top: 2px; }
.muhurat-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag { font-size: .78rem; padding: 2px 8px; border-radius: 999px; background: #eef5ef; color: var(--good); }
.tag.caution-tag { background: #fff3cd; color: #8a6d1f; }

/* SEO page sets */
.city-links { margin-top: 20px; }
.city-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.city-grid a { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; text-decoration: none; color: var(--ink); font-size: .9rem; }
.city-grid a:hover { border-color: var(--gold); }
.city-grid a.current { background: var(--gold); border-color: var(--gold); font-weight: 600; }
.mantra { font-weight: 600; color: var(--maroon); }

/* Gemstone suitability and wearing times */
.gem-score { margin: 10px 0 14px; }
.gem-score-head { display: flex; align-items: baseline; gap: 8px; }
.gem-percent { font-size: 1.5rem; font-weight: 700; }
.gem-percent.good, .gem-bar span.good { color: var(--good, #1a7f4b); }
.gem-percent.fair, .gem-bar span.fair { color: #a8760a; }
.gem-percent.weak, .gem-bar span.weak { color: var(--bad, #b3261e); }
.gem-bar { height: 8px; margin: 6px 0 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.gem-bar span { display: block; height: 100%; border-radius: 999px; background: currentColor; }
.gem-factors { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.gem-factors li { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); }
.gem-factors li.plus span { color: var(--good, #1a7f4b); font-variant-numeric: tabular-nums; }
.gem-factors li.minus span { color: var(--bad, #b3261e); font-variant-numeric: tabular-nums; }
.gem-timing { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.gem-timing summary { cursor: pointer; font-weight: 600; }
.gem-windows { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.gem-windows li { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.gem-windows li strong { font-size: .95rem; }
.gem-windows li .pill { justify-self: start; }
