/* CrypToldYouSo — dark theme, orange accent */

:root {
    --orange: #f7931a;
    --orange-dim: rgba(247, 147, 26, 0.15);
    --orange-glow: rgba(247, 147, 26, 0.45);
    --bg-deep: #07080c;
    --bg-card: rgba(18, 21, 28, 0.72);
    --bg-card-solid: #12151c;
    --border: rgba(255, 255, 255, 0.08);
    --text: #e8eaef;
    --text-muted: #8b919d;
    --success: #3dd68c;
    --danger: #ff6b6b;
    --radius: 16px;
    --radius-sm: 10px;
    --font-sans: "DM Sans", system-ui, sans-serif;
    --font-display: "Outfit", var(--font-sans);
    --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.55);
    --transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    color-scheme: dark;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100dvh;
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg-deep);
    line-height: 1.6;
    overflow-x: hidden;
}

.bg-orbs {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(247, 147, 26, 0.22), transparent 55%),
        radial-gradient(ellipse 60% 40% at 100% 50%, rgba(247, 147, 26, 0.06), transparent 50%),
        radial-gradient(ellipse 50% 40% at 0% 80%, rgba(120, 80, 200, 0.08), transparent 45%),
        linear-gradient(180deg, #0a0c10 0%, var(--bg-deep) 45%, #050608 100%);
}

/* Header & nav */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem max(1.25rem, env(safe-area-inset-right)) 0.85rem max(1.25rem, env(safe-area-inset-left));
    max-width: 1100px;
    margin: 0 auto;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(7, 8, 12, 0.75);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    transition: color var(--transition);
}

.brand:hover {
    color: var(--orange);
}

.brand:hover .brand__tld {
    color: var(--text-muted);
}

.brand__text {
    display: inline-flex;
    align-items: baseline;
}

.brand__tld {
    color: var(--text-muted);
    font-weight: 600;
}

.brand__logo {
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    object-fit: contain;
    display: block;
}

.site-nav {
    display: none;
    gap: 0.35rem;
}

@media (min-width: 768px) {
    .site-nav {
        display: flex;
    }
    .nav-toggle {
        display: none;
    }
}

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: background var(--transition), color var(--transition);
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.nav-link--active {
    color: var(--orange) !important;
    background: var(--orange-dim) !important;
}

.nav-drawer__link.nav-link--active {
    border: 1px solid rgba(247, 147, 26, 0.35);
}

.nav-toggle {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition);
}

.nav-toggle:hover {
    border-color: var(--orange);
    color: var(--orange);
}

.nav-drawer {
    position: fixed;
    inset: 0 0 auto 0;
    top: 57px;
    z-index: 40;
    padding: 1rem max(1rem, env(safe-area-inset-right)) 1rem max(1rem, env(safe-area-inset-left));
    background: rgba(7, 8, 12, 0.96);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: drawerIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes drawerIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-drawer[hidden] {
    display: none !important;
}

.nav-drawer__link {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.04);
}

.nav-drawer__link:hover {
    background: var(--orange-dim);
    color: var(--orange);
}

/* Main shell & views */
.main-shell {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 1.25rem max(1.25rem, env(safe-area-inset-right)) calc(3rem + env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
}

.view {
    animation: viewIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
    min-width: 0;
    max-width: 100%;
}

.view[hidden] {
    display: none !important;
}

@keyframes viewIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero {
    text-align: center;
    margin-bottom: 1.75rem;
    padding: 0.5rem 0 1rem;
}

.hero--compact {
    margin-bottom: 1.25rem;
    padding-bottom: 0.25rem;
}

.hero__title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.75rem, 5vw, 2.35rem);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0 0 0.5rem;
    background: linear-gradient(135deg, #fff 0%, #c8cdd8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero__subtitle {
    margin: 0 auto;
    max-width: 36rem;
    color: var(--text-muted);
    font-size: 1rem;
}

/* Cards */
.card {
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    background: var(--bg-card-solid);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.card--glass {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Results layout: context pills → unified panel → actions (outside panel) */
.results-area[hidden] {
    display: none !important;
}

.results-area {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    margin-top: 1.25rem;
    width: 100%;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

/* Shared recipient link (#… with creator flag 1): minimal chrome, vertically centered stack */
body.recipient-share-view {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

body.recipient-share-view .site-header,
body.recipient-share-view #site-nav-drawer,
body.recipient-share-view .site-footer {
    display: none !important;
}

body.recipient-share-view .main-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: clamp(1rem, 4dvh, 2rem);
    padding-bottom: clamp(1rem, 4dvh, 2rem);
    min-height: 0;
}

body.recipient-share-view #view-create {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}

body.recipient-share-view #view-create .hero,
body.recipient-share-view #view-create #calculator-form {
    display: none !important;
}

body.recipient-share-view .results-area {
    margin-top: 0;
    margin-bottom: 0;
}

body.recipient-share-view .result-actions {
    justify-content: center;
    flex-wrap: nowrap;
}

body.recipient-share-view #calculate-again {
    display: none !important;
}

body.recipient-share-view .result-actions .btn {
    width: 100%;
    max-width: 320px;
}

.result-context-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
}

