/* Forum layout: light, plain and easy to scan. Blue for actions, bright colours for categories. */
:root {
  --text: #222222;
  --text-2: #4d4d4d;
  --muted: #919191;
  --line: #e9e9e9;
  --line-2: #dcdcdc;
  --bg: #ffffff;
  --bg-2: #f6f7f8;
  --accent: #0a78c2;
  --accent-dark: #075f9a;
  --accent-soft: #e6f2fa;
  --highlight: #fff8e1;
  --danger: #c4402f;
  --font: Arial, "Helvetica Neue", Helvetica, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --wrap: 1110px;
}
* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header */
.d-header { position: sticky; top: 0; z-index: 20; height: 64px; background: var(--bg); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.d-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.header-wrap { position: relative; }
.title { display: flex; align-items: center; gap: 12px; color: var(--text); }
.title:hover { text-decoration: none; }
.title .wordmark { height: 19px; width: auto; display: block; color: #111; }
.title .site-label { font-size: 15px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 4px; }
.header-icons { display: flex; align-items: center; gap: 4px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 0; background: none; color: #777; cursor: pointer; border-radius: 6px; }
.icon-btn:hover { color: var(--text); background: var(--bg-2); text-decoration: none; }
.icon-btn svg { width: 22px; height: 22px; }
.menu-panel { position: absolute; right: 16px; top: 60px; width: 300px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 10px 0; display: none; }
.menu-panel.open { display: block; }
.menu-panel h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 10px 16px 4px; font-weight: 700; }
.menu-panel a { display: flex; align-items: center; gap: 8px; padding: 7px 16px; font-size: 15px; color: var(--text); }
.menu-panel a:hover { background: var(--bg-2); text-decoration: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; font: inherit; font-size: 15px; border: 0; border-radius: 4px; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { text-decoration: none; }
.btn-default { background: #e9e9e9; color: var(--text); }
.btn-default:hover { background: #dcdcdc; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a23325; }
.btn svg { width: 15px; height: 15px; }
.btn[disabled] { opacity: .6; cursor: default; }
.btn-small { padding: 7px 12px; font-size: 14px; }

/* Navigation row */
.navigation-container { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 6px; margin: 22px 0 16px; }
.cat-select { position: relative; }
.cat-select summary { list-style: none; cursor: pointer; border: 1px solid var(--line-2); border-radius: 4px; padding: 8px 12px; font-size: 15px; color: var(--text); display: inline-flex; align-items: center; gap: 8px; min-width: 150px; justify-content: space-between; background: var(--bg); }
.cat-select summary::-webkit-details-marker { display: none; }
.cat-select[open] summary { border-color: var(--accent); }
.cat-select .drop { position: absolute; z-index: 10; top: calc(100% + 4px); left: 0; width: 290px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 6px 0; }
.cat-select .drop a { display: block; padding: 8px 14px; font-size: 15px; color: var(--text); }
.cat-select .drop a:hover { background: var(--bg-2); text-decoration: none; }
.nav-pills { display: flex; list-style: none; margin: 0 0 0 6px; padding: 0; }
.nav-pills a { display: block; padding: 8px 14px; font-size: 16px; color: var(--text); border-bottom: 3px solid transparent; }
.nav-pills a:hover { text-decoration: none; color: var(--accent); }
.nav-pills a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.nav-actions { margin-left: auto; }

/* Category badges and tags */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--c); flex: none; }
.badge:hover { text-decoration: none; color: var(--text); }
.tags { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: 10px; }
.tag { font-size: 13px; color: var(--text-2); background: var(--bg-2); border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; }

/* Categories page */
.categories-and-latest { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.table-head { display: flex; justify-content: space-between; font-size: 15px; font-weight: 700; color: var(--muted); padding: 0 8px 10px; border-bottom: 3px solid var(--line); }
.category-row { display: flex; align-items: flex-start; gap: 12px; border-left: 6px solid var(--c); border-bottom: 1px solid var(--line); padding: 16px 8px 16px 14px; }
.category-row:hover { background: #fafbfc; }
.category-row .info { flex: 1; min-width: 0; }
.category-name { font-size: 19px; font-weight: 700; color: var(--text); }
.category-name:hover { color: var(--accent); text-decoration: none; }
.category-desc { color: var(--text-2); font-size: 15px; margin-top: 5px; }
.subcats { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 9px; }
.subcats span { font-size: 14px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.subcats span::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--c); }
.category-count { width: 72px; text-align: right; font-size: 15px; color: var(--muted); flex: none; }
.category-count b { color: var(--text-2); font-weight: 700; font-size: 17px; }

.latest-row { display: flex; gap: 14px; align-items: flex-start; padding: 14px 8px; border-bottom: 1px solid var(--line); }
.latest-row:hover { background: #fafbfc; }
.latest-row .main { flex: 1; min-width: 0; }
.topic-link { font-size: 17px; color: var(--text); overflow-wrap: anywhere; }
.topic-link:hover { color: var(--accent); text-decoration: none; }
.topic-link:visited { color: #555; }
.latest-row .meta { margin-top: 5px; }
.latest-row .excerpt { font-size: 15px; color: var(--text-2); margin-top: 4px; }
.latest-row .side { text-align: right; flex: none; width: 76px; }
.side .num { font-size: 17px; font-weight: 700; color: #e45735; }
.side .age { font-size: 14px; color: var(--muted); margin-top: 2px; }
.more-link { display: block; padding: 14px 8px; font-size: 15px; font-weight: 700; }

/* Topic list */
.topic-list { width: 100%; border-collapse: collapse; }
.topic-list th { text-align: left; font-weight: 700; font-size: 15px; color: var(--muted); padding: 0 8px 10px; border-bottom: 3px solid var(--line); }
.topic-list th.num, .topic-list td.num { text-align: right; white-space: nowrap; }
.topic-list td { padding: 14px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.topic-list tbody tr:hover { background: #fafbfc; }
.topic-list .meta { margin-top: 5px; }
.topic-list .excerpt { font-size: 15px; color: var(--text-2); margin-top: 6px; max-width: 640px; }
.topic-list .thumb { width: 128px; }
.topic-list .thumb img { width: 128px; height: 72px; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; display: block; }
.nodes { font-size: 15px; color: var(--text-2); }
.nodes .arrow { color: var(--muted); padding: 0 3px; }
.nodes .after { font-weight: 700; color: #2a9d4b; }
.col-replies { font-size: 17px; font-weight: 700; color: var(--text-2); }
.age-cell { font-size: 15px; color: var(--muted); }
.empty { padding: 26px 8px; color: var(--muted); font-size: 16px; border-bottom: 1px solid var(--line); }

/* Category header */
.category-heading { border-left: 8px solid var(--c); padding: 8px 0 8px 16px; margin: 8px 0 4px; }
.category-heading h1 { font-size: 28px; margin: 0; }
.category-heading p { margin: 6px 0 0; color: var(--text-2); font-size: 16px; }

/* Topic page */
.topic-title { margin: 24px 0 8px; }
.topic-title h1 { font-size: 30px; line-height: 1.25; margin: 0 0 10px; font-weight: 700; }
.topic-area { display: grid; grid-template-columns: minmax(0, 720px) 160px; gap: 40px; margin-top: 14px; }
.topic-post { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; border-top: 1px solid var(--line); padding: 16px 0 6px; }
.names { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; gap: 10px; }
.username { font-weight: 700; color: var(--text); font-size: 16px; }
a.username:hover { color: var(--accent); }
.user-title { color: var(--muted); font-size: 14px; margin-left: 8px; }
.post-date { color: var(--muted); font-size: 14px; white-space: nowrap; }
.cooked { font-size: 17px; line-height: 1.6; overflow-wrap: anywhere; }
.cooked p { margin: 0 0 16px; }
.cooked h2 { font-size: 21px; margin: 22px 0 10px; }
.cooked figure { margin: 0 0 18px; }
.cooked figure img { border: 1px solid var(--line); border-radius: 4px; display: block; }
.cooked figcaption { font-size: 15px; color: var(--muted); margin-top: 6px; }
.cooked table { border-collapse: collapse; margin: 0 0 18px; font-size: 16px; }
.cooked th, .cooked td { padding: 8px 16px 8px 0; border-bottom: 1px solid var(--line); text-align: left; }
.cooked thead th { border-bottom: 2px solid var(--line-2); font-weight: 700; }
.cooked td:not(:first-child), .cooked th:not(:first-child) { text-align: right; }
.attachments { border: 1px solid var(--line-2); border-radius: 6px; padding: 12px 16px; margin: 0 0 18px; background: var(--bg-2); }
.attachments h3, .source-box h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 6px; font-weight: 700; }
.attachments a { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 700; }
.attachments a svg { width: 16px; height: 16px; }
.source-box { border-left: 5px solid var(--line-2); background: var(--bg-2); padding: 12px 16px; margin: 0 0 18px; font-size: 16px; }
.post-controls { display: flex; justify-content: flex-end; gap: 4px; padding: 4px 0 10px; }
.post-controls .icon-btn { width: 36px; height: 36px; }
.post-controls .icon-btn svg { width: 19px; height: 19px; }
.post-controls .copied { font-size: 14px; color: var(--muted); align-self: center; }
.post-panel { margin: 4px 0 12px; padding: 14px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 6px; }
.timeline { position: sticky; top: 96px; align-self: start; font-size: 15px; color: var(--muted); border-left: 1px solid var(--line-2); padding-left: 14px; }
.timeline .scroller { height: 120px; border-left: 4px solid var(--accent); margin: 8px 0 8px -16px; padding-left: 12px; display: flex; flex-direction: column; justify-content: center; }
.timeline .scroller b { color: var(--text); font-weight: 700; }
.suggested { margin-top: 40px; }
.suggested h2 { font-size: 20px; margin: 0 0 12px; font-weight: 700; }

/* Avatars: soft colour circles with one letter; guests say "guest". */
.avatar { width: 42px; height: 42px; border-radius: 50%; flex: none; display: block; }
.avatar.large { width: 48px; height: 48px; }
.avatar.small { width: 34px; height: 34px; }
.avatar.tiny { width: 22px; height: 22px; vertical-align: -6px; display: inline-flex; }
.avatar.huge { width: 120px; height: 120px; }
img.avatar { object-fit: cover; }
.avatar.letter { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-family: Arial, Helvetica, sans-serif; font-weight: 400; font-size: 22px; line-height: 1; }
.avatar.letter.large { font-size: 25px; }
.avatar.letter.small { font-size: 17px; }
.avatar.letter.tiny { font-size: 12px; }
.avatar.letter.huge { font-size: 60px; }
.avatar.guest { background: #9fb3c8; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.avatar.guest.large { font-size: 12px; }
.avatar.guest.small { font-size: 9px; }
.avatar.guest.tiny { font-size: 6px; }
.avatar.guest.huge { font-size: 26px; }

/* Account area in the header */
.auth-slot { display: inline-flex; align-items: center; gap: 8px; margin-right: 6px; position: relative; }
.avatar-btn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; display: inline-flex; }
.avatar-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.user-menu { position: absolute; right: 0; top: 46px; width: 230px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 6px 0; z-index: 30; }
.user-menu-name { padding: 8px 14px; font-weight: 700; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-menu-name span { display: block; font-weight: 400; font-size: 14px; color: var(--muted); }
.user-menu a, .user-menu button { display: block; width: 100%; text-align: left; padding: 8px 14px; font: inherit; font-size: 15px; background: none; border: 0; cursor: pointer; color: var(--text); }
.user-menu a:hover, .user-menu button:hover { background: var(--bg-2); text-decoration: none; }

/* Profiles */
.user-main { display: flex; gap: 24px; align-items: center; margin: 30px 0 10px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.user-main h1 { font-size: 30px; margin: 0; font-weight: 700; }
.user-handle { color: var(--muted); margin-top: 2px; font-size: 16px; }
.user-bio { margin: 10px 0 0; max-width: 560px; font-size: 16px; }
.user-meta { margin-top: 10px; font-size: 15px; color: var(--muted); }
.user-activity-h { font-size: 20px; margin: 20px 0 4px; font-weight: 700; }
.avatar-edit { display: flex; align-items: center; gap: 16px; }
.avatar-edit .btn { font-weight: 400; }

/* Forms */
.reply-area { margin: 28px 0 0 62px; border-top: 1px solid var(--line); padding-top: 18px; }
.reply-area h2 { font-size: 20px; margin: 0 0 12px; font-weight: 700; }
.post-form { display: grid; gap: 14px; max-width: 660px; }
.post-form label { display: grid; gap: 6px; font-size: 15px; font-weight: 700; color: var(--text); }
.post-form .hint { font-weight: 400; color: var(--muted); font-size: 14px; }
.post-form p.hint { margin: 0; }
.post-form input[type=text], .post-form input:not([type]), .post-form input[type=email], .post-form input[type=password], .post-form select, .post-form textarea {
  font: inherit; font-size: 16px; font-weight: 400; color: var(--text); padding: 9px 11px; border: 1px solid #c8c8c8; border-radius: 4px; background: var(--bg); width: 100%;
}
.post-form textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
.post-form input:focus, .post-form select:focus, .post-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.post-form input[type=file] { font-size: 15px; font-weight: 400; }
.posting-as { margin: 0; font-size: 15px; color: var(--text-2); }
.guest-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-status { font-size: 15px; color: var(--text-2); }
.form-status.error { color: var(--danger); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.new-topic { max-width: 720px; }

/* Search and static pages */
.search-box { display: flex; gap: 8px; margin: 24px 0 18px; }
.search-box input { flex: 1; font: inherit; font-size: 17px; padding: 10px 12px; border: 1px solid #c8c8c8; border-radius: 4px; }
.search-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.page-body { max-width: 720px; margin: 24px 0 40px; font-size: 17px; line-height: 1.65; }
.page-body h1 { font-size: 30px; margin: 0 0 14px; font-weight: 700; }

/* Footer */
.site-footer { margin-top: 60px; border-top: 1px solid var(--line); background: var(--bg-2); padding: 24px 0 44px; font-size: 15px; color: var(--muted); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }

@media (max-width: 960px) {
  .categories-and-latest { grid-template-columns: 1fr; }
  .topic-area { grid-template-columns: minmax(0, 1fr); }
  .timeline { display: none; }
}
@media (max-width: 640px) {
  .title .site-label { display: none; }
  .title .wordmark { height: 15px; }
  .nav-actions { margin-left: 0; width: 100%; }
  .nav-actions .btn { width: 100%; justify-content: center; }
  .topic-list .thumb, .topic-list .col-nodes, .topic-list .col-replies { display: none; }
  .topic-title h1 { font-size: 24px; }
  .topic-post { grid-template-columns: 1fr; }
  .topic-post > .avatar { display: none; }
  .reply-area { margin-left: 0; }
  .guest-fields { grid-template-columns: 1fr; }
  .auth-slot .btn-default { display: none; }
  .user-main { flex-direction: column; align-items: flex-start; }
  .menu-panel { left: 16px; right: 16px; width: auto; }
}
