:root {
    --bg: #f4f7fb;
    --bg-soft: #eef3ff;
    --card: rgba(255, 255, 255, 0.88);
    --card-strong: #ffffff;
    --text: #162033;
    --muted: #64748b;
    --line: rgba(148, 163, 184, 0.24);
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --brand-soft: rgba(37, 99, 235, 0.12);
    --accent: #8b5cf6;
    --accent-soft: rgba(139, 92, 246, 0.14);
    --success: #0f766e;
    --danger: #be123c;
    --shadow-sm: 0 12px 30px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.10);
    --radius-sm: 14px;
    --radius-md: 22px;
    --radius-lg: 30px;
}

* { 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;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 34%),
        radial-gradient(circle at top right, rgba(139, 92, 246, 0.14), transparent 26%),
        linear-gradient(180deg, #f8fbff 0%, #f4f7fb 40%, #eef3fb 100%);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: min(1180px, calc(100% - 1.5rem)); margin: 0 auto; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(248, 251, 255, 0.78);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}
.logo {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    font-size: clamp(1.25rem, 1.2rem + .3vw, 1.6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
}
.logo::before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.10);
}
.nav-toggle { display: none; }
.nav-toggle-label {
    display: none;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
    position: relative;
    transition: .25s ease;
}
.nav-toggle-label span::before,
.nav-toggle-label span::after {
    content: "";
    position: absolute;
    left: 0;
}
.nav-toggle-label span::before { top: -6px; }
.nav-toggle-label span::after { top: 6px; }
.nav {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
}
.nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: .65rem .95rem;
    border-radius: 999px;
    color: var(--text);
    font-weight: 600;
    transition: transform .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.nav a:hover {
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

main.container {
    padding-top: 1.5rem;
    padding-bottom: 2rem;
}
.site-footer {
    padding: 1rem 0 2.5rem;
    color: var(--muted);
    font-size: .96rem;
}

.stack > * + *, .stack-md > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: .75rem; }
.stack-lg > * + * { margin-top: 1.5rem; }
.stack-xl > * + * { margin-top: 2rem; }
.stack-xs > * + * { margin-top: .5rem; }
.grid { display: grid; gap: 1.1rem; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card,
.form-card,
.stat-card,
.page-header,
.hero-card {
    position: relative;
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(14px);
}
.card,
.form-card,
.stat-card { border-radius: var(--radius-md); padding: 1.35rem; }
.card.subtle { box-shadow: none; }
.page-header,
.hero-card {
    border-radius: var(--radius-lg);
    padding: 1.6rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.2rem;
    overflow: hidden;
}
.page-header::after,
.hero-card::after,
.hero::after {
    content: "";
    position: absolute;
    inset: auto -80px -80px auto;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.18), transparent 65%);
    pointer-events: none;
}
.page-header.compact { padding: 1.35rem; }
.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: clamp(1.5rem, 1.2rem + 1.6vw, 2.6rem);
    background:
        linear-gradient(135deg, rgba(22, 32, 51, 0.98), rgba(37, 99, 235, 0.92) 55%, rgba(139, 92, 246, 0.90));
    color: #fff;
    box-shadow: var(--shadow-lg);
}
.hero a { color: inherit; }
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, .9fr);
    gap: 1.5rem;
    align-items: end;
}
.hero-copy h1 {
    margin: .35rem 0 .9rem;
    font-size: clamp(2rem, 1.65rem + 2vw, 3.5rem);
    line-height: 1.02;
    letter-spacing: -0.05em;
}
.hero-copy p {
    margin: 0;
    max-width: 64ch;
    color: rgba(255, 255, 255, 0.84);
    font-size: clamp(1rem, .94rem + .25vw, 1.12rem);
}
.hero-panel {
    padding: 1.15rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.hero-panel .metric {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: .8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.hero-panel .metric:last-child { border-bottom: 0; }
.hero-panel strong {
    font-size: clamp(1.5rem, 1.15rem + 1vw, 2.1rem);
    letter-spacing: -0.04em;
}
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .8rem;
    font-weight: 800;
    color: var(--accent);
}
.hero .eyebrow { color: rgba(255,255,255,.78); }
.eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
}

.actions,
.inline-form,
.hero-actions,
.form-actions,
.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
}

.form-actions {
    margin-top: .5rem;
    padding-top: .25rem;
}
.button,
button,
.button-link,
.link-button {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    border-radius: 999px;
    min-height: 46px;
    padding: .85rem 1.15rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease;
}
.button,
button,
.button-link.primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.22);
}
.button:hover,
button:hover,
.button-link.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 36px rgba(37, 99, 235, 0.28);
}
.button-secondary,
.button-link,
.ghost {
    background: rgba(255, 255, 255, 0.78);
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: none;
}
.button-secondary:hover,
.button-link:not(.primary):hover,
.ghost:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,0.98);
}

