:root {
    color-scheme: dark;
    --void: #050b14;
    --navy: #07111f;
    --panel: rgba(13, 29, 50, 0.9);
    --panel-deep: rgba(7, 20, 35, 0.96);
    --line: #263f5f;
    --line-hot: #2ee6a6;
    --cyan: #68c7ff;
    --green: #2ee6a6;
    --amber: #ffc45b;
    --red: #ff6078;
    --text: #eef5ff;
    --muted: #91a4bf;
    --shadow: 0 26px 90px rgba(0, 0, 0, 0.55);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--void);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.valhalla-access-page {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 72% 18%, rgba(46, 230, 166, 0.11), transparent 29%),
        radial-gradient(circle at 19% 60%, rgba(56, 148, 255, 0.12), transparent 32%),
        linear-gradient(145deg, #040914 0%, #081727 52%, #050b14 100%);
}

.valhalla-access-page > * {
    transition: opacity 520ms ease, transform 620ms cubic-bezier(0.2, 0.75, 0.2, 1), filter 520ms ease;
}

.valhalla-access-page.access-exit > * {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(-14px) scale(1.015);
}

.network-policy-note {
    margin: 12px 0 0;
    padding: 11px 12px;
    color: #8fa4bf;
    border-left: 2px solid rgba(255, 196, 91, 0.58);
    background: rgba(255, 196, 91, 0.045);
    font-size: 10px;
    line-height: 1.55;
}

.valhalla-access-page::before {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    content: "";
    opacity: 0.28;
    background-image:
        linear-gradient(rgba(104, 199, 255, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(104, 199, 255, 0.055) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: linear-gradient(to bottom, black, transparent 90%);
}

.aurora {
    position: fixed;
    z-index: 0;
    width: 55vw;
    height: 42vh;
    pointer-events: none;
    opacity: 0.18;
    filter: blur(56px);
    border-radius: 50%;
    transform: rotate(-18deg);
}

.aurora-one {
    top: -22vh;
    left: 8vw;
    background: linear-gradient(100deg, transparent, var(--green), transparent);
    animation: aurora-drift 13s ease-in-out infinite alternate;
}

.aurora-two {
    right: -10vw;
    bottom: -18vh;
    background: linear-gradient(100deg, transparent, #2386ff, var(--amber), transparent);
    animation: aurora-drift 17s ease-in-out infinite alternate-reverse;
}

@keyframes aurora-drift {
    from { transform: translate3d(-4%, -2%, 0) rotate(-18deg) scale(0.95); }
    to { transform: translate3d(7%, 4%, 0) rotate(-10deg) scale(1.08); }
}

.gate-lines {
    position: fixed;
    inset: 12vh auto 0 5vw;
    z-index: 0;
    width: min(46vw, 760px);
    pointer-events: none;
    opacity: 0.4;
}

.gate-lines span {
    position: absolute;
    bottom: 0;
    left: calc(var(--gate-index, 0) * 11%);
    width: 2px;
    height: calc(44% + var(--gate-index, 0) * 9%);
    background: linear-gradient(to top, transparent, rgba(104, 199, 255, 0.6), transparent);
    transform: skewX(-23deg);
}

.gate-lines span:nth-child(1) { --gate-index: 0; }
.gate-lines span:nth-child(2) { --gate-index: 1; }
.gate-lines span:nth-child(3) { --gate-index: 2; }
.gate-lines span:nth-child(4) { --gate-index: 3; }
.gate-lines span:nth-child(5) { --gate-index: 4; }

.access-header,
.access-footer,
.access-shell,
.success-shell {
    position: relative;
    z-index: 2;
}

.access-header {
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: 76px;
    padding: 14px clamp(20px, 4vw, 68px);
    border-bottom: 1px solid rgba(104, 199, 255, 0.17);
    background: rgba(4, 11, 21, 0.58);
    backdrop-filter: blur(18px);
}

.valhalla-mark {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    color: var(--green);
    border: 1px solid rgba(46, 230, 166, 0.7);
    background: rgba(46, 230, 166, 0.07);
    text-decoration: none;
    font-size: 24px;
    font-weight: 950;
    line-height: 1;
    box-shadow: inset 0 0 18px rgba(46, 230, 166, 0.08), 0 0 24px rgba(46, 230, 166, 0.1);
    clip-path: polygon(14% 0, 86% 0, 100% 14%, 100% 86%, 86% 100%, 14% 100%, 0 86%, 0 14%);
}

.access-status {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.access-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 14px var(--green);
}

.support-link {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px;
    text-decoration: none;
}

.support-link strong {
    color: var(--cyan);
}

.access-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(420px, 0.82fr);
    align-items: center;
    gap: clamp(42px, 7vw, 120px);
    width: min(1380px, calc(100% - 40px));
    margin: 0 auto;
    padding: clamp(50px, 8vh, 108px) 0;
}

.hero-column {
    max-width: 760px;
}

.hero-kicker,
.panel-label {
    margin: 0 0 16px;
    color: var(--green);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.28em;
}

.hero-column h1,
.success-shell h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(62px, 8vw, 132px);
    font-weight: 950;
    letter-spacing: -0.075em;
    line-height: 0.78;
    text-transform: uppercase;
    text-shadow: 0 14px 45px rgba(0, 0, 0, 0.46);
}

.hero-column h1 span,
.success-shell h1 span {
    color: transparent;
    background: linear-gradient(102deg, var(--green), var(--cyan) 52%, var(--amber));
    background-clip: text;
    -webkit-background-clip: text;
}

.hero-copy {
    max-width: 620px;
    margin: 32px 0 0;
    color: #adbed3;
    font-size: clamp(15px, 1.4vw, 19px);
    line-height: 1.7;
}

.hero-readouts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    max-width: 650px;
    margin-top: 38px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.hero-readouts div {
    display: grid;
    gap: 7px;
    padding: 18px 20px 17px 0;
}

.hero-readouts div + div {
    padding-left: 20px;
    border-left: 1px solid var(--line);
}

.hero-readouts small,
.generated-code small,
.purchase-code small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.16em;
}