.result-context-stack[hidden] {
    display: none !important;
}

.result-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0;
    max-width: 100%;
    text-align: center;
    line-height: 1.35;
}

.result-pill[hidden] {
    display: none !important;
}

/* Match .cryptoldyouso-panel shell; primary type matches .result-kicker + .result-kicker--dyk (“Did you know?”). */
.result-pill--primary {
    align-self: stretch;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    padding: 1.15rem 1.35rem;
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    line-height: 1.35;
    color: var(--orange);
    background: var(--bg-card);
    border: 1px solid rgba(247, 147, 26, 0.28);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 0 0 1px rgba(247, 147, 26, 0.06),
        0 20px 50px rgba(0, 0, 0, 0.45);
    cursor: default;
    user-select: none;
}

.result-pill--secondary {
    align-self: stretch;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    padding: 1rem 1.35rem;
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.55;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid rgba(247, 147, 26, 0.28);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 0 0 1px rgba(247, 147, 26, 0.06),
        0 20px 50px rgba(0, 0, 0, 0.45);
    cursor: default;
    user-select: none;
}

.result-pill--secondary strong {
    color: var(--text);
    font-weight: 700;
}

.cryptoldyouso-panel {
    border-radius: var(--radius);
    padding: 0;
    border: 1px solid rgba(247, 147, 26, 0.28);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 0 0 1px rgba(247, 147, 26, 0.06),
        0 20px 50px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.cryptoldyouso-panel__body {
    padding: 1.5rem 1.35rem 1.65rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
}

@media (min-width: 480px) {
    .cryptoldyouso-panel__body {
        padding: 1.75rem 1.75rem 1.85rem;
    }
}

.card-reveal {
    animation: cardReveal 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardReveal {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.result-pop {
    animation: resultPulse 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes resultPulse {
    0% {
        box-shadow: 0 0 0 0 var(--orange-glow);
    }
    100% {
        box-shadow: 0 0 0 0 transparent;
    }
}

.result-pop-child {
    animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.result-pop-child:nth-child(2) {
    animation-delay: 0.06s;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form */
.form-stack {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.form-group {
    margin-bottom: 1.1rem;
    min-width: 0;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-group label i {
    color: var(--orange);
    width: 1.1rem;
    text-align: center;
}

.label-with-badge {
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem 0.75rem;
    width: 100%;
}

.label-with-badge__text {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-muted);
}

.label-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--orange-dim), rgba(247, 147, 26, 0.25));
    border: 1px solid rgba(247, 147, 26, 0.5);
    color: var(--orange);
    box-shadow: 0 0 20px rgba(247, 147, 26, 0.12);
}

.label-badge i {
    width: auto;
    font-size: 0.6rem;
    opacity: 0.95;
    filter: drop-shadow(0 0 6px rgba(247, 147, 26, 0.5));
}

.optional {
    font-weight: 400;
    opacity: 0.7;
    font-size: 0.8rem;
}

input,
select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
    box-sizing: border-box;
}

/* WebKit / mobile: native date & time controls use a large intrinsic min-width */
input[type="date"],
input[type="datetime-local"],
input[type="time"] {
    min-width: 0;
    max-width: 100%;
}

/**
 * iOS Safari (and some WebKit): the date field’s shadow UI can paint wider than
 * the box. A shell with overflow:hidden + flex + ::-webkit-datetime-edit rules
 * keeps the control inside the card.
 */
.field-date-shell {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.35);
    color-scheme: dark;
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.field-date-shell:focus-within {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px var(--orange-dim);
}

.field-date-shell input[type="date"] {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    padding: 0.85rem 0.65rem 0.85rem 0.85rem;
    line-height: 1.25;
}

.field-date-shell input[type="date"]:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

/* WebKit: keep the inline date text within the (shrunk) input width */
.field-date-shell input[type="date"]::-webkit-datetime-edit {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    padding: 0;
}

.field-date-shell input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    min-width: 0;
    max-width: 100%;
}

.field-date-shell input[type="date"]::-webkit-date-and-time-value {
    text-align: left;
}

.field-date-shell input[type="date"]::-webkit-calendar-picker-indicator {
    flex-shrink: 0;
    margin-left: 0.15rem;
    opacity: 0.9;
    cursor: pointer;
}

input {
    background: rgba(0, 0, 0, 0.35);
}

select {
    background-color: var(--bg-card-solid);
    color-scheme: dark;
    cursor: pointer;
}

select option,
select optgroup {
    background-color: var(--bg-card-solid);
    color: var(--text);
}

select option:disabled {
    color: var(--text-muted);
    opacity: 0.55;
}

#cryptocurrency option:disabled {
    font-style: italic;
    opacity: 0.5;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px var(--orange-dim);
}

/* Amount + currency: one outer ring (avoids clipped shadow / missing border at the seam) */
.input-with-select {
    display: flex;
    align-items: stretch;
    min-width: 0;
    max-width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.35);
    color-scheme: dark;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.input-with-select:focus-within {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px var(--orange-dim);
}

.input-with-select input {
    flex: 1 1 0;
    min-width: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    border-right: 1px solid var(--border);
}

.input-with-select select {
    width: 5.5rem;
    flex-shrink: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background-color: transparent;
}

.input-with-select input:focus,
.input-with-select select:focus {
    outline: none;
    border-color: var(--border);
    box-shadow: none;
}

.input-with-select input:focus {
    border-right-color: var(--border);
}

@media (max-width: 480px) {
    .input-with-select {
        flex-direction: column;
    }

    .input-with-select input {
        border-right: none;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
    }

    .input-with-select input:focus {
        border-bottom-color: var(--border);
    }

    .input-with-select select {
        width: 100%;
        border-radius: 0;
    }
}

/* Personalise toggle */
.personalise-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-button {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    color: var(--text-muted);
    transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.toggle-button span:nth-of-type(1) {
    flex: 1;
    text-align: left;
    font-weight: 500;
    color: var(--text);
}

.toggle-icon {
    transition: transform var(--transition);
    color: var(--text-muted);
}

.toggle-state {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

input:checked + .toggle-button {
    border-color: var(--orange);
    background: var(--orange-dim);
    color: var(--orange);
}

input:checked + .toggle-button .toggle-icon {
    transform: rotate(180deg);
    color: var(--orange);
}

input:checked + .toggle-button .toggle-state {
    background: var(--orange);
    color: #111;
}

.share-options-container {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0;
    padding-left: 0.5rem;
    border-left: 2px solid transparent;
    transition:
        max-height 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.35s ease,
        margin 0.35s ease,
        border-color 0.35s ease;
}

.share-options-container.visible {
    max-height: 560px;
    opacity: 1;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    border-left-color: var(--orange);
}

.custom-select {
    position: relative;
    min-width: 0;
    max-width: 100%;
}

.custom-select select {
    appearance: none;
    padding-right: 2.5rem;
}

.select-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.35rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
}

.btn i {
    font-size: 1rem;
}

.btn .btn-emoji {
    font-size: 1.05rem;
    line-height: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--orange) 0%, #e8850f 100%);
    color: #111;
    border-color: rgba(255, 255, 255, 0.12);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(247, 147, 26, 0.35);
}

.btn-glow:hover {
    box-shadow: 0 0 28px var(--orange-glow);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border-color: var(--border);
}

.btn-ghost:hover {
    border-color: var(--orange);
    color: var(--orange);
    transform: translateY(-2px);
}

.result-lead--personal {
    font-size: 1.08rem;
    text-align: center;
    line-height: 1.65;
    margin: 0;
}

.result-signoff-wrap {
    margin: 0.35rem 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.result-signoff {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.5rem, 5vw, 2rem);
    letter-spacing: -0.02em;
    color: var(--orange);
    text-align: center;
    text-shadow: 0 0 28px var(--orange-dim);
}

.result-signoff__logo {
    width: min(5.5rem, 28vw);
    height: auto;
    object-fit: contain;
    opacity: 0.98;
    filter: drop-shadow(0 4px 20px rgba(247, 147, 26, 0.25));
}

.result-signoff--subtle {
    font-size: clamp(1.15rem, 3.5vw, 1.5rem);
    opacity: 0.92;
}

.result-signoff-wrap--subtle .result-signoff__logo {
    width: min(4.25rem, 22vw);
    opacity: 0.9;
    filter: drop-shadow(0 2px 14px rgba(247, 147, 26, 0.18));
}

/* Results */
.result-content {
    text-align: center;
}

.cryptoldyouso-panel .result-card {
    text-align: center;
    margin-bottom: 0;
}

.result-kicker {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--orange);
    margin: 0 0 0.5rem;
}