.button-link.primary:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
}
.button-link.small,
.button-small { min-height: 38px; padding: .55rem .85rem; font-size: .9rem; }
.link-button {
    background: transparent;
    color: var(--brand);
    min-height: auto;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    font-weight: 600;
}
.button-danger,
.ghost.danger {
    color: #fff;
    background: linear-gradient(135deg, var(--danger), #e11d48);
    border-color: transparent;
}
.button-danger:hover,
.ghost.danger:hover { box-shadow: 0 16px 28px rgba(225, 29, 72, 0.22); }

label { display: flex; flex-direction: column; gap: .4rem; font-weight: 700; color: var(--text); }
input,
textarea,
select {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.30);
    border-radius: 16px;
    padding: .9rem 1rem;
    font: inherit;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
input:focus,
textarea:focus,
select:focus {
    outline: 0;
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    background: #fff;
}
textarea { min-height: 140px; resize: vertical; }
.checkbox-row { display: flex; flex-direction: row; align-items: center; gap: .65rem; }
.checkbox-row input { width: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.compact-grid { grid-template-columns: repeat(2, minmax(0, max-content)); }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.stat-card {
    gap: .6rem;
    overflow: hidden;
}
.stat-card::before {
    content: "";
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--brand-soft), var(--accent-soft));
}
.stat-card strong {
    margin-top: .15rem;
    font-size: clamp(1.9rem, 1.55rem + 1vw, 2.5rem);
    letter-spacing: -0.05em;
}
.stat-card span,
.card h2,
.page-header h1,
.hero h2,
.hero-card h1 { letter-spacing: -0.03em; }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.item-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .9rem;
}
.item-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0 0;
    border-top: 1px solid var(--line);
}
.item-list li:first-child { border-top: 0; padding-top: 0; }
.notifications li { align-items: flex-start; }
.list { margin: 0; padding-left: 1.15rem; }
.list.small { font-size: .92rem; }
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .36rem .65rem;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: .78rem;
    font-weight: 700;
}
.muted, .empty-state { color: var(--muted); }
.flash {
    border-radius: 20px;
    padding: .95rem 1.1rem;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
}
.flash-success { background: rgba(15, 118, 110, 0.10); color: var(--success); border-color: rgba(15, 118, 110, 0.18); }
.flash-error { background: rgba(190, 18, 60, 0.08); color: var(--danger); border-color: rgba(190, 18, 60, 0.16); }
.error-card { text-align: center; }
.gap-top { margin-top: .6rem; }
.table-card { overflow-x: auto; }
.table-card table,
.table { width: 100%; border-collapse: collapse; min-width: 720px; }
.table-card th,
.table-card td,
.table th,
.table td {
    padding: .95rem .75rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}
.users-table-card td,
.users-table-card th {
    vertical-align: middle;
}

.table-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: .65rem;
    align-items: stretch;
}

.table-actions form {
    margin: 0;
}

.table-actions .button-link,
.table-actions .ghost {
    width: 100%;
    justify-content: center;
    text-align: center;
    min-height: 40px;
}

.table-card th,
.table th {
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
}
code {
    background: rgba(15, 23, 42, 0.06);
    padding: .18rem .42rem;
    border-radius: 8px;
}
.narrow { max-width: 740px; }

.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.feature-card {
    border-radius: var(--radius-md);
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255,255,255,.72);
    box-shadow: var(--shadow-sm);
}
.feature-card strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand-soft), var(--accent-soft));
    margin-bottom: .8rem;
}
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .9rem;
}
.surface-accent {
    background: linear-gradient(180deg, rgba(255,255,255,.84), rgba(255,255,255,.72));
}

body.theme-alpine {
    --brand: #1d7a52;
    --brand-dark: #12533a;
    --brand-soft: rgba(29, 122, 82, 0.12);
    --accent: #d97706;
    --accent-soft: rgba(217, 119, 6, 0.14);
}
body.theme-dark {
    --bg: #09111f;
    --bg-soft: #0d1729;
    --card: rgba(12, 22, 37, 0.86);
    --card-strong: #0f1b30;
    --text: #ecf2ff;
    --muted: #9fb0c9;
    --line: rgba(148, 163, 184, 0.18);
    --brand: #60a5fa;
    --brand-dark: #3b82f6;
    --brand-soft: rgba(96, 165, 250, 0.16);
    --accent: #a78bfa;
    --accent-soft: rgba(167, 139, 250, 0.18);
    --success: #5eead4;
    --danger: #fb7185;
    --shadow-sm: 0 12px 30px rgba(2, 8, 23, 0.38);
    --shadow-lg: 0 24px 60px rgba(2, 8, 23, 0.54);
}
body.theme-dark .site-header { background: rgba(9, 17, 31, 0.72); }
body.theme-dark .hero { background: linear-gradient(135deg, rgba(7, 15, 28, 0.98), rgba(30, 64, 175, 0.95), rgba(91, 33, 182, 0.92)); }
body.theme-dark .button-secondary,
body.theme-dark .button-link,
body.theme-dark .ghost,
body.theme-dark .nav a:hover,
body.theme-dark input,
body.theme-dark textarea,
body.theme-dark select,
body.theme-dark .nav-toggle-label {
    background: rgba(15, 27, 48, 0.82);
    color: var(--text);
}
body.theme-dark code { background: rgba(255,255,255,.08); }