.hero-readouts strong {
    color: var(--text);
    font-size: 13px;
    letter-spacing: 0.05em;
}

.risk-note {
    max-width: 650px;
    margin: 18px 0 0;
    color: #70839e;
    font-size: 11px;
    line-height: 1.6;
}

.access-card {
    position: relative;
    min-height: 548px;
    padding: clamp(28px, 3vw, 44px);
    border: 1px solid rgba(104, 199, 255, 0.28);
    background:
        linear-gradient(145deg, rgba(18, 39, 64, 0.88), rgba(7, 19, 34, 0.96)),
        var(--panel);
    box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.03);
    clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 24px 100%, 0 calc(100% - 24px));
    backdrop-filter: blur(24px);
}

.access-card::after {
    position: absolute;
    inset: 8px;
    z-index: -1;
    content: "";
    border: 1px solid rgba(46, 230, 166, 0.08);
    pointer-events: none;
}

.card-crown {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.22em;
}

.card-crown i {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--line), transparent);
}

.access-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 32px;
    padding: 5px;
    border: 1px solid var(--line);
    background: rgba(3, 11, 21, 0.62);
}

.access-tab {
    min-height: 40px;
    padding: 8px 5px;
    color: #71859f;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.09em;
}

.access-tab:hover,
.access-tab:focus-visible {
    color: var(--text);
}

.access-tab.is-active {
    color: var(--green);
    background: rgba(46, 230, 166, 0.09);
    box-shadow: inset 0 -2px var(--green);
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
    animation: panel-enter 220ms ease-out;
}

@keyframes panel-enter {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-panel h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(25px, 2.4vw, 36px);
    line-height: 1.12;
    letter-spacing: -0.035em;
}

.tab-panel > p:not(.panel-label),
#admin-login-view > p:not(.panel-label),
#admin-generator-view > p:not(.panel-label) {
    margin: 11px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.access-form {
    display: grid;
    gap: 11px;
    margin-top: 28px;
}

.form-field-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.form-field-pair > div {
    display: grid;
    gap: 11px;
}

.compact-registration-form {
    gap: 9px;
    margin-top: 20px;
}

.compact-registration-form .terms-consent {
    margin-top: 2px;
}

