:root {
    color-scheme: dark;
    --bg: #070a12;
    --bg-soft: #0c1220;
    --page-bg:
        radial-gradient(circle at 18% 5%, rgba(77, 163, 255, 0.2), transparent 28rem),
        radial-gradient(circle at 82% 12%, rgba(79, 224, 163, 0.12), transparent 24rem),
        linear-gradient(145deg, #060811 0%, #101522 54%, #070a12 100%);
    --page-grid:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    --panel: rgba(18, 25, 42, 0.78);
    --panel-strong: rgba(20, 30, 52, 0.94);
    --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.045));
    --notice-bg: rgba(255, 255, 255, 0.06);
    --field-bg: rgba(3, 8, 18, 0.66);
    --field-focus-bg: rgba(3, 8, 18, 0.86);
    --button-bg: rgba(255, 255, 255, 0.07);
    --topbar-bg: rgba(5, 9, 18, 0.82);
    --mobile-nav-bg: rgba(7, 10, 18, 0.96);
    --hero-bg:
        linear-gradient(120deg, rgba(77, 163, 255, 0.18), rgba(95, 224, 255, 0.04)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.045));
    --hero-ring: rgba(95, 224, 255, 0.22);
    --game-card-bg: rgba(255, 255, 255, 0.05);
    --table-mobile-row-bg: rgba(255, 255, 255, 0.05);
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.18);
    --text: #f5f7fb;
    --muted: #aab4c4;
    --soft: #d7dce7;
    --blue: #4da3ff;
    --cyan: #5fe0ff;
    --green: #4fe0a3;
    --gold: #ffd166;
    --red: #ff6b7a;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
    --radius: 8px;
    --surface-pad: clamp(18px, 2vw, 24px);
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #f6f8fc;
    --bg-soft: #eaf0f7;
    --page-bg:
        radial-gradient(circle at 18% 5%, rgba(77, 163, 255, 0.15), transparent 28rem),
        radial-gradient(circle at 82% 12%, rgba(24, 170, 128, 0.1), transparent 24rem),
        linear-gradient(145deg, #f8fbff 0%, #edf3fa 54%, #fbfcff 100%);
    --page-grid:
        linear-gradient(rgba(8, 20, 38, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(8, 20, 38, 0.035) 1px, transparent 1px);
    --panel: rgba(255, 255, 255, 0.8);
    --panel-strong: rgba(255, 255, 255, 0.96);
    --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 250, 255, 0.78));
    --notice-bg: rgba(255, 255, 255, 0.78);
    --field-bg: rgba(255, 255, 255, 0.9);
    --field-focus-bg: rgba(255, 255, 255, 1);
    --button-bg: rgba(9, 18, 32, 0.055);
    --topbar-bg: rgba(250, 252, 255, 0.88);
    --mobile-nav-bg: rgba(255, 255, 255, 0.96);
    --hero-bg:
        linear-gradient(120deg, rgba(77, 163, 255, 0.16), rgba(24, 170, 128, 0.08)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 255, 0.78));
    --hero-ring: rgba(0, 119, 216, 0.18);
    --game-card-bg: rgba(255, 255, 255, 0.74);
    --table-mobile-row-bg: rgba(255, 255, 255, 0.8);
    --line: rgba(8, 20, 38, 0.12);
    --line-strong: rgba(8, 20, 38, 0.18);
    --text: #07111f;
    --muted: #566578;
    --soft: #172337;
    --blue: #176dce;
    --cyan: #0077d8;
    --green: #0b9b72;
    --gold: #9c6500;
    --red: #c83245;
    --shadow: 0 20px 60px rgba(27, 43, 68, 0.16);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: var(--page-grid);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
    font-size: 16px;
}

.ambient-shapes {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.ps-shape {
    position: absolute;
    opacity: 0.12;
    filter: drop-shadow(0 0 24px rgba(95, 224, 255, 0.4));
}

.ps-circle {
    width: 110px;
    height: 110px;
    border: 2px solid var(--cyan);
    border-radius: 50%;
    right: 8%;
    top: 18%;
}

.ps-square {
    width: 86px;
    height: 86px;
    border: 2px solid var(--green);
    left: 6%;
    bottom: 18%;
    transform: rotate(12deg);
}

.ps-triangle {
    width: 0;
    height: 0;
    border-left: 58px solid transparent;
    border-right: 58px solid transparent;
    border-bottom: 100px solid rgba(255, 209, 102, 0.38);
    left: 64%;
    bottom: 9%;
}

.ps-cross {
    width: 92px;
    height: 92px;
    right: 24%;
    top: 66%;
}

.ps-cross::before,
.ps-cross::after {
    content: "";
    position: absolute;
    left: 43px;
    top: 0;
    width: 6px;
    height: 92px;
    background: var(--red);
    border-radius: 999px;
}

.ps-cross::before {
    transform: rotate(45deg);
}

.ps-cross::after {
    transform: rotate(-45deg);
}

.auth-page,
.app-page {
    position: relative;
}

.auth-wrap {
    position: relative;
    z-index: 1;
    width: min(480px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    padding: 40px 0;
}

.auth-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
}

.brand-lockup.compact {
    min-width: max-content;
}

.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(77, 163, 255, 0.95), rgba(95, 224, 255, 0.72));
    color: #03111e;
    font-weight: 900;
    box-shadow: 0 16px 42px rgba(77, 163, 255, 0.28);
}