.result-kicker i {
    margin-right: 0.35rem;
}

/* Higher specificity than .result-kicker alone — that rule would override .result-kicker--dyk font-size. */
.result-kicker.result-kicker--dyk {
    text-transform: none;
    letter-spacing: 0.02em;
    font-size: 1.05rem;
}

.result-lead {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
    line-height: 1.55;
}

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

.result-stats {
    padding: 1.15rem 1rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    margin-top: 0.15rem;
}

.result-stats__value {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 0.6rem + 8vw, 3.2rem);
    font-weight: 800;
    color: var(--orange);
    line-height: 1.08;
    text-shadow: 0 0 40px var(--orange-dim);
    white-space: nowrap;
}

.result-stats__pct {
    margin-top: clamp(0.35rem, 1.2vw, 0.5rem);
    font-size: clamp(0.78rem, 0.28rem + 2vw, 1.05rem);
    font-weight: 700;
    display: inline-block;
    padding: clamp(0.22rem, 0.5vw + 0.1rem, 0.32rem) clamp(0.5rem, 1.4vw + 0.25rem, 0.75rem);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    line-height: 1.25;
}

.result-stats__pct.positive {
    color: var(--success);
}

.result-stats__pct.negative {
    color: var(--danger);
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 0;
    padding-top: 0.15rem;
}