@media (max-width: 980px) {
    .hero-grid,
    .feature-grid,
    .stats-grid,
    .form-grid,
    .two-col,
    .cols-2,
    .cols-3,
    .cols-4 { grid-template-columns: 1fr; }
    .page-header,
    .hero-card { flex-direction: column; }
    .compact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .container { width: min(100% - 1rem, 1180px); }
    .header-inner { flex-wrap: wrap; }
    .nav-toggle-label { display: inline-flex; }
    .nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: .5rem;
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.92);
        border: 1px solid var(--line);
        box-shadow: var(--shadow-sm);
    }
    .nav a { width: 100%; justify-content: flex-start; border-radius: 14px; }
    .nav-toggle:checked + .nav-toggle-label span { background: transparent; }
    .nav-toggle:checked + .nav-toggle-label span::before { top: 0; transform: rotate(45deg); }
    .nav-toggle:checked + .nav-toggle-label span::after { top: 0; transform: rotate(-45deg); }
    .nav-toggle:checked ~ .nav { display: flex; }
    .hero,
    .page-header,
    .form-card,
    .card,
    .stat-card { padding: 1.15rem; }
    .hero-copy h1 { font-size: clamp(2rem, 1.7rem + 4vw, 2.7rem); }
    .button,
    button,
    .button-link,
    .button-secondary,
    .ghost { width: 100%; justify-content: center; }
    .actions,
    .hero-actions,
    .form-actions { width: 100%; }
    .item-list li { flex-direction: column; align-items: flex-start; }
    .table-card { margin: 0 -.2rem; }
}

.checkbox-option {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.checkbox-row input[type="checkbox"] {
    margin-top: 0.25rem;
}

.actions-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.section-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.selectable-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
}

.checkbox-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.checkbox-row input[type="checkbox"] {
    margin-top: 0.2rem;
}

.repeater-list {
    width: 100%;
}

.repeater-row {
    display: flex;
    align-items: end;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem;
    border: 1px dashed rgba(15, 23, 42, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.68);
}

.repeater-row > label {
    flex: 1 1 240px;
}

.repeater-row-block {
    display: block;
}

.info-list {
    display: grid;
    gap: 1rem;
}

.list-stack {
    display: grid;
    gap: 0.875rem;
}

.list-item {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.88);
}

.actions-inline {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 1rem;
}

.ghost.small,
.button-secondary.small {
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
}


.input-with-suffix {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
}

.input-with-suffix input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-with-suffix span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.25rem;
    padding: 0 1rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-left: 0;
    border-radius: 0 16px 16px 0;
    background: rgba(15, 23, 42, 0.06);
    color: var(--ink);
    font-weight: 700;
}
@media (max-width: 768px) {
    .section-title {
        flex-direction: column;
        align-items: stretch;
    }

    .repeater-row {
        align-items: stretch;
    }
}

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

.address-grid .address-street { grid-column: span 3; }
.address-grid .address-postal { grid-column: span 1; }
.address-grid .address-city { grid-column: span 2; }

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

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

    .address-grid .address-street,
    .address-grid .address-postal,
    .address-grid .address-city {
        grid-column: auto;
    }
}

.form-layout {
    display: grid;
    gap: 1.75rem;
}