.brand-lockup strong {
    display: block;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
}

.brand-lockup small {
    display: block;
    color: var(--muted);
    font-size: 0.74rem;
    letter-spacing: 0.18em;
}

.auth-card,
.panel,
.stat-card,
.mini-card {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.auth-card {
    padding: 28px;
}

.auth-card h1,
.hero h1,
.section-title h2 {
    margin: 0;
    line-height: 1.05;
}

.auth-card h1 {
    font-size: clamp(2rem, 7vw, 3.6rem);
    max-width: 10ch;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--cyan);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 800;
}

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

.notice {
    position: relative;
    z-index: 2;
    padding: 13px 15px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--notice-bg);
}

.notice.success {
    border-color: rgba(79, 224, 163, 0.35);
    color: #c8ffe8;
}

.notice.error {
    border-color: rgba(255, 107, 122, 0.42);
    color: #ffd3d8;
}

html[data-theme="light"] .notice.success {
    color: #096044;
}

html[data-theme="light"] .notice.error {
    color: #a51f34;
}

.form-stack {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.panel.form-stack,
form.panel.form-stack {
    margin-top: 0;
}

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

.full {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--soft);
    font-weight: 700;
    font-size: 0.9rem;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--field-bg);
    color: var(--text);
    padding: 12px 13px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

textarea {
    min-height: 112px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(95, 224, 255, 0.62);
    box-shadow: 0 0 0 4px rgba(95, 224, 255, 0.12);
    background: var(--field-focus-bg);
}

.btn,
button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 11px 15px;
    min-height: 44px;
    color: var(--text);
    background: var(--button-bg);
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.form-actions .btn {
    width: auto;
    min-width: 0;
}

.panel.form-stack > .btn,
.panel .form-stack > .btn,
.form-stack > button.btn {
    justify-self: start;
    width: auto;
}

.btn:hover,
.icon-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(95, 224, 255, 0.42);
}

.btn-primary {
    background: linear-gradient(135deg, #4da3ff, #5fe0ff);
    color: #04111f;
    border-color: transparent;
    font-weight: 900;
}

.btn-danger {
    border-color: rgba(255, 107, 122, 0.35);
    color: #ffd3d8;
}

.btn-ghost {
    background: transparent;
}

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

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 9px 11px;
    color: var(--text);
    background: var(--button-bg);
    cursor: pointer;
    white-space: nowrap;
}

.theme-toggle:hover {
    border-color: rgba(95, 224, 255, 0.42);
}

.theme-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid currentColor;
    box-shadow: inset -5px -3px 0 currentColor;
    opacity: 0.9;
}

html[data-theme="light"] .theme-icon {
    box-shadow: inset 0 0 0 4px currentColor;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px clamp(16px, 3vw, 34px);
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: auto;
}

.main-nav a {
    color: var(--muted);
    padding: 9px 10px;
    border-radius: 7px;
    font-size: 0.9rem;
}

.main-nav a:hover {
    color: var(--text);
    background: var(--button-bg);
}

.main-nav a.is-active {
    color: var(--text);
    background: rgba(95, 224, 255, 0.12);
    border: 1px solid rgba(95, 224, 255, 0.22);
}

.logout-form {
    margin: 0;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--button-bg);
    color: var(--text);
    cursor: pointer;
}

.icon-exit {
    width: 16px;
    height: 16px;
    display: inline-block;
    border: 2px solid currentColor;
    border-left: 0;
    position: relative;
}

.icon-exit::before {
    content: "";
    position: absolute;
    top: 5px;
    left: -8px;
    width: 14px;
    height: 2px;
    background: currentColor;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    background: var(--button-bg);
    border-radius: var(--radius);
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    margin: 4px auto;
}

.page-wrap {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 22px;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 70px;
}

.page-wrap > * {
    min-width: 0;
}

.page-wrap > section,
.page-wrap > form.panel,
.page-wrap > .split,
.page-wrap > .grid,
.page-wrap > .table-wrap {
    margin-top: 0 !important;
}

