/* ============================================================
   Wirex — stylesheet
   hand-written, one section at a time.  the class names are part
   of the site's contract with member layouts: .wrap .panel
   .heading .navbar .post .comment ... keep them.

   two things to keep in mind when editing:
   - literal colours are declared before the var() version so old
     engines (Vita browser, old WebKit) still get a readable page
   - layout is flexbox with -webkit- prefixes; no grid for anything
     structural
   ============================================================ */

:root {
  /* paper & ink */
  --bg: #100f11;
  --bg-2: #141317;
  --header: #17151a;
  --nav: #1a181d;
  --surface: #17161a;
  --surface-2: #1c1a1f;
  --surface-3: #242128;
  --surface-4: #322d36;
  --line: #2c2830;
  --line-2: #3d3742;
  --line-strong: #0a090b;

  --text: #d7d1c9;
  --text-strong: #f0e9e0;
  --text-dim: #ada5a0;
  --text-faint: #7b7370;

  --link: #e0a08c;
  --link-hover: #ffc2ad;
  --ok: #6f9b8c;
  --ok-text: #a9d3c4;
  --danger: #cf5f50;
  --danger-text: #eb8d7c;
  --on-accent: #14100f;
  --accent: #c9674f;
  --amber: #d3a663;

  --sans: Verdana, Geneva, Tahoma, "DejaVu Sans", Arial, sans-serif;
  --display: "Trebuchet MS", "Lucida Grande", Verdana, Tahoma, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;

  --radius: 0px;
  --shadow: 4px 4px 0 rgba(0, 0, 0, 0.35);
  --hair: rgba(255, 255, 255, 0.045);
}
/* Scrims laid over the member's page gradient. They are declared per theme so
   the panels stay the same tone as the rest of the page: dark scrims in dark
   mode, paper scrims in light mode. Hard-coding dark ones made light-mode text
   unreadable the moment a gradient was picked. */
body.has-page-gradient {
  --gradient-soft: rgba(18, 15, 22, 0.46);
  --gradient-soft-darker: rgba(10, 8, 14, 0.66);
  --scrim-panel: rgba(22, 19, 27, 0.78);
  --scrim-head: rgba(18, 16, 24, 0.62);
  --scrim-btn: rgba(18, 15, 22, 0.55);
  --scrim-btn-hover: rgba(45, 35, 60, 0.55);
  --scrim-msg: rgba(20, 16, 25, 0.5);
  --scrim-msg-mine: rgba(45, 35, 60, 0.5);
  --scrim-field: #0e0c12;
  --scrim-panel-solid: #16131b;
}
html[data-theme="light"] body.has-page-gradient {
  --gradient-soft: rgba(251, 248, 241, 0.62);
  --gradient-soft-darker: rgba(234, 226, 211, 0.78);
  --scrim-panel: rgba(251, 248, 241, 0.88);
  --scrim-head: rgba(234, 226, 211, 0.78);
  --scrim-btn: rgba(251, 248, 241, 0.78);
  --scrim-btn-hover: rgba(221, 210, 191, 0.88);
  --scrim-msg: rgba(251, 248, 241, 0.8);
  --scrim-msg-mine: rgba(221, 210, 191, 0.75);
  --scrim-field: #fbf8f1;
  --scrim-panel-solid: #fbf8f1;
}

html[data-theme="light"] {
  --bg: #f2ede3;
  --bg-2: #eae3d6;
  --header: #e6ddcc;
  --nav: #ded3c0;
  --surface: #fbf8f1;
  --surface-2: #f4efe4;
  --surface-3: #eae2d3;
  --surface-4: #ddd2bf;
  --line: #d3c7b2;
  --line-2: #b3a48b;
  --line-strong: #9c8c74;

  --text: #35302a;
  --text-strong: #1a1713;
  --text-dim: #57504a;
  --text-faint: #7d7469;

  --link: #a8452c;
  --link-hover: #822f18;
  --ok: #3f6d5e;
  --ok-text: #27503f;
  --danger: #ab3d26;
  --danger-text: #872b14;
  --on-accent: #fffaf2;
  --amber: #8a6320;

  --shadow: 4px 4px 0 rgba(90, 70, 50, 0.16);
  --hair: rgba(60, 45, 30, 0.05);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-flex-direction: column;
  flex-direction: column;
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.65;
  color: #d7d1c9;
  color: var(--text);
  background-color: #100f11;
  background-color: var(--bg);
}

body.has-page-gradient {
  background-image: -webkit-linear-gradient(left, var(--page-bg1), var(--page-bg2));
  background-image: linear-gradient(to right, var(--page-bg1), var(--page-bg2));
  background-color: var(--page-bg1);
  background-attachment: fixed;
}

/* Page gradient, toned down so panels/buttons/dialogs still read as surfaces. */
body.has-page-gradient .panel,
body.has-page-gradient .box,
body.has-page-gradient .card,
body.has-page-gradient .comment,
body.has-page-gradient .entry,
body.has-page-gradient .feed-item,
body.has-page-gradient .alert-row,
body.has-page-gradient .flash {
  background-image: -webkit-linear-gradient(var(--scrim-panel), var(--scrim-panel)), -webkit-linear-gradient(left, var(--page-bg1), var(--page-bg2));
  background-image: linear-gradient(var(--scrim-panel), var(--scrim-panel)), linear-gradient(to right, var(--page-bg1), var(--page-bg2));
  background-color: var(--scrim-panel-solid);
}
body.has-page-gradient .section-head,
body.has-page-gradient .side-title {
  background-image: -webkit-linear-gradient(var(--scrim-head), var(--scrim-head)), -webkit-linear-gradient(left, var(--page-bg1), var(--page-bg2));
  background-image: linear-gradient(var(--scrim-head), var(--scrim-head)), linear-gradient(to right, var(--page-bg1), var(--page-bg2));
}
body.has-page-gradient .btn {
  background-image: -webkit-linear-gradient(var(--scrim-btn), var(--scrim-btn)), -webkit-linear-gradient(left, var(--page-bg1), var(--page-bg2));
  background-image: linear-gradient(var(--scrim-btn), var(--scrim-btn)), linear-gradient(to right, var(--page-bg1), var(--page-bg2));
  background-attachment: fixed;
  background-color: var(--scrim-btn);
  color: var(--text-strong);
  border-color: var(--line-2);
}
body.has-page-gradient .btn:hover {
  background-image: -webkit-linear-gradient(var(--scrim-btn-hover), var(--scrim-btn-hover)), -webkit-linear-gradient(left, var(--page-bg1), var(--page-bg2));
  background-image: linear-gradient(var(--scrim-btn-hover), var(--scrim-btn-hover)), linear-gradient(to right, var(--page-bg1), var(--page-bg2));
  background-attachment: fixed;
  background-color: var(--surface-4);
  color: var(--text-strong);
  border-color: var(--line-2);
}
body.has-page-gradient .btn-ghost {
  background: var(--gradient-soft);
  color: var(--text-strong);
  border-color: var(--line-2);
}
body.has-page-gradient .btn-ghost:hover { color: var(--text-strong); background: var(--surface-4); border-color: var(--line-2); }
body.has-page-gradient input[type="color"], body.has-page-gradient input[type="file"],
body.has-page-gradient input[type="text"],
body.has-page-gradient input[type="password"],
body.has-page-gradient input[type="search"],
body.has-page-gradient input[type="email"],
body.has-page-gradient input[type="url"],
body.has-page-gradient input[type="number"],
body.has-page-gradient textarea,
body.has-page-gradient select {
  background-color: var(--scrim-field);
  background-image: none;
  background-attachment: fixed;
  color: var(--text) !important;
  border-color: var(--line-2) !important;
}
body.has-page-gradient input[type="color"] {
  background-image: -webkit-linear-gradient(var(--scrim-btn), var(--scrim-btn)), -webkit-linear-gradient(left, var(--page-bg1), var(--page-bg2));
  background-image: linear-gradient(var(--scrim-btn), var(--scrim-btn)), linear-gradient(to right, var(--page-bg1), var(--page-bg2));
  background-attachment: fixed;
  background-color: var(--scrim-btn);
  border-color: var(--line-2);
}
body.has-page-gradient input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
body.has-page-gradient input[type="color"]::-webkit-color-swatch { border: 1px solid var(--line-2); }