.form-section {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 24px;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.form-section h2,
.form-section h3 {
    margin-bottom: 0.3rem;
}

.form-section > p.muted:first-of-type,
.section-description {
    margin-top: 0;
    margin-bottom: 1rem;
}

.field-grid-2,
.field-grid-3,
.toggle-grid {
    display: grid;
    gap: 1rem;
}

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

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

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

.field-span-2 {
    grid-column: span 2;
}

.form-note {
    border-left: 4px solid rgba(37, 99, 235, 0.45);
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: rgba(239, 246, 255, 0.75);
}

.auth-shell {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
}

.auth-shell + .auth-shell {
    margin-top: 1.5rem;
}

@media (max-width: 900px) {
    .field-grid-2,
    .field-grid-3,
    .toggle-grid {
        grid-template-columns: 1fr;
    }

    .field-span-2,
    .field-span-full {
        grid-column: auto;
    }
}

/* Uniform card and form spacing overrides */
.card.stack-xs,
.form-card.stack-xs { display: grid; gap: .5rem; }
.card.stack-sm,
.form-card.stack-sm { display: grid; gap: .75rem; }
.card.stack-md,
.form-card.stack-md { display: grid; gap: 1rem; }
.card.stack-lg,
.form-card.stack-lg { display: grid; gap: 1.5rem; }
.card.stack-xl,
.form-card.stack-xl { display: grid; gap: 2rem; }
.card.stack-xs > *,
.card.stack-sm > *,
.card.stack-md > *,
.card.stack-lg > *,
.card.stack-xl > *,
.form-card.stack-xs > *,
.form-card.stack-sm > *,
.form-card.stack-md > *,
.form-card.stack-lg > *,
.form-card.stack-xl > * { margin: 0; }

.form-layout,
.form-section,
.profile-game-form { display: grid; gap: 1.5rem; }
.form-section > div:first-child { margin: 0; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .875rem; margin-top: 1.5rem; padding-top: .25rem; }
.form-actions-spacious { margin-top: 2rem; }
.form-actions-inline-start,
.form-actions-inline-end { display: flex; align-items: center; gap: .875rem; }
.form-actions-inline-end { justify-content: flex-end; }

.field-grid-location {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(120px, .33fr) minmax(0, .67fr);
    gap: 1rem;
    align-items: end;
}

.three-col-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.status-hint-card {
    display: grid;
    gap: .5rem;
    padding: 1rem 1.1rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,.45);
}

.compact-list-card { min-height: 0; }
.dashboard-grid,
.stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 900px) {
    .field-grid-location,
    .three-col-grid,
    .dashboard-grid,
    .stats-grid { grid-template-columns: 1fr; }
}

/* Consistent grids and repeater spacing */
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid,
.field-grid-1,
.field-grid-2,
.field-grid-3,
.field-grid-location,
.toggle-grid,
.uniform-grid-gap {
    column-gap: 1rem;
    row-gap: 1rem;
}
.repeater-row-block {
    display: grid;
    gap: 1rem;
    align-items: stretch;
}
.repeater-row-block > .actions-inline,
.actions-inline-flush {
    margin-top: 0;
}
.profile-game-form .repeater-row,
.profile-game-form .repeater-row-block {
    width: 100%;
}
@media (max-width: 980px) {
    .form-grid.cols-2,
    .form-grid.cols-3,
    .form-grid.cols-4 { grid-template-columns: 1fr; }
}

/* Targeted layout fixes */
.page-toolbar { margin-bottom: 1rem; }
.admin-nav { margin-bottom: 1rem; }
.stat-card { display: grid; gap: .6rem; }
.stat-card span,
.stat-card strong,
.stat-card p { display: block; }
.stat-card::before { display: none; }
.installer-shell { max-width: 980px; padding-top: 2rem; padding-bottom: 2rem; }
.installer-hero,
.installer-card { max-width: 980px; margin-inline: auto; }
.setup-error-list { margin: .75rem 0 0 1.25rem; padding: 0; }
.guest-home-hero { margin-bottom: 1.5rem; }
.guest-home-grid { align-items: start; }
@media (max-width: 900px) {
  .guest-home-grid { grid-template-columns: 1fr; }
}


/* Guest home and auth page refinements */
.guest-home-hero {
    display: block;
}

.guest-home-hero .stack-md {
    max-width: 960px;
}

.guest-home-grid {
    align-items: start;
}

.auth-shell .form-actions {
    margin-top: 1.5rem;
}

@media (max-width: 900px) {
    .guest-home-grid {
        grid-template-columns: 1fr;
    }
}

/* === Unified redesign overrides === */
:root {
    --ink: #10233d;
    --ink-soft: #4e607a;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-strong: #ffffff;
    --surface-muted: rgba(241, 245, 251, 0.94);
    --surface-accent-bg: linear-gradient(180deg, rgba(237, 244, 255, 0.96) 0%, rgba(249, 251, 255, 0.98) 100%);
    --border: rgba(146, 168, 198, 0.26);
    --border-strong: rgba(122, 148, 183, 0.38);
    --shadow-soft: 0 18px 50px rgba(8, 28, 58, 0.08);
    --shadow-card: 0 12px 30px rgba(16, 35, 61, 0.08);
    --radius-sm: 14px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --space-1: 0.375rem;
    --space-2: 0.625rem;
    --space-3: 0.875rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-7: 1.875rem;
    --space-8: 2.25rem;
}