.page-wrap > .hero {
    margin-bottom: 0;
}

.page-wrap > .section-title {
    margin-top: 0;
}

.page-wrap > section > .section-title:first-child {
    margin-top: 0;
}

.panel > .section-title:first-child {
    margin-top: 0;
}

.admin-mode .page-wrap {
    gap: 18px;
}

.admin-mode .hero {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
}

.admin-mode .hero-main {
    min-height: 220px;
}

.admin-mode .hero h1 {
    max-width: 14ch;
    font-size: clamp(2.1rem, 4vw, 4.2rem);
}

.admin-mode .section-title {
    margin: 0 0 14px;
    padding-inline: 2px;
}

.admin-mode .section-title h2 {
    max-width: none;
}

.admin-mode .panel,
.admin-mode .stat-card,
.admin-mode .mini-card {
    padding: clamp(16px, 1.8vw, 22px);
}

.admin-mode .mini-card {
    min-height: 0;
}

.admin-mode .grid {
    gap: 14px;
}

.admin-mode .data-table .btn {
    min-height: 36px;
    padding: 8px 11px;
}

.admin-mode .inline-form .btn,
.admin-mode .admin-actions .btn {
    min-height: 38px;
    padding: 8px 12px;
}

.admin-mode form.panel.form-grid {
    align-items: end;
}

.admin-mode .split {
    gap: 16px;
}

.member-dashboard {
    display: grid;
    gap: 22px;
}

.member-dashboard > section {
    margin: 0;
}

.content-section {
    scroll-margin-top: 96px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
    gap: 18px;
    align-items: stretch;
    margin-bottom: 18px;
}

.hero-main {
    min-height: 260px;
    border-radius: var(--radius);
    padding: var(--surface-pad);
    border: 1px solid var(--line);
    background: var(--hero-bg);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}

.hero-main::after {
    content: "";
    position: absolute;
    right: 36px;
    bottom: 28px;
    width: 150px;
    height: 150px;
    border: 1px solid var(--hero-ring);
    border-radius: 50%;
    box-shadow: inset 0 0 42px rgba(95, 224, 255, 0.08);
}

.hero h1 {
    font-size: clamp(2.3rem, 5vw, 5.4rem);
    max-width: 11ch;
}

.hero p {
    max-width: 58ch;
}

.panel {
    padding: var(--surface-pad);
}

.panel.tight {
    padding: 14px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
    margin: 30px 0 14px;
    padding-inline: 2px;
}

.member-dashboard .section-title {
    margin: 0 0 16px;
}

.section-title h2 {
    max-width: 18ch;
    font-size: clamp(1.45rem, 2.4vw, 2.25rem);
    letter-spacing: 0;
}

.grid {
    display: grid;
    gap: 14px;
}

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

.grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
    padding: var(--surface-pad);
}

.stats-grid {
    align-items: stretch;
}

.stat-card span {
    color: var(--muted);
    font-size: 0.86rem;
}

.stat-card strong {
    display: block;
    font-size: clamp(1.7rem, 4vw, 2.8rem);
    margin-top: 6px;
}

.mini-card {
    padding: var(--surface-pad);
    min-height: 156px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mini-card h3,
.panel h3 {
    margin: 0;
}

.mini-card p {
    margin: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    align-self: start;
    width: fit-content;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--soft);
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.78rem;
    font-weight: 800;
}

.benefit-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    align-items: stretch;
}

.benefit-card {
    justify-content: flex-start;
    gap: 12px;
}

.benefit-card h3 {
    font-size: 1.08rem;
    line-height: 1.18;
}

.benefit-card .muted {
    font-size: 0.96rem;
    line-height: 1.42;
}

.benefit-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 22px;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--cyan);
    background: transparent;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

html[data-theme="light"] .benefit-pill {
    color: #075da8;
    background: transparent;
    border-color: transparent;
}

.badge.ok {
    color: #c8ffe8;
    border-color: rgba(79, 224, 163, 0.32);
}

.badge.warn {
    color: #fff0c4;
    border-color: rgba(255, 209, 102, 0.38);
}

.badge.danger {
    color: #ffd3d8;
    border-color: rgba(255, 107, 122, 0.38);
}

html[data-theme="light"] .badge.ok {
    color: #08724f;
}

html[data-theme="light"] .badge.warn {
    color: #805000;
}

html[data-theme="light"] .badge.danger {
    color: #a51f34;
}

.progress {
    height: 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.hero .progress {
    margin-top: 10px;
}

.progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--green));
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.data-table th,
.data-table td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.inline-form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.stack-sm {
    display: grid;
    gap: 8px;
}

.stack-md {
    display: grid;
    gap: 14px;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.46fr);
    gap: 14px;
    align-items: start;
}

