:root {
    --bg0: #020617;
    --bg1: #071226;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --muted2: #a3b2c7;

    --accent: #ff8c32;
    --accent2: #2caecb;
    --ok: #22c55e;
    --warn: #f59e0b;
    --bad: #ef4444;

    --border: rgba(148, 163, 184, .18);
    --border2: rgba(148, 163, 184, .28);
    --shadow: 0 22px 60px rgba(0, 0, 0, .55);
    --shadow2: 0 10px 22px rgba(0, 0, 0, .35);

    --glowA: 0 0 18px rgba(255, 140, 50, .22), 0 0 42px rgba(255, 140, 50, .14);
    --glowB: 0 0 18px rgba(44, 174, 203, .22), 0 0 42px rgba(44, 174, 203, .14);
    --glowG: 0 0 18px rgba(34, 197, 94, .18), 0 0 42px rgba(34, 197, 94, .12);

    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    background:
        radial-gradient(1200px 700px at 10% 10%, rgba(44, 174, 203, .18), transparent 60%),
        radial-gradient(900px 600px at 90% 20%, rgba(255, 140, 50, .18), transparent 55%),
        radial-gradient(700px 520px at 50% 100%, rgba(34, 197, 94, .10), transparent 65%),
        linear-gradient(180deg, var(--bg0), var(--bg1));
    overflow-x: hidden;
    padding: 12px;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(to right, rgba(148, 163, 184, .06) 1px, transparent 1px) 0 0 / 44px 44px,
        linear-gradient(to bottom, rgba(148, 163, 184, .06) 1px, transparent 1px) 0 0 / 44px 44px;
    mask-image: radial-gradient(70% 60% at 50% 20%, #000 30%, transparent 70%);
    opacity: .24;
    pointer-events: none;
}

body::after {
    content: "";
    position: fixed;
    inset: -2px 0 0 0;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, .06),
            rgba(255, 255, 255, 0) 18%,
            rgba(255, 255, 255, .045) 55%,
            rgba(255, 255, 255, 0) 80%);
    opacity: .12;
    pointer-events: none;
    mix-blend-mode: overlay;
    animation: scan 7.5s linear infinite;
}

@keyframes scan {
    0% {
        transform: translateY(-8%);
    }

    100% {
        transform: translateY(8%);
    }
}

.nav-wrapper {
    width: 100%;
    margin-bottom: 10px;
}

.wrap {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin: 10px 0 14px;
    flex-wrap: wrap;
}

.title {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.title h1 {
    margin: 0;
    font-size: 1.85rem;
    letter-spacing: .4px;
    line-height: 1.15;
}

.subtitle {
    color: var(--muted);
    font-size: .98rem;
}

.badge-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(2, 6, 23, .45);
    box-shadow: var(--shadow2);
    backdrop-filter: blur(10px);
    font-size: .9rem;
    color: var(--muted2);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--muted);
    box-shadow: 0 0 0 3px rgba(148, 163, 184, .12);
}

.dot.live {
    background: var(--ok);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .12), 0 0 18px rgba(34, 197, 94, .25);
    animation: pulse 1.6s ease-in-out infinite;
}

.dot.paused {
    background: var(--warn);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, .14), 0 0 18px rgba(245, 158, 11, .22);
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
        opacity: .75;
    }
}

.chip {
    font-family: var(--mono);
    font-size: .82rem;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(2, 6, 23, .42);
    color: var(--muted2);
}

.card {
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}

.card::before {
    content: "";
    position: absolute;
    inset: -2px;
    background:
        radial-gradient(650px 260px at 12% 0%, rgba(44, 174, 203, .22), transparent 55%),
        radial-gradient(650px 260px at 88% 0%, rgba(255, 140, 50, .22), transparent 55%),
        linear-gradient(180deg, rgba(9, 16, 32, .92), rgba(9, 16, 32, .66));
    z-index: 0;
}