html { scroll-behavior: smooth; }
body {
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(53, 126, 221, 0.08), transparent 28%),
        radial-gradient(circle at top right, rgba(16, 201, 190, 0.08), transparent 22%),
        linear-gradient(180deg, #f4f8fd 0%, #eef3fa 100%);
}

body, input, textarea, select, button {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

h1, h2, h3, h4 { color: var(--ink); }
p { line-height: 1.62; }
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(18px);
    background: rgba(245, 249, 255, 0.84);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(10, 28, 52, 0.04);
}

.site-header .inner,
.page-shell,
.container {
    width: min(1180px, calc(100% - 2rem));
    margin-inline: auto;
}

.site-header .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
    min-height: 78px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--ink);
    text-decoration: none;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 10px 24px rgba(39, 95, 179, 0.26);
}

.site-nav,
.site-nav ul {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav a,
.site-nav button.nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink-soft);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.18s ease;
}

.site-nav a:hover,
.site-nav button.nav-button:hover,
.site-nav a.active,
.site-nav button.nav-button.active {
    color: var(--primary-dark);
    background: rgba(53, 126, 221, 0.1);
    border-color: rgba(53, 126, 221, 0.14);
}

.site-nav form { margin: 0; }

.page-shell {
    flex: 1;
    padding-block: 2rem 2.75rem;
}

.page-content,
.stack-xs,
.stack-sm,
.stack-md,
.stack-lg,
.stack-xl {
    display: grid;
}
.stack-xs { gap: var(--space-2); }
.stack-sm { gap: var(--space-3); }
.stack-md { gap: var(--space-4); }
.stack-lg { gap: var(--space-6); }
.stack-xl { gap: var(--space-8); }
.page-content { gap: var(--space-7); }

.page-header,
.hero-card,
.card,
.form-card,
.table-card,
.section-block,
.intro-card,
.surface-accent,
.status-hint-card,
.card-stack-md > * {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

.page-header,
.hero-card,
.card,
.form-card,
.table-card,
.section-block,
.intro-card {
    padding: clamp(1.2rem, 2vw, 1.8rem);
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-6);
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(246,250,255,0.98) 100%);
}

.page-header.compact {
    padding-block: 1.1rem;
}

.page-header h1,
.hero-card h1 {
    margin: 0;
    font-size: clamp(1.65rem, 3vw, 2.45rem);
    line-height: 1.14;
}

.page-header p:last-child,
.hero-card p:last-child {
    margin-bottom: 0;
}

.page-header .actions,
.page-toolbar,
.hero-actions,
.form-actions,
.inline-actions,
.actions-inline,
.actions-inline-flush {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.eyebrow,
.kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.45rem;
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.muted,
.section-description,
.form-note,
.empty-state,
.hint {
    color: var(--ink-soft);
}

.card-grid,
.card-grid-2,
.dashboard-grid,
.stats-grid,
.split-grid,
.two-col,
.uniform-grid-gap,
.toggle-grid,
.repeater-list,
.selection-grid,
.vote-grid,
.info-list,
.address-grid {
    display: grid;
    gap: var(--space-5);
}

.card-grid,
.card-grid-2,
.split-grid,
.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-grid,
.stats-grid,
.three-col-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-5);
}

.field-grid-1,
.field-grid-2,
.field-grid-3,
.field-grid-location,
.form-layout,
.form-section {
    display: grid;
    gap: var(--space-5);
}

.field-grid-1 { grid-template-columns: minmax(0, 1fr); }
.field-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-grid-location {
    grid-template-columns: minmax(0, 1.45fr) minmax(7rem, 0.65fr) minmax(0, 1.35fr);
}

.field-span-full { grid-column: 1 / -1; }
.field-span-2 { grid-column: span 2; }
.address-street { grid-column: span 2; }
.address-postal, .address-city { grid-column: span 1; }

.form-card,
.form-layout,
.form-section {
    width: 100%;
}

.form-section {
    padding: 1.2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.62);
}

.surface-accent {
    background: var(--surface-accent-bg);
    border-color: rgba(53, 126, 221, 0.18);
}

.form-section h2,
.section-title h2,
.card h2,
.table-card h2,
.section-block h2 {
    margin: 0;
    font-size: 1.04rem;
}

label,
.label,
.checkbox-option,
.checkbox-row {
    display: grid;
    gap: 0.45rem;
    color: var(--ink);
    font-weight: 600;
}

.checkbox-row,
.checkbox-option {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.72);
}

input,
textarea,
select {
    width: 100%;
    min-height: 50px;
    padding: 0.82rem 0.95rem;
    border-radius: 14px;
    border: 1px solid rgba(133, 157, 191, 0.38);
    background: #fff;
    color: var(--ink);
    box-shadow: inset 0 1px 2px rgba(16,35,61,0.03);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

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

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: rgba(53, 126, 221, 0.8);
    box-shadow: 0 0 0 4px rgba(53, 126, 221, 0.12);
}

