:root {
    color-scheme: light;
    --bg: #eef5ef;
    --surface: rgba(255, 255, 255, 0.68);
    --surface-strong: rgba(255, 255, 255, 0.84);
    --surface-muted: rgba(237, 242, 232, 0.72);
    --glass: rgba(255, 255, 255, 0.58);
    --glass-strong: rgba(255, 255, 255, 0.74);
    --glass-border: rgba(255, 255, 255, 0.68);
    --text: #101513;
    --muted: #63716a;
    --border: rgba(17, 20, 18, 0.1);
    --accent: #111412;
    --accent-dark: #205b44;
    --accent-bright: #b7f34a;
    --cyan: #7ee7d4;
    --aqua: #c4fff3;
    --mint: #e7ffd2;
    --violet: #dcd2ff;
    --danger: #b42318;
    --success: #067647;
    --shadow: 0 24px 70px rgba(17, 20, 18, 0.14);
    --glass-shadow: 0 24px 70px rgba(17, 20, 18, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* ── Dark Mode ── */
[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0c1210;
    --surface: rgba(22, 32, 28, 0.78);
    --surface-strong: rgba(28, 40, 34, 0.88);
    --surface-muted: rgba(18, 26, 22, 0.72);
    --glass: rgba(22, 32, 28, 0.62);
    --glass-strong: rgba(28, 40, 34, 0.76);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text: #e8efe9;
    --muted: #8a9b92;
    --border: rgba(255, 255, 255, 0.08);
    --accent: #e8efe9;
    --accent-dark: #6bcca5;
    --accent-bright: #b7f34a;
    --cyan: #4fc4b0;
    --aqua: #2a7a6a;
    --mint: #3a5a2a;
    --violet: #5a4e8a;
    --danger: #f87171;
    --success: #34d399;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
    --glass-shadow: 0 24px 70px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 12% 8%, rgba(183, 243, 74, 0.38), transparent 30%),
        radial-gradient(circle at 88% 4%, rgba(126, 231, 212, 0.34), transparent 28%),
        radial-gradient(circle at 84% 78%, rgba(220, 210, 255, 0.42), transparent 26%),
        linear-gradient(135deg, #f5faee 0%, #eef7f4 44%, #f7f2ff 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] body {
    background:
        radial-gradient(circle at 12% 8%, rgba(183, 243, 74, 0.1), transparent 30%),
        radial-gradient(circle at 88% 4%, rgba(126, 231, 212, 0.08), transparent 28%),
        radial-gradient(circle at 84% 78%, rgba(90, 78, 138, 0.12), transparent 26%),
        linear-gradient(135deg, #0c1210 0%, #0e1614 44%, #100e18 100%);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.44);
    opacity: 0;
    transform: translateX(-100%);
    transition: opacity 180ms ease, transform 220ms ease;
    backdrop-filter: blur(12px);
}

[data-theme="dark"] body::after {
    background: rgba(0, 0, 0, 0.44);
}

body > *:not(.page-transition-loader) {
    transition: transform 180ms ease, opacity 180ms ease, filter 180ms ease;
}

body.is-leaving {
    cursor: progress;
}

body.is-leaving::after {
    opacity: 1;
    transform: translateX(0);
}

body.is-leaving > *:not(.page-transition-loader) {
    opacity: 0.78;
    transform: translateX(18px);
    filter: blur(1px);
}

.page-transition-loader {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.page-transition-loader span {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(16, 21, 19, 0.18);
    border-top-color: var(--accent-dark);
    border-radius: 50%;
    box-shadow: 0 16px 34px rgba(17, 20, 18, 0.18);
    animation: spin 700ms linear infinite;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, 0.24) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.42), transparent 72%);
    z-index: -1;
}

[data-theme="dark"] body::before {
    background:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

a {
    color: var(--accent-dark);
}

/* ── Dark mode overrides for components ── */
[data-theme="dark"] .page > h1:first-child,
[data-theme="dark"] .page-heading {
    border-color: rgba(255, 255, 255, 0.06);
    background: rgba(22, 32, 28, 0.52);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] .topbar {
    background: rgba(14, 22, 18, 0.72);
    border-bottom-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .nav a {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(22, 32, 28, 0.52);
    color: var(--text);
}

[data-theme="dark"] .nav a:hover {
    background: rgba(30, 44, 38, 0.78);
}

[data-theme="dark"] .card::before,
[data-theme="dark"] .panel::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01) 42%, rgba(255, 255, 255, 0.02));
    opacity: 0.6;
}