.result-error {
    padding: 1rem;
}

.result-error i {
    font-size: 2rem;
    color: var(--danger);
    margin-bottom: 0.5rem;
}

.result-error__title {
    font-family: var(--font-display);
    margin: 0 0 0.5rem;
}

/* Meme grid */
.meme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.meme-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 1.25rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    background: var(--bg-card);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
    animation: fadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(0.05s * var(--meme-stagger, 0));
}

.meme-card:hover {
    transform: translateY(-4px);
    border-color: rgba(247, 147, 26, 0.45);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.meme-card__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

.meme-card__meta {
    font-size: 0.8rem;
    color: var(--orange);
    font-weight: 600;
}

/* Meme article */
.meme-article {
    max-width: 720px;
    margin: 0 auto;
}

.meme-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    transition: color var(--transition);
}

.meme-back:hover {
    color: var(--orange);
}

/* Meme detail: same width/rhythm as calculator results */
.meme-detail-results-wrap {
    width: 100%;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.result-meme-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.25rem, 4vw, 1.65rem);
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 0 0 0.5rem;
    line-height: 1.25;
}

.result-meme-desc {
    font-size: 1.02rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.55;
}

.meme-article__title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    margin: 0 0 0.35rem;
    letter-spacing: -0.02em;
}

.meme-article__meta {
    color: var(--orange);
    font-weight: 600;
    margin: 0 0 1.25rem;
}

.meme-article__body p {
    color: var(--text-muted);
    margin: 0 0 1rem;
    line-height: 1.7;
}

.meme-article__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

/* Prose / about */
.prose p {
    color: var(--text-muted);
    margin: 0 0 1rem;
    line-height: 1.75;
}

.fine-print {
    font-size: 0.85rem;
    opacity: 0.85;
}

/* Footer */
.site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem max(1rem, env(safe-area-inset-right)) calc(2.5rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}

/* Notification */
.notification {
    position: fixed;
    bottom: max(1.25rem, env(safe-area-inset-bottom));
    right: max(1.25rem, env(safe-area-inset-right));
    left: auto;
    max-width: calc(100vw - max(1.25rem, env(safe-area-inset-left)) - max(1.25rem, env(safe-area-inset-right)));
    padding: 1rem 1.15rem;
    border-radius: var(--radius-sm);
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
    z-index: 100;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.notification-content i {
    color: var(--success);
    font-size: 1.2rem;
}

#notification-message {
    margin: 0;
    font-size: 0.95rem;
}

@media (max-width: 480px) {
    .result-actions .btn {
        width: 100%;
    }
    .meme-article__actions .btn {
        width: 100%;
    }
}

/* Full-screen boot loader (share links & meme deep links) */
body.app-loader-active {
    overflow: hidden;
}

.app-loader {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(7, 8, 12, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.app-loader--off {
    display: none;
}

/* Early share-link visits: visible before app.js (see index.html head script). */
html.app-boot-loading #app-loader {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.app-loader--visible {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.app-loader__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.35rem;
    text-align: center;
    max-width: 18rem;
}

.app-loader__ring {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    border: 3px solid rgba(247, 147, 26, 0.2);
    border-top-color: var(--orange);
    border-right-color: var(--orange);
    animation: appLoaderSpin 0.85s linear infinite;
    box-shadow: 0 0 32px rgba(247, 147, 26, 0.2);
}

.app-loader__label {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    line-height: 1.45;
}

@keyframes appLoaderSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-loader {
        transition-duration: 0.01ms;
    }

    .app-loader__ring {
        animation-duration: 1.4s;
    }
}
