:root {
    color-scheme: light;
    --bg: #f4f1e8;
    --surface: #fffdf8;
    --surface-strong: #ffffff;
    --border: #d8d0c3;
    --text: #1f1d17;
    --muted: #625b50;
    --accent: #0f6d62;
    --accent-strong: #0b4f47;
    --danger: #8d2b2b;
    --success: #24643c;
    --shadow: 0 18px 45px rgba(54, 45, 29, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(15, 109, 98, 0.14), transparent 24rem),
        linear-gradient(180deg, #f6f1e7 0%, #ede6d6 100%);
}

a {
    color: inherit;
}

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

.site-header {
    border-bottom: 1px solid rgba(31, 29, 23, 0.08);
    background: rgba(255, 253, 248, 0.8);
    backdrop-filter: blur(18px);
}

.site-header__inner {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.brand {
    display: inline-block;
    font-size: 1.45rem;
    font-weight: 700;
    text-decoration: none;
}

.brand__subtitle {
    margin: 0.35rem 0 0;
    color: var(--muted);
}

.site-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.95rem;
}

.site-nav a {
    text-decoration: none;
}

.nav-form {
    margin: 0;
}

.nav-form button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent-strong);
    font: inherit;
    cursor: pointer;
}

.runtime-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    font-weight: 700;
    background: #ddd7ca;
}

.runtime-badge--local {
    background: #d9efe9;
    color: #0b4f47;
}

.runtime-badge--staging {
    background: #f4e7c6;
    color: #7a5212;
}

.runtime-badge--production {
    background: #f0dbdb;
    color: #7a1f1f;
}

.hero {
    padding: 3rem 0 2rem;
}

.hero--compact {
    padding-bottom: 1rem;
}

.eyebrow {
    margin: 0 0 0.5rem;
    color: var(--accent-strong);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p,
ul {
    margin-top: 0;
}

h1 {
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1.05;
    max-width: 12ch;
}

.lead {
    max-width: 70ch;
    font-size: 1.08rem;
    color: var(--muted);
}

.grid {
    display: grid;
    gap: 1.25rem;
    margin: 1.5rem 0;
}

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

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

.admin-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
    gap: 1.25rem;
    align-items: start;
    margin: 1.5rem 0 3rem;
}

.admin-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.admin-action {
    display: grid;
    gap: 0.35rem;
    padding: 1.4rem;
    border: 1px solid var(--border);
    border-radius: 1.2rem;
    background: var(--surface-strong);
    text-decoration: none;
    box-shadow: var(--shadow);
}

.admin-action strong {
    font-size: 2rem;
    color: var(--accent-strong);
}

.admin-action small {
    color: var(--muted);
}

.card,
.product-card,
.empty-state,
.alert {
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 1.2rem;
    background: rgba(255, 253, 248, 0.95);
    box-shadow: var(--shadow);
}

.card--centered {
    margin: 3rem auto;
    max-width: 42rem;
    text-align: center;
}

.error-page {
    width: min(48rem, calc(100% - 2rem));
    margin: 3rem auto;
    padding: 1rem 0 3rem;
}

.error-page__card {
    display: grid;
    justify-items: center;
    gap: 1rem;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border: 1px solid var(--border);
    border-radius: 1.2rem;
    background: rgba(255, 253, 248, 0.95);
    box-shadow: var(--shadow);
    text-align: center;
}

.error-page__code {
    margin: 0;
    color: var(--accent-strong);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.error-page h1 {
    max-width: none;
    margin: 0;
}

.error-page p {
    max-width: 42rem;
    margin: 0;
    color: var(--muted);
}

.error-page__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.35rem;
}

.error-page__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.75rem 1.1rem;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

.error-page__button:hover {
    background: var(--accent-strong);
}

.error-page__button--secondary {
    background: #e9e1d2;
    color: var(--text);
}

.error-page__button--secondary:hover {
    background: #d9d0bf;
}

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

code {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 0.45rem;
    background: #efe7d8;
    color: var(--accent-strong);
    font-size: 0.92em;
}