/* Disable gradient on tables and members lists (timestamps, ipts, delicate metadata) */
body.has-page-gradient .table,
body.has-page-gradient tr,
body.has-page-gradient td,
body.has-page-gradient th,
body.has-page-gradient .member-ip,
body.has-page-gradient .conversation,
body.has-page-gradient .track,
body.has-page-gradient .updates li,
body.has-page-gradient .plain li,
body.has-page-gradient .feature,
body.has-page-gradient .person-line,
body.has-page-gradient .msg-form,
body.has-page-gradient .msg-form textarea,
body.has-page-gradient .msg-form textarea:focus,
body.has-page-gradient .msg-mine .msg-text,
body.has-page-gradient .conference-list,
body.has-page-gradient .conversation-top,
body.has-page-gradient .msg-form textarea:focus+* {
  background: none;
  background-image: none;
}
body.has-page-gradient .msg-text {
  background-image: -webkit-linear-gradient(var(--scrim-msg), var(--scrim-msg)), -webkit-linear-gradient(left, var(--page-bg1), var(--page-bg2));
  background-image: linear-gradient(var(--scrim-msg), var(--scrim-msg)), linear-gradient(to right, var(--page-bg1), var(--page-bg2));
  background-attachment: fixed;
  background-color: var(--scrim-msg);
}
body.has-page-gradient .msg-mine .msg-text {
  background-image: -webkit-linear-gradient(var(--scrim-msg-mine), var(--scrim-msg-mine)), -webkit-linear-gradient(left, var(--page-bg1), var(--page-bg2));
  background-image: linear-gradient(var(--scrim-msg-mine), var(--scrim-msg-mine)), linear-gradient(to right, var(--page-bg1), var(--page-bg2));
  background-attachment: fixed;
  background-color: var(--surface-4);
  color: var(--text-strong);
}
body.has-page-gradient .msg-form textarea:focus,
body.has-page-gradient .msg-form textarea:focus+* {
  background-color: transparent;
  background-image: none;
  box-shadow: none;
  border-color: var(--line-2);
}
body.has-page-gradient .msg-form textarea:focus {
  box-shadow: 0 0 0 1px var(--accent);
  border-color: var(--accent);
}

/* CRT: scanlines, a soft tube glow at the corners, and a slow flicker.
   Sits above everything but never eats a click. */
body::after {
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9000;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.26) 0,
    rgba(0, 0, 0, 0.26) 1px,
    rgba(0, 0, 0, 0) 1px,
    rgba(0, 0, 0, 0) 3px
  );
  opacity: 0.85;
  -webkit-animation: crt-flicker 6s steps(60) infinite;
  animation: crt-flicker 6s steps(60) infinite;
}
@-webkit-keyframes crt-flicker {
  0%, 100% { opacity: 0.85; }
  48% { opacity: 0.85; }
  50% { opacity: 0.72; }
  52% { opacity: 0.85; }
  78% { opacity: 0.79; }
}
@keyframes crt-flicker {
  0%, 100% { opacity: 0.85; }
  48% { opacity: 0.85; }
  50% { opacity: 0.72; }
  52% { opacity: 0.85; }
  78% { opacity: 0.79; }
}
@media (prefers-reduced-motion: reduce) {
  body::after { -webkit-animation: none; animation: none; }
}
html[data-theme="light"] body::after { opacity: 0.5; }

/* 2000s link rules: everything in a page body is underlined */
a { color: #e0a08c; color: var(--link); text-decoration: underline; }
a:hover { color: #ffc2ad; color: var(--link-hover); text-decoration: underline; text-underline-offset: 2px; }
.brand, .nav-link, .btn, .chip, .user-card, .menu a, .track-play, .bulletin-card-title, a.post-title { text-decoration: none; }

h1, h2, h3, h4 {
  margin: 0 0 0.45em;
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}
h1 { font-size: 25px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 0.75em; }
p:last-child { margin-bottom: 0; }

hr { border: 0; border-top: 1px dotted var(--line-2); margin: 12px 0; }

code, kbd, samp {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 1px 4px;
  color: var(--text-strong);
  background: var(--surface-3);
  border: 1px solid var(--line);
}
pre {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 10px;
  overflow-x: auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-2);
}
::selection { background: var(--accent); color: var(--on-accent); }

/* ------------------------------------------------------------
   masthead
   ------------------------------------------------------------ */

.topbar {
  position: relative;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
  background: #17151a;
  background: var(--header);
  border-bottom: 1px solid var(--line-strong);
  border-bottom-color: #0a090b;
}
.topbar-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-align-items: center;
  align-items: center;
  padding: 6px 16px;
}
.brand {
  display: inline-block;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f0e9e0;
  color: var(--text-strong);
  margin-right: 18px;
  padding: 2px 0;
}
.brand:hover { color: var(--link); text-decoration: none; }

.topbar-right {
  margin-left: auto;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
}
.topbar-right > * { margin-left: 8px; }

.searchbox { display: flex; align-items: center; border: 1px solid var(--line-2); background: var(--bg); }
.searchbox input {
  width: 148px;
  height: 23px;
  padding: 0 6px;
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--text);
  background: transparent;
  border: 0;
}
.searchbox input:focus { outline: none; }
.searchbox:focus-within { border-color: var(--accent); }
.searchbox .btn { border: 0; border-left: 1px solid var(--line-2); height: 23px; }

