:root {
    --ink: #211719;
    --muted: #716265;
    --line: #eadde0;
    --paper: #fff7f3;
    --panel: #ffffff;
    --rose: #9f1f35;
    --rose-dark: #6e1424;
    --sage: #7d2937;
    --gold: #b54a5c;
    --blue: #5f2a34;
    --danger: #8f1722;
    --shadow: 0 18px 50px rgba(64, 28, 36, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

body.mode-maga {
    --ink: #111827;
    --muted: #5f6675;
    --line: #e1d9d0;
    --paper: #fff8ee;
    --panel: #ffffff;
    --rose: #b91c1c;
    --rose-dark: #7f1d1d;
    --sage: #1f3b64;
    --gold: #b91c1c;
    --blue: #1f3b64;
    --danger: #991b1b;
    --shadow: 0 18px 50px rgba(17, 24, 39, 0.13);
}

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

img {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

main {
    min-height: calc(100vh - 164px);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px clamp(18px, 4vw, 56px);
    border-bottom: 1px solid rgba(34, 25, 29, 0.08);
    background: rgba(255, 247, 243, 0.92);
    backdrop-filter: blur(14px);
}

body.mode-maga .site-header {
    background: rgba(255, 248, 238, 0.92);
}

.brand,
.nav,
.site-footer,
.inline-form,
.action-row,
.hero-actions,
.section-heading,
.photo-row,
.message-header {
    display: flex;
    align-items: center;
}

.brand {
    gap: 10px;
    font-weight: 800;
}

.brand-mark,
.avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    color: #fff;
    background: var(--ink);
    font-size: 0.8rem;
    font-weight: 800;
}

.nav {
    gap: 16px;
    color: var(--muted);
    font-weight: 700;
}

.nav a:hover,
.link-button:hover {
    color: var(--ink);
}

.nav-pill,
.button {
    border-radius: 8px;
    border: 1px solid transparent;
}

.nav-pill {
    padding: 9px 13px;
    background: var(--ink);
    color: #fff;
}

.link-button {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-weight: 700;
}

.link-button.danger {
    color: var(--danger);
}

.mode-toggle {
    order: -1;
}

.mode-button {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px 10px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font-size: 0.83rem;
    font-weight: 900;
}

body.mode-maga .mode-button {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 800;
}

.button.primary {
    background: var(--rose);
    color: #fff;
    box-shadow: 0 10px 24px rgba(200, 63, 93, 0.26);
}

.button.primary:hover {
    background: var(--rose-dark);
}

.button.secondary {
    border-color: var(--line);
    background: #fff;
    color: var(--ink);
}

.wide {
    width: 100%;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.78fr);
    gap: clamp(30px, 6vw, 86px);
    align-items: center;
    min-height: calc(100vh - 86px);
    padding: clamp(38px, 7vw, 86px) clamp(18px, 6vw, 78px);
    overflow: hidden;
}

.hero h1 {
    margin: 0;
    max-width: 760px;
    font-size: clamp(4rem, 12vw, 8.8rem);
    line-height: 0.86;
    letter-spacing: 0;
}

.hero p {
    max-width: 650px;
    font-size: clamp(1.05rem, 2vw, 1.32rem);
    color: var(--muted);
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--rose-dark);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-actions {
    gap: 12px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.hero-panel {
    position: relative;
    min-height: 520px;
}

.hero-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.mini-card {
    position: absolute;
    width: min(100%, 360px);
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.mini-card strong,
.mini-card span {
    display: block;
}

.mini-card span {
    margin-top: 6px;
    color: var(--muted);
}

.mini-card.top {
    top: 24px;
    right: 14px;
    border-top: 5px solid var(--rose);
}

.mini-card.middle {
    top: 200px;
    left: 0;
    border-top: 5px solid var(--sage);
}

.mini-card.bottom {
    right: 42px;
    bottom: 26px;
    border-top: 5px solid var(--gold);
}

.feature-band,
.dashboard-grid,
.auth-shell,
.section-heading,
.profile-grid,
.list-panel,
.message-shell,
.plans,
.admin-grid,
.legal,
.setup-panel {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
}

.feature-band {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    padding: 42px 0 72px;
    border-top: 1px solid var(--line);
}

.feature-band h2,
.panel h1,
.panel h2,
.section-heading h1,
.empty-state h2 {
    margin: 0 0 10px;
}

.feature-band p,
.panel p,
.empty-state p,
.fine-print,
.meta,
.tagline {
    color: var(--muted);
}

.auth-shell {
    display: grid;
    place-items: start center;
    padding: 56px 0;
}

.auth-shell.two-column,
.dashboard-grid,
.admin-grid,
.plans {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
}

.plans {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-bottom: 70px;
}

.panel,
.profile-card,
.plan-card,
.setup-panel > div {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.panel,
.plan-card,
.setup-panel > div {
    padding: clamp(22px, 4vw, 34px);
}

.form-panel {
    width: min(100%, 560px);
}

.stacked-form,
.form-panel,
.plan-card {
    display: grid;
    gap: 16px;
}

.compact {
    gap: 8px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 12px 13px;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(200, 63, 93, 0.18);
    border-color: var(--rose);
}

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

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

.flash {
    width: min(1180px, calc(100% - 36px));
    margin: 16px auto 0;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    font-weight: 800;
}

.flash.success {
    border-color: rgba(77, 123, 99, 0.35);
    color: var(--sage);
}

.flash.error {
    border-color: rgba(165, 34, 34, 0.35);
    color: var(--danger);
}

.flash.info {
    border-color: rgba(49, 92, 131, 0.35);
    color: var(--blue);
}

.dashboard-grid,
.section-heading,
.admin-grid {
    padding: 40px 0;
}

.section-heading {
    justify-content: space-between;
    gap: 18px;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    padding-bottom: 70px;
}

.profile-card {
    overflow: hidden;
}

.photo-frame {
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #9f1f35, #211719);
    color: #fff;
    font-size: 3rem;
    font-weight: 900;
}

body.mode-maga .photo-frame {
    background: linear-gradient(135deg, #b91c1c, #111827);
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-body {
    padding: 18px;
}

.profile-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.profile-title h2 {
    margin: 0;
}

.action-row {
    gap: 10px;
    margin-top: 18px;
}

.action-row form,
.action-row button {
    flex: 1;
}

.moderation-details {
    margin-top: 14px;
    color: var(--muted);
}

.moderation-details summary {
    cursor: pointer;
    font-weight: 800;
}

.photo-list {
    display: grid;
    gap: 12px;
}

.photo-row {
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.photo-row img {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 8px;
}

.status-box {
    display: flex;
    justify-content: space-between;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.list-panel {
    display: grid;
    gap: 12px;
    padding-bottom: 70px;
}

.match-row {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.match-row span {
    display: block;
    color: var(--muted);
}

.empty-state {
    grid-column: 1 / -1;
    padding: 34px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.58);
    text-align: center;
}

.message-shell {
    display: grid;
    gap: 16px;
    padding: 36px 0 70px;
}

.message-header {
    justify-content: space-between;
}

.messages {
    display: grid;
    gap: 12px;
    min-height: 380px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.bubble {
    width: min(76%, 620px);
    padding: 12px 14px;
    border-radius: 8px;
}

.bubble span {
    display: block;
    margin-bottom: 3px;
    font-size: 0.76rem;
    font-weight: 900;
    color: var(--muted);
}

.bubble p {
    margin: 0;
}

.bubble.mine {
    justify-self: end;
    background: #fae5e9;
}

.bubble.theirs {
    justify-self: start;
    background: #f4ecec;
}

.message-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
}

.plan-card strong {
    font-size: 2.1rem;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.report-row {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.report-row span {
    display: block;
    color: var(--muted);
}

.legal,
.setup-panel {
    margin-top: 42px;
    margin-bottom: 70px;
}

.legal {
    max-width: 820px;
}

.center {
    text-align: center;
}

.site-footer {
    justify-content: space-between;
    gap: 18px;
    padding: 22px clamp(18px, 4vw, 56px);
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.site-footer div,
.site-footer nav {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

@media (max-width: 980px) {
    .hero,
    .auth-shell.two-column,
    .dashboard-grid,
    .admin-grid,
    .feature-band,
    .plans {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
    }

    .hero-panel {
        min-height: 430px;
    }

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

@media (max-width: 720px) {
    .site-header,
    .site-footer,
    .section-heading,
    .message-form {
        align-items: stretch;
        flex-direction: column;
    }

    .nav {
        flex-wrap: wrap;
        gap: 10px;
    }

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

    .hero-panel {
        min-height: auto;
        display: grid;
        gap: 12px;
    }

    .hero-art {
        position: static;
        aspect-ratio: 1.25;
    }

    .mini-card {
        position: static;
        width: 100%;
    }

    .grid.two,
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .bubble {
        width: 92%;
    }
}