.check-list,
.status-list {
    padding-left: 1.15rem;
    margin-bottom: 0;
}

.status-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.45rem 0;
    list-style: none;
    border-bottom: 1px solid rgba(31, 29, 23, 0.08);
}

.status-list li:last-child {
    border-bottom: 0;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.auth-shell {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 9rem);
    padding: 2rem 0;
}

.auth-card {
    width: min(100%, 34rem);
}

.form {
    display: grid;
    gap: 1rem;
}

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

.form-field {
    display: grid;
    gap: 0.45rem;
    font-weight: 700;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.form-field textarea {
    resize: vertical;
}

.form-field small {
    color: var(--danger);
    font-weight: 700;
}

.form-switches {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.form-switches label {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}

.admin-table th,
.admin-table td {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(31, 29, 23, 0.1);
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: var(--accent-strong);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-table small {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted);
}

.product-card__tag {
    display: inline-block;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: rgba(15, 109, 98, 0.12);
    color: var(--accent-strong);
    font-size: 0.8rem;
    font-weight: 700;
}

.price {
    margin-top: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-strong);
}

.button {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.2rem;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.button:hover {
    background: var(--accent-strong);
}

.button--secondary {
    background: #e9e1d2;
    color: var(--text);
}

.button--secondary:hover {
    background: #d9d0bf;
}

.button--small {
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
}

.button--icon {
    width: 2.45rem;
    min-width: 2.45rem;
    height: 2.45rem;
    padding: 0;
}

.button__icon {
    width: 1.05rem;
    height: 1.05rem;
    flex: 0 0 auto;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
}

.inline-form select {
    min-width: 11rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: #fff;
    font: inherit;
}

.permission-box {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
}

.permission-box legend {
    padding: 0 0.4rem;
    font-weight: 700;
    color: var(--accent-strong);
}

.permission-box label {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
}

.permission-box small {
    display: block;
    color: var(--muted);
}

.permission-box--compact {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

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

.group-card {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(31, 29, 23, 0.1);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.55);
}

.permission-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.permission-tags span {
    display: inline-flex;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(15, 109, 98, 0.12);
    color: var(--accent-strong);
    font-size: 0.85rem;
    font-weight: 700;
}

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

.feed-card {
    display: grid;
    gap: 0.75rem;
    padding: 1.25rem;
    border: 1px solid rgba(31, 29, 23, 0.1);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.55);
}

.feed-card h3,
.feed-card h4,
.feed-card p {
    margin-bottom: 0;
}

.feed-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.feed-tags span {
    display: inline-flex;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: #efe7d8;
    color: var(--accent-strong);
    font-size: 0.85rem;
    font-weight: 700;
}

.cleanup-list {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0 3rem;
}

.cleanup-item {
    padding: 1.35rem;
    border: 1px solid var(--border);
    border-left-width: 0.45rem;
    border-radius: 1.2rem;
    background: rgba(255, 253, 248, 0.95);
    box-shadow: var(--shadow);
}

.cleanup-item--warning {
    border-left-color: #a86114;
}

.cleanup-item--info {
    border-left-color: var(--accent);
}

.cleanup-item--ok {
    border-left-color: var(--success);
}

.cleanup-metric {
    margin-bottom: 0.4rem;
    color: var(--accent-strong);
    font-size: 2rem;
    font-weight: 700;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-chip--warning {
    background: #f4e7c6;
    color: #7a5212;
}

.status-chip--info {
    background: #d9efe9;
    color: #0b4f47;
}

.status-chip--ok {
    background: #dfefe4;
    color: var(--success);
}

.alert--success {
    color: var(--success);
    border-color: rgba(36, 100, 60, 0.24);
    background: rgba(223, 243, 230, 0.95);
}

.alert--error {
    color: var(--danger);
    border-color: rgba(141, 43, 43, 0.24);
    background: rgba(247, 229, 229, 0.95);
}

@media (max-width: 760px) {
    .site-header__inner,
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-actions,
    .admin-layout,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .site-nav {
        flex-wrap: wrap;
    }

    h1 {
        max-width: none;
    }
}