button,
.button-link,
.button,
.danger-button,
a.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0.8rem 1.1rem;
    border-radius: 14px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    font-weight: 700;
    line-height: 1.1;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease, background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
    box-shadow: 0 10px 24px rgba(39, 95, 179, 0.18);
}

button:hover,
.button-link:hover,
.button:hover,
.danger-button:hover,
a.button-link:hover {
    color: #fff;
    transform: translateY(-1px);
    filter: brightness(0.98);
}

.button-link.primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; }
.button-link.ghost,
.button-link.small,
.button.secondary,
button.ghost,
button.subtle {
    background: rgba(255,255,255,0.92);
    color: var(--primary-dark);
    border-color: rgba(53, 126, 221, 0.18);
    box-shadow: none;
}

.button-link.ghost:hover,
.button-link.small:hover,
.button.secondary:hover,
button.ghost:hover,
button.subtle:hover {
    color: var(--primary-dark);
    background: rgba(239, 245, 255, 0.96);
}

.danger-button,
.button-link.danger,
button.danger {
    background: linear-gradient(135deg, #d13f5f 0%, #b22f49 100%);
    color: #fff;
}

.button-link.small,
button.small {
    min-height: 40px;
    padding: 0.62rem 0.9rem;
    font-size: 0.92rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: rgba(53, 126, 221, 0.1);
    color: var(--primary-dark);
    border: 1px solid rgba(53, 126, 221, 0.12);
    font-size: 0.86rem;
    font-weight: 800;
}

.hero-card,
.intro-card {
    background:
        radial-gradient(circle at top right, rgba(16, 201, 190, 0.12), transparent 26%),
        radial-gradient(circle at bottom left, rgba(53, 126, 221, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(245,249,255,0.98) 100%);
}

.auth-shell {
    width: min(880px, 100%);
    margin-inline: auto;
}

.installer-shell { padding-block: 2rem 2.75rem; }
.installer-card { width: min(980px, 100%); margin-inline: auto; }

.table-card,
.users-table-card {
    overflow: hidden;
}

.table-responsive { overflow-x: auto; }

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

table thead th {
    position: sticky;
    top: 0;
    background: rgba(245, 249, 255, 0.98);
    color: var(--ink-soft);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

table th,
table td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid rgba(133, 157, 191, 0.18);
    text-align: left;
    vertical-align: middle;
}

table tbody tr:hover td {
    background: rgba(243, 247, 253, 0.72);
}

.users-table-card td,
.users-table-card th { vertical-align: middle; }

.table-actions,
.actions-inline,
.actions-inline-flush,
.inline-form,
.form-actions form,
.table-responsive form {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0;
}

.table-actions {
    flex-wrap: wrap;
}

.table-actions > *,
.actions-inline > *,
.actions-inline-flush > * {
    margin: 0;
}

.table-actions .button-link,
.table-actions button,
.actions-inline .button-link,
.actions-inline button {
    min-width: 8.75rem;
}

.status-list,
.public-list,
.list-stack,
.event-list,
.repeater-list,
.mini-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.status-list,
.list-stack,
.event-list,
.public-list,
.mini-list { display: grid; gap: var(--space-4); }
.repeater-list { display: grid; gap: var(--space-4); }

.list-item,
.event-card,
.option-card,
.mini-item,
.selectable-card,
.repeater-row {
    display: grid;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.82);
}

.selectable-card input[type="checkbox"],
.selectable-card input[type="radio"] {
    width: 1.1rem;
    height: 1.1rem;
    min-height: 0;
    margin-top: 0.2rem;
}

.selectable-card {
    grid-template-columns: auto 1fr;
    align-items: start;
}

.option-card.selected,
.selectable-card:hover,
.repeater-row:hover {
    border-color: rgba(53, 126, 221, 0.35);
    background: rgba(240, 247, 255, 0.96);
}

.poll-options-list,
.selection-grid { display: grid; gap: var(--space-4); }
.vote-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.section-title:last-child { margin-bottom: 0; }

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

.info-list dl,
.address-grid dl,
.info-list div,
.address-grid div {
    margin: 0;
    padding: 0.95rem 1rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255,255,255,0.72);
}

.card-stack-md {
    display: grid;
    gap: var(--space-5);
}

.card-stack-md > * {
    padding: 1rem 1.1rem;
}

.empty-state {
    margin: 0;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    border: 1px dashed rgba(133, 157, 191, 0.38);
    background: rgba(248, 250, 253, 0.9);
}