.topbar {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 12px;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

/* NOC ticker */
.ticker {
    width: 100%;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(2, 6, 23, .42);
    box-shadow: var(--shadow2);
    display: none;
    position: relative;
    overflow: hidden;
    min-height: 54px;
}

.ticker::before {
    content: "";
    position: absolute;
    inset: -2px;
    background:
        radial-gradient(520px 180px at 10% 0%, rgba(44, 174, 203, .16), transparent 60%),
        radial-gradient(520px 180px at 90% 0%, rgba(255, 140, 50, .16), transparent 60%);
    pointer-events: none;
    opacity: .9;
}

.ticker-inner {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.ticker-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
}

.ticker-led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent2);
    box-shadow: 0 0 0 3px rgba(44, 174, 203, .12), 0 0 18px rgba(44, 174, 203, .28);
    animation: pulse2 1.35s ease-in-out infinite;
}

@keyframes pulse2 {

    0%,
    100% {
        transform: scale(1);
        opacity: .95;
    }

    50% {
        transform: scale(1.2);
        opacity: .75;
    }
}

.ticker-label {
    font-family: var(--mono);
    font-size: .84rem;
    color: var(--muted2);
    letter-spacing: .12em;
    text-transform: uppercase;
}

.ticker-msg {
    flex: 1 1 420px;
    min-height: 22px;
    font-family: var(--mono);
    color: var(--text);
    font-size: .95rem;
    line-height: 1.35;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity .12s linear;
}

.ticker-msg b {
    color: var(--accent);
    text-shadow: var(--glowA);
}

.ticker-right {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tickpill {
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(2, 6, 23, .35);
    color: var(--muted2);
    font-family: var(--mono);
    font-size: .82rem;
}

.tickpill strong {
    color: var(--text);
}

.input-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 260px;
    flex: 1 1 360px;
}

label {
    color: var(--muted);
    font-size: .95rem;
}

.input-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

input[type="date"] {
    appearance: none;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border2);
    background: rgba(2, 6, 23, .65);
    color: var(--text);
    outline: none;
    font-size: 1.05rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03);
    transition: border-color .2s, box-shadow .2s;
}

input[type="date"]:focus {
    border-color: rgba(44, 174, 203, .65);
    box-shadow:
        inset 0 0 0 1px rgba(44, 174, 203, .20),
        0 0 0 4px rgba(44, 174, 203, .12),
        var(--glowB);
}

.btn {
    cursor: pointer;
    border: none;
    padding: 12px 14px;
    border-radius: 14px;
    font-weight: 800;
    letter-spacing: .2px;
    color: #071226;
    background: linear-gradient(135deg, rgba(255, 140, 50, 1), rgba(255, 140, 50, .72));
    box-shadow: 0 10px 24px rgba(255, 140, 50, .18), 0 0 0 1px rgba(255, 255, 255, .10) inset;
    transition: transform .15s, filter .15s, box-shadow .15s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: 0 14px 28px rgba(255, 140, 50, .22), 0 0 0 1px rgba(255, 255, 255, .14) inset;
}

.btn:active {
    transform: translateY(0px) scale(.99);
}

.btn.secondary {
    color: var(--text);
    background: rgba(2, 6, 23, .55);
    border: 1px solid var(--border2);
    box-shadow: var(--shadow2);
}

.btn.secondary:hover {
    border-color: rgba(44, 174, 203, .55);
    box-shadow: var(--shadow2), var(--glowB);
}

.btn.good {
    color: #04120b;
    background: linear-gradient(135deg, rgba(34, 197, 94, 1), rgba(34, 197, 94, .68));
    box-shadow: 0 10px 24px rgba(34, 197, 94, .16), 0 0 0 1px rgba(255, 255, 255, .10) inset;
}

.btn.good:hover {
    box-shadow: 0 14px 28px rgba(34, 197, 94, .18), 0 0 0 1px rgba(255, 255, 255, .14) inset, var(--glowG);
}

.hint {
    color: var(--muted);
    font-size: .9rem;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    flex: 0 1 520px;
}

.pill {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(2, 6, 23, .42);
    color: var(--muted2);
    font-family: var(--mono);
    font-size: .86rem;
}

.pill strong {
    color: var(--text);
}