.member-portal-page {
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.portal-title {
    display: block;
    margin-top: 5px;
    color: var(--text);
    font-size: 13px;
    letter-spacing: 0.12em;
}

.portal-header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.portal-header-actions button,
.portal-header-actions a,
.secondary-action {
    padding: 9px 12px;
    color: var(--cyan);
    border: 1px solid rgba(104, 199, 255, 0.35);
    background: rgba(104, 199, 255, 0.05);
    cursor: pointer;
    text-decoration: none;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.11em;
}

.member-portal-shell {
    position: relative;
    z-index: 2;
    width: min(1420px, calc(100% - 40px));
    margin: 0 auto;
    padding: 34px 0 52px;
}

.portal-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 28px;
    padding: 30px 34px;
    border: 1px solid rgba(104, 199, 255, 0.25);
    border-left: 3px solid var(--green);
    background: linear-gradient(120deg, rgba(17, 39, 64, 0.94), rgba(6, 19, 33, 0.96));
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
}

.portal-hero h1 {
    margin: 0;
    font-size: clamp(31px, 4vw, 58px);
    letter-spacing: -0.045em;
}

.portal-hero h1 span { color: var(--green); }
.portal-hero p:not(.hero-kicker) { margin: 11px 0 0; color: var(--muted); }

.portal-access-badge {
    display: grid;
    gap: 6px;
    min-width: 280px;
    padding: 18px 22px;
    border: 1px solid rgba(46, 230, 166, 0.48);
    background: rgba(46, 230, 166, 0.07);
}

