:root {
  --bg: #f4f1ea; --paper: #fffdf8; --ink: #22211f; --muted: #77726a; --line: #e2dccf;
  --brand: #1f3a4d; --brand2: #2f5d74; --accent: #c8553d; --ok: #3d7a4f; --warn: #b7791f;
  --red: #b33a3a; --blue: #2b5fa8; --radius: 6px;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: "PT Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; line-height: 1.5; }
a { color: var(--brand2); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

header.top { background: var(--brand); color: #fff; border-bottom: 3px solid var(--accent); }
header.top .wrap { display: flex; align-items: center; gap: 12px; min-height: 58px; flex-wrap: wrap; }
.logo { font-family: Georgia, "Times New Roman", serif; font-size: 1.55rem; color: #fff; letter-spacing: .5px; }
.logo small { display: block; font-family: inherit; font-size: .7rem; opacity: .7; letter-spacing: 2px; text-transform: uppercase; }
.logo:hover { text-decoration: none; }
nav.main { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
nav.main a, .userbar a { color: #dfe8ee; padding: 6px 8px; white-space: nowrap; border-radius: 4px; }
nav.main a:hover, .userbar a:hover { background: rgba(255,255,255,.1); text-decoration: none; color: #fff; }
.userbar { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.userbar form { display: inline; }
.userbar button { background: none; border: 0; color: #dfe8ee; cursor: pointer; font: inherit; padding: 6px 10px; }
.badge { background: var(--accent); color: #fff; font-size: .72rem; border-radius: 9px; padding: 0 6px; margin-left: 3px; }
.hqlink { background: #f3d27a !important; color: #3b2d06 !important; font-weight: bold; }

main { padding: 20px 0 40px; }
.crumbs { color: var(--muted); font-size: .9rem; margin-bottom: 10px; }
h1 { font-family: Georgia, serif; font-weight: normal; font-size: 1.7rem; margin: 6px 0 14px; }
h2 { font-family: Georgia, serif; font-weight: normal; font-size: 1.3rem; margin: 20px 0 10px; }
h3 { margin: 14px 0 6px; font-size: 1.05rem; }

.box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.box > .hd { background: #ebe5d8; padding: 8px 14px; font-weight: bold; border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0; display: flex; justify-content: space-between; align-items: center; }
.box > .bd { padding: 12px 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 300px; gap: 18px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }

table.list { width: 100%; border-collapse: collapse; }
table.list td, table.list th { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; }
table.list th { font-size: .8rem; text-transform: uppercase; color: var(--muted); font-weight: normal; letter-spacing: .5px; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr:hover td { background: #faf7f0; }
.cat-icon { font-size: 1.6rem; width: 46px; text-align: center; }
.cat-title { font-weight: bold; font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { text-align: center; color: var(--muted); white-space: nowrap; }
.pin { color: var(--accent); font-weight: bold; }

.post { display: grid; grid-template-columns: 170px 1fr; border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: 0; }
.post .who { background: #f7f3ea; padding: 14px; border-right: 1px solid var(--line); text-align: center; font-size: .85rem; }
.post .who img.av { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.post .who .name { font-weight: bold; font-size: .95rem; display: block; margin: 6px 0 2px; word-break: break-word; }
.post .content { padding: 12px 16px; min-width: 0; }
.post .meta { font-size: .8rem; color: var(--muted); display: flex; justify-content: space-between; gap: 10px;
  border-bottom: 1px dashed var(--line); padding-bottom: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.post .body { word-wrap: break-word; overflow-wrap: anywhere; }
.post .sig { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 6px; font-size: .82rem; color: var(--muted); }
.post .actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: .85rem; }
.post.deleted .body { color: var(--muted); font-style: italic; }
@media (max-width: 700px) { .post { grid-template-columns: 1fr; } .post .who { border-right: 0; text-align: left; display: flex; gap: 10px; align-items: center; } .post .who img.av { width: 48px; height: 48px; } }
blockquote { margin: 6px 0 10px; padding: 6px 12px; border-left: 3px solid var(--brand2); background: #f2eee5; font-size: .93rem; }
blockquote .qa { font-size: .8rem; color: var(--muted); font-weight: bold; }
code { background: #efe9dd; padding: 1px 5px; border-radius: 3px; font-family: Consolas, monospace; font-size: .9em; }
img.pimg { max-width: 100%; max-height: 480px; border-radius: 4px; border: 1px solid var(--line); margin: 6px 0; }
a.pfile { display: inline-block; padding: 6px 10px; background: #efe9dd; border-radius: 4px; margin: 4px 0; }
.mention { font-weight: bold; }
.tag { display: inline-block; font-family: "PT Sans", "Segoe UI", Roboto, Arial, sans-serif; vertical-align: middle; font-size: .72rem; padding: 1px 7px; border-radius: 9px; background: #e7e0d0; color: #574f40; margin: 2px 0; }
.tag.ver { background: #d8ecd9; color: #2a5d36; }
.tag.stu { background: #f3e4bf; color: #6b4b06; }
.tag.red { background: #f4d4d4; color: var(--red); }
.tag.blue { background: #d4e1f4; color: var(--blue); }
.tag.done { background: #d8ecd9; color: #2a5d36; }
.tag.burned { background: #f4d4d4; color: var(--red); }
.tag.progress { background: #f6e8c3; color: #7a5a10; }

.btn { display: inline-block; background: var(--brand2); color: #fff; border: 0; padding: 8px 16px; border-radius: 4px;
  cursor: pointer; font: inherit; font-size: .92rem; }
.btn:hover { background: var(--brand); text-decoration: none; color: #fff; }
.btn.sm { padding: 3px 10px; font-size: .8rem; }
.btn.ghost { background: transparent; color: var(--brand2); border: 1px solid var(--line); }
.btn.ghost:hover { background: #efe9dd; color: var(--brand); }
.btn.warn { background: var(--accent); }
.like-form { display: inline; }
.like-form button { background: none; border: 1px solid var(--line); border-radius: 12px; padding: 1px 10px; cursor: pointer; font: inherit; color: var(--muted); }
.like-form button.on { background: #fbe3dc; border-color: #e9b6a8; color: var(--accent); }

form.stack label { display: block; margin: 10px 0 4px; font-weight: bold; font-size: .9rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], textarea, select {
  width: 100%; padding: 8px 10px; border: 1px solid #cfc7b6; border-radius: 4px; font: inherit; background: #fff; }
textarea { min-height: 140px; resize: vertical; }
.editor .tools { display: flex; gap: 4px; margin-bottom: 4px; flex-wrap: wrap; align-items: center; }
.editor .tools button { border: 1px solid var(--line); background: #fff; border-radius: 3px; cursor: pointer; padding: 2px 8px; font: inherit; font-size: .85rem; }
.editor .tools label { font-size: .85rem; cursor: pointer; border: 1px dashed #bdb39e; padding: 2px 8px; border-radius: 3px; }
.editor .tools input[type=file] { display: none; }
.up-status { font-size: .8rem; color: var(--muted); }
.check { display: flex; gap: 8px; align-items: center; margin: 6px 0; font-weight: normal !important; }
.check input { width: auto; }

.flash { padding: 10px 14px; border-radius: 4px; margin-bottom: 12px; }
.flash.ok { background: #dff0e0; border: 1px solid #b9dcbc; }
.flash.error { background: #f8dcd6; border: 1px solid #ebb5aa; }
.announce { background: #fff4cf; border: 1px solid #ecd78f; padding: 8px 14px; border-radius: 4px; margin-bottom: 14px; }

.pager { display: flex; gap: 4px; margin: 10px 0; flex-wrap: wrap; }
.pager a, .pager span { padding: 3px 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--paper); font-size: .85rem; }
.pager span.cur { background: var(--brand2); color: #fff; border-color: var(--brand2); }

.heat { border-collapse: collapse; font-size: .7rem; }
.heat td { width: 17px; height: 15px; border: 1px solid #fff; }
.heat th { font-weight: normal; color: var(--muted); padding: 0 4px; }
.profile-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.profile-head img { width: 140px; height: 140px; border-radius: 8px; border: 1px solid var(--line); object-fit: cover; background: #fff; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs img { width: 90px; height: 70px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.online-list a { margin-right: 6px; }
.dm { max-width: 75%; padding: 8px 12px; border-radius: 10px; margin: 6px 0; background: #efe9dd; }
.dm.mine { margin-left: auto; background: #dbe7ee; }
.dm .t { font-size: .72rem; color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 70px; }
.bars div { flex: 1; background: var(--brand2); min-height: 1px; border-radius: 2px 2px 0 0; }
.bars.b2 div { background: var(--accent); }
.bars-l { display: flex; gap: 2px; font-size: .6rem; color: var(--muted); }
.bars-l span { flex: 1; text-align: center; }
.meter { height: 10px; background: #e7e0d0; border-radius: 5px; overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), var(--warn), var(--accent)); }
.score-big { font-size: 2.2rem; font-family: Georgia, serif; }
.team-red { border-top: 4px solid var(--red); }
.team-blue { border-top: 4px solid var(--blue); }
.phrase { background: #fff4cf; padding: 2px 6px; border-radius: 3px; font-family: Georgia, serif; }
footer.foot { color: var(--muted); font-size: .8rem; text-align: center; padding: 20px 0 30px; border-top: 1px solid var(--line); }
.hq-nav { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.hq-nav a { padding: 6px 14px; border-radius: 16px; background: #e7e0d0; color: var(--ink); }
.hq-nav a.on { background: var(--brand); color: #fff; }
pre.log { background: #1d2126; color: #cfe3cf; padding: 12px; border-radius: 4px; overflow: auto; font-size: .78rem; max-height: 500px; white-space: pre; }