.error {
    display: none;
    margin: 12px 16px 0;
    padding: 12px 12px;
    border-radius: 16px;
    border: 1px solid rgba(239, 68, 68, .35);
    background: rgba(239, 68, 68, .10);
    color: #fecaca;
    box-shadow: 0 12px 26px rgba(0, 0, 0, .35);
    position: relative;
    z-index: 1;
}

#results {
    display: none;
    padding: 16px;
    position: relative;
    z-index: 1;
}

.grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 14px;
}

.panel {
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(2, 6, 23, .42);
    box-shadow: var(--shadow2);
    overflow: hidden;
    position: relative;
}

.panel::before {
    content: "";
    position: absolute;
    inset: -2px;
    background:
        radial-gradient(520px 200px at 12% 0%, rgba(255, 140, 50, .14), transparent 62%),
        radial-gradient(520px 200px at 88% 0%, rgba(44, 174, 203, .14), transparent 62%);
    pointer-events: none;
    opacity: .9;
}

.hero {
    grid-column: span 12;
    padding: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .00));
}

.hero-inner {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-kicker {
    color: var(--muted);
    letter-spacing: .14em;
    text-transform: uppercase;
    font-size: .78rem;
}

.hero-age {
    margin-top: 10px;
    font-size: clamp(1.45rem, 2.7vw, 2.35rem);
    font-weight: 950;
    line-height: 1.12;
}

.hero-age .a {
    color: var(--accent);
    text-shadow: var(--glowA);
}

.hero-age .b {
    color: var(--accent2);
    text-shadow: var(--glowB);
}

.hero-sub {
    margin-top: 10px;
    color: var(--muted2);
    font-family: var(--mono);
    font-size: .92rem;
}

.mini {
    grid-column: span 4;
    min-height: 92px;
    padding: 14px;
}

.mini .label {
    position: relative;
    z-index: 1;
    color: var(--muted);
    font-size: .78rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.mini .value {
    position: relative;
    z-index: 1;
    margin-top: 8px;
    font-size: 1.35rem;
    font-weight: 950;
    color: var(--accent2);
    text-shadow: var(--glowB);
}

.mini .subvalue {
    position: relative;
    z-index: 1;
    margin-top: 6px;
    font-family: var(--mono);
    font-size: .84rem;
    color: var(--muted2);
}

@media (hover:hover) and (pointer:fine) {
    .mini:hover {
        border-color: rgba(44, 174, 203, .38);
        box-shadow: var(--shadow2), var(--glowB);
        transform: translateY(-1px);
        transition: .18s ease;
    }
}

.wide {
    grid-column: span 12;
    padding: 14px;
    background: linear-gradient(180deg, rgba(44, 174, 203, .10), rgba(2, 6, 23, .35));
}

.wide-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.bday {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bday .top {
    color: var(--muted2);
    font-size: .98rem;
}

.bday .top b {
    color: var(--text);
}

.bday .count {
    font-size: 1.25rem;
    font-weight: 950;
    color: var(--ok);
    text-shadow: var(--glowG);
}

.rightmeta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.split {
    grid-column: span 12;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 14px;
}

.facts {
    grid-column: span 5;
    padding: 14px;
}

.miles {
    grid-column: span 7;
    padding: 14px;
}

.section-title {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.section-title h2 {
    margin: 0;
    font-size: 1.05rem;
    letter-spacing: .2px;
}

.section-title .tag {
    font-family: var(--mono);
    font-size: .82rem;
    color: var(--muted2);
    border: 1px solid var(--border);
    background: rgba(2, 6, 23, .42);
    border-radius: 999px;
    padding: 6px 10px;
}

.list {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 10px;
}

.item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(2, 6, 23, .42);
}

.item .k {
    color: var(--muted2);
    font-size: .95rem;
    display: flex;
    gap: 10px;
    align-items: center;
}

.emoji {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, 0));
}

.item .v {
    font-family: var(--mono);
    color: var(--text);
    font-size: .92rem;
    text-align: right;
}

.mil-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 12px;
}

.mil {
    grid-column: span 6;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(2, 6, 23, .42);
    overflow: hidden;
}

.mil .a {
    color: var(--muted);
    font-size: .78rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.mil .b {
    margin-top: 8px;
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--accent2);
    text-shadow: var(--glowB);
}