.flash {
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow-card);
}
.flash-error { background: rgba(255, 238, 241, 0.96); border-color: rgba(209,63,95,0.2); }
.flash-success { background: rgba(233, 248, 239, 0.96); border-color: rgba(46, 161, 93, 0.22); }
.flash-info { background: rgba(238, 246, 255, 0.96); border-color: rgba(53, 126, 221, 0.18); }

.site-footer {
    margin-top: auto;
    padding: 1.25rem 0 2rem;
    color: var(--ink-soft);
}

.site-footer .inner {
    width: min(1180px, calc(100% - 2rem));
    margin-inline: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.gap-top { margin-top: var(--space-6); }
.wrap { flex-wrap: wrap; }
.subtle { color: var(--ink-soft); }

@media (max-width: 1100px) {
    .dashboard-grid,
    .stats-grid,
    .three-col-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .site-header .inner,
    .page-header,
    .hero-actions,
    .section-title,
    .page-toolbar { align-items: stretch; }

    .site-header .inner,
    .page-header,
    .hero-actions,
    .section-title,
    .page-toolbar,
    .site-nav { flex-direction: column; }

    .site-nav,
    .site-nav ul { width: 100%; }
    .site-nav a,
    .site-nav button.nav-button { width: 100%; }

    .card-grid,
    .card-grid-2,
    .dashboard-grid,
    .stats-grid,
    .split-grid,
    .two-col,
    .field-grid-2,
    .field-grid-3,
    .vote-grid,
    .info-list,
    .address-grid,
    .three-col-grid { grid-template-columns: minmax(0, 1fr); }

    .field-grid-location {
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr) minmax(0, 1.15fr);
    }
}

@media (max-width: 680px) {
    .site-header .inner,
    .page-shell,
    .container { width: min(100% - 1.1rem, 100%); }

    .page-shell { padding-block: 1rem 1.75rem; }

    .page-header,
    .hero-card,
    .card,
    .form-card,
    .table-card,
    .section-block,
    .intro-card,
    .form-section { padding: 1rem; }

    .field-grid-location,
    .field-grid-2,
    .field-grid-3,
    .dashboard-grid,
    .stats-grid,
    .card-grid,
    .card-grid-2,
    .split-grid,
    .two-col,
    .vote-grid,
    .three-col-grid,
    .info-list,
    .address-grid { grid-template-columns: minmax(0, 1fr); }

    .form-actions,
    .actions-inline,
    .actions-inline-flush,
    .table-actions,
    .hero-actions,
    .page-toolbar { align-items: stretch; }

    .form-actions > *,
    .actions-inline > *,
    .actions-inline-flush > *,
    .table-actions > *,
    .hero-actions > *,
    .page-toolbar > * { width: 100%; }

    .table-actions .button-link,
    .table-actions button,
    .actions-inline .button-link,
    .actions-inline button { min-width: 0; }
}
.grid { display: grid; gap: var(--space-5); }
.button-danger { background: linear-gradient(135deg, #d13f5f 0%, #b22f49 100%); color: #fff; }
.button-danger:hover { color: #fff; }
.button-secondary {
    background: rgba(255,255,255,0.92);
    color: var(--primary-dark);
    border: 1px solid rgba(53, 126, 221, 0.18);
    box-shadow: none;
}
.button-secondary:hover { color: var(--primary-dark); background: rgba(239, 245, 255, 0.96); }

/* Installer */
.installer-shell {
    max-width: 1120px;
}

.installer-hero {
    width: 100%;
    max-width: none;
}

.installer-form {
    width: 100%;
}

.installer-progress {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.installer-progress-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.15rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.84);
    color: var(--text-color);
    text-align: left;
    box-shadow: none;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.installer-progress-item:hover {
    transform: translateY(-1px);
    border-color: rgba(45, 93, 255, 0.22);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 14px 32px rgba(50, 70, 120, 0.1);
}

.installer-progress-item.is-active {
    border-color: rgba(45, 93, 255, 0.3);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(238, 233, 255, 0.92));
    box-shadow: 0 16px 36px rgba(63, 84, 140, 0.12);
}

.installer-progress-item strong,
.installer-progress-item small {
    display: block;
}

.installer-progress-item small {
    margin-top: 0.2rem;
    color: var(--text-muted);
}

.installer-progress-number {
    width: 2.4rem;
    height: 2.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(45, 93, 255, 0.12);
    color: var(--brand-primary);
    font-weight: 800;
    flex: 0 0 2.4rem;
}

.installer-progress-item.is-active .installer-progress-number {
    background: var(--brand-primary);
    color: #fff;
}

.installer-checks-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.installer-check-card {
    padding: 1rem 1.1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.82);
    display: grid;
    gap: 0.35rem;
}

.installer-check-card.is-ok {
    border-color: rgba(38, 173, 96, 0.22);
}

.installer-check-card.is-error {
    border-color: rgba(224, 87, 87, 0.24);
}

.installer-check-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.status-dot {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 999px;
    background: rgba(224, 87, 87, 0.72);
    box-shadow: 0 0 0 0.28rem rgba(224, 87, 87, 0.12);
}

.installer-check-card.is-ok .status-dot {
    background: rgba(38, 173, 96, 0.92);
    box-shadow: 0 0 0 0.28rem rgba(38, 173, 96, 0.12);
}

.installer-check-card p,
.installer-check-card small {
    margin: 0;
}

.installer-check-card small {
    color: var(--text-muted);
    word-break: break-all;
}

.content-card-inner {
    padding: 1.35rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.72);
}