.member-dashboard .split {
    gap: 16px;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.55fr);
}

.aligned-split > .panel,
.aligned-split > form.panel,
.aligned-split > aside.panel {
    min-height: 100%;
}

.admin-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.game-option {
    position: relative;
    display: block;
}

.game-option input {
    position: absolute;
    left: 12px;
    top: 12px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.game-card {
    display: grid;
    align-content: start;
    gap: 10px;
    height: 100%;
    min-height: 118px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    background: var(--game-card-bg);
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.game-card h3 {
    margin: 0;
    line-height: 1.18;
    position: relative;
    z-index: 1;
}

.game-card .badge,
.game-card .muted {
    position: relative;
    z-index: 1;
}

.featured-offer {
    border-color: rgba(95, 224, 255, 0.28);
    box-shadow: 0 28px 90px rgba(77, 163, 255, 0.18);
}

.game-cover {
    display: block;
    height: 150px;
    margin: -14px -14px 14px;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--line);
}

.game-option input:checked + .game-card {
    border-color: rgba(95, 224, 255, 0.8);
    box-shadow: 0 0 0 4px rgba(95, 224, 255, 0.1);
}

.game-option input:focus-visible + .game-card {
    border-color: rgba(95, 224, 255, 0.82);
    box-shadow: 0 0 0 4px rgba(95, 224, 255, 0.14);
}

.game-option input:disabled + .game-card {
    cursor: default;
    opacity: 0.72;
}

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

.undo-timer {
    font-size: 0.86rem;
}

.vip-shop-panel h3 {
    margin: 10px 0 6px;
}

.renew-summary-card {
    align-content: start;
    gap: 18px;
}

.renew-summary-card h3 {
    margin-bottom: 10px;
}

.renew-summary-card .muted {
    margin: 0;
}

.promo-code-box {
    display: grid;
    gap: 6px;
    width: fit-content;
    min-width: min(100%, 280px);
    padding: 16px;
    border: 1px solid rgba(95, 224, 255, 0.24);
    border-radius: var(--radius);
    background: rgba(95, 224, 255, 0.08);
}

.promo-code-box span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.promo-code-box strong {
    font-size: clamp(1.5rem, 4vw, 2.3rem);
    letter-spacing: 0.02em;
}

.rules-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
}

.rules-list li {
    margin: 6px 0;
}

.clean-list {
    margin: 0;
    padding-left: 0;
    color: var(--muted);
    list-style: none;
}

.clean-list li {
    position: relative;
    margin: 7px 0;
    padding-left: 20px;
    line-height: 1.35;
}

.clean-list li::before {
    content: "";
    position: absolute;
    left: 1px;
    top: 0.65em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--blue);
    box-shadow: 0 0 0 4px rgba(77, 163, 255, 0.1);
}

.loyalty-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
}

.subtle-divider {
    height: 1px;
    background: var(--line);
    margin: 14px 0;
}

@media (max-width: 960px) {
    .hero,
    .split,
    .member-dashboard .split,
    .grid.cols-4,
    .grid.cols-3 {
        grid-template-columns: 1fr;
    }

    .grid.cols-2 {
        grid-template-columns: 1fr;
    }

    .nav-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        position: absolute;
        left: 16px;
        right: 16px;
        top: 76px;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--mobile-nav-bg);
        box-shadow: var(--shadow);
    }

    .main-nav.is-open {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topbar {
        gap: 10px;
    }

    .theme-toggle span[data-theme-label] {
        display: none;
    }
}

@media (max-width: 640px) {
    .auth-card {
        padding: 20px;
    }

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

    .page-wrap {
        width: min(100% - 24px, 1180px);
        padding-top: 18px;
    }

    .hero-main {
        min-height: auto;
        padding: 24px;
    }

    .hero h1 {
        font-size: 2.45rem;
    }

    .section-title {
        align-items: start;
        flex-direction: column;
        gap: 10px;
    }

    .section-title h2 {
        max-width: 100%;
        font-size: clamp(1.55rem, 9vw, 2.25rem);
    }

    .member-dashboard {
        gap: 18px;
    }

    .form-stack > button.btn,
    .form-actions .btn {
        width: 100%;
    }

    .brand-lockup.compact div {
        display: none;
    }

    .main-nav.is-open {
        grid-template-columns: 1fr;
    }

    .table-wrap {
        overflow: visible;
        border: 0;
    }

    .data-table {
        min-width: 0;
        display: block;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        margin-bottom: 12px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--table-mobile-row-bg);
        overflow: hidden;
    }

    .data-table td {
        border-bottom: 1px solid var(--line);
        padding: 11px 12px;
    }

    .data-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }
}