.mil .c {
    margin-top: 6px;
    font-family: var(--mono);
    font-size: .86rem;
    color: var(--muted2);
}

.actions {
    grid-column: span 12;
    padding: 14px;
    background: linear-gradient(180deg, rgba(34, 197, 94, .10), rgba(2, 6, 23, .35));
}

.actions-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.actions-left,
.actions-right {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.toast {
    display: none;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(34, 197, 94, .35);
    background: rgba(34, 197, 94, .12);
    color: #bbf7d0;
    font-family: var(--mono);
    font-size: .86rem;
}

details {
    position: relative;
    z-index: 1;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(2, 6, 23, .42);
    padding: 10px 12px;
}

summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted2);
    font-weight: 800;
}

summary::-webkit-details-marker {
    display: none;
}

.details-body {
    margin-top: 10px;
    color: var(--muted2);
    font-size: .92rem;
    line-height: 1.45;
}

.details-body code {
    font-family: var(--mono);
    font-size: .88rem;
    color: var(--text);
    background: rgba(255, 255, 255, .04);
    padding: 2px 6px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, .18);
}

/* Life composition (matches your NEW markup in index.php) */
.life {
    grid-column: span 12;
    padding: 14px;
    background: linear-gradient(180deg, rgba(255, 140, 50, .10), rgba(2, 6, 23, .35));
}

.life-wrap {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
}

.life-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.life-era {
    display: grid;
    gap: 6px;
    min-width: 240px;
}

.life-era-title {
    font-weight: 950;
    letter-spacing: .2px;
    font-size: 1.05rem;
    color: var(--text);
}

.life-era-meta {
    font-family: var(--mono);
    font-size: .88rem;
    color: var(--muted2);
}

.life-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.life-bar {
    width: 100%;
    height: 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(2, 6, 23, .45);
    overflow: hidden;
    box-shadow: var(--shadow2);
}

.life-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, rgba(44, 174, 203, .95), rgba(255, 140, 50, .95));
    box-shadow: var(--glowA);
    transition: width .35s ease;
    will-change: width;
}

.life-bar-labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-family: var(--mono);
    font-size: .82rem;
    color: var(--muted2);
}

.life-era-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 4px;
}

.era-chip {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(2, 6, 23, .42);
    color: var(--muted2);
    font-family: var(--mono);
    font-size: .82rem;
    user-select: none;
}

.era-chip.on {
    border-color: rgba(255, 140, 50, .45);
    color: var(--text);
    box-shadow: var(--shadow2), var(--glowA);
    background: linear-gradient(180deg, rgba(255, 140, 50, .10), rgba(2, 6, 23, .42));
}

/* Planet Ages grid */
.planet-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.planet-card {
    grid-column: span 6;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(2, 6, 23, .42);
    padding: 12px;
    overflow: hidden;
}

.planet-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.planet-name {
    font-weight: 900;
    color: var(--text);
    letter-spacing: .2px;
}

.planet-period {
    font-family: var(--mono);
    font-size: .8rem;
    color: var(--muted2);
}

.planet-val {
    margin-top: 10px;
    font-size: 1.12rem;
    font-weight: 950;
    color: var(--accent2);
    text-shadow: var(--glowB);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum"1, "lnum"1;
}

.planet-sub {
    margin-top: 6px;
    font-family: var(--mono);
    font-size: .86rem;
    color: var(--muted2);
    min-height: 18px;
}

/* Confetti canvas */
#confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
}

/* Options modal */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 14px;
    z-index: 99999;
}

.modal.open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(8px);
}

