
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #202126; background: #fff; line-height: 1.46; font-size: 14px; }
a { color: #2f5f9f; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Topbar */
.topbar { height: 64px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid #e5e7eb; background: #fff; }
.topbar nav { width: min(1240px, calc(100% - 36px)); display: flex; gap: 24px; align-items: center; }
.topbar a { color: #555761; font-size: 15px; }
.topbar a.active { color: #17181d; font-weight: 600; }
.topbar .brand { color: #17181d; font-weight: 650; font-size: 16px; margin-right: auto; }

main { width: min(1240px, calc(100% - 36px)); margin: 0 auto; padding: 32px 0 72px; }

/* Hero */
.hero { max-width: 980px; margin-bottom: 22px; }
h1 { font-size: 34px; line-height: 1.08; letter-spacing: 0; margin: 0 0 8px; color: #17181d; }
.meta { color: #6d707a; font-size: 16px; margin: 0 0 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { border: 1px solid #dedfe3; border-radius: 999px; padding: 6px 11px; color: #62646e; background: #fff; font-size: 13px; }
.row-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border: 1px solid #fecaca; border-radius: 999px; background: #fef2f2; color: #b91c1c; font-size: 11px; font-weight: 600; letter-spacing: .01em; vertical-align: 1px; white-space: nowrap; }

/* Fact-strip */
.fact-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; border: 1px solid #dedfe3; background: #dedfe3; margin-bottom: 22px; }
.fact { background: #fff; padding: 11px 12px; min-height: 68px; }
.fact span { display: block; color: #777984; font-size: 11px; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .02em; }
.fact strong { display: block; color: #1f2024; font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }

/* Layout (detail pages) */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 30px; align-items: start; }
.section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid #dedfe3; border-left: 1px solid #dedfe3; }
.info-block { min-width: 0; padding: 18px 20px 16px; border-right: 1px solid #dedfe3; border-bottom: 1px solid #dedfe3; }
.info-block.wide { grid-column: 1 / -1; }
.info-block.note { background: #fffaf0; }

h2 { font-size: 17px; line-height: 1.2; letter-spacing: 0; margin: 0 0 10px; color: #17181d; }
h3 { font-size: 14px; color: #2f5f9f; margin: 14px 0 7px; }
p { margin: 0 0 10px; color: #444752; }
ul, ol { margin: 0 0 10px; padding-left: 19px; color: #4f515b; }
li { margin-bottom: 5px; }
strong { color: #1f2024; }
em { color: #444752; }
blockquote { margin: 10px 0; padding: 10px 13px; border-left: 3px solid #2f5f9f; background: #f6f8fb; color: #444752; }
hr { border: 0; border-top: 1px solid #e5e7eb; margin: 16px 0; }

/* Sidebar */
.sidebar { position: sticky; top: 20px; border-left: 1px solid #dedfe3; padding-left: 20px; }
.side-panel { padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid #dedfe3; }
.side-panel:last-child { border-bottom: 0; }
.side-panel h2 { font-size: 16px; margin-bottom: 12px; }
.side-facts { display: grid; gap: 8px; }
.side-fact { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; font-size: 13px; }
.side-fact span { color: #777984; }
.side-fact strong { color: #1f2024; font-weight: 600; overflow-wrap: anywhere; }
.side-list { list-style: none; padding-left: 0; margin: 0; font-size: 13px; }
.side-list li { margin-bottom: 6px; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 13px; }
th { text-align: left; color: #555761; background: #f5f6f8; font-weight: 650; padding: 7px 8px; border-bottom: 1px solid #e3e4e8; cursor: pointer; }
td { padding: 7px 8px; border-bottom: 1px solid #ececef; vertical-align: top; overflow-wrap: anywhere; }
tr:nth-child(even) td { background: #fafafa; }

/* Category grid (home page) */
.cat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; border: 1px solid #dedfe3; background: #dedfe3; margin-bottom: 26px; }
.cat-card { background: #fff; padding: 14px 14px 16px; display: flex; flex-direction: column; min-height: 124px; text-decoration: none; color: inherit; transition: background 0.15s; position: relative; }
.cat-card:hover { background: #f8f9fb; text-decoration: none; }
.cat-card .cat-icon { width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px; margin-bottom: 8px; letter-spacing: -0.02em; }
.cat-card .cat-name { font-size: 14px; font-weight: 650; color: #17181d; margin: 0 0 4px; }
.cat-card .cat-desc { font-size: 12px; color: #6d707a; line-height: 1.35; margin: 0; }
.cat-card .cat-badge { position: absolute; top: 10px; right: 10px; font-size: 10px; padding: 2px 6px; border-radius: 4px; background: #e94560; color: #fff; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

/* Two-column helper for home */
.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.panel { border: 1px solid #dedfe3; padding: 16px 18px; }
.panel h2 { margin-top: 0; }

.prompt-snap { display: grid; gap: 10px; }
.prompt-snap .prompt { padding: 10px 12px; border-left: 3px solid #2f5f9f; background: #f6f8fb; font-size: 13px; }
.prompt-snap .prompt small { color: #6d707a; display: block; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; font-size: 10px; font-weight: 650; }
.prompt-snap .prompt p { margin: 0; color: #1f2024; }

/* Filter input on archive pages */
.filter-bar { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; }
.filter-bar input, .filter-bar select { padding: 7px 10px; border: 1px solid #d6d7dc; border-radius: 6px; font-size: 13px; font-family: inherit; }
.filter-bar input { flex: 1; }
.filter-bar .count { font-size: 12px; color: #6d707a; }

/* Print */
.print-btn { position: fixed; right: 18px; bottom: 18px; border: 1px solid #d6d7dc; background: #fff; color: #202126; padding: 9px 13px; border-radius: 999px; cursor: pointer; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.print-btn:hover { background: #f8f9fb; }

footer { margin-top: 48px; padding-top: 18px; border-top: 1px solid #e5e7eb; color: #888a92; font-size: 12px; text-align: center; }

@media print { .topbar, .print-btn, .filter-bar { display: none; } body { font-size: 10px; } main { width: auto; padding: 0; } .layout { grid-template-columns: 1fr; } .sidebar { position: static; border-left: 0; padding-left: 0; } .info-block { break-inside: avoid; } }
@media (max-width: 1100px) { .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 980px) { .layout, .two-col { grid-template-columns: 1fr; } .sidebar { position: static; border-left: 0; padding-left: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; } .fact-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { main { padding-top: 24px; } h1 { font-size: 28px; } .section-grid, .sidebar, .cat-grid { grid-template-columns: 1fr; } .fact-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
