:root {
    --bg: #0b0f14;
    --card: #121a24;
    --card2: #0f1620;
    --text: #e9eef6;
    --muted: rgba(233, 238, 246, 0.68);
    --line: rgba(233, 238, 246, 0.12);
    --accent: #7dd3fc;
    --danger: #fb7185;
    --ok: #86efac;
    --shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background:
        radial-gradient(1200px 700px at 20% 0%, rgba(125, 211, 252, 0.12), transparent 60%),
        radial-gradient(900px 700px at 90% 10%, rgba(251, 113, 133, 0.10), transparent 55%),
        var(--bg);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 22px 14px 40px;
}

.hero {
    margin: 10px 0 16px;
}

h1 {
    margin: 0 0 8px;
    font-size: 28px;
    letter-spacing: 0.2px;
}

.sub {
    margin: 0;
    color: var(--muted);
}

.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 45%), var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    box-shadow: var(--shadow);
    margin: 14px 0;
}

.label {
    display: block;
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 13px;
}

.textarea {
    width: 100%;
    resize: vertical;
    min-height: 140px;
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--card2);
    color: var(--text);
    outline: none;
}

.textarea:focus {
    border-color: rgba(125, 211, 252, 0.55);
}

.sliders {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 14px 0 8px;
}

.slider input[type="range"] {
    width: 100%;
}

.select {
    width: 100%;
    padding: 10px 10px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--card2);
    color: var(--text);
}

.row {
    display: flex;
    align-items: center;
}

.between {
    justify-content: space-between;
}

.gap {
    gap: 10px;
}

.tiny {
    font-size: 12px;
}

.muted {
    color: var(--muted);
}

.pill {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
}

.btn {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    cursor: pointer;
}

.btn:hover {
    border-color: rgba(233, 238, 246, 0.25);
}

.btn.primary {
    border-color: rgba(125, 211, 252, 0.35);
    background: rgba(125, 211, 252, 0.10);
}

.status {
    margin-top: 10px;
    min-height: 18px;
}

.hidden {
    display: none;
}

.h2 {
    margin: 0;
    font-size: 16px;
    color: var(--muted);
    font-weight: 600;
}

.big {
    font-size: 64px;
    line-height: 1;
    margin: 10px 0 10px;
    letter-spacing: -1px;
}

.pct {
    font-size: 22px;
    color: var(--muted);
    margin-left: 2px;
}

.badge {
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

.reason {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted);
}

/* Modal */
.modal.hidden {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
}

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

.modal-panel {
    position: relative;
    max-width: 720px;
    width: calc(100vw - 32px);

    max-height: 75vh;
    overflow-y: auto;

    margin: 6vh auto;
    padding: 16px;

    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.03),
        transparent 45%
    ), var(--card);

    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

@media (max-width: 520px) {
    .modal-panel {
        max-height: 85vh;
        margin: 4vh 12px;
    }
}

.modal-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.btn.close {
    padding: 8px 10px;
    border-radius: 12px;
    line-height: 1;
}

@media (max-width: 780px) {
    .modal-panel {
        margin: 4vh 12px 0;
    }
}

/* --- Share-card-like modal layout --- */
.shareLayout {
    width: 100%;
}

.shareHeader {
    text-align: center;
    margin: 8px 0 18px;
}

.shareTitle {
    font-size: 38px;
    font-weight: 900;
    letter-spacing: -0.4px;
}

.shareSub {
    margin-top: 6px;
    opacity: 0.72;
    font-size: 16px;
}

.shareGrid {
    display: grid;
    grid-template-columns: 1.18fr 1fr;
    gap: 26px;
    align-items: start;
}

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

.sharePctRow {
    font-size: 92px;
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1;
    margin-top: 4px;
}

.pctLabel {
    margin-left: 10px;
    font-size: 22px;
    color: rgba(233, 238, 246, 0.78);
    font-weight: 650;
    letter-spacing: 0.2px;
}

.divider {
    margin: 16px 0 18px;
    height: 1px;
    background: rgba(233, 238, 246, 0.10);
    width: 100%;
    max-width: 520px;
}

.flavor {
    margin: 0 0 12px;
    padding: 14px 14px;
    border: 1px dashed rgba(233, 238, 246, 0.16);
    border-radius: 14px;
    color: rgba(233, 238, 246, 0.86);
    font-size: 16px;
    line-height: 1.35;
    background: rgba(255, 255, 255, 0.02);
    max-width: 520px;
}

.barBlock {
    padding: 12px 12px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(233, 238, 246, 0.10);
    margin-top: 10px;
}

.barRow {
    margin-bottom: 14px;
}

.barRow:last-child {
    margin-bottom: 0;
}

.barTop {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.barName {
    opacity: 0.78;
    font-weight: 700;
}

.barPct {
    opacity: 0.72;
    font-weight: 650;
    font-size: 13px;
}

.barTrack {
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(233, 238, 246, 0.10);
    overflow: hidden;
}

.barFill {
    height: 100%;
    border-radius: 999px;
    width: 0%;
}

.barFill.fault {
    background: rgba(251, 113, 133, 0.55);
}

.barFill.friction {
    background: rgba(125, 211, 252, 0.55);
}

.signalsTitle {
    margin-top: 16px;
    font-weight: 800;
    opacity: 0.75;
    letter-spacing: 0.2px;
}

.signalsList .reason {
    display: inline-flex;
    margin-top: 8px;
}

.shareActions {
    margin-top: 14px;
}

.shareFooter {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid rgba(233, 238, 246, 0.10);
    opacity: 0.62;
    font-size: 12px;
}

.shareFooter .site {
    white-space: nowrap;
}

/* Site footer main page */
.footer {
    margin-top: 24px;
    text-align: center;
}

.hero {
    position: relative;
    margin: 10px 0 16px;
}

.helpBtn {
    position: absolute;
    top: 4px;
    right: 4px;
}

.footer .sep {
    margin: 0 6px;
    opacity: 0.4;
}

.footlink {
    color: rgba(233, 238, 246, 0.55);
    text-decoration: none;
}

.footlink:hover {
    color: rgba(233, 238, 246, 0.85);
    text-decoration: underline;
}

.verdictRow {
    margin-top: 6px;
    margin-bottom: 10px;
}

.verdictBadge {
    font-size: 13px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
}

.sharePctRow {
    align-items: baseline;
}

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

.iconBtn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(233, 238, 246, 0.78);
    cursor: pointer;
    flex: 0 0 auto;
    font-weight: 800;
    line-height: 1;
}

.iconBtn:hover {
    border-color: rgba(233, 238, 246, 0.25);
    color: rgba(233, 238, 246, 0.92);
}

.helpPanel {
    max-width: 560px;
    overflow-y: auto;
}

.helpBody {
    margin-top: 10px;

}

.helpCallout {
    margin: 14px 0 10px;
    padding: 12px 12px;
    border: 1px dashed rgba(233, 238, 246, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
}

.helpCalloutTitle {
    font-weight: 800;
    letter-spacing: 0.2px;
    color: rgba(233, 238, 246, 0.92);
}

.helpLinks {
    margin-top: 10px;
    text-align: center;
}