.theme-toggle {
  width: 24px;
  height: 22px;
  padding: 0;
  display: inline-block;
  text-align: center;
  font-size: 12px;
  line-height: 20px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--line-2);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text-strong); border-color: var(--accent); background: var(--surface-3); }

.account { display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 10.5px; }
.user-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); }
.user-chip:hover { color: var(--text-strong); text-decoration: none; }
.user-chip-handle { max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-dot {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid currentColor;
  padding: 0 3px;
}

.navbar {
  -webkit-flex: 1 1 auto;
  flex: 1 1 auto;
  min-width: 0;
  background: none;
  border: 0;
}
.navbar-inner {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: nowrap;
  flex-wrap: nowrap;
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.navbar-inner::-webkit-scrollbar { display: none; }
.nav-link {
  display: block;
  padding: 4px 10px;
  margin-right: 2px;
  font-family: var(--sans);
  font-size: 11.5px;
  white-space: nowrap;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
}
.nav-link:hover { color: var(--text-strong); text-decoration: none; }
.nav-link.is-active { color: var(--text-strong); border-bottom-color: var(--accent); }

/* ------------------------------------------------------------
   page shell
   ------------------------------------------------------------ */

.wrap {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 16px 44px;
  flex: 1 0 auto;
}

.page-head {
  display: -webkit-flex;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  margin-bottom: 14px;
  border-bottom: 1px dotted var(--line-2);
}
.page-title { margin: 0; font-size: 28px; }
.page-sub { margin: 2px 0 0; font-family: var(--mono); font-size: 11px; color: var(--text-faint); }

/* columns are flex, not grid: the Vita browser only knows flexbox */
.grid { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; }
.grid > * { width: 100%; }
.grid-2 > * { width: 60%; }
.grid-2 > * + * { width: 38%; margin-left: 2%; }
.grid-3 > * { width: 32.5%; }
.grid-3 > * + * { margin-left: 1.25%; }
.grid > * + * { margin-top: 0; }
.grid-2 > * + *, .grid-3 > * + * { margin-top: 0; }
.stack > * + * { margin-top: 14px; }

.layout-home {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-align-items: flex-start;
  align-items: flex-start;
}
.layout-home > .col-main { width: 72%; }
.layout-home > .col-right { width: 25%; margin-left: 3%; }

/* home greeting + shortcuts */
.home-head {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: flex-end;
  align-items: flex-end;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.home-head-text .page-title { margin: 0; font-size: 27px; }
.home-head .page-sub { margin: 3px 0 0; font-family: var(--sans); font-size: 12.5px; color: var(--text-dim); }
.chips { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: -3px; }
.chips > * { margin: 3px; }
.chip {
  display: inline-block;
  padding: 2px 8px 3px;
  font-size: 11.5px;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.chip:hover { color: var(--text-strong); border-color: var(--accent); text-decoration: none; }
.chip.is-on { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.filter-toggle { margin: 0 0 10px -3px; }

.you-card { display: block; }
.you-card .avatar { display: -webkit-flex; display: flex; margin-bottom: 6px; }
.you-card-body { min-width: 0; }
.col-right { font-size: 11.5px; }
.col-right .side-title { margin: 14px 0 5px; }
.col-right .side-title:first-of-type { margin-top: 10px; }
.col-right .person-line { font-size: 11.5px; }
.col-right .accent-form { margin-top: 12px; }
.stats-inline { border: 0; padding: 0; margin: 0; background: none; gap: 10px 14px; }

/* ------------------------------------------------------------
   panels: a box with a lip, not a card
   ------------------------------------------------------------ */

.panel {
  position: relative;
  padding: 10px 12px;
  background: #17161a;
  background: var(--surface);
  border: 1px solid #2c2830;
  border-color: var(--line);
  border-radius: var(--radius);
}
.panel + .panel { margin-top: 12px; }
.stack .panel + .panel { margin-top: 0; }

/* quiet caption bar: a label with a rule under it */
.panel > .section-head:first-child,
.panel > .section-head {
  margin: -10px -12px 9px;
  padding: 5px 12px;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: baseline;
  align-items: baseline;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  background: #1c1a1f;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.section-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0;
  color: #f0e9e0;
  color: var(--text-strong);
}
.section-sub { font-family: var(--sans); font-size: 10.5px; color: var(--text-faint); }
.panel > .section-head h2 { color: var(--text-strong); }
.section-head { display: -webkit-flex; display: flex; -webkit-align-items: baseline; align-items: baseline; -webkit-justify-content: space-between; justify-content: space-between; margin-bottom: 9px; }
.section-head > * + * { margin-left: 10px; }
.panel-tight { padding: 8px 10px; }
.col-left .panel > .section-head,
.col-right .panel > .section-head { margin: -10px -12px 9px; padding: 4px 12px; }
.col-left .section-head h2,
.col-right .section-head h2 { font-size: 12px; }

.sidebar .panel,
.col-left .panel,
.col-right .panel { padding: 10px 11px; }
.col-left .panel > .section-head,
.col-right .panel > .section-head { margin: -10px -11px 9px; padding: 4px 11px; }

.kicker { margin: 0 0 4px; font-size: 11px; font-style: italic; color: var(--text-faint); }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.mono { font-family: var(--mono); font-size: 11.5px; }
.custom-box iframe { display: block; max-width: 100%; margin: 10px 0; border: 0; background: #000; }
.member-ip { margin-top: 2px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.02em; color: var(--text-faint); }
.admin-ip-form {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 10px;
  -webkit-align-items: flex-end;
  align-items: flex-end;
  margin-bottom: 14px;
}
.admin-ip-form > * { margin-top: 0 !important; }
.admin-ip-form .field { -webkit-flex: 1 1 160px; flex: 1 1 160px; min-width: 130px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.rule { border-top: 1px dotted var(--line-2); margin: 11px 0; }
.crumb { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 12px; }

/* sidebar menu: an index, not buttons */
.menu { list-style: none; margin: 0; padding: 0; }
.menu li { border-bottom: 1px dotted var(--line); }
.menu li:last-child { border-bottom: 0; }
.menu a { display: block; padding: 4px 0 4px 11px; position: relative; font-size: 12px; color: var(--text-dim); }
.menu a::before {
  content: "·";
  position: absolute;
  left: 1px;
  color: var(--text-faint);
}
.menu a:hover { color: var(--text-strong); text-decoration: none; }
.menu a:hover::before { content: "›"; color: var(--accent); }

/* ------------------------------------------------------------
   controls
   ------------------------------------------------------------ */

.btn {
  display: inline-block;
  height: auto;
  padding: 3px 11px 4px;
  font-family: var(--sans);
  font-size: 11.5px;
  line-height: 1.4;
  text-align: center;
  color: #fff;
  background: #b45a43;
  background: var(--accent);
  border: 1px solid #70331f;
  border-radius: 2px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { color: #fff; background: #c9674f; text-decoration: none; }
.btn:active { background: #a94f3a; }
.btn-ghost {
  color: #d7d1c9;
  color: var(--text);
  background: #242128;
  background: var(--surface-3);
  border-color: #3d3742;
  border-color: var(--line-2);
}
body.has-page-gradient .btn-ghost {
  background: var(--gradient-soft);
  color: var(--text-strong);
  border-color: var(--line-2);
}
body.has-page-gradient .btn-ghost:hover { color: var(--text-strong); background: var(--surface-4); }
.btn-ghost:hover { color: #f0e9e0; background: #2d2932; background: var(--surface-4); }
.btn-tiny { padding: 1px 7px 2px; font-size: 10.5px; }
.btn-block { display: block; width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.inline { display: inline; margin: 0; }
.link-btn {
  padding: 0;
  background: none;
  border: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  cursor: pointer;
}
.link-btn:hover { color: var(--text-strong); text-decoration: underline; }
.link-btn.danger:hover { color: var(--danger-text); }

/* forms: flat fields with a single bottom rule */
.form { display: block; }
.form > * + * { margin-top: 10px; }
.field { display: block; }
.field > * + * { margin-top: 3px; }
.field > label, .label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
}
input,
textarea,
select,
.field input,
.field textarea,
.field select,
.form input,
.form textarea,
.form select {
  width: 100%;
  padding: 5px 8px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--text) !important;
  background: var(--bg) !important;
  border: 1px solid var(--line-2) !important;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  color-scheme: dark;
}
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  color-scheme: light;
  background: #fffdf8 !important;
}
input:focus, textarea:focus, select:focus,
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 1px var(--accent);
}
.field textarea { min-height: 112px; resize: vertical; line-height: 1.6; }
.field-row { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; }
.field-row > * { width: 48.5%; }
.field-row > * + * { margin-left: 3%; }
.hint { font-size: 11px; color: var(--text-faint); line-height: 1.5; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
input[type="color"] { width: 40px; height: 23px; padding: 0; border: 1px solid var(--line-2); background: var(--bg); }
input[type="file"] { font-size: 11.5px; color: var(--text-dim); padding: 5px 8px; }
input[type="file"]::file-selector-button {
  margin-right: 8px;
  padding: 2px 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  cursor: pointer;
}

.flash {
  margin-bottom: 14px;
  padding: 7px 11px;
  font-size: 12px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--text-faint);
}
.flash-err { border-left-color: var(--danger); color: var(--danger-text); }
.flash-ok { border-left-color: var(--ok); color: var(--ok-text); }

/* ------------------------------------------------------------
   avatars
   ------------------------------------------------------------ */

.avatar {
  display: -webkit-inline-flex;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
  flex: 0 0 auto;
  font-family: var(--display);
  font-weight: 700;
  color: var(--text-faint);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  border-radius: 0;
}
.avatar-xs { width: 17px; height: 17px; font-size: 8px; }
.avatar-sm { width: 31px; height: 31px; font-size: 11px; }
.avatar-md { width: 52px; height: 52px; font-size: 17px; }
.avatar-lg { width: 100%; height: auto; aspect-ratio: 1 / 1; font-size: 34px; }
.avatar-xl { width: 104px; height: 104px; font-size: 36px; }
.avatar-xxl { width: 150px; height: 150px; font-size: 52px; }
a:hover > .avatar { border-color: var(--accent); }

/* ------------------------------------------------------------
   profile
   ------------------------------------------------------------ */

.profile-hero {
  margin-bottom: 14px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
}
.profile-banner {
  height: 132px;
  background-color: var(--surface-3);
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--line-strong);
}
.profile-head {
  display: -webkit-flex;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 12px 14px;
}
.profile-head .avatar {
  margin-top: -66px;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line-2);
}
@media (max-width: 620px) {
  .avatar-xl { width: 84px; height: 84px; font-size: 28px; }
  .avatar-xxl { width: 112px; height: 112px; font-size: 38px; }
  .profile-head .avatar { margin-top: -50px; }
}
.profile-id { flex: 1; min-width: 0; }
.profile-name { margin: 0; font-size: 23px; }
.profile-handle { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.05em; color: var(--text-faint); }
.presence {
  display: inline-block;
  margin-left: 6px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.03em;
  color: var(--text-faint);
  vertical-align: middle;
  white-space: nowrap;
}
.presence-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 3px;
  vertical-align: middle;
  background: #7b7370;
  background: var(--text-faint);
  border: 1px solid var(--line-2);
}
.presence.is-online { color: #6f9b8c; color: var(--ok-text); }
.presence.is-online .presence-dot {
  background: #6f9b8c;
  background: var(--ok);
  border-color: #6f9b8c;
  border-color: var(--ok);
}
.profile-actions { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 2px; align-items: center; }
.profile-tagline { margin: 4px 0 0; font-size: 12.5px; color: var(--text-dim); }

.stats {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  padding: 6px 12px;
  margin-bottom: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.stat { display: -webkit-flex; display: flex; -webkit-align-items: baseline; align-items: baseline; margin-right: 16px; }
.stat > * + * { margin-left: 5px; }
.stat-value { font-family: var(--display); font-size: 15px; font-weight: 700; color: var(--text-strong); }
.stat-label { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }

/* ------------------------------------------------------------
   people
   ------------------------------------------------------------ */

.cards { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -5px; }
.cards > * { width: 47%; margin: 0 1.5% 10px; }
.user-card {
  display: -webkit-flex;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.user-card:hover { background: var(--surface-3); border-color: var(--line-2); text-decoration: none; }
.user-card-body { display: block; min-width: 0; flex: 1; }
.user-card-body > * { display: block; }
.user-card-name { font-family: var(--display); font-size: 13.5px; font-weight: 700; color: var(--text-strong); }
.user-card-handle { font-family: var(--mono); font-size: 10px; color: var(--text-faint); }
.user-card-tag { font-size: 11.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card-meta { font-family: var(--mono); font-size: 9.5px; color: var(--text-faint); }

/* ------------------------------------------------------------
   album
   ------------------------------------------------------------ */

.album { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -3px; }
.album-item { width: 25%; padding: 0 3px 10px; }
.album-photo { display: block; width: 100%; height: auto; border: 1px solid var(--line-2); background: #111; }
.album-item a:hover .album-photo { border-color: var(--accent); }
.album-caption { display: block; margin-top: 2px; font-family: var(--mono); font-size: 9.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album-item form { display: block; }
.album-item .link-btn { font-family: var(--mono); font-size: 9.5px; }
.album-add { margin-top: 2px; }
.album-by { display: block; margin-top: 1px; font-family: var(--mono); font-size: 9.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album-by:hover { color: var(--accent); }
.album-actions { margin: 9px 0 0; }
.album-actions .btn { margin: 0 6px 6px 0; }
@media (max-width: 620px) {
  .album-item { width: 50%; }
}

/* ------------------------------------------------------------
   journal
   ------------------------------------------------------------ */

.post {
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.post-head { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; margin-bottom: 4px; }
.post-title { margin: 0; font-size: 17px; }
a.post-title { color: var(--text-strong); text-decoration: none; }
a.post-title:hover { color: var(--accent); text-decoration: none; }
.post-meta { font-family: var(--mono); font-size: 10px; letter-spacing: 0.03em; color: var(--text-faint); }
.post-body { color: var(--text-dim); font-size: 12.5px; line-height: 1.65; }
.post-body strong { color: var(--text-strong); }
.post-body a { color: var(--link); }

/* markdown output */
.post-body p, .bulletin-body p { margin: 0 0 10px; }
.post-body p:last-child, .bulletin-body p:last-child { margin-bottom: 0; }
.post-body h2, .post-body h3, .post-body h4,
.bulletin-body h2, .bulletin-body h3, .bulletin-body h4 {
  margin: 18px 0 7px;
  font-family: var(--display);
  font-size: 19px;
  line-height: 1.25;
  color: var(--text-strong);
}
.post-body h3, .bulletin-body h3 { font-size: 16px; }
.post-body h4, .bulletin-body h4 { font-size: 14px; }
.post-body > :first-child, .bulletin-body > :first-child { margin-top: 0; }
.post-body ul, .post-body ol, .bulletin-body ul, .bulletin-body ol { margin: 0 0 10px; padding-left: 21px; }
.post-body li, .bulletin-body li { margin-bottom: 3px; }
.post-body blockquote, .bulletin-body blockquote {
  margin: 0 0 10px;
  padding: 1px 0 1px 12px;
  border-left: 2px solid var(--line-strong);
  color: var(--text-faint);
}
.post-body code, .bulletin-body code {
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 0 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-strong);
}
.post-body pre, .bulletin-body pre {
  margin: 0 0 10px;
  padding: 9px 11px;
  overflow-x: auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.post-body pre code, .bulletin-body pre code {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-dim);
}
.post-body hr, .bulletin-body hr { margin: 15px 0; border: 0; border-top: 1px dotted var(--line-2); }
.post-body del, .bulletin-body del { color: var(--text-faint); }
.post-foot {
  display: -webkit-flex;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 7px;
  border-top: 1px dotted var(--line-2);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
}
.post-foot a { color: var(--text-dim); }

/* ------------------------------------------------------------
   replies & guestbook
   ------------------------------------------------------------ */

.comment { display: flex; gap: 9px; padding: 9px 0; border-bottom: 1px dotted var(--line); }
.comment:last-child { border-bottom: 0; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.comment-author { font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--text-strong); }
.comment-time { font-family: var(--mono); font-size: 9.5px; color: var(--text-faint); }
.comment-text { color: var(--text-dim); font-size: 12.5px; overflow-wrap: anywhere; }
.comment-permalink { font-family: var(--mono); font-size: 9.5px; color: var(--text-faint); }
.comment-permalink:hover { color: var(--accent); }
.gb-entry { display: flex; gap: 9px; padding: 10px 0; border-bottom: 1px dotted var(--line); }
.gb-entry:last-child { border-bottom: 0; }

/* ------------------------------------------------------------
   bulletins
   ------------------------------------------------------------ */

.bulletin-layout { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; -webkit-align-items: flex-start; align-items: flex-start; }
.bulletin-layout > *:first-child { width: 66%; }
.bulletin-layout > * + * { width: 31%; margin-left: 3%; }
.bulletin-list > * + * { margin-top: 12px; }

.bulletin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  padding: 11px 13px;
}
.bulletin-card-head { display: flex; align-items: flex-start; gap: 9px; }
.bulletin-card-meta { flex: 1; min-width: 0; }
.bulletin-card-meta > * { display: block; }
.bulletin-card-title { font-family: var(--display); font-size: 16px; font-weight: 700; color: var(--text-strong); }
.bulletin-card-title:hover { color: var(--accent); text-decoration: none; }
.bulletin-card-by { font-family: var(--mono); font-size: 9.5px; color: var(--text-faint); }
.bulletin-card-by a { color: var(--text-dim); }
.bulletin-count { font-family: var(--mono); font-size: 9.5px; color: var(--text-faint); white-space: nowrap; }
.bulletin-card-excerpt { margin: 8px 0 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.6; }
.bulletin-card-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-top: 8px; border-top: 1px dotted var(--line); }

.bulletin {
  margin-bottom: 16px;
  padding: 16px 18px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
}
.bulletin-head { display: flex; align-items: flex-start; gap: 11px; }
.bulletin-head-body { flex: 1; min-width: 0; }
.bulletin-title { margin: 0; font-size: 25px; line-height: 1.2; }
.bulletin-meta { margin: 5px 0 0; font-family: var(--mono); font-size: 10px; color: var(--text-faint); }
.bulletin-meta a { color: var(--text-dim); }
.bulletin-body {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px dotted var(--line-2);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text);
  overflow-wrap: anywhere;
}
.bulletin-replies .comment-list { margin-bottom: 4px; }
.bulletin-comment { display: flex; gap: 9px; padding: 10px 0; border-bottom: 1px dotted var(--line); }
.bulletin-comment:last-child { border-bottom: 0; }
.bulletin-comment.is-focused { background: rgba(201, 103, 79, 0.12); background: color-mix(in srgb, var(--accent) 10%, transparent); border-left: 2px solid var(--accent); padding-left: 8px; }
.bulletin-reply-form { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }

.bulletin-form > * + * { margin-top: 8px; }
.bulletin-form-head { display: flex; align-items: center; gap: 7px; }
.bulletin-form-sign { font-family: var(--mono); font-size: 10px; color: var(--text-faint); }
.bulletin-form .field textarea { min-height: 96px; }

.bulletin-mini { list-style: none; margin: 0; padding: 0; }
.bulletin-mini li { padding: 6px 0; border-bottom: 1px dotted var(--line); }
.bulletin-mini li:last-child { border-bottom: 0; }
.bulletin-mini-title { font-family: var(--display); font-size: 13px; font-weight: 700; color: var(--text-strong); }
.bulletin-mini-title:hover { color: var(--accent); text-decoration: none; }
.bulletin-mini-meta { font-family: var(--mono); font-size: 9.5px; color: var(--text-faint); }

/* ------------------------------------------------------------
   radio & player
   ------------------------------------------------------------ */

ul.tracks { list-style: none; margin: 0; padding: 0; }
.track { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-bottom: 1px dotted var(--line); }
.track:last-child { border-bottom: 0; }
.track-play {
  width: 24px;
  height: 22px;
  flex: 0 0 auto;
  display: block;
  padding: 0;
  text-align: center;
  font-size: 8px;
  line-height: 20px;
  color: var(--text-dim);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  cursor: pointer;
}
.track-play:hover { color: var(--on-accent); background: var(--accent); border-color: var(--line-strong); }
.track-body { flex: 1; min-width: 0; }
.track-body > * { display: block; }
.track-title { font-size: 12.5px; font-weight: 600; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-sub { font-family: var(--mono); font-size: 9.5px; color: var(--text-faint); }
.track-actions { display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 10px; }
.track-dl { color: var(--text-faint); }
.track-dl:hover { color: var(--accent); }

.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9500;
  display: -webkit-flex;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  background: var(--header);
  border-top: 2px solid var(--line-strong);
}
.player[hidden] { display: none; }
.player-title { font-family: var(--mono); font-size: 10px; color: var(--text-dim); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player audio { height: 28px; width: 260px; max-width: 50vw; }
.player-close { margin-left: auto; padding: 0 2px; font-size: 14px; color: var(--text-faint); background: none; border: 0; cursor: pointer; }
.player-close:hover { color: var(--text-strong); }
body.has-player { padding-bottom: 48px; }

/* ------------------------------------------------------------
   landing
   ------------------------------------------------------------ */

.page-title { font-size: 30px; letter-spacing: -0.03em; font-weight: 800; }

/* front page: not a hero, just a heading and some words */
.intro { padding-bottom: 12px; margin-bottom: 16px; border-bottom: 1px dotted var(--line-2); }
.site-title { margin: 0 0 6px; font-size: 30px; letter-spacing: -0.02em; }
.intro p { max-width: 620px; font-size: 12.5px; line-height: 1.7; color: var(--text-dim); }
.intro-links { margin-top: 8px; }
.intro-links a { margin-right: 6px; }

.front { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; -webkit-align-items: flex-start; align-items: flex-start; }
.front-main { width: 64%; }
.front-side { width: 32%; margin-left: 4%; font-size: 11.5px; }

.box {
  padding: 10px 12px;
  margin-bottom: 12px;
  background: #17161a;
  background: var(--surface);
  border: 1px solid #2c2830;
  border-color: var(--line);
}
.box h2 { margin: 0 0 8px; font-size: 13px; }

.side-title {
  margin: 14px 0 4px;
  padding-bottom: 2px;
  font-size: 12px;
  border-bottom: 1px dotted var(--line-2);
}
.front-side .side-title:first-child { margin-top: 0; }

.small { font-size: 11px; line-height: 1.6; color: var(--text-faint); }

.person-line { padding: 3px 0; font-size: 12px; }
.person-line .avatar { vertical-align: -8px; margin-right: 4px; }
.person-line .small { margin-left: 4px; }

.updates { list-style: none; margin: 0; padding: 0; font-size: 11.5px; color: var(--text-dim); }
.updates li { padding: 4px 0; border-bottom: 1px dotted var(--line); }
.updates li:last-child { border-bottom: 0; }
.updates b { display: inline-block; width: 30px; font-family: var(--mono); font-size: 9.5px; font-weight: 400; color: var(--text-faint); }

.plain { list-style: none; margin: 0; padding: 0; font-size: 12.5px; color: var(--text-dim); }
.plain li { padding: 3px 0 3px 14px; position: relative; }
.plain li::before { content: "–"; position: absolute; left: 0; color: var(--text-faint); }
.plain b { color: var(--text-strong); }

.feature { padding: 9px 0; border-bottom: 1px dotted var(--line); }
.feature:last-child { border-bottom: 0; }
.feature h3 { margin-bottom: 2px; font-size: 14px; }
.feature p { margin: 0; font-size: 12px; color: var(--text-dim); }
.feature-glyph, .hero-ascii { display: none; }

/* ------------------------------------------------------------
   activity
   ------------------------------------------------------------ */

.feed-item { display: flex; gap: 9px; padding: 8px 0; border-bottom: 1px dotted var(--line); }
.feed-item:last-child { border-bottom: 0; }
.feed-body { flex: 1; min-width: 0; }
.feed-line { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.feed-line strong { font-family: var(--display); font-size: 13px; color: var(--text-strong); }
.feed-title { display: inline-block; margin-top: 2px; font-size: 12.5px; color: var(--link); }
.feed-text { margin: 2px 0 0; font-size: 11.5px; color: var(--text-faint); }
.feed-kind { display: none; }

/* ------------------------------------------------------------
   odds & ends
   ------------------------------------------------------------ */

.empty { padding: 22px 10px; text-align: center; font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.empty-glyph { display: none; }
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.pager-page { font-family: var(--mono); font-size: 10px; color: var(--text-faint); }

.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th {
  padding: 5px 7px;
  text-align: left;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: var(--surface-3);
  border-bottom: 1px solid var(--line-2);
}
.table td { padding: 6px 7px; color: var(--text-dim); border-bottom: 1px dotted var(--line); vertical-align: top; }
.table tr:hover td { background: var(--surface-2); }

.badge {
  display: inline-block;
  padding: 0 4px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
  border: 1px solid var(--line-2);
}
.badge-admin { color: var(--amber); border-color: var(--amber); }
.badge-banned { color: var(--danger-text); border-color: var(--danger-text); }

.footer {
  flex: 0 0 auto;
  padding: 9px 16px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  line-height: 1.6;
  color: var(--text-faint);
  background: var(--bg-2);
  border-top: 1px solid var(--line);
}
.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: -webkit-flex;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.footer-brand { display: inline-flex; align-items: center; gap: 5px; color: var(--text-dim); }
.footer-links { color: var(--text-faint); }
.footer-note { color: var(--text-faint); }

.accent-form { margin-top: 11px; padding-top: 9px; border-top: 1px dotted var(--line); }
.accent-row { display: flex; align-items: center; gap: 7px; }
.accent-row input[type="color"] { width: 34px; height: 22px; }

/* conversations */
.conversations { display: block; }
.conversation {
  display: -webkit-flex;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 2px;
  color: var(--text);
  border-bottom: 1px dotted var(--line);
}
.conversation:last-child { border-bottom: 0; }
.conversation:hover { background: var(--surface-2); text-decoration: none; }
.conversation-body { flex: 1; min-width: 0; }
.conversation-body > * { display: block; }
.conversation-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.conversation-name { font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--text-strong); }
.conversation-time { font-family: var(--mono); font-size: 9.5px; color: var(--text-faint); white-space: nowrap; }
.conversation-line { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.thread {
  padding: 5px 0 11px;
  margin-bottom: 11px;
  border-bottom: 1px solid var(--line);
}
/* conversation thread (messages): scroll vertically, never horizontally */
.thread[data-thread] {
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-flex-direction: column;
  flex-direction: column;
  gap: 8px;
  max-height: 55vh;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}
.msg { display: -webkit-flex; display: flex; gap: 8px; -webkit-align-items: flex-start; align-items: flex-start; -webkit-justify-content: flex-start; justify-content: flex-start; width: 100%; min-width: 0; }
.msg-body { max-width: 72%; min-width: 0; }
.msg-mine { -webkit-justify-content: flex-end; justify-content: flex-end; }
.msg-mine .msg-body { text-align: right; }
.msg-mine .msg-text { background: #2a2226; background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); }
.msg-meta { margin-bottom: 1px; font-family: var(--mono); font-size: 9.5px; color: var(--text-faint); }
.msg-text {
  display: block;
  max-width: 100%;
  padding: 6px 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow-wrap: break-word;
  word-wrap: break-word;
  white-space: normal;
}
.msg-form > * + * { margin-top: 8px; }
.msg-form textarea {
  width: 100%;
  min-height: 72px;
  padding: 6px 9px;
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-2);
  resize: vertical;
}
.msg-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* member-written profile box */
.custom-box { font-size: 12.5px; color: var(--text-dim); overflow-wrap: anywhere; }
.custom-box img { max-width: 100%; height: auto; }
.custom-box a { color: var(--link); }
.custom-box table { max-width: 100%; }
.custom-box marquee { display: block; }

/* ------------------------------------------------------------
   small screens
   ------------------------------------------------------------ */

@media (max-width: 900px) {
  .front-main { width: 58%; }
  .front-side { width: 38%; margin-left: 4%; }
  .layout-home > .col-main { width: 68%; }
  .layout-home > .col-right { width: 29%; margin-left: 3%; }
  .grid-2 > * { width: 100%; }
  .grid-2 > * + * { width: 100%; margin-left: 0; margin-top: 14px; }
  .grid-3 > * { width: 100%; }
  .grid-3 > * + * { margin-left: 0; margin-top: 14px; }
  .bulletin-layout > *:first-child { width: 100%; }
  .bulletin-layout > * + * { width: 100%; margin-left: 0; margin-top: 14px; }
}

@media (max-width: 720px) {
  body { font-size: 12px; }
  .topbar-inner { padding: 6px 12px; }
  .brand { font-size: 18px; margin-right: 10px; }
  .searchbox { display: none; }
  .navbar { -webkit-flex-basis: 100%; flex-basis: 100%; -webkit-order: 3; order: 3; border-top: 1px solid var(--line); padding-top: 4px; margin-top: 6px; }
  .navbar-inner { -webkit-flex-wrap: wrap; flex-wrap: wrap; }
  .nav-link { padding: 3px 8px 4px; }
  .wrap { padding: 16px 12px 36px; }
  .layout-home > .col-main,
  .layout-home > .col-right { width: 100%; margin-left: 0; }
  .layout-home > .col-right { margin-top: 12px; }
  .home-head { -webkit-align-items: flex-start; align-items: flex-start; }
  .home-head-text .page-title { font-size: 23px; }
  .profile-head { -webkit-flex-wrap: wrap; flex-wrap: wrap; }
  .profile-id { padding-top: 0; }
  .field-row > * { width: 100%; }
  .field-row > * + * { margin-left: 0; margin-top: 9px; }
  .cards > * { width: 100%; margin: 0 0 10px; }
  .front-main, .front-side { width: 100%; margin-left: 0; }
  .player audio { width: 180px; }
}

/* ------------------------------------------------------------
   alerts
   ------------------------------------------------------------ */

.alert-list { border-top: 1px dotted var(--line); }
.alert-row {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  padding: 9px 4px;
  border-bottom: 1px dotted var(--line);
  color: var(--text);
}
.alert-row:hover { background: var(--surface-2); text-decoration: none; }
.alert-row.is-unread { background: rgba(201, 103, 79, 0.07); }
.alert-row.is-unread::before {
  content: "";
  display: block;
  width: 3px;
  -webkit-align-self: stretch;
  align-self: stretch;
  margin-right: 8px;
  background: var(--accent);
}
.alert-body {
  -webkit-flex: 1 1 auto;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 10px;
}
.alert-line { display: block; font-size: 12.5px; color: var(--text-dim); }
.alert-row.is-unread .alert-line { color: var(--text-strong); }
.alert-who { color: var(--link); }
.alert-subject {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.alert-time { font-family: var(--mono); font-size: 9.5px; color: var(--text-faint); white-space: nowrap; }

/* ------------------------------------------------------------
   page swaps
   the bar is only ever shown between a click and the new page.
   ------------------------------------------------------------ */

.nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  z-index: 300;
  background: var(--accent);
  opacity: 0;
  box-shadow: 0 0 6px var(--accent);
  -webkit-transition: width 0.5s ease-out, opacity 0.2s linear;
  transition: width 0.5s ease-out, opacity 0.2s linear;
}
.nav-progress.is-on { opacity: 1; width: 72%; }
.nav-progress.is-done { width: 100%; opacity: 0; -webkit-transition: width 0.12s linear, opacity 0.25s linear 0.1s; transition: width 0.12s linear, opacity 0.25s linear 0.1s; }

main.wrap.is-swapping { opacity: 0.55; -webkit-transition: opacity 0.12s linear; transition: opacity 0.12s linear; }
main.wrap.is-fresh { -webkit-animation: pageFade 0.16s linear; animation: pageFade 0.16s linear; }
@-webkit-keyframes pageFade { from { opacity: 0.55; } to { opacity: 1; } }
@keyframes pageFade { from { opacity: 0.55; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .nav-progress, main.wrap.is-swapping, main.wrap.is-fresh { -webkit-transition: none; transition: none; -webkit-animation: none; animation: none; }
}

/* ---------------------------------------------------------------- */
/* themes, groups & forums                                           */
/* ---------------------------------------------------------------- */

/* The basic themes: a small swatch grid, not a row of buttons. */
.theme-grid { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -3px; }
.theme-swatch {
  width: 33.333%;
  margin: 0 0 6px;
  padding: 5px 6px;
  text-align: left;
  line-height: 1.3;
  border-color: var(--line-2);
}
.theme-swatch .preset-note { display: block; font-family: var(--mono); font-size: 9px; color: var(--text-faint); letter-spacing: 0; text-transform: none; }
.theme-swatch:hover .preset-note { color: var(--text-dim); }
@media (max-width: 620px) {
  .theme-swatch { width: 50%; }
}

/* Groups */
.group-grid { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -4px; }
.group-card {
  display: block;
  width: 50%;
  padding: 9px 10px;
  margin: 0 4px 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.group-card:hover { border-color: var(--line-2); background: var(--surface-2); text-decoration: none; }
.group-card-name { display: block; font-family: var(--display); font-size: 15px; color: var(--text-strong); }
.group-card-blurb { display: block; margin: 3px 0 6px; font-size: 11px; color: var(--text-dim); }
.group-card-meta { display: block; font-family: var(--mono); font-size: 9.5px; color: var(--text-faint); }
.group-card-meta span + span::before { content: " · "; }
@media (max-width: 620px) {
  .group-card { width: 100%; }
}

.group-head { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; -webkit-align-items: flex-start; align-items: flex-start; gap: 10px; margin: 0 0 12px; }
.group-head > div:first-child { -webkit-flex: 1 1 320px; flex: 1 1 320px; min-width: 0; }
.group-actions { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; gap: 8px; -webkit-flex-wrap: wrap; flex-wrap: wrap; }

.member-strip { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -3px; }
.member { display: block; width: 33.333%; padding: 0 3px 8px; text-align: center; text-decoration: none; }
.member:hover { text-decoration: none; }
.member .avatar { margin: 0 auto; }
.member-handle { display: block; margin-top: 3px; font-family: var(--mono); font-size: 9px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member:hover .member-handle { color: var(--accent); }

/* Forums */
.thread-list { display: block; }
.thread {
  display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-top: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}
.thread:first-child { border-top: 0; }
.thread:hover { background: var(--surface-2); text-decoration: none; }
.thread-main { -webkit-flex: 1 1 auto; flex: 1 1 auto; min-width: 0; }
.thread-title { display: block; font-size: 13px; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread:hover .thread-title { color: var(--link-hover); }
.thread-sub { display: block; font-family: var(--mono); font-size: 9.5px; color: var(--text-faint); }
.thread-sub b { font-weight: normal; color: var(--text-dim); }
.thread-where { color: var(--text-dim); }
a.thread-where:hover { color: var(--accent); }
.thread-count { font-family: var(--mono); font-size: 9.5px; color: var(--text-faint); white-space: nowrap; }

.side-row { display: -webkit-flex; display: flex; -webkit-justify-content: space-between; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--text); text-decoration: none; }
.side-row:hover { color: var(--link-hover); text-decoration: none; }
.side-row .faint { font-family: var(--mono); font-size: 9.5px; }

.thread-first { padding: 12px 13px; margin: 0 0 14px; border: 1px solid var(--line-2); border-top: 3px solid var(--accent); background: var(--surface); }
.thread-first .bulletin-body { margin-top: 10px; }

/* ---------------------------------------------------------------- */
/* journal categories & desktop notifications                        */
/* ---------------------------------------------------------------- */

/* The category strip sits above newest / most kudos and runs sideways. */
.journal-cats {
  display: -webkit-flex; display: flex;
  -webkit-flex-wrap: nowrap; flex-wrap: nowrap;
  gap: 6px;
  margin: 0 0 9px;
  padding: 1px 0 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.journal-cat {
  display: block;
  -webkit-flex: 0 0 auto; flex: 0 0 auto;
  min-width: 190px;
  padding: 7px 9px;
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.journal-cat:hover { background: var(--surface-2); border-color: var(--line-2); text-decoration: none; }
.journal-cat-kicker { display: block; font-family: var(--mono); font-size: 8.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }
.journal-cat-name { display: block; margin-top: 1px; font-family: var(--display); font-size: 13px; color: var(--text-strong); }
.journal-cat:hover .journal-cat-name { color: var(--link-hover); }
.journal-cat-note { display: block; font-family: var(--mono); font-size: 9px; color: var(--text-dim); }

/* Header switch: says what it is and whether it is on, instead of a mystery "!". */
.notify-toggle {
  display: inline-flex; display: -webkit-inline-flex;
  -webkit-align-items: center; align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 7px 0 6px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--line-2);
  cursor: pointer;
}
.notify-toggle:hover { color: var(--text-strong); border-color: var(--accent); background: var(--surface-3); }
.notify-toggle[hidden] { display: none; }
.notify-toggle-mark { font-size: 8px; line-height: 1; color: var(--text-faint); }
.notify-toggle-label { white-space: nowrap; }
.notify-toggle.is-on { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.notify-toggle.is-on:hover { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.notify-toggle.is-on .notify-toggle-mark { color: var(--on-accent); }
.notify-toggle.is-blocked { color: var(--danger-text); border-color: var(--danger); }
.notify-toggle.is-blocked .notify-toggle-mark { color: var(--danger-text); }

/* One-time explainer for signed-in people who have not decided yet. */
.notify-banner {
  display: flex; display: -webkit-flex;
  -webkit-align-items: center; align-items: center;
  -webkit-flex-wrap: wrap; flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
  padding: 8px 11px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
}
.notify-banner[hidden] { display: none; }
.notify-banner strong { color: var(--text-strong); font-weight: 600; }
.notify-banner-text { margin: 0; -webkit-flex: 1 1 320px; flex: 1 1 320px; }
.notify-banner-actions { display: flex; display: -webkit-flex; -webkit-align-items: center; align-items: center; gap: 9px; }

/* Pictures inside markdown bodies (journal, bulletins, forum threads). */
.md-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 10px 0;
  border: 1px solid var(--line-2);
  background: #0d0c0f;
}
.comment-text .md-image,
.gb-entry .md-image { margin: 6px 0; max-width: 100%; }

/* In-page notice toasts (mobile fallback while the site is open). */
.toast-stack {
  position: fixed;
  right: 10px;
  bottom: 56px;
  z-index: 60;
  width: 290px;
  max-width: 92%;
  display: block;
}
.toast {
  display: block;
  margin-top: 8px;
  padding: 9px 10px;
  color: var(--text);
  text-decoration: none;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.toast:hover { border-color: var(--accent); color: var(--text-strong); }
.toast-title { display: block; font-family: var(--display); font-size: 13px; color: var(--text-strong); }
.toast-body { display: block; margin-top: 2px; font-size: 12px; color: var(--text-dim); line-height: 1.35; overflow-wrap: break-word; word-wrap: break-word; }

/* report control: a small "report" opener that expands into a one-line form */
.report { display: inline-block; }
.report > summary { list-style: none; cursor: pointer; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); border-bottom: 1px dotted currentColor; }
.report > summary::-webkit-details-marker { display: none; }
.report > summary:hover { color: var(--danger); }
.report[open] > summary { color: var(--danger); border-bottom-style: solid; }
.report-form { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; gap: 4px; margin-top: 5px; padding: 6px; border: 1px solid var(--line); background: var(--surface); max-width: 340px; }
.report-form select, .report-form input { font-size: 11px; padding: 3px 4px; background: var(--bg, #141210); color: inherit; border: 1px solid var(--line); min-width: 0; }
.report-form input[name="note"] { -webkit-flex: 1 1 8rem; flex: 1 1 8rem; }
.report-row { display: -webkit-flex; display: flex; gap: 10px; -webkit-justify-content: space-between; justify-content: space-between; -webkit-align-items: flex-start; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.report-what { min-width: 0; }
.report-actions { display: -webkit-flex; display: flex; gap: 10px; -webkit-flex: 0 0 auto; flex: 0 0 auto; }
