@font-face { font-family: 'Figtree'; src: url('/static/figtree.woff2') format('woff2'); font-weight: 300 900; font-style: normal; font-display: swap; }
:root { --ink: #0b1220; --ink-2: #4a5568; --ink-3: #8a94a6; --bg: #fff; --soft: #f4f7fb; --line: #e7ebf1; --accent: #0a59f7; --r: 6px; }
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; --ink: #edf2fb; --ink-2: #b7c3d7; --ink-3: #95a5bd; --bg: #0b101a; --soft: #141d2c; --line: #29354a; --accent: #79aaff; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-top: 28px; padding-bottom: 60px; min-height: 60vh; }

.strip { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #0b1220; color: #fff; font-size: 13px; padding: 8px 20px; }
.strip a { color: #fff; opacity: .85; }
.nav { display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5; }
.brand img { height: 20px; width: auto; display: block; filter: invert(1); }
.search { flex: 1; max-width: 420px; display: flex; gap: 8px; }
.search input { width: 100%; height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--soft); color: var(--ink); font: inherit; font-size: 14px; }
.search.big { max-width: none; margin: 14px 0 6px; }
.search.big input { height: 44px; }
.nav-r { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-link { color: var(--ink-2); font-weight: 600; font-size: 14px; }
form.inline { display: inline; margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; height: 42px; padding: 0 20px; border-radius: var(--r); border: 0; font: inherit; font-weight: 600; font-size: 14.5px; cursor: pointer; text-decoration: none !important; transition: transform .15s, box-shadow .15s; }
.btn.small { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn.dark { background: #0b1220; color: #fff; }
.btn.light { background: #eef1f6; color: #0b1220; }
.btn.danger { color: #c92a2a; }
.btn:hover { transform: translateY(-1px); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }

h1, h2 { letter-spacing: -0.02em; }
.hero { padding: 36px 0 30px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 300; line-height: 1.06; letter-spacing: -0.03em; margin: 0 0 14px; }
.hero p { font-size: 18px; color: var(--ink-2); max-width: 640px; margin: 0; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.h { font-size: 22px; margin: 34px 0 14px; }
.h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 300; margin: 6px 0 18px; }

.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.cat { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--r); background: var(--c); color: #fff; min-height: 128px; transition: transform .2s, box-shadow .2s; }
.cat:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(10, 30, 80, .18); text-decoration: none; }
.cat strong { font-size: 18px; letter-spacing: -0.01em; }
.cat span { font-size: 13.5px; opacity: .92; flex: 1; }
.cat em { font-style: normal; font-size: 12.5px; opacity: .85; }

.topics { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.topics li { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.topics li:hover { background: var(--soft); }
.t-title { grid-column: 1; font-weight: 700; font-size: 16.5px; color: var(--ink); letter-spacing: -0.01em; }
.t-meta { grid-column: 1; font-size: 13px; color: var(--ink-3); }
.t-stats { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 13px; color: var(--ink-3); text-align: right; }
.chip { display: inline-block; padding: 1px 8px; border-radius: var(--r); background: var(--c); color: #fff; font-size: 12px; font-weight: 600; }
.chip:hover { text-decoration: none; opacity: .9; }
.tag { display: inline-block; padding: 1px 7px; border-radius: var(--r); background: var(--soft); border: 1px solid var(--line); color: var(--ink-2); font-size: 11.5px; font-weight: 600; vertical-align: middle; }
.empty { color: var(--ink-3); padding: 18px 0; }
.count { color: var(--ink-2); }

.crumbs { display: flex; gap: 8px; font-size: 13.5px; color: var(--ink-3); margin-bottom: 16px; }
.crumbs a { color: var(--ink-2); }
.cat-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px; border-radius: var(--r); background: var(--c); color: #fff; margin-bottom: 20px; }
.cat-head h1 { margin: 0 0 4px; font-size: 30px; }
.cat-head p { margin: 0; opacity: .92; }
.cat-head .btn.dark { background: #fff; color: #0b1220; }

.topic-title { font-size: clamp(24px, 3.6vw, 34px); font-weight: 600; margin: 4px 0 18px; line-height: 1.15; }
.posts { display: flex; flex-direction: column; gap: 14px; }
.post { display: grid; grid-template-columns: 150px 1fr; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.post.gone { opacity: .6; }
.who { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; font-size: 14px; }
.av { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 18px; text-decoration: none !important; }
.av.big { width: 72px; height: 72px; font-size: 30px; }
.name { font-weight: 700; color: var(--ink); word-break: break-word; }
.role { display: inline-block; padding: 1px 7px; border-radius: var(--r); background: #e7f0ff; color: #0a59f7; font-size: 11.5px; font-weight: 700; }
.role.ban { background: #ffe3e3; color: #c92a2a; }
.msg { min-width: 0; }
.msg-meta { font-size: 12.5px; color: var(--ink-3); margin-bottom: 8px; }
.msg-meta a { color: var(--ink-3); }
.body { font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.body p { margin: 0 0 12px; }
.body p:last-child { margin-bottom: 0; }
.body a { color: var(--accent); text-decoration: underline; }
.body code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .9em; background: var(--soft); border: 1px solid var(--line); padding: 1px 6px; border-radius: var(--r); }
.body pre { background: #0b1220; color: #e6edf7; padding: 14px 16px; border-radius: var(--r); overflow-x: auto; margin: 0 0 12px; }
.body pre code { background: none; border: 0; padding: 0; color: inherit; }
.body blockquote { margin: 0 0 12px; padding: 4px 14px; border-left: 3px solid var(--accent); color: var(--ink-2); }
.body ul { margin: 0 0 12px; padding-left: 22px; }
.actions { margin-top: 10px; font-size: 13px; color: var(--ink-3); }
.modbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; background: var(--soft); border: 1px solid var(--line); border-radius: var(--r); margin: 0 0 16px; font-size: 14px; }

.compose { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; max-width: 760px; }
.compose label { font-weight: 700; font-size: 14px; margin-top: 8px; }
.compose input, .compose select, .compose textarea { width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--soft); color: var(--ink); font: inherit; font-size: 15px; }
.compose textarea { resize: vertical; min-height: 140px; line-height: 1.55; }
.compose .btn { align-self: flex-start; margin-top: 12px; }
.hint { font-size: 13px; color: var(--ink-3); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.alert { padding: 12px 16px; border-radius: var(--r); margin: 0 0 18px; font-size: 14.5px; }
.alert.ok { background: #e6f7ee; color: #14683a; }
.alert.err { background: #ffe9e9; color: #b02121; }
.auth { max-width: 460px; }
.auth .compose { margin-top: 10px; }
.alt { color: var(--ink-2); margin-top: 18px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 24px 0; font-size: 14px; }
.pg.cur { color: var(--ink-3); }
.profile { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.profile h1 { margin: 0 0 4px; font-size: 30px; }
.profile p { margin: 0; color: var(--ink-2); }
.admin-cats { display: flex; flex-direction: column; gap: 10px; }
.admin-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.admin-row input, .admin-row select { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--soft); color: var(--ink); font: inherit; font-size: 14px; }
.admin-row input[type=color] { padding: 2px; width: 44px; height: 36px; }
.admin-row input[type=number] { width: 70px; }

.foot { border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; }
.foot .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 20px; padding-bottom: 28px; }
.foot a { color: var(--ink-2); }

@media (max-width: 720px) {
  .nav { flex-wrap: wrap; gap: 10px; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .post { grid-template-columns: 1fr; gap: 10px; }
  .who { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .topics li { grid-template-columns: 1fr; }
  .t-stats { grid-column: 1; grid-row: auto; text-align: left; }
  .cat-head { flex-direction: column; align-items: flex-start; }
}

/* tema claro/escuro */
.brand img { filter: invert(1); }
html[data-theme="dark"] .brand img { filter: none; }
html[data-theme="dark"] .btn.dark { background: #edf2fb; color: #0b101a; }
html[data-theme="dark"] .btn.light { background: #202c40; color: var(--ink); }
html[data-theme="dark"] .strip { background: #05080e; }
html[data-theme="dark"] .role { background: #1c2c4d; color: #9fc0ff; }
html[data-theme="dark"] .role.ban { background: #4a1f24; color: #ff9a9a; }
html[data-theme="dark"] .alert.ok { background: #12301f; color: #8fe0b0; }
html[data-theme="dark"] .alert.err { background: #3d1a1d; color: #ffb0b0; }
html[data-theme="dark"] .btn.danger { color: #ff8a8a; }
html[data-theme="dark"] .body pre { background: #05080e; border: 1px solid var(--line); }
.theme-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--r); background: #eef1f6; flex-shrink: 0; }
.theme-choice { display: grid; place-items: center; width: 30px; height: 32px; padding: 0; background: transparent; border: 0; border-radius: var(--r); color: var(--ink-2); cursor: pointer; }
.theme-choice[aria-pressed="true"] { background: #fff; color: var(--accent); box-shadow: 0 2px 6px #0b122010; }
html[data-theme="dark"] .theme-switch { background: #202c40; }
html[data-theme="dark"] .theme-choice[aria-pressed="true"] { background: #354866; }
@media (max-width: 560px) { .theme-choice { width: 26px; } }