.portal-access-badge.is-inactive { border-color: rgba(255, 196, 91, 0.45); background: rgba(255, 196, 91, 0.055); }
.portal-access-badge small { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: 0.16em; }
.portal-access-badge strong { color: var(--green); font-size: 17px; }
.portal-access-badge.is-inactive strong { color: var(--amber); }
.portal-access-badge span { color: #a8bad0; font-size: 12px; font-variant-numeric: tabular-nums; }

.portal-message { margin: 18px 0 0; }

.portal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.portal-card {
    position: relative;
    padding: 26px;
    border: 1px solid rgba(104, 199, 255, 0.22);
    background: linear-gradient(145deg, rgba(15, 35, 58, 0.94), rgba(6, 18, 32, 0.98));
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

.portal-card h2 { margin: 0; font-size: 24px; letter-spacing: -0.03em; }
.portal-card > p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.profile-monogram { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 18px; color: var(--green); border: 1px solid var(--green); background: rgba(46, 230, 166, 0.07); font-size: 30px; font-weight: 950; }
.profile-details { display: grid; gap: 0; margin: 22px 0 0; }
.profile-details div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 11px 0; border-top: 1px solid rgba(104, 199, 255, 0.14); }
.profile-details dt { color: #7086a1; font-size: 8px; font-weight: 900; letter-spacing: 0.14em; }
.profile-details dd { margin: 0; color: var(--text); font-size: 12px; overflow-wrap: anywhere; }

.portal-launch { display: flex; margin-top: 26px; text-decoration: none; }
.portal-launch.disabled { opacity: 0.45; cursor: not-allowed; }
.portal-policy { margin-top: 14px; color: #6f829c; font-size: 9px; }
.discord-contact { display: block; margin: 22px 0; color: var(--cyan); font-size: 16px; font-weight: 900; text-decoration: none; }
.discord-contact:hover, .support-link:hover { color: var(--green); }
.support-card .secondary-action { display: inline-block; }
.purchase-section { margin-top: 16px; }
.purchase-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.purchase-heading p { color: var(--muted); font-size: 12px; }
.purchase-heading > span { padding: 8px 10px; color: var(--amber); border: 1px solid rgba(255, 196, 91, 0.35); font-size: 9px; font-weight: 900; }
.purchase-section .plan-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 20px; }
.portal-beta-action { margin-top: 20px; max-width: 460px; }
.discord-logo-link { display: inline-flex; align-items: center; gap: 8px; }
.discord-logo-link :is(img, .discord-mark) { width: 20px; height: 20px; flex: 0 0 auto; }
.discord-logo-link .discord-mark { display: block; fill: #56d8ff; }
.primary-action.discord-logo-link :is(img, .discord-mark) { filter: brightness(0) saturate(100%); }
.discord-logo-link.icon-only { min-width: 38px; justify-content: center; padding-inline: 9px; }
.discord-logo-link.icon-only :is(img, .discord-mark) { width: 21px; height: 21px; }

@media (max-width: 900px) {
    .portal-hero, .portal-grid { grid-template-columns: 1fr; }
    .portal-access-badge { min-width: 0; }
    .purchase-section .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .form-field-pair, .purchase-section .plan-grid { grid-template-columns: 1fr; }
    .portal-header-actions span { display: none; }
    .member-portal-shell { width: min(100% - 22px, 1420px); }
    .portal-hero, .portal-card { padding: 20px; }
}

@media print {
    body.protected-client-view > * {
        display: none !important;
    }

    body.protected-client-view {
        background: #fff !important;
    }
}

.access-form label {
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.18em;
}

.access-form input,
.access-form select {
    width: 100%;
    height: 56px;
    padding: 0 17px;
    color: var(--text);
    border: 1px solid #314c6d;
    border-radius: 0;
    outline: 0;
    background: rgba(3, 11, 21, 0.72);
    font-size: 15px;
    font-weight: 720;
    letter-spacing: 0.06em;
}

.access-form input:focus,
.access-form select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(46, 230, 166, 0.1), inset 0 0 24px rgba(46, 230, 166, 0.025);
}

.terms-consent {
    display: grid;
    grid-template-columns: 18px 1fr;
    align-items: start;
    gap: 10px;
    margin: 3px 0 7px;
    color: var(--muted) !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    line-height: 1.5;
}

.terms-consent input {
    width: 17px;
    height: 17px;
    margin: 0;
    padding: 0;
    accent-color: var(--green);
}

.terms-consent a {
    color: var(--amber);
    font-weight: 850;
    text-underline-offset: 3px;
}

.primary-action,
.secondary-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 56px;
    margin-top: 4px;
    padding: 0 18px;
    border: 1px solid var(--green);
    cursor: pointer;
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.12em;
    transition: transform 130ms ease, box-shadow 130ms ease, filter 130ms ease;
}

.primary-action {
    color: #04130e;
    background: linear-gradient(100deg, #2ee6a6, #63d8ff);
    box-shadow: 0 12px 28px rgba(46, 230, 166, 0.13);
}

.primary-action:hover:not(:disabled),
.primary-action:focus-visible:not(:disabled),
.secondary-action:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 15px 34px rgba(46, 230, 166, 0.22);
}

.primary-action:disabled,
.plan-button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.admin-action {
    border-color: var(--amber);
    background: linear-gradient(100deg, #ffc45b, #ffdd85);
}

.access-message {
    margin: -12px 0 22px;
    padding: 11px 13px;
    color: var(--amber);
    border: 1px solid rgba(255, 196, 91, 0.36);
    background: rgba(255, 196, 91, 0.07);
    font-size: 12px;
    line-height: 1.45;
}

.access-message.is-error {
    color: #ff8a9b;
    border-color: rgba(255, 96, 120, 0.4);
    background: rgba(255, 96, 120, 0.07);
}

.access-message.is-success {
    color: var(--green);
    border-color: rgba(46, 230, 166, 0.36);
    background: rgba(46, 230, 166, 0.07);
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
    margin-top: 24px;
}

.plan-card {
    display: grid;
    gap: 10px;
    min-height: 118px;
    padding: 16px;
    border: 1px solid var(--line);
    background: rgba(4, 13, 24, 0.63);
}

.plan-card:hover {
    border-color: rgba(104, 199, 255, 0.55);
}

.plan-card small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.14em;
}

.plan-card strong {
    color: var(--text);
    font-size: 18px;
}

.plan-button {
    min-height: 32px;
    color: var(--cyan);
    border: 1px solid rgba(104, 199, 255, 0.32);
    background: rgba(104, 199, 255, 0.06);
    cursor: pointer;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.plan-skeleton,
.payment-status {
    color: var(--muted);
    font-size: 11px;
}

.plan-skeleton {
    grid-column: 1 / -1;
    padding: 24px;
    border: 1px dashed var(--line);
    text-align: center;
}

.generated-code,
.purchase-code {
    display: grid;
    gap: 12px;
    margin-top: 22px;
    padding: 18px;
    border: 1px solid rgba(46, 230, 166, 0.48);
    background: rgba(46, 230, 166, 0.07);
}

.generated-code strong,
.purchase-code strong {
    overflow-wrap: anywhere;
    color: var(--green);
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: clamp(18px, 2vw, 28px);
    letter-spacing: 0.08em;
}

.generated-code button,
.admin-footer-actions button {
    color: var(--cyan);
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-align: left;
}

.admin-footer-actions {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.admin-footer-actions a {
    color: var(--green);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-decoration: none;
}

.access-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 17px clamp(20px, 4vw, 68px);
    color: #53677f;
    border-top: 1px solid rgba(104, 199, 255, 0.13);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.15em;
}

.success-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
}

.success-shell {
    width: min(760px, calc(100% - 36px));
    padding: clamp(42px, 7vw, 76px);
    border: 1px solid rgba(46, 230, 166, 0.38);
    background: var(--panel-deep);
    box-shadow: var(--shadow);
    text-align: center;
    clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 28px 100%, 0 calc(100% - 28px));
}

