:root {
    --bg: #f5f5f3;
    --surface: #ffffff;
    --text: #171717;
    --muted: #6b6b67;
    --line: #ddddda;
    --accent: #171717;
    --danger: #a12b2b;
    --radius: 12px;
    --max: 1200px;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); line-height: 1.55; }
a { color: inherit; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
.container { width: min(calc(100% - 32px), var(--max)); margin-inline: auto; }
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.nav-wrap { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { font-weight: 800; text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; font-size: .94rem; }
.nav a { text-decoration: none; }
.nav-user { color: var(--muted); }
.page { min-height: calc(100vh - 130px); padding-block: 40px 72px; }
.site-footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: .9rem; }
h1, h2, p { margin-top: 0; }
h1 { letter-spacing: -.035em; line-height: 1.05; font-size: clamp(2rem, 4vw, 4rem); margin-bottom: 16px; }
h2 { line-height: 1.2; letter-spacing: -.02em; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 800; color: var(--muted); margin-bottom: 10px; }
.hero, .page-heading { margin-bottom: 28px; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 32px; padding: 36px 0; }
.hero.compact h1 { max-width: 850px; }
.hero p, .page-heading p { max-width: 720px; color: var(--muted); }
.split { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 16px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent); color: white; text-decoration: none; cursor: pointer; font-weight: 700; white-space: nowrap; }
.button.secondary { background: transparent; color: var(--text); border-color: var(--line); }
.button-row, .action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.inline-form, .article-footer form, .action-row form { display: inline; margin: 0; }
.link-button, .text-button { border: 0; background: none; padding: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.danger, .error-text { color: var(--danger); }
.filter-panel { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 28px; }
.field { display: grid; gap: 6px; min-width: 170px; }
.field.grow { flex: 1 1 280px; }
.field label { font-size: .84rem; font-weight: 700; }
.field small, .muted { color: var(--muted); }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: white; border-radius: 8px; padding: 10px 12px; color: var(--text); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #999; outline-offset: 1px; }
.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.article-card { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-height: 100%; }
.article-image-wrap { aspect-ratio: 16/9; overflow: hidden; background: #e9e9e6; }
.article-image { width: 100%; height: 100%; object-fit: cover; }
.article-body { display: flex; flex-direction: column; flex: 1; padding: 18px; }
.article-card h2 { font-size: 1.16rem; margin: 10px 0; }
.article-card h2 a { text-decoration: none; }
.article-card p { color: #454542; font-size: .94rem; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; }
.article-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; padding-top: 16px; color: var(--muted); font-size: .8rem; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 32px; }
.alert { padding: 12px 15px; border-radius: 8px; margin-bottom: 20px; border: 1px solid; background: white; }
.alert.success { border-color: #7eaa87; }
.alert.error { border-color: #c68181; color: #792020; }
.empty-state { text-align: center; padding: 80px 20px; border: 1px dashed var(--line); border-radius: var(--radius); background: rgba(255,255,255,.5); }
.empty-state h1, .empty-state h2 { font-size: 2rem; }
.auth-card { width: min(100%, 520px); margin: 5vh auto; background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.auth-card h1 { font-size: 2.4rem; }
.stack-form { display: grid; gap: 18px; }
.form-wide { max-width: 760px; }
.checkbox { display: flex; align-items: center; gap: 10px; }
.checkbox input { width: auto; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; background: white; font-size: .88rem; }
.chip.active { background: var(--text); color: white; border-color: var(--text); }
.feed-list { display: grid; gap: 12px; }
.feed-row { display: flex; justify-content: space-between; gap: 24px; align-items: center; background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.feed-row h2 { margin: 8px 0; }
.feed-row p { color: var(--muted); margin-bottom: 8px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat, .panel { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat strong { display: block; font-size: 2rem; }
.stat span { color: var(--muted); }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel-heading, .list-line { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.panel-heading { margin-bottom: 12px; }
.panel-heading h2 { margin: 0; }
.list-line { padding: 12px 0; border-top: 1px solid var(--line); }
.list-line.vertical { display: grid; justify-content: stretch; gap: 4px; }
.block { display: block; }
.table-wrap { overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { text-align: left; vertical-align: top; padding: 14px; border-bottom: 1px solid var(--line); }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.truncate { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.status { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: .75rem; background: #ececea; }
.status.ok { background: #e4f0e6; }
.status.off { color: var(--muted); }
@media (max-width: 900px) {
    .article-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .nav-wrap, .hero, .split, .feed-row { align-items: flex-start; flex-direction: column; }
    .nav { gap: 12px; }
    .article-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .filter-panel > * { width: 100%; }
}