.section-header.compact {
    margin-bottom: 0.5rem;
}

.checkbox-panel {
    padding: 0.95rem 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.82);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--border-soft);
}

.status-pill.is-success {
    color: #177245;
    background: rgba(38, 173, 96, 0.12);
    border-color: rgba(38, 173, 96, 0.18);
}

.status-pill.is-warning {
    color: #a75d12;
    background: rgba(255, 190, 92, 0.16);
    border-color: rgba(255, 190, 92, 0.24);
}

.installer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-actions-note {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.installer-address-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
}

.installer-address-street,
.installer-address-postal,
.installer-address-city {
    min-width: 0;
}

@media (max-width: 980px) {
    .installer-progress,
    .installer-checks-grid,
    .installer-address-grid {
        grid-template-columns: 1fr;
    }

    .installer-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .installer-actions .button-link,
    .installer-actions .button-secondary {
        width: 100%;
        justify-content: center;
    }
}

.button-link:disabled,
.button-secondary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Installer redesign v3.3 */
.installer-shell {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.installer-hero {
  padding: clamp(1.5rem, 3vw, 2.4rem);
}

.installer-hero-layout {
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.9fr);
  align-items: start;
}

.hero-note {
  display: grid;
  gap: 0.45rem;
  padding: 1rem 1.1rem;
  border-radius: calc(var(--radius-lg) - 8px);
  background: rgba(92, 114, 255, 0.08);
  border: 1px solid rgba(92, 114, 255, 0.12);
  color: var(--color-text-muted);
}

.hero-note strong {
  color: var(--color-text);
  font-size: 0.95rem;
}

.installer-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
}

.installer-progress-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  text-align: left;
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.installer-progress-item:hover {
  transform: translateY(-1px);
  border-color: rgba(92, 114, 255, 0.22);
}

.installer-progress-item strong,
.installer-progress-item small {
  display: block;
}

.installer-progress-item small {
  margin-top: 0.2rem;
  color: var(--color-text-muted);
}

.installer-progress-item.is-active {
  border-color: rgba(45, 94, 255, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(236, 240, 255, 0.88));
  box-shadow: 0 18px 40px rgba(59, 92, 173, 0.12);
}

.installer-progress-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  background: rgba(45, 94, 255, 0.1);
  color: var(--color-primary);
  font-weight: 800;
}

.installer-form .content-card {
  border-radius: var(--radius-xl);
}

.installer-step {
  display: none;
}

.installer-step.is-active {
  display: block;
}

.installer-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.25rem 0.85rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 800;
}

.status-pill.is-success {
  background: rgba(39, 174, 96, 0.12);
  color: #1f8d54;
}

.status-pill.is-warning {
  background: rgba(240, 162, 42, 0.14);
  color: #b86f00;
}

.installer-checks-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}

.installer-check-card {
  display: grid;
  gap: 0.9rem;
  padding: 1.1rem 1.15rem;
  border-radius: calc(var(--radius-lg) - 6px);
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.78);
}

.installer-check-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.installer-check-card p,
.installer-check-card small {
  margin: 0;
  color: var(--color-text-muted);
}

.status-dot {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 999px;
  flex: 0 0 0.95rem;
  box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.12);
  background: #27ae60;
}

.installer-check-card.is-error .status-dot {
  background: #f2994a;
  box-shadow: 0 0 0 4px rgba(242, 153, 74, 0.16);
}

.installer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.2rem;
}

.installer-address-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-md);
}

.button-link:disabled,
.button-secondary:disabled {
  cursor: not-allowed;
  background: rgba(25, 35, 60, 0.1);
  color: rgba(25, 35, 60, 0.5);
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

@media (max-width: 980px) {
  .installer-progress {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .installer-hero-layout,
  .installer-checks-grid,
  .installer-address-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .installer-shell {
    width: min(100%, calc(100% - 1rem));
  }

  .installer-progress {
    grid-template-columns: 1fr;
  }

  .installer-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .installer-actions .button-link,
  .installer-actions .button-secondary {
    width: 100%;
    justify-content: center;
  }
}
