:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --primary: #0f766e;
    --primary-hover: #115e59;
    --danger: #b91c1c;
    --ok: #166534;
    --border: #dbe3ef;
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 18px;
    line-height: 1.6;
}

.container {
    width: min(1150px, 92%);
    margin: 0 auto;
}

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
}

.brand {
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
    font-size: 1.35rem;
}

.nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.main-content {
    padding: 2rem 0 3rem;
}

.hero {
    background: #eef6f5;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.article-tabs {
    display: flex;
    gap: 0.6rem;
    margin: 0 0 1rem;
    flex-wrap: wrap;
}

.article-tabs a {
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 10px;
    padding: 0.45rem 0.8rem;
    font-weight: 600;
}

.article-tabs a.active {
    border-color: var(--primary);
    color: var(--primary);
}

.auth-callout {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.auth-callout .meta {
    margin-right: 0.5rem;
}

.hero h1 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.2;
}

.btn,
button {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
}

.btn:hover,
button:hover {
    background: var(--primary-hover);
}

.btn.secondary {
    background: #334155;
}

.danger {
    background: var(--danger);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.card,
.article-view {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
}

.card h2,
.article-view h1 {
    margin-top: 0.4rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.card h2 a {
    color: var(--text);
    text-decoration: none;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.meta {
    color: var(--muted);
    font-size: 0.95rem;
}

.badge {
    display: inline-block;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    font-size: 0.78rem;
    letter-spacing: 0.3px;
}

.badge-normal {
    background: #e2e8f0;
    color: #0f172a;
}

.badge-important {
    background: #ffedd5;
    color: #9a3412;
}

.badge-featured {
    background: #fef9c3;
    color: #854d0e;
}

.form-wrap {
    max-width: 850px;
}

.form {
    display: grid;
    gap: 0.9rem;
}

label {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.65rem;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
}

textarea {
    resize: vertical;
}

.comments {
    margin-top: 1rem;
}

.comment-list {
    display: grid;
    gap: 0.8rem;
    margin-top: 0.8rem;
}

.updates {
    margin-top: 1rem;
}

.sort-tabs {
    display: inline-flex;
    gap: 0.5rem;
}

.sort-tabs a {
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.3rem 0.55rem;
    color: var(--text);
    background: #fff;
    font-size: 0.9rem;
}

.sort-tabs a.active {
    border-color: var(--primary);
    color: var(--primary);
}

.update-card h3 {
    margin: 0.3rem 0 0.4rem;
}

.pagination {
    margin-top: 1rem;
    display: flex;
    gap: 0.4rem;
}

.pagination a {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.4rem 0.7rem;
    background: #fff;
    text-decoration: none;
    color: var(--text);
}

.pagination a.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.admin-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.admin-box {
    margin-top: 1rem;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th,
td {
    text-align: left;
    padding: 0.55rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.inline-form {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    margin-right: 0.35rem;
}

.inline-form select,
.inline-form button {
    font-size: 0.85rem;
    padding: 0.35rem 0.5rem;
}

.success,
.error {
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    margin: 0.7rem 0;
    border: 1px solid;
    font-weight: 600;
}

.success {
    border-color: #86efac;
    color: var(--ok);
    background: #f0fdf4;
}

.error {
    border-color: #fca5a5;
    color: #991b1b;
    background: #fef2f2;
}

.site-footer {
    border-top: 1px solid var(--border);
    background: #fff;
    margin-top: 2rem;
    padding: 1.2rem 0;
}

.legal-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.legal-content {
    max-width: 960px;
}

.legal-content h2 {
    margin-top: 1.2rem;
    margin-bottom: 0.4rem;
}

.cookie-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    display: grid;
    place-items: center;
    padding: 1rem;
    z-index: 1000;
}

.cookie-modal-card {
    width: min(900px, 100%);
    max-height: 86vh;
    overflow: auto;
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--border);
    padding: 1rem;
}

.cookie-modal-card h2 {
    margin-top: 0.2rem;
}

.cookie-modal-content {
    font-size: 0.98rem;
    color: var(--text);
}

.cookie-modal-actions {
    margin-top: 0.9rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

@media (max-width: 700px) {
    body {
        font-size: 17px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }
}