.success-mark {
    margin: 0 auto 28px;
}

.success-shell h1 {
    font-size: clamp(42px, 7vw, 72px);
    line-height: 0.92;
}

.success-copy {
    margin: 25px 0;
    color: var(--muted);
}

.purchase-code {
    margin: 28px auto 0;
    text-align: left;
}

.purchase-code p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.secondary-action {
    justify-content: center;
    color: var(--cyan);
    border-color: rgba(104, 199, 255, 0.45);
    background: rgba(104, 199, 255, 0.06);
}

.success-support {
    margin: 24px 0 0;
}

.terms-page {
    display: block;
    min-height: 100vh;
    padding: 34px 18px 72px;
}

.terms-shell {
    position: relative;
    z-index: 2;
    width: min(900px, 100%);
    margin: 0 auto;
    padding: clamp(28px, 5vw, 64px);
    border: 1px solid rgba(104, 199, 255, 0.28);
    background: rgba(7, 20, 35, 0.95);
    box-shadow: var(--shadow);
}

.terms-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.terms-header h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 52px);
    letter-spacing: -0.045em;
}

.terms-header p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.terms-content {
    color: #acbdd2;
    font-size: 14px;
    line-height: 1.72;
}

.terms-content h2 {
    margin: 34px 0 10px;
    color: var(--text);
    font-size: 18px;
    letter-spacing: -0.015em;
}

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

.terms-content a,
.terms-back {
    color: var(--green);
}

.admin-page {
    display: block;
    min-height: 100vh;
}

.admin-header {
    position: relative;
    z-index: 3;
}

.admin-header h1 {
    margin: 2px 0 0;
    font-size: 17px;
    letter-spacing: 0.015em;
}

.admin-kicker {
    color: var(--amber);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.2em;
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.admin-nav a,
.admin-nav button,
.ledger-heading button,
.admin-table button {
    min-height: 34px;
    padding: 0 13px;
    color: var(--cyan);
    border: 1px solid rgba(104, 199, 255, 0.3);
    background: rgba(104, 199, 255, 0.05);
    cursor: pointer;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.11em;
    text-decoration: none;
}

.admin-table td:last-child {
    display: flex;
    gap: 6px;
}

.admin-table td:last-child button {
    padding: 5px 7px;
    font-size: 8px;
    white-space: nowrap;
}

.admin-nav a {
    display: grid;
    place-items: center;
}

.admin-shell {
    position: relative;
    z-index: 2;
    width: min(1440px, calc(100% - 34px));
    margin: 0 auto;
    padding: 28px 0 70px;
}

.admin-status-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.admin-status-grid article {
    display: grid;
    gap: 8px;
    min-height: 92px;
    padding: 18px;
    border: 1px solid var(--line);
    background: rgba(8, 22, 39, 0.82);
}

.admin-status-grid small {
    color: var(--muted);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.16em;
}

.admin-status-grid strong {
    align-self: end;
    color: var(--text);
    font-size: 18px;
}

.admin-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
    gap: 12px;
    margin-top: 12px;
}

