:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --border: #d8e0ea;
    --text: #1e293b;
    --text-muted: #64748b;
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --success-bg: #ecfdf3;
    --success-text: #166534;
    --error-bg: #fef2f2;
    --error-text: #991b1b;
    --warning-bg: #fff7ed;
    --warning-text: #9a3412;
    --resolved-bg: #f0fdf4;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    --radius: 16px;
    --radius-sm: 10px;
    --max-width: 1040px;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

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

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

.site-header {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--text);
    text-decoration: none;
}

.brand:hover {
    text-decoration: none;
}

.brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 10px;
    background: white;
    border: 1px solid var(--border);
    padding: 0.3rem;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-title {
    font-weight: 700;
    font-size: 1rem;
}

.brand-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.main-nav a {
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    color: var(--text);
    background: transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

.main-nav a:hover {
    text-decoration: none;
    background: var(--surface-muted);
    color: var(--primary-dark);
}

.page-shell {
    padding: 2rem 0 3rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.4rem;
    margin-bottom: 1.25rem;
}

.hero {
    padding: 1.8rem;
}

.hero h1,
.card h1,
.card h2,
.card h3 {
    margin-top: 0;
}

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

.grid {
    display: grid;
    gap: 1.25rem;
}

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

.message-stack {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.message {
    border-radius: 12px;
    padding: 0.85rem 1rem;
    border: 1px solid transparent;
}

.message-success,
.message-info {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: #bbf7d0;
}

.message-error {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: #fecaca;
}

.message-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border-color: #fed7aa;
}

form p {
    margin: 0 0 1rem 0;
}

label {
    display: inline-block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    color: var(--text);
    font: inherit;
}

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

input:focus,
textarea:focus,
select:focus {
    outline: 3px solid rgba(29, 78, 216, 0.12);
    border-color: var(--primary);
}

input[type="checkbox"],
input[type="radio"] {
    margin-right: 0.5rem;
}

ul.errorlist {
    list-style: none;
    padding: 0;
    margin: 0.4rem 0 0 0;
    color: var(--error-text);
    font-size: 0.95rem;
}

.helptext {
    display: block;
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}

button,
.button-link {
    display: inline-block;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.8rem 1rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease;
    text-decoration: none;
}

button:hover,
.button-link:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

button:active,
.button-link:active {
    transform: translateY(1px);
}

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

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

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

.section-title {
    margin-bottom: 0.5rem;
}

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

.comment-card {
    border: 1px solid var(--border);
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.2rem;
    margin-bottom: 1.25rem;
}

.comment-card.resolved {
    background: var(--resolved-bg);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.comment-status {
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    background: #e2e8f0;
    color: var(--text);
}

.comment-status.resolved {
    background: #dcfce7;
    color: #166534;
}

.comment-body {
    margin-bottom: 1rem;
    white-space: normal;
}

.reply-block {
    margin-left: 1.5rem;
    border-left: 3px solid var(--border);
    padding-left: 1rem;
    margin-top: 1rem;
}

.reply-item {
    padding: 0.9rem 0 0.9rem;
    border-bottom: 1px solid #edf2f7;
}

.reply-item:last-child {
    border-bottom: none;
}

.event-list {
    margin: 1rem 0 0 0;
    padding: 0;
    list-style: none;
}

.event-list li {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.auth-box {
    max-width: 640px;
    margin: 0 auto;
}

.centered-text {
    text-align: center;
}

.spacer-top {
    margin-top: 1rem;
}

.spacer-bottom {
    margin-bottom: 1rem;
}

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

    .main-nav {
        width: 100%;
    }

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

    .reply-block {
        margin-left: 0.5rem;
        padding-left: 0.75rem;
    }

    .comment-header {
        flex-direction: column;
    }
}
/* Checkbox layout */
form p:has(> input[type="checkbox"]) {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 0.75rem;
    row-gap: 0.25rem;
    align-items: start;
}

form p > input[type="checkbox"] {
    grid-column: 1;
    grid-row: 1;
    width: 18px;
    height: 18px;
    margin: 0.3rem 0 0 0;
    accent-color: var(--primary);
    cursor: pointer;
}

form p:has(> input[type="checkbox"]) > label {
    grid-column: 2;
    grid-row: 1;
    font-weight: 400;
    margin: 0;
    cursor: pointer;
}

form p:has(> input[type="checkbox"]) > .helptext {
    grid-column: 2;
}
/* Page layout */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-shell {
    flex: 1;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1.25rem 0;
}

.site-footer a {
    color: var(--text-muted);
}

.site-footer a:hover {
    color: var(--primary);
}

/* Privacy notice */
.privacy-notice {
    max-width: 850px;
    margin: 0 auto;
    line-height: 1.8;
    overflow-wrap: anywhere;
}