.modal-card {
    position: relative;
    z-index: 2;
    width: min(720px, 100%);
    border-radius: 18px;
    border: 1px solid var(--border);
    background:
        radial-gradient(900px 360px at 10% 0%, rgba(44, 174, 203, .18), transparent 60%),
        radial-gradient(900px 360px at 90% 0%, rgba(255, 140, 50, .18), transparent 60%),
        rgba(2, 6, 23, .86);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.modal-head {
    padding: 14px 14px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.modal-head h3 {
    margin: 0;
    font-size: 1.05rem;
    letter-spacing: .2px;
}

.modal-body {
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 12px;
}

.field {
    grid-column: span 6;
    border: 1px solid var(--border);
    background: rgba(2, 6, 23, .42);
    border-radius: 16px;
    padding: 12px;
}

.field label {
    display: block;
    font-size: .85rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.field input {
    width: 100%;
    padding: 12px 12px;
    border-radius: 14px;
    border: 1px solid var(--border2);
    background: rgba(2, 6, 23, .65);
    color: var(--text);
    outline: none;
    font-size: 1.02rem;
    font-family: var(--mono);
}

.field small {
    display: block;
    margin-top: 8px;
    color: var(--muted2);
    font-size: .9rem;
    line-height: 1.35;
}

.modal-foot {
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

/* Modal row/toggles/inputs used by index.php */
.modal-body .row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.modal-body input.num {
    width: 140px;
    max-width: 45%;
}

.modal-body input[type="range"] {
    flex: 1 1 auto;
    accent-color: var(--accent);
}

.toggle {
    display: flex;
    gap: 10px;
    align-items: center;
    color: var(--muted2);
    font-family: var(--mono);
    font-size: .92rem;
}

.toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent2);
}

/* Dark selects (Options modal + general) */
select {
    width: 100%;
    color: var(--text);
    background: rgba(2, 6, 23, .72);
    border: 1px solid var(--border2);
    border-radius: 14px;
    padding: 12px 12px;
    font-family: var(--mono);
    font-size: 1.02rem;
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03);
    appearance: none;

    background-image:
        linear-gradient(45deg, transparent 50%, rgba(229, 231, 235, .75) 50%),
        linear-gradient(135deg, rgba(229, 231, 235, .75) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 3px),
        calc(100% - 12px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 36px;
}

select:focus {
    border-color: rgba(44, 174, 203, .65);
    box-shadow:
        inset 0 0 0 1px rgba(44, 174, 203, .20),
        0 0 0 4px rgba(44, 174, 203, .12),
        var(--glowB);
}

select option {
    background: #020617;
    color: var(--text);
}

/* Settings icon button polish */
.btn.icon {
    width: 46px;
    height: 46px;
    padding: 0;
    justify-content: center;
    align-items: center;
}

.btn.icon svg {
    width: 20px;
    height: 20px;
    opacity: .92;
}

.btn.secondary.icon {
    background: rgba(2, 6, 23, .50);
}

.btn.secondary.icon:hover {
    border-color: rgba(255, 140, 50, .45);
    box-shadow: var(--shadow2), var(--glowA);
}

/* Prevent layout jumps from changing digits */
.value,
.v,
.hero-age,
.hero-sub,
.tickpill strong,
#next-birthday,
#tickerMsg,
.toast {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum"1, "lnum"1;
}

/* Reduce motion toggle support (JS toggles .motion-off on <html>) */
html.motion-off *,
html.motion-off *::before,
html.motion-off *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

html.motion-off body::after {
    display: none !important;
}

/* Extra anti-shift rules for fast-updating fields */
#age-ms,
#age-seconds,
#age-minutes,
#age-hours,
#age-days,
#next-birthday,
#tickerMsg {
    min-width: 0;
    contain: content;
}

@media (max-width: 980px) {
    .mini {
        grid-column: span 6;
    }

    .facts {
        grid-column: span 12;
    }

    .miles {
        grid-column: span 12;
    }

    .mil {
        grid-column: span 12;
    }

    .planet-card {
        grid-column: span 6;
    }
}

@media (max-width: 560px) {
    body {
        padding: 10px;
    }

    .topbar {
        padding: 14px;
    }

    #results {
        padding: 14px;
    }

    .mini {
        grid-column: span 12;
    }

    .hint {
        justify-content: flex-start;
    }

    .actions-left,
    .actions-right {
        width: 100%;
    }

    .ticker-msg {
        flex-basis: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .field {
        grid-column: span 12;
    }

    .planet-card {
        grid-column: span 12;
    }

    .modal-card {
        border-radius: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }

    body::after {
        display: none !important;
    }
}