.admin-panel {
    padding: clamp(24px, 3vw, 38px);
    border: 1px solid rgba(104, 199, 255, 0.24);
    background: rgba(8, 22, 39, 0.9);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.25);
}

.admin-panel h2 {
    margin: 0;
    font-size: clamp(24px, 3vw, 35px);
    letter-spacing: -0.035em;
}

.admin-panel-copy {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.duration-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.duration-row > div {
    display: grid;
    gap: 11px;
}

.lifetime-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    color: var(--text) !important;
    border: 1px solid var(--line);
    background: rgba(3, 11, 21, 0.52);
    cursor: pointer;
}

.lifetime-toggle input {
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    accent-color: var(--amber);
}

.lifetime-toggle span {
    display: grid;
    gap: 3px;
}

.lifetime-toggle strong {
    color: var(--amber);
    font-size: 10px;
    letter-spacing: 0.12em;
}

.lifetime-toggle small {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0;
}

.duration-preview {
    margin: 0;
    color: var(--green);
    font-size: 11px;
    font-weight: 800;
}

.duration-preview.is-invalid {
    color: var(--red);
}

.generated-code > span {
    color: var(--muted);
    font-size: 11px;
}

.operational-panel h2 {
    margin-bottom: 23px;
}

.admin-checklist {
    display: grid;
    border-top: 1px solid var(--line);
}

.admin-checklist div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
}

.admin-checklist strong,
.status-good,
.status-warn,
.status-bad {
    font-size: 10px;
    letter-spacing: 0.08em;
}

.status-good {
    color: var(--green) !important;
}

.status-warn {
    color: var(--amber) !important;
}

.status-bad {
    color: var(--red) !important;
}

.admin-tool-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    margin-top: 25px;
}

.admin-tool-links a {
    display: grid;
    place-items: center;
    min-height: 43px;
    padding: 8px;
    color: var(--cyan);
    border: 1px solid rgba(104, 199, 255, 0.26);
    background: rgba(104, 199, 255, 0.04);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-align: center;
    text-decoration: none;
}

.code-ledger-panel {
    margin-top: 12px;
}

.precision-lab-panel {
    margin-top: 12px;
}

.precision-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 20px 0 12px;
}

.precision-summary-grid article {
    padding: 14px;
    border: 1px solid var(--line);
    background: rgba(4, 14, 27, 0.72);
}

.precision-summary-grid small,
.precision-summary-grid strong {
    display: block;
}

.precision-summary-grid small {
    color: #7287a4;
    font-size: 8px;
    letter-spacing: 0.12em;
}

.precision-summary-grid strong {
    margin-top: 7px;
    color: var(--cyan);
    font-size: 13px;
}

.precision-table-wrap {
    max-height: 250px;
}

.precision-table {
    min-width: 760px;
}

.ledger-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.ledger-heading .panel-label {
    display: block;
    margin-bottom: 7px;
}

.ledger-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.online-users-badge {
    min-width: 90px;
    padding: 9px 11px;
    color: #7287a4;
    border: 1px solid var(--line);
    background: rgba(4, 14, 27, 0.72);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-align: center;
}

.online-users-badge.has-online-users {
    color: var(--green);
    border-color: rgba(47, 226, 167, 0.42);
    box-shadow: 0 0 18px rgba(47, 226, 167, 0.08);
}

.presence-offline {
    color: #7287a4 !important;
}

.admin-table-wrap {
    overflow: auto;
    max-height: 430px;
    border: 1px solid var(--line);
}

.admin-table {
    width: 100%;
    min-width: 1050px;
    border-collapse: collapse;
    font-size: 11px;
}

.admin-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 12px 13px;
    color: #7890ad;
    border-bottom: 1px solid var(--line);
    background: #09182a;
    font-size: 8px;
    letter-spacing: 0.12em;
    text-align: left;
}

.admin-table td {
    padding: 12px 13px;
    color: #b4c3d7;
    border-bottom: 1px solid rgba(38, 63, 95, 0.68);
    white-space: nowrap;
}

.admin-table tr:hover td {
    background: rgba(104, 199, 255, 0.025);
}

