:root {
    --bg: #120e18;
    --bg-2: #1b1422;
    --surface: rgba(255, 240, 220, 0.04);
    --surface-2: rgba(255, 240, 220, 0.07);
    --line: rgba(255, 235, 205, 0.10);
    --text: #f4ece0;
    --muted: rgba(244, 236, 224, 0.66);
    --gold: #e3a645;
    --gold-soft: #f0cf8a;
    --saffron: #c4572b;
    --maroon: #7d2635;
    --font-display: 'Fraunces', 'Noto Serif Sinhala', serif;
    --font-text: 'Outfit', 'Noto Sans Sinhala', sans-serif;
    --radius: 18px;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-text);
    background-color: var(--bg);
    background-image:
        radial-gradient(900px 600px at 10% -10%, rgba(125, 38, 53, 0.45), transparent 60%),
        radial-gradient(800px 600px at 110% 20%, rgba(196, 87, 43, 0.16), transparent 60%),
        radial-gradient(700px 500px at 50% 110%, rgba(227, 166, 69, 0.08), transparent 60%);
    background-attachment: fixed;
    color: var(--text);
    overflow-x: hidden;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}
/* Fine grain so the dark background doesn't feel flat */
body::after {
    content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .06;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
h1, h2, h3, h4, h5 { text-wrap: balance; letter-spacing: -0.01em; }
p { text-wrap: pretty; }
::selection { background: rgba(227, 166, 69, 0.35); color: #fff; }
a, button, .btn { transition: color .25s var(--ease), background-color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease); }
button:active, .btn:active { transform: scale(0.98); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.form-control:focus, .form-select:focus { border-color: var(--gold) !important; box-shadow: 0 0 0 3px rgba(227, 166, 69, 0.2) !important; }

.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 1100; background: var(--gold); color: #1a1208; padding: .6rem 1rem; border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 1rem; }

.stars { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.star { position: absolute; width: 2px; height: 2px; background: #fbe7c2; border-radius: 50%; animation: twinkle 4s infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.8; } }
@media (prefers-reduced-motion: reduce) { .star { animation: none; } html { scroll-behavior: auto; } }

/* Navbar */
.site-nav { background: rgba(18, 14, 24, 0.78); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid var(--line); padding: .8rem 0; position: sticky; top: 0; z-index: 1000; }
.site-nav .navbar-brand { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: .6rem; letter-spacing: -0.01em; }
.site-nav .navbar-brand:hover { color: var(--gold-soft); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(140deg, var(--gold) 0%, var(--saffron) 100%); color: #1a1208; font-size: .95rem; box-shadow: 0 6px 18px rgba(196, 87, 43, 0.35), inset 0 1px 0 rgba(255,255,255,.35); }
.site-nav .navbar-brand img { max-height: 46px; }
.site-nav .nav-link { color: var(--muted) !important; font-weight: 500; font-size: .95rem; padding: .5rem .85rem !important; white-space: nowrap; position: relative; }
.site-nav .nav-link:hover { color: var(--text) !important; }
.site-nav .nav-link.active { color: var(--gold-soft) !important; }
.site-nav .nav-link.active::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); transform: translateX(-50%); }
.nav-cta { background: linear-gradient(140deg, var(--gold) 0%, #d48a3a 100%); color: #1a1208 !important; font-weight: 600; padding: .55rem 1.1rem; border-radius: 12px; text-decoration: none; font-size: .92rem; white-space: nowrap; box-shadow: 0 8px 24px rgba(227, 166, 69, 0.22); }
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(227, 166, 69, 0.32); }
.site-nav .dropdown-menu { background: #1d1626; border: 1px solid var(--line); border-radius: 14px; padding: .5rem; box-shadow: 0 24px 60px rgba(8, 4, 12, 0.6); }
.site-nav .dropdown-item { color: var(--muted); border-radius: 9px; padding: .55rem .8rem; font-size: .95rem; }
.site-nav .dropdown-item:hover, .site-nav .dropdown-item:focus { background: var(--surface-2); color: var(--text); }
.site-nav .dropdown-item i { width: 1.2rem; color: var(--gold); opacity: .85; }
.navbar-toggler { border: 1px solid var(--line); padding: .45rem .6rem; }
.navbar-toggler:focus { box-shadow: none; border-color: var(--gold); }
.navbar-toggler-icon { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28244, 236, 224, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"); }
@media (max-width: 1199.98px) {
    .site-nav .navbar-collapse { margin-top: .8rem; padding: .6rem; border-radius: 16px; background: #1a1422; border: 1px solid var(--line); }
    /* The nav is sticky, so an open menu taller than the screen could never be scrolled to its end:
       cap it at the screen height (minus the bar) and scroll inside it instead of the page */
    .site-nav .navbar-collapse.show, .site-nav .navbar-collapse.collapsing { max-height: calc(100dvh - 5.5rem); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
    .site-nav .dropdown-menu { position: static; box-shadow: none; }
    .site-nav .nav-link.active::after { left: 0; top: 50%; bottom: auto; transform: translateY(-50%); }
    .nav-cta { display: block; text-align: center; margin: .5rem .3rem .2rem; }
}

/* Footer */
.site-footer { position: relative; z-index: 2; margin-top: 6rem; border-top: 1px solid var(--line); background: linear-gradient(180deg, rgba(18, 14, 24, 0.4), rgba(12, 9, 16, 0.95)); padding: 4.5rem 0 2rem; }
.footer-brand { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.footer-text { color: var(--muted); line-height: 1.7; font-size: .95rem; max-width: 34ch; }
.footer-heading { font-family: var(--font-text); color: var(--gold-soft); font-weight: 600; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 1.1rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .65rem; }
.footer-links a, .footer-contact a { color: var(--muted); text-decoration: none; }
.footer-links a:hover, .footer-contact a:hover { color: var(--text); }
.footer-contact { color: var(--muted); font-size: .95rem; line-height: 2; }
.footer-contact i { color: var(--gold); width: 1.3rem; opacity: .8; }
.social-links { display: flex; gap: .5rem; margin-top: 1.4rem; }
.social-links a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.social-links a:hover { background: var(--gold); color: #1a1208; transform: translateY(-2px); }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 1.6rem; margin-top: 3rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; color: rgba(244, 236, 224, 0.45); font-size: .85rem; }
.footer-bottom a { color: inherit; text-decoration: none; }
.footer-disclaimer { margin: 2.5rem 0 0; color: rgba(244, 236, 224, 0.45); font-size: .85rem; line-height: 1.6; max-width: 80ch; }
.footer-bottom a:hover { color: var(--text); }

main { position: relative; z-index: 2; }

/* =========================================================
   Shared page components (tool pages, content pages)
   Page <style> blocks only add page-specific pieces on top.
   ========================================================= */

/* Page hero */
.page-hero { padding: 4.5rem 0 2.5rem; position: relative; }
.page-hero .eyebrow { display: inline-flex; align-items: center; gap: .55rem; font-size: .9rem; color: var(--gold-soft); background: rgba(227, 166, 69, 0.08); border: 1px solid rgba(227, 166, 69, 0.22); padding: .38rem .8rem; border-radius: 10px; margin-bottom: 1.2rem; }
.page-hero h1 { font-family: var(--font-display); font-size: clamp(2.3rem, 5vw, 3.6rem); font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; margin-bottom: .9rem; max-width: 18ch; }
.page-hero h1 em { font-style: italic; font-weight: 500; color: var(--gold); }
.page-hero p { color: var(--muted); font-size: 1.12rem; line-height: 1.65; max-width: 56ch; margin: 0; }
.page-hero.center { text-align: center; }
.page-hero.center h1, .page-hero.center p { margin-left: auto; margin-right: auto; }
@media (max-width: 575.98px) { .page-hero { padding: 2.8rem 0 1.8rem; } }

/* Tool layout: form panel + side notes */
.tool-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr); gap: 1.5rem; align-items: start; }
.tool-grid > aside { position: sticky; top: 6.5rem; display: grid; gap: 1rem; }
@media (max-width: 991.98px) { .tool-grid { grid-template-columns: 1fr; } .tool-grid > aside { position: static; } }

/* Panels */
.panel, .main-card, .glass-card {
    background: linear-gradient(180deg, rgba(255, 240, 220, 0.055), rgba(255, 240, 220, 0.025));
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 2rem;
    box-shadow: 0 30px 60px -30px rgba(8, 4, 12, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    position: relative;
}
@media (max-width: 575.98px) { .panel, .main-card, .glass-card { padding: 1.4rem; border-radius: 18px; } }
.panel-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; margin-bottom: 1.4rem; display: flex; align-items: center; gap: .7rem; }
.panel-title i { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: .95rem; color: var(--gold); background: rgba(227, 166, 69, 0.12); border: 1px solid rgba(227, 166, 69, 0.2); flex-shrink: 0; }

/* Forms */
.form-label, .form-group label { font-weight: 500; font-size: .92rem; color: rgba(244, 236, 224, 0.85); margin-bottom: .45rem; display: block; }
.form-label i, .form-group label i { color: var(--gold); opacity: .85; }
.form-control, .form-select, .search-input {
    background-color: rgba(10, 6, 14, 0.45);
    border: 1px solid rgba(255, 235, 205, 0.14);
    border-radius: 12px;
    padding: .8rem 1rem;
    color: var(--text);
    font-size: 1rem;
    font-family: var(--font-text);
}
.search-input { width: 100%; }
.form-control:focus, .form-select:focus, .search-input:focus { background-color: rgba(10, 6, 14, 0.6); color: var(--text); outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(227, 166, 69, 0.2); }
.form-control::placeholder, .search-input::placeholder { color: rgba(244, 236, 224, 0.4); }
.form-control::-webkit-calendar-picker-indicator { filter: invert(0.85) sepia(0.4); cursor: pointer; }
.form-select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23e3a645' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23e3a645' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right .8rem center; background-size: 12px; padding-right: 2.1rem; }
select option, .form-select option, select.form-control option { background: #1d1626; color: var(--text); }
.form-hint { display: block; margin-top: .45rem; font-size: .85rem; color: rgba(244, 236, 224, 0.5); }

/* Buttons */
.btn-calculate, .btn-generate, .btn-predict, .btn-submit, .btn-action, .btn-confirm-location, .btn-gold {
    display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
    background: linear-gradient(140deg, var(--gold) 0%, #d48a3a 100%);
    color: #1a1208 !important; border: none; font-weight: 600; font-size: 1.05rem; font-family: var(--font-text);
    padding: .95rem 1.8rem; border-radius: 14px; cursor: pointer; text-decoration: none;
    box-shadow: 0 14px 30px -10px rgba(227, 166, 69, 0.5), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn-calculate:hover, .btn-generate:hover, .btn-predict:hover, .btn-submit:hover, .btn-action:hover, .btn-confirm-location:hover, .btn-gold:hover { transform: translateY(-2px); box-shadow: 0 20px 36px -12px rgba(227, 166, 69, 0.6), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-calculate:disabled, .btn-generate:disabled, .btn-predict:disabled, .btn-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }
.btn-ai-analyze, .btn-ai-names, .btn-outline-gold {
    display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
    background: rgba(227, 166, 69, 0.08); color: var(--gold-soft) !important; border: 1px solid rgba(227, 166, 69, 0.45);
    font-weight: 600; font-size: 1rem; padding: .85rem 1.5rem; border-radius: 14px; cursor: pointer; text-decoration: none;
}
.btn-ai-analyze:hover, .btn-ai-names:hover, .btn-outline-gold:hover { background: rgba(227, 166, 69, 0.16); border-color: var(--gold); color: #fff !important; transform: translateY(-2px); }
.btn-ai-analyze:disabled { opacity: .6; transform: none; }
.loading-spinner { display: none; margin-left: .4rem; }

/* Side notes */
.info-box, .info-card { background: rgba(255, 240, 220, 0.03); border: 1px solid var(--line); border-radius: 18px; padding: 1.6rem; }
.info-box h4, .info-card h4 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: var(--gold-soft); margin-bottom: .9rem; }
.info-box h4 i, .info-card h4 i { color: var(--gold); }
.info-box ul { list-style: none; padding: 0; margin: 0; }
.info-box li { padding: .65rem 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .95rem; line-height: 1.55; display: flex; gap: .7rem; }
.info-box li:last-child { border-bottom: none; padding-bottom: 0; }
.info-box li i { color: var(--gold); margin-top: .3rem; font-size: .8rem; }
.info-card p { color: var(--muted); line-height: 1.7; margin: 0; }

/* Results */
.result-reveal { animation: riseIn .6s var(--ease) both; }
@keyframes riseIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.result-hero {
    border-radius: 24px; padding: 2.6rem 2rem; text-align: center; position: relative; overflow: hidden; isolation: isolate;
    background: radial-gradient(500px 260px at 50% -10%, rgba(227, 166, 69, 0.35), transparent 70%), linear-gradient(160deg, #4a1a26 0%, #2a1a2b 100%);
    border: 1px solid rgba(227, 166, 69, 0.3);
    box-shadow: 0 40px 80px -40px rgba(196, 87, 43, 0.6);
}
.result-hero .kicker { font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-soft); font-weight: 600; margin-bottom: .8rem; }
.result-hero .big { font-family: var(--font-display); font-size: clamp(2.4rem, 6vw, 3.6rem); font-weight: 600; line-height: 1.1; color: #fff; }
.result-hero .sub { color: var(--muted); margin-top: .6rem; font-size: 1.05rem; }

/* Loader */
.loader { width: 34px; height: 34px; border: 3px solid rgba(227, 166, 69, 0.18); border-top-color: var(--gold); border-radius: 50%; animation: spin .9s linear infinite; margin: 1.5rem auto; display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tabs */
.tab-buttons { display: flex; gap: .4rem; padding: .35rem; background: rgba(10, 6, 14, 0.45); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 1.6rem; }
.tab-btn { flex: 1; border: none; background: transparent; color: var(--muted); font-weight: 600; font-size: .95rem; padding: .75rem 1rem; border-radius: 10px; cursor: pointer; }
.tab-btn:hover { color: var(--text); background: rgba(255, 240, 220, 0.05); }
.tab-btn.active { background: linear-gradient(140deg, var(--gold) 0%, #d48a3a 100%); color: #1a1208; }
.tab-section { display: none; }
.tab-section.active { display: block; animation: riseIn .4s var(--ease) both; }

/* Location picker */
.location-picker { margin-bottom: 1rem; }
.location-row { display: flex; gap: .5rem; margin-bottom: .5rem; }
.location-row .form-control { flex: 1; min-width: 0; }
.btn-map-picker { flex-shrink: 0; width: 50px; border-radius: 12px; border: 1px solid rgba(227, 166, 69, 0.4); background: rgba(227, 166, 69, 0.1); color: var(--gold); cursor: pointer; }
.btn-map-picker:hover { background: var(--gold); color: #1a1208; }
.location-search-wrapper { position: relative; margin-top: .5rem; }
.location-search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 1000; background: #1d1626; border: 1px solid var(--line); border-radius: 12px; max-height: 220px; overflow-y: auto; display: none; box-shadow: 0 24px 50px rgba(8, 4, 12, 0.6); }
.location-search-results.show { display: block; }
.search-result-item { padding: .7rem 1rem; cursor: pointer; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.search-result-item:hover { background: rgba(227, 166, 69, 0.12); color: var(--text); }
.search-result-item:last-child { border-bottom: none; }
.search-result-item i { color: var(--gold) !important; }
.selected-location { margin-top: .5rem; padding: .5rem .8rem; background: rgba(227, 166, 69, 0.07); border: 1px dashed rgba(227, 166, 69, 0.3); border-radius: 10px; font-size: .85rem; color: var(--gold-soft); }
.selected-location i { margin-right: .4rem; }

/* Map modal */
.map-modal { display: none; position: fixed; inset: 0; background: rgba(8, 4, 12, 0.78); backdrop-filter: blur(6px); z-index: 1200; align-items: center; justify-content: center; padding: 1rem; }
.map-modal.show { display: flex; }
.map-modal-content { background: #1a1422; border-radius: 22px; width: 100%; max-width: 820px; max-height: 92vh; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6); display: flex; flex-direction: column; }
.map-modal-header { padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.map-modal-header h5 { margin: 0; color: var(--text); font-family: var(--font-display); font-weight: 600; }
.map-modal-header h5 i { color: var(--gold); }
.btn-close-modal { background: rgba(255, 240, 220, 0.06); border: 1px solid var(--line); color: var(--text); width: 38px; height: 38px; border-radius: 10px; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.btn-close-modal:hover { background: rgba(255, 240, 220, 0.12); }
.map-modal-body { padding: 1rem 1.5rem; overflow-y: auto; }
#mapContainer { height: 400px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
@media (max-width: 575.98px) { #mapContainer { height: 300px; } }
.map-modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--line); text-align: right; }
.map-search-box { margin-bottom: 1rem; }
.map-coords-display { color: var(--muted); font-size: .9rem; margin-top: .6rem; }

/* Long-form text (legal pages, blog posts) */
.prose { color: rgba(244, 236, 224, 0.85); font-size: 1.07rem; line-height: 1.85; max-width: 70ch; }
.prose h2, .prose h3, .prose h4 { font-family: var(--font-display); color: var(--text); font-weight: 600; margin: 2.2rem 0 .8rem; line-height: 1.25; }
.prose h2 { font-size: 1.8rem; } .prose h3 { font-size: 1.4rem; } .prose h4 { font-size: 1.15rem; }
.prose > :first-child { margin-top: 0; }
.prose p { margin-bottom: 1.2rem; }
.prose a { color: var(--gold-soft); text-underline-offset: 3px; }
.prose a:hover { color: var(--gold); }
.prose ul, .prose ol { padding-left: 1.3rem; margin-bottom: 1.2rem; }
.prose li { margin-bottom: .45rem; }
.prose li::marker { color: var(--gold); }
.prose img { max-width: 100%; height: auto; border-radius: 14px; margin: 1rem 0; }
.prose blockquote { border-left: 3px solid var(--gold); padding: .3rem 0 .3rem 1.2rem; margin: 1.5rem 0; color: var(--muted); font-style: italic; }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 1.2rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: .6rem .8rem; }

/* Small spinner inside buttons */
button .loader { width: 20px; height: 20px; margin: 0; border-width: 2px; vertical-align: middle; border-color: rgba(26, 18, 8, 0.25); border-top-color: #1a1208; }
.btn-ai-analyze .loader, .btn-outline-gold .loader { border-color: rgba(227, 166, 69, 0.25); border-top-color: var(--gold); }

/* Good / mixed / bad status pills used by several result screens */
.status-good { --s: #9fe0b8; } .status-mixed { --s: #f0c45c; } .status-bad { --s: #f39a8c; }

@media print {
    body { background: #fff !important; }
    body::after, .stars, .skip-link { display: none !important; }
}

/* Bootstrap cards / buttons used by the stock auth pages (password reset, verify) */
main .card { background: linear-gradient(180deg, rgba(255, 240, 220, 0.055), rgba(255, 240, 220, 0.025)); border: 1px solid var(--line); border-radius: 22px; color: var(--text); margin-top: 3rem; overflow: hidden; }
main .card-header { background: transparent; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; padding: 1.2rem 1.6rem; }
main .card-body { padding: 1.6rem; }
main .card .col-form-label { color: rgba(244, 236, 224, 0.85); }
main .btn-primary { background: linear-gradient(140deg, var(--gold) 0%, #d48a3a 100%); border: none; color: #1a1208; font-weight: 600; border-radius: 12px; padding: .7rem 1.3rem; }
main .btn-primary:hover, main .btn-primary:focus { background: linear-gradient(140deg, var(--gold-soft) 0%, var(--gold) 100%); color: #1a1208; }
main .btn-link { color: var(--gold-soft); }
main .alert-success { background: rgba(127, 209, 160, 0.1); border-color: rgba(127, 209, 160, 0.4); color: #9fe0b8; }
.invalid-feedback { color: #f39a8c; }

@media (max-width: 575.98px) {
    select.form-control { padding-left: .75rem; padding-right: 1.6rem; background-position: right .55rem center; }
}

/* =========================================================
   Languages
   Sinhala / Devanagari pages put the Noto font first so a whole word
   (including the zero-width joiner in ශ්‍රී, ක්‍ර, ද්‍ය ...) is shaped by one font.
   ========================================================= */
html[lang="si"] { --font-text: 'Noto Sans Sinhala', 'Outfit', sans-serif; --font-display: 'Noto Serif Sinhala', 'Fraunces', serif; }
html[lang="hi"] { --font-text: 'Noto Sans Devanagari', 'Outfit', sans-serif; --font-display: 'Noto Serif Devanagari', 'Fraunces', serif; }
/* Single elements marked lang="si" / "hi" inside a page of another language (icons keep their own font) */
:not(html)[lang="si"] { font-family: 'Noto Sans Sinhala', 'Outfit', sans-serif; }
:not(html)[lang="hi"] { font-family: 'Noto Sans Devanagari', 'Outfit', sans-serif; }
html[lang="si"] h1, html[lang="si"] h2, html[lang="si"] h3, html[lang="hi"] h1, html[lang="hi"] h2, html[lang="hi"] h3 { font-family: var(--font-display); }
/* Letter-spacing and uppercase break up Sinhala and Devanagari letter clusters */
html[lang="si"] *, html[lang="hi"] * { letter-spacing: 0 !important; }
html[lang="si"] body, html[lang="hi"] body { line-height: 1.65; }
html[lang="si"] .page-hero h1, html[lang="hi"] .page-hero h1, html[lang="si"] .hero h1, html[lang="hi"] .hero h1 { line-height: 1.3; }

.lang-toggle i { color: var(--gold); margin-right: .25rem; }
.site-nav .dropdown-item.active-lang { color: var(--gold-soft); }

/* AdSense units (partials/ad) */
.ad-slot { margin: 1.75rem 0 .5rem; padding-top: 1.1rem; position: relative; min-height: 50px; text-align: center; clear: both; }
.ad-slot::before { content: attr(data-label); position: absolute; top: 0; left: 0; right: 0; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); opacity: .7; }
.ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }
@media print { .ad-slot { display: none !important; } }

/* Share buttons (partials/share) */
.share-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; margin-top: 1.4rem; }
.share-label { color: var(--muted); font-size: .9rem; margin-right: .2rem; }
.share-label i { color: var(--gold); }
.share-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 1.05rem; cursor: pointer; text-decoration: none; transition: transform .2s var(--ease), background .2s var(--ease); }
.share-btn:hover { transform: translateY(-2px); color: #fff; }
.share-wa:hover { background: #1f9e55; } .share-fb:hover { background: #1b64d8; } .share-x:hover { background: #000; }
.share-copy:hover, .share-native:hover, .share-copy.done { background: rgba(227, 166, 69, 0.25); }

/* Label / value rows and status pills used by the result pages */
.text-muted { color: var(--muted) !important; }
.kv-row { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-top: 1px solid var(--line); }
.kv-row:first-child { border-top: 0; }
.kv-row > span { color: var(--muted); }
.kv-row > strong { color: var(--text); font-weight: 600; text-align: right; }
.kv-row small { display: block; color: var(--muted); font-weight: 400; font-size: .82rem; }
.pill { display: inline-block; padding: .25rem .7rem; border-radius: 999px; font-size: .82rem; font-weight: 600; border: 1px solid currentColor; }
.pill-bad { color: #f39a8c; } .pill-warn { color: #f0b860; } .pill-good { color: #7fd6a0; }
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.link-grid a { display: block; padding: .9rem 1rem; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 500; }
.link-grid a:hover, .link-grid a.active { border-color: var(--gold); background: rgba(227, 166, 69, 0.1); color: #fff; }
.link-grid a small { display: block; color: var(--muted); font-weight: 400; margin-top: .2rem; }
.ai-text { color: rgba(244, 236, 224, 0.88); line-height: 1.85; font-size: 1.04rem; }
.ai-text h3 { font-family: var(--font-display); color: var(--gold-soft); font-size: 1.2rem; margin: 1.4rem 0 .5rem; }
.ai-text h3:first-child { margin-top: 0; }
.ai-text p { margin-bottom: .9rem; }

/* Space backdrop (public/js/space.js): canvas starfield behind heroes, fading into the next section */
.page-hero { overflow-x: clip; }
.page-hero > .container { position: relative; z-index: 1; }
.hero-space { position: absolute; left: 0; top: 0; width: 100%; height: calc(100% + 14rem); pointer-events: none; z-index: 0;
    -webkit-mask-image: linear-gradient(to bottom, #000 65%, transparent); mask-image: linear-gradient(to bottom, #000 65%, transparent); }
@keyframes spin-slow { to { transform: rotate(360deg); } }
.orbit { position: absolute; border-radius: 50%; border: 1px dashed rgba(244, 236, 224, 0.16); animation: spin-slow linear infinite; pointer-events: none; }
.orbit i { position: absolute; top: 0; left: 50%; border-radius: 50%; transform: translate(-50%, -50%); }
.orbit-1 { inset: -5%; animation-duration: 38s; }
.orbit-1 i { width: 12px; height: 12px; background: radial-gradient(circle at 35% 30%, #fff1d6, #e3a645); box-shadow: 0 0 14px rgba(227, 166, 69, 0.8); }
.orbit-2 { inset: -12%; animation-duration: 64s; animation-direction: reverse; border-color: rgba(244, 236, 224, 0.1); }
.orbit-2 i { width: 9px; height: 9px; background: radial-gradient(circle at 35% 30%, #ffd2c4, #d0563b); box-shadow: 0 0 12px rgba(208, 86, 59, 0.8); }
.orbit-3 { inset: 22%; animation-duration: 24s; border-color: rgba(227, 166, 69, 0.12); }
.orbit-3 i { width: 7px; height: 7px; background: #cfe3ff; box-shadow: 0 0 10px rgba(180, 210, 255, 0.9); }
/* Inner pages: the page's icon as a glowing sun with planets around it, in the empty right of the hero */
.hero-orbits { position: absolute; z-index: 0; right: max(4vw, calc((100vw - 1320px) / 2 + 3rem)); top: 50%; width: clamp(220px, 24vw, 340px); aspect-ratio: 1; transform: translateY(-45%); pointer-events: none; }
.hero-orbits::before { content: ''; position: absolute; inset: 10%; border-radius: 50%; background: radial-gradient(circle, rgba(227, 166, 69, 0.2), transparent 70%); filter: blur(24px); }
.hero-sun { position: absolute; inset: 34%; border-radius: 50%; display: grid; place-items: center; font-size: clamp(1.3rem, 2vw, 1.9rem); color: #3a2410;
    background: radial-gradient(circle at 35% 30%, #f6d69a, var(--gold) 45%, #a8662a 100%); box-shadow: 0 0 50px rgba(227, 166, 69, 0.45), inset 0 -6px 16px rgba(90, 40, 10, 0.35);
    animation: sun-pulse 5s ease-in-out infinite; }
.hero-orbits .orbit-1 { inset: 14%; }
.hero-orbits .orbit-2 { inset: 0; }
.hero-orbits .orbit { border-color: rgba(244, 236, 224, 0.2); }
.hero-orbits .orbit-3 { inset: 26%; }
@keyframes sun-pulse { 50% { box-shadow: 0 0 80px rgba(227, 166, 69, 0.6), inset 0 -6px 16px rgba(90, 40, 10, 0.35); } }
@media (max-width: 991.98px) { .hero-orbits { display: none; } }
@media (prefers-reduced-motion: reduce) { .orbit, .hero-sun { animation: none; } }

/* Tool FAQs (partials/tool-faq) and the AI editorial note (partials/ai-note) */
.tool-faq details { border-bottom: 1px solid rgba(227, 166, 69, .18); padding: .75rem 0; }
.tool-faq summary { cursor: pointer; font-weight: 600; color: var(--text); list-style-position: outside; }
.tool-faq summary::marker { color: var(--gold-soft, #e3a645); }
.tool-faq details p { margin: .6rem 0 0; }
.ai-note { padding: 1.1rem 1.3rem; border-left: 3px solid rgba(227, 166, 69, .6); }
.ai-note h2 { color: var(--text); margin-bottom: .4rem; }
.ai-note p { color: var(--muted); font-size: .95rem; line-height: 1.7; }