[data-theme="dark"] .grid .card:hover {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 28px 78px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .stat {
    background: rgba(255, 255, 255, 0.92);
    color: #0c1210;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(14, 22, 18, 0.62);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    outline-color: rgba(183, 243, 74, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] button,
[data-theme="dark"] .button {
    background: linear-gradient(135deg, #d8efd2, #b7f34a);
    color: #0c1210;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] button:hover,
[data-theme="dark"] .button:hover {
    background: linear-gradient(135deg, #e4f5de, #c8f86e);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] .button-secondary {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(22, 32, 28, 0.58);
    color: var(--text);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .button-secondary:hover {
    background: rgba(30, 44, 38, 0.78);
}

[data-theme="dark"] .button-danger {
    background: linear-gradient(135deg, #991b1b, #dc2626);
    box-shadow: 0 14px 28px rgba(153, 27, 27, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .button-danger:hover {
    background: linear-gradient(135deg, #7f1d1d, #b91c1c);
}

[data-theme="dark"] .alert-error {
    background: rgba(127, 29, 29, 0.32);
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.24);
}

[data-theme="dark"] .alert-success {
    background: rgba(6, 78, 59, 0.32);
    color: #6ee7b7;
    border-color: rgba(52, 211, 153, 0.24);
}

[data-theme="dark"] .table-wrap {
    border-color: rgba(255, 255, 255, 0.06);
    background: rgba(14, 22, 18, 0.36);
}

[data-theme="dark"] th {
    color: var(--muted);
    background: rgba(22, 32, 28, 0.42);
}

[data-theme="dark"] th,
[data-theme="dark"] td {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] tbody tr:hover {
    background: rgba(30, 44, 38, 0.38);
}

[data-theme="dark"] .badge {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(22, 32, 28, 0.58);
    color: var(--text);
}

[data-theme="dark"] .badge-active,
[data-theme="dark"] .badge-approved,
[data-theme="dark"] .badge-transferred {
    background: rgba(6, 78, 59, 0.36);
    color: #6ee7b7;
}

[data-theme="dark"] .badge-disabled,
[data-theme="dark"] .badge-rejected,
[data-theme="dark"] .badge-cancelled {
    background: rgba(127, 29, 29, 0.36);
    color: #fca5a5;
}

[data-theme="dark"] .badge-pending_setup,
[data-theme="dark"] .badge-pending {
    background: rgba(120, 53, 15, 0.36);
    color: #fcd34d;
}

[data-theme="dark"] .badge-none {
    background: rgba(40, 50, 46, 0.58);
    color: var(--muted);
}

[data-theme="dark"] .landing-brand,
[data-theme="dark"] .brand {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(22, 32, 28, 0.52);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] .eyebrow {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(22, 32, 28, 0.58);
    color: #6bcca5;
}

[data-theme="dark"] .landing-hero p {
    color: #8a9b92;
}

[data-theme="dark"] .landing-sections article {
    border-color: rgba(255, 255, 255, 0.06);
    background: rgba(22, 32, 28, 0.52);
    box-shadow: var(--glass-shadow);
}

[data-theme="dark"] .landing-sections span {
    color: #6bcca5;
}

[data-theme="dark"] .landing-sections p {
    color: #8a9b92;
}

[data-theme="dark"] .appearance-preview {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(14, 22, 18, 0.68);
}

[data-theme="dark"] .appearance-media-preview {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(14, 22, 18, 0.52);
}

[data-theme="dark"] .details-list div {
    border-top-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .page-transition-loader span {
    border-color: rgba(255, 255, 255, 0.12);
    border-top-color: #6bcca5;
}

[data-theme="dark"] .download-landing-icon {
    background: linear-gradient(135deg, rgba(183, 243, 74, 0.1), rgba(126, 231, 212, 0.08));
    border-color: rgba(183, 243, 74, 0.18);
    color: #6bcca5;
}

[data-theme="dark"] .statement-download-form select {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(22, 32, 28, 0.58);
    color: var(--text);
}

[data-theme="dark"] .landing {
    background:
        radial-gradient(circle at 11% 14%, rgba(183, 243, 74, 0.14), transparent 28%),
        radial-gradient(circle at 82% 8%, rgba(126, 231, 212, 0.1), transparent 30%),
        radial-gradient(circle at 74% 72%, rgba(90, 78, 138, 0.14), transparent 28%),
        linear-gradient(135deg, #0c1210 0%, #0e1614 44%, #100e18 100%);
}

[data-theme="dark"] .landing::before {
    background:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

.page {
    width: min(1040px, calc(100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    margin: 0 auto;
    padding: 32px 0;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

.page > h1:first-child,
.page-heading {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 20px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.38);
    box-shadow: 0 18px 44px rgba(17, 20, 18, 0.08);
    backdrop-filter: blur(20px) saturate(1.3);
}

.page > h1:first-child + .muted,
.page > h1:first-child + p {
    margin: 14px 20px 0;
}

.auth-page {
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    place-items: center;
    padding: 24px;
    padding-top: calc(24px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    padding-left: calc(24px + env(safe-area-inset-left, 0px));
    padding-right: calc(24px + env(safe-area-inset-right, 0px));
}

.panel {
    width: min(520px, 100%);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(24px) saturate(1.35);
    padding: 28px;
}

.panel-wide {
    width: min(760px, 100%);
}

.topbar {
    background: rgba(255, 255, 255, 0.54);
    border-bottom: 1px solid rgba(255, 255, 255, 0.66);
    box-shadow: 0 14px 42px rgba(17, 20, 18, 0.07);
    backdrop-filter: blur(24px) saturate(1.45);
    position: sticky;
    top: 0;
    z-index: 10;
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

.topbar-inner {
    width: min(1040px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    text-decoration: none;
    color: var(--text);
}

.brand-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.nav {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 14px;
}

.nav a {
    border: 1px solid rgba(17, 20, 18, 0.08);
    border-radius: 999px;
    padding: 7px 11px;
    background: rgba(255, 255, 255, 0.44);
    color: var(--text);
    text-decoration: none;
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.76);
}

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

h2 {
    margin: 0 0 16px;
    font-size: 20px;
}

p {
    margin: 0 0 16px;
}

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

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.two-column {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.card {
    position: relative;
    overflow: hidden;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 22px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(22px) saturate(1.35);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.page > .card + .card {
    margin-top: 22px;
}

.page > .grid + .card {
    margin-top: 22px;
}

.card::before,
.panel::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.08) 42%, rgba(255, 255, 255, 0.28));
    opacity: 0.85;
}

.card > *,
.panel > * {
    position: relative;
}

.grid .card {
    display: flex;
    flex-direction: column;
    min-height: 260px;
}

.grid .card .actions {
    margin-top: auto;
}

.grid .card:hover {
    border-color: rgba(255, 255, 255, 0.86);
    box-shadow: 0 28px 78px rgba(17, 20, 18, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.74);
    transform: translateY(-2px);
}

.stat {
    display: inline-flex;
    width: fit-content;
    margin-top: 8px;
    border-radius: 999px;
    padding: 4px 12px;
    background: rgba(17, 20, 18, 0.92);
    color: #ffffff;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.15;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(17, 20, 18, 0.1);
    border-radius: 12px;
    padding: 11px 13px;
    font: inherit;
    background: rgba(255, 255, 255, 0.62);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(12px);
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(183, 243, 74, 0.88);
    border-color: rgba(17, 20, 18, 0.24);
}

input,
select {
    min-height: 42px;
}

textarea {
    resize: vertical;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.check-row input {
    width: auto;
    min-height: auto;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border: 0;
    border-radius: 999px;
    padding: 9px 16px;
    background: linear-gradient(135deg, #101513, #27332e);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(17, 20, 18, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

button:hover,
.button:hover {
    background: linear-gradient(135deg, #1a241f, #2f6b4f);
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(17, 20, 18, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

button:disabled,
.button[aria-disabled="true"],
button.is-loading,
.button.is-loading {
    cursor: wait;
    opacity: 0.78;
    transform: none;
}

button.is-loading::after,
.button.is-loading::after {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.button-secondary {
    border: 1px solid rgba(255, 255, 255, 0.62);
    background: rgba(255, 255, 255, 0.58);
    color: var(--text);
    box-shadow: 0 10px 24px rgba(17, 20, 18, 0.08);
    backdrop-filter: blur(16px);
}

.button-secondary:hover {
    background: rgba(255, 255, 255, 0.82);
}

.button-danger {
    background: linear-gradient(135deg, #b42318, #d92d20);
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(180, 35, 24, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.button-danger:hover {
    background: linear-gradient(135deg, #912018, #b42318);
    box-shadow: 0 18px 34px rgba(180, 35, 24, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.alert {
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 16px;
    box-shadow: 0 14px 30px rgba(17, 20, 18, 0.08);
    backdrop-filter: blur(18px);
}

.alert-error {
    background: rgba(254, 243, 242, 0.76);
    color: var(--danger);
    border: 1px solid #fecdca;
}

.alert-success {
    background: rgba(236, 253, 243, 0.76);
    color: var(--success);
    border: 1px solid #abefc6;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

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

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.46);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.24);
    backdrop-filter: blur(12px);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    border-bottom: 1px solid rgba(17, 20, 18, 0.08);
    padding: 12px 10px;
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.28);
}

th:first-child {
    border-top-left-radius: 14px;
}

th:last-child {
    border-top-right-radius: 14px;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.32);
}

.table-actions {
    white-space: nowrap;
    text-align: right;
}

.table-actions a {
    margin-left: 10px;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.inline-form button {
    min-height: 34px;
    padding: 6px 10px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.54);
    background: rgba(255, 255, 255, 0.48);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    backdrop-filter: blur(10px);
}

.badge-active {
    background: rgba(236, 253, 243, 0.72);
    color: var(--success);
}

.badge-disabled {
    background: rgba(254, 243, 242, 0.72);
    color: var(--danger);
}

.badge-pending_setup {
    background: rgba(255, 250, 235, 0.72);
    color: #b54708;
}

.badge-pending {
    background: rgba(255, 250, 235, 0.72);
    color: #b54708;
}

.badge-none {
    background: rgba(242, 244, 247, 0.72);
    color: var(--muted);
}

.badge-approved {
    background: rgba(236, 253, 243, 0.72);
    color: var(--success);
}

.badge-transferred {
    background: rgba(236, 253, 243, 0.72);
    color: var(--success);
}

.badge-rejected,
.badge-cancelled {
    background: rgba(254, 243, 242, 0.72);
    color: var(--danger);
}

.details-list {
    display: grid;
    gap: 10px;
    margin: 16px 0 0;
}

.details-list div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.details-list dt {
    color: var(--muted);
    font-weight: 700;
}

.details-list dd {
    margin: 0;
    text-align: right;
}

.appearance-preview {
    width: 120px;
    max-height: 80px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(12px);
}

.appearance-media-preview {
    width: min(420px, 100%);
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.52);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(18px);
}

.appearance-media-preview img,
.appearance-media-preview video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.statement-download-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.statement-download-form select {
    width: auto;
    min-width: 140px;
    min-height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 999px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.58);
    box-shadow: 0 10px 24px rgba(17, 20, 18, 0.08);
    backdrop-filter: blur(16px);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

.statement-download-form select:focus {
    outline: 2px solid rgba(183, 243, 74, 0.88);
    border-color: rgba(17, 20, 18, 0.24);
}

.download-landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 50vh;
    padding: 48px 24px;
}

.download-landing h1 {
    font-size: 24px;
    margin-bottom: 6px;
}

.download-landing .muted {
    font-size: 15px;
    margin-bottom: 0;
}

.download-landing-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin-bottom: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(183, 243, 74, 0.22), rgba(126, 231, 212, 0.18));
    border: 1px solid rgba(183, 243, 74, 0.34);
    color: #2f6b4f;
    animation: download-bounce 1.6s ease-in-out infinite;
}

@keyframes download-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

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

@media (max-width: 560px) {
    .auth-actions {
        grid-template-columns: 1fr;
    }
}

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

.landing {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 11% 14%, rgba(183, 243, 74, 0.52), transparent 28%),
        radial-gradient(circle at 82% 8%, rgba(126, 231, 212, 0.42), transparent 30%),
        radial-gradient(circle at 74% 72%, rgba(220, 210, 255, 0.48), transparent 28%),
        linear-gradient(135deg, #f8fcef 0%, #f4fbf8 44%, #f8f3ff 100%);
    color: var(--text);
    overflow: hidden;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.landing::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, 0.38) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.24) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.42), transparent 70%);
}

.landing-nav {
    position: relative;
    z-index: 2;
    width: min(1180px, calc(100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 0;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

.landing-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 800;
    text-decoration: none;
}

.landing-brand,
.brand {
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 999px;
    padding: 7px 12px;
    background: rgba(255, 255, 255, 0.42);
    box-shadow: 0 12px 28px rgba(17, 20, 18, 0.07);
    backdrop-filter: blur(16px);
}

.landing-hero {
    width: min(1180px, calc(100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    margin: 0 auto;
    min-height: calc(100vh - 92px);
    min-height: calc(100dvh - 92px);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: 48px;
    align-items: center;
    padding: 28px 0 70px;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    position: relative;
    z-index: 1;
}

.landing-hero-copy {
    max-width: 720px;
}

.eyebrow {
    display: inline-flex;
    width: fit-content;
    margin: 0 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    padding: 7px 12px;
    background: rgba(255, 255, 255, 0.48);
    color: #315746;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 12px 30px rgba(17, 20, 18, 0.08);
    backdrop-filter: blur(14px);
}

.landing-hero h1 {
    margin: 0 0 18px;
    max-width: 760px;
    font-size: clamp(48px, 8vw, 92px);
    line-height: 0.94;
    letter-spacing: 0;
}

.landing-hero p {
    max-width: 620px;
    color: #4d5b54;
    font-size: 19px;
}

.landing-media-frame {
    position: relative;
    width: min(500px, 100%);
    justify-self: center;
    aspect-ratio: 4 / 5;
    overflow: visible;
    border: none;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    transform-style: preserve-3d;
    transform: perspective(800px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.landing-media-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    border-radius: 26px;
    background: radial-gradient(
        600px circle at var(--glare-x, 50%) var(--glare-y, 50%),
        rgba(255, 255, 255, 0.18),
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.35s ease;
}

.landing-media-frame.is-tilting::after {
    opacity: 1;
}

.landing-media-frame.is-tilting {
    /* no extra box-shadow since there's no container */
}

.landing-media-frame::before {
    content: none;
}

.landing-media {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 26px;
    object-fit: contain;
    background: transparent;
    filter: drop-shadow(0 24px 60px rgba(17, 20, 18, 0.14));
}

.landing-media-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    border-radius: 26px;
    background:
        linear-gradient(135deg, rgba(183, 243, 74, 0.74), rgba(126, 231, 212, 0.54)),
        rgba(255, 255, 255, 0.62);
    color: var(--text);
    font-size: 34px;
    font-weight: 900;
    text-align: center;
    padding: 24px;
}

.landing-sections {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 0 0 56px;
    position: relative;
    z-index: 1;
}

.landing-sections article {
    min-height: 220px;
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 20px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.48);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(22px) saturate(1.35);
}

.landing-sections span {
    display: inline-flex;
    margin-bottom: 28px;
    color: #2f6b4f;
    font-weight: 900;
}

.landing-sections h2 {
    font-size: 24px;
}

.landing-sections p {
    color: #52605a;
}

.landing-earth {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 80px;
}

.landing-earth canvas {
    display: block;
    width: min(520px, 100%);
    aspect-ratio: 1;
    filter: drop-shadow(0 0 60px rgba(47, 107, 79, 0.12));
}

.setup-steps {
    margin: 20px 0;
    padding-left: 20px;
}

@media (max-width: 640px) {
    .topbar-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 4px;
    }

    .nav::-webkit-scrollbar {
        display: none;
    }

    .nav a,
    .nav span {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .page-heading {
        flex-direction: column;
    }

    .panel {
        padding: 22px;
    }

    .stat {
        font-size: 24px;
    }

    .landing-hero h1 {
        font-size: 46px;
    }
}

@media (max-width: 860px) {
    .landing-hero {
        grid-template-columns: 1fr;
        min-height: calc(100vh - 92px);
        min-height: calc(100dvh - 92px);
        align-content: center;
    }

    .landing-sections {
        grid-template-columns: 1fr;
    }
}