.admin-table button {
    min-height: 28px;
    color: var(--red);
    border-color: rgba(255, 96, 120, 0.28);
}

@media (max-width: 960px) {
    .admin-status-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-main-grid {
        grid-template-columns: 1fr;
    }

    .precision-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .admin-header h1 {
        font-size: 13px;
    }

    .admin-nav a {
        display: none;
    }

    .admin-status-grid {
        grid-template-columns: 1fr;
    }

    .duration-row,
    .admin-tool-links {
        grid-template-columns: 1fr;
    }

    .precision-summary-grid {
        grid-template-columns: 1fr;
    }
}

.terms-content ul {
    padding-left: 21px;
}

.terms-notice {
    padding: 16px 18px;
    color: var(--amber);
    border: 1px solid rgba(255, 196, 91, 0.34);
    background: rgba(255, 196, 91, 0.06);
}

.terms-back {
    display: inline-block;
    margin-top: 34px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-decoration: none;
}

@media (max-width: 960px) {
    .access-shell {
        grid-template-columns: 1fr;
        width: min(720px, calc(100% - 34px));
        padding: 54px 0;
    }

    .hero-column {
        text-align: center;
    }

    .hero-copy,
    .hero-readouts,
    .risk-note {
        margin-right: auto;
        margin-left: auto;
    }

    .gate-lines {
        width: 90vw;
    }
}

@media (max-width: 600px) {
    .access-header {
        min-height: 66px;
        padding: 11px 16px;
    }

    .access-status {
        font-size: 8px;
        letter-spacing: 0.1em;
    }

    .access-header .support-link {
        display: inline-flex;
        width: 38px;
        min-width: 38px;
        height: 38px;
        padding: 0;
        justify-content: center;
        gap: 0;
        overflow: hidden;
        color: transparent;
        font-size: 0;
    }

    .access-header .support-link .discord-mark {
        width: 21px;
        height: 21px;
    }

    .hero-column h1 {
        font-size: clamp(55px, 21vw, 86px);
    }

    .hero-readouts {
        grid-template-columns: 1fr;
    }

    .hero-readouts div + div {
        padding-left: 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .access-card {
        min-height: 0;
        padding: 25px 20px 30px;
    }

    .access-tabs {
        grid-template-columns: 1fr;
    }

    .plan-grid {
        grid-template-columns: 1fr;
    }

    .access-footer {
        justify-content: center;
        flex-wrap: wrap;
    }
}

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

/* Phone-safe member gate and account portal. */
@media (max-width: 700px) {
    .member-portal-page .access-header {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 10px 12px;
        min-height: 0;
        padding: 12px;
    }

    .member-portal-page .portal-header-actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        margin-left: 0;
    }

    .member-portal-page .portal-header-actions button,
    .member-portal-page .portal-header-actions a {
        min-width: 0;
        text-align: center;
    }

    .member-portal-shell {
        width: calc(100% - 18px);
        padding: 18px 0 28px;
    }

    .portal-hero,
    .portal-grid,
    .purchase-section .plan-grid,
    .form-field-pair {
        grid-template-columns: minmax(0, 1fr);
    }

    .portal-hero,
    .portal-card {
        min-width: 0;
        padding: 18px;
    }

    .portal-hero h1 {
        overflow-wrap: anywhere;
        font-size: clamp(28px, 10vw, 43px);
        line-height: 1;
    }

    .portal-access-badge {
        min-width: 0;
        width: 100%;
    }

    .profile-details div {
        grid-template-columns: minmax(74px, 0.42fr) minmax(0, 1fr);
    }

    .purchase-heading,
    .access-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .purchase-heading {
        display: grid;
    }

    .access-footer {
        gap: 7px;
        text-align: center;
    }
}

@media (max-width: 420px) {
    .access-header {
        padding: 10px;
    }

    .access-shell {
        width: calc(100% - 18px);
        padding: 28px 0;
    }

    .access-card {
        padding: 20px 14px 24px;
    }

    .hero-column h1 {
        font-size: clamp(48px, 19vw, 70px);
    }

    .access-form input,
    .access-form select {
        min-width: 0;
        height: 52px;
    }

    .portal-card h2,
    .discord-contact {
        overflow-wrap: anywhere;
    }
}
