/* ============================================================
   DARKSECLABS — NEO-INDUSTRIAL / LABELS & SCHEMATICS
   Dark charcoal base · warning-yellow + signal-orange
   Stenciled condensed type · blueprint grid · technical labels
   ============================================================ */

:root {
  --fg:      #c9d1dd;   /* main text */
  --muted:   #6b7686;   /* secondary text */
  --faint:   #3a4250;   /* tertiary */
  --bg:      #0d0f12;   /* page base — dark charcoal */
  --bg2:     #14171c;   /* panel base */
  --bg3:     #1a1e25;   /* raised surface */
  --line:    #2a313c;   /* hard rule / border */
  --line2:   #3a4351;   /* lighter rule */
  --yellow:  #ffc400;   /* warning yellow — primary accent */
  --orange:  #ff6a00;   /* signal orange — secondary accent */
  --red:     #e52020;   /* alert red — danger/status */
  --cyan:    #3fa2ff;   /* evidence cyan — links/schematics */
  --mono:    "Anonymous Pro", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --disp:    "Archivo", "Archivo Narrow", Arial, sans-serif;
  --stencil: "Bebas Neue", "Archivo Narrow", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
}

/* ---- blueprint grid backdrop ---- */
.grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    linear-gradient(rgba(255,196,0,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,196,0,0.04) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px, 200px 200px, 200px 200px;
  opacity: 0.5;
}

/* ---- hazard stripe bar (danger tape) ---- */
.hazardbar {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 6px;
  z-index: 6;
  background: repeating-linear-gradient(45deg, var(--yellow) 0 14px, #10100a 14px 28px);
}

.wrap { position: relative; z-index: 2; max-width: 900px; margin: 0 auto; padding: 14px 18px 70px; }

/* same treatment on panels: small hazard tab */
.panel { position: relative; }

/* plate = bordered chamfered industrial panel label bar */
.plate {
  background: var(--bg2);
  border: 1px solid var(--line2);
  position: relative;
}
.plate::after {
  content: "";
  position: absolute;
  top: -1px; right: -1px;
  width: 10px; height: 10px;
  border-top: 2px solid var(--yellow);
  border-right: 2px solid var(--yellow);
}

/* ==============================================================
   TOP BAR
   ============================================================== */
.topbar {
  position: sticky; top: 6px; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--bg2);
  border: 1px solid var(--line2);
  background:
    linear-gradient(0deg, rgba(255,196,0,0.06), rgba(255,196,0,0.06)),
    var(--bg2);
}
.brand { display: flex; flex-direction: column; line-height: 1.05; }
.wordmark {
  font-family: var(--stencil);
  font-size: 30px;
  letter-spacing: 2px;
  color: var(--fg);
  white-space: nowrap;
}
.wordmark em { color: var(--yellow); font-style: normal; }
.tl {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--orange);
  margin-top: 2px;
}

#nav { display: flex; gap: 2px; flex-wrap: wrap; padding: 3px; }
#nav a {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 12px;
  border: 1px solid transparent;
  transition: color .12s, border-color .12s, background .12s;
}
#nav a:hover, #nav a.active {
  color: var(--bg);
  background: var(--yellow);
  border-color: var(--yellow);
}

.auth { display: flex; gap: 6px; align-items: center; font-size: 12px; }
.auth .u { color: var(--yellow); font-weight: 700; letter-spacing: 1px; }

/* ==============================================================
   BUTTONS & FORM CONTROL — stencil label buttons
   ============================================================== */
button, .btn, input[type="submit"] {
  font-family: var(--disp);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 12px;
  background: var(--bg3);
  color: var(--fg);
  border: 1px solid var(--line2);
  padding: 8px 14px;
  cursor: pointer;
  transition: all .12s;
}
button:hover, .btn:hover {
  color: var(--bg);
  background: var(--yellow);
  border-color: var(--yellow);
  box-shadow: 3px 3px 0 rgba(255,196,0,0.35);
}
button.danger, .btn.danger { color: var(--orange); border-color: var(--orange); }
button.danger:hover, .btn.danger:hover { background: var(--orange); color: var(--bg); border-color: var(--orange); }

/* ==============================================================
   PANELS & CARDS — industrial plate, corner-ticks, schematic tab
   ============================================================== */
.panel {
  background: var(--bg2);
  border: 1px solid var(--line2);
  margin-bottom: 16px;
  position: relative;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35);
}
/* schematic corner registration ticks */
.panel::before, .panel::after {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  border: 2px solid var(--yellow);
}
.panel::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.panel::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.panel.red::before, .panel.red::after { border-color: var(--orange); }

/* section label bar inside panels */
.plate-tab {
  display: inline-block;
  font-family: var(--disp);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--bg);
  background: var(--yellow);
  padding: 3px 10px;
  margin: -1px 0 0 -1px;
}
.plate-tab.orange { background: var(--orange); color: var(--bg); }
.plate-tab.red { background: var(--red); color: var(--bg); }

/* ---- post listing ---- */
.post-head {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.post-head { border-bottom: 1px solid var(--line); }
.post-head:last-child { border-bottom: none; }
.post-head:hover { background: var(--bg3); }
.post-thumb {
  width: 84px; height: 84px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line2);
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 40 40 0M0 0l40 40' stroke='%233a4351'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  position: relative;
}
.post-title {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 16px;
  color: var(--fg);
  line-height: 1.25;
  margin-bottom: 6px;
}
.post-head:hover .post-title { color: var(--yellow); }
.post-meta { font-size: 11px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.up { color: var(--yellow); font-weight: 700; }
.upbtn { background:none; border:none; cursor:pointer; font-size:12px; font-family:var(--disp); font-weight:700; color:var(--yellow); }
.upbtn:hover { color: var(--bg); background: var(--yellow); box-shadow:none; }
.upbtn.liked { color: var(--orange); }

/* ==============================================================
   ARTICLE READER
   ============================================================== */
.article { padding: 6px 0 22px; }
.article .art-head { padding: 16px 22px; border-bottom: 1px solid var(--line); }
.article h1 {
  font-family: var(--disp);
  font-weight: 900;
  font-size: 28px;
  color: var(--fg);
  line-height: 1.15;
  margin: 6px 0 8px;
}
.article h1 .warn { color: var(--orange); }
.article .hero {
  width: 100%; max-height: 340px; object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--line2);
  background: var(--bg);
}
.article-meta { font-size: 11px; color: var(--muted); margin-bottom: 10px; display: flex; gap: 14px; flex-wrap: wrap; letter-spacing: 1px; }
.article-meta .tag-y { background: var(--yellow); color: var(--bg); font-weight: 700; padding: 1px 6px; }
.article .body { padding: 18px 22px; line-height: 1.75; font-size: 15px; color: var(--fg); }
.article .body h1, .article .body h2, .article .body h3, .article .body h4 {
  font-family: var(--disp); font-weight: 700; color: var(--cyan); margin: 20px 0 8px; letter-spacing: 1px;
}
.article .body p { margin: 10px 0; }
.article .body code { background: var(--bg3); border: 1px solid var(--line); color: var(--yellow); padding: 1px 5px; font-family: var(--mono); font-size: 0.9em; }
.article .body pre { background: var(--bg3); border: 1px solid var(--line); padding: 12px; overflow-x: auto; color: var(--faint); margin: 10px 0; }
.article .body pre code { border: none; background: none; color: var(--cyan); }
.article .body blockquote { border-left: 3px solid var(--orange); padding-left: 12px; color: var(--muted); margin: 10px 0; font-style: italic; }
.article .body b { color: var(--yellow); }
.article .body a { color: var(--cyan); }
.article .body ul, .article .body ol { margin: 10px 0 10px 22px; }
.article .body li { margin: 4px 0; }

/* ==============================================================
   COMMENTS / FORUM
   ============================================================== */
.sec-title {
  font-family: var(--disp); font-weight: 700; font-size: 12px; letter-spacing: 3px;
  color: var(--orange);
  margin: 20px 0 10px;
  display: flex; align-items: center; gap: 8px;
  text-transform: uppercase;
}
.sec-title::before { content: ""; width: 24px; height: 2px; background: var(--orange); }
.comment { border-left: 2px solid var(--line2); padding: 6px 0 6px 14px; margin: 12px 0; }
.comment .c-head { font-size: 11px; color: var(--muted); display: flex; gap: 10px; margin-bottom: 3px; letter-spacing: 1px; }
.comment .c-head .who { color: var(--yellow); font-weight: 700; }
.comment .c-body { font-size: 14px; line-height: 1.55; color: var(--fg); }

.thread-row {
  padding: 12px 16px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--line);
}
.thread-row:last-child { border-bottom: none; }
.thread-row:hover { background: var(--bg3); }
.thread-row .t { font-family: var(--disp); font-weight: 600; font-size: 15px; color: var(--fg); }
.thread-row:hover .t { color: var(--yellow); }
.thread-row .meta { font-size: 11px; color: var(--muted); white-space: nowrap; letter-spacing: 1px; }
.thread-row .cnt { color: var(--orange); font-weight: 700; }

/* ==============================================================
   FORMS
   ============================================================== */
.form { padding: 8px; max-width: 440px; margin: 24px auto; }
.form .inner { padding: 20px 24px 24px; }
.form h2 { font-family: var(--disp); font-weight: 900; font-size: 22px; color: var(--fg); margin: 8px 0 16px; letter-spacing: 2px; }
.form h2 .s { color: var(--orange); }
label { display: block; font-size: 11px; color: var(--muted); margin: 14px 0 5px; letter-spacing: 2px; font-family: var(--disp); font-weight: 700; text-transform: uppercase; }
input[type=text], input[type=password], input[type=file], textarea, select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line2);
  border-left: 3px solid var(--line2);
  color: var(--fg);
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 14px;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--yellow);
  border-left-color: var(--yellow);
  background: var(--bg2);
}
textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
select { appearance: none; }
.hint { font-size: 11px; color: var(--faint); margin-top: 5px; }
.err { color: var(--red); font-size: 13px; margin-top: 12px; font-weight: 700; }
.ok { color: var(--yellow); font-size: 13px; margin-top: 12px; font-weight: 700; }

/* ==============================================================
   MISC
   ============================================================== */
.btn { display: inline-block; text-decoration: none; text-align: center; }
.dim { color: var(--muted); }
.muted { color: var(--muted); }
.red { color: var(--red); }
.yellow { color: var(--yellow); }
.orange { color: var(--orange); }
.cyan { color: var(--cyan); }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.right { margin-left: auto; }
.mt { margin-top: 14px; }
.loading {
  text-align: center; color: var(--muted); padding: 60px 0;
  letter-spacing: 3px; font-size: 12px;
}
.loading::after { content: "..."; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0%{content:""} 25%{content:"."} 50%{content:".."} 75%{content:"..."} }

.banner {
  border: 1px solid var(--yellow);
  color: var(--yellow);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-family: var(--disp); font-weight: 700; letter-spacing: 2px; font-size: 13px;
  background:
    repeating-linear-gradient(-45deg, rgba(255,196,0,0.10) 0 12px, transparent 12px 24px),
    var(--bg2);
  display: flex; align-items: center; gap: 10px;
}
.banner::before { width: 10px; height: 10px; background: var(--yellow); content: ""; flex-shrink: 0; }

.foot {
  position: relative; z-index: 2;
  padding: 12px 16px; margin: 0 18px 18px;
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: 11px; color: var(--muted); letter-spacing: 1px;
}
.foot b { color: var(--orange); }
.foot .clock { color: var(--yellow); }
.footdiv {
  display: block; width: 100%; max-width: 100%;
  margin: 0 0 6px; text-align: center;
  image-rendering: pixelated;
}

/* status OSC amber blink on footer */
#osc { color: var(--yellow); animation: oscblink 2s infinite; }
@keyframes oscblink { 0%,70%{opacity:1} 75%,100%{opacity:.3} }

@media (max-width: 560px) {
  .post-thumb { width: 60px; height: 60px; }
  .post-title { font-size: 14px; }
  .wordmark { font-size: 24px; }
  .article h1 { font-size: 22px; }
}

/* ==============================================================
   STANDING NOTICE MARQUEE
   ============================================================== */
.notice {
  position: relative; z-index: 2;
  margin: 0 18px 14px;
  background: var(--red);
  color: #fff;
  font-family: var(--disp); font-weight: 700; letter-spacing: 2px; font-size: 12px;
  overflow: hidden;
  border: 1px solid #000;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15) inset;
}
.notice .track { display: inline-block; white-space: nowrap; padding: 7px 0; animation: marquee 22s linear infinite; }
.notice .track::before { content: "!! "; }
@keyframes marquee { from{transform:translateX(0)} to{transform:translateX(-50%)} }

/* ==============================================================
   HOME LAYOUT + SIDE AD PANELS
   ============================================================== */
.home-grid {
  display: grid;
  grid-template-columns: 88px 1fr 88px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 760px) {
  .home-grid { grid-template-columns: 1fr; }
  .adcol { order: -1; flex-direction: row !important; flex-wrap: wrap; gap: 8px; }
}
.adcol { display: flex; flex-direction: column; gap: 12px; }
.adcol .adcap {
  font-size: 9px; letter-spacing: 2px; color: var(--faint);
  text-align: center; margin-bottom: 2px;
}
.adcol .adcol-t { display: flex; flex-direction: column; gap: 12px; }
.blinky a { display: inline-block; }
.blinky img {
  display: block;
  image-rendering: pixelated;
  border: 1px solid var(--line2);
  background: var(--bg3);
}
.blinky .adlbl { display: block; font-size: 9px; color: var(--muted); text-align: center; margin-top: 3px; letter-spacing: 1px; }
.ad-empty { border: 1px dashed var(--line); color: var(--faint); font-size: 9px; text-align: center; padding: 8px 2px; letter-spacing: 1px; }

/* ==============================================================
   SIGNAL BADGE
   ============================================================== */
.sig {
  display: inline-block;
  font-weight: 700;
  font-size: 10px;
  color: var(--bg);
  background: var(--orange);
  padding: 1px 6px;
  margin-left: 4px;
  letter-spacing: 1px;
  border-radius: 2px;
}
.sig.zero { background: var(--line2); color: var(--muted); }

/* ==============================================================
   OPS TAB BAR + PANELS
   ============================================================== */
.opstab { display: flex; gap: 2px; flex-wrap: wrap; margin: 0 2px 14px; }
.opstab button {
  flex: 1;
  min-width: 110px;
}
.opstab button.on {
  color: var(--bg); background: var(--yellow); border-color: var(--yellow);
  box-shadow: 3px 3px 0 rgba(255,196,0,0.35);
}

.modbox { padding: 14px 16px; }
.modbox hr.item { border: none; border-top: 1px dashed var(--line); margin: 10px 0; }
.modbox .mbody { color: var(--muted); font-size: 13px; margin: 6px 0; background: var(--bg); padding: 8px 10px; border: 1px solid var(--line); }
.modbox .mmeta { font-size: 11px; color: var(--faint); }
.modbox .ban-badge { color: var(--red); font-weight: 700; }
.modbox .row-btn { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.usrrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.usrrow:last-child { border-bottom: none; }
.usrrow .uname { color: var(--yellow); font-weight: 700; }
.usrrow .ustats { font-size: 11px; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.usrrow select { width: auto; padding: 5px 8px; font-size: 12px; }

.adedit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.adedit .full { grid-column: 1 / -1; }

/* share / tool row */
.shareline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.copyhit { color: var(--yellow); font-size: 11px; }
.green { color: #4ade80 !important; }

/* inline images in board posts & intel bodies */
.bimg {
  display: block; max-width: 100%; max-height: 480px;
  margin: 8px 0; border: 1px solid var(--line2);
  background: var(--bg); object-fit: contain;
}
.c-body .bimg { max-height: 340px; }

/* md preview toggle */
.mdpreview { border: 1px solid var(--line); background: var(--bg); padding: 12px; min-height: 120px; }
.mdpreview.empty { color: var(--faint); }

/* linkify + rich link preview cards */
.c-body a[data-link], .body a[data-link] {
  color: var(--cyan); text-decoration: underline; text-underline-offset: 2px;
  word-break: break-all;
}
.c-body a[data-link]:hover, .body a[data-link]:hover { color: var(--yellow); }

.pvcard {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--line2); background: var(--bg2);
  margin: 10px 0 4px; padding: 10px 12px; cursor: pointer;
  transition: border-color .12s, box-shadow .12s; max-width: 480px;
}
.pvcard:hover { border-color: var(--cyan); box-shadow: 3px 3px 0 rgba(76,201,240,0.15); }
.pvcard .pv-img { width: 88px; height: 66px; flex: 0 0 88px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.pvcard .pv-img img { width: 100%; height: 100%; object-fit: cover; }
.pvcard .pv-img.placeholder { font-size: 26px; color: var(--faint); }
.pvcard .pv-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pvcard .pv-title { font-family: var(--disp); font-weight: 600; font-size: 13px; color: var(--fg); line-height: 1.25; }
.pvcard:hover .pv-title { color: var(--cyan); }
.pvcard .pv-desc { font-size: 12px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pvcard .pv-host { font-size: 10px; color: var(--faint); letter-spacing: 1px; text-transform: uppercase; }

/* ==============================================================
   HOME SCREEN (hero / featured / blocks / sidebar)
   ============================================================== */
.hero {
  position: relative;
  border: 1px solid var(--line2);
  border-top: 4px solid var(--yellow);
  background:
    linear-gradient(180deg, transparent 33%, rgba(255,196,0,0.05) 34%, rgba(255,196,0,0.05) 35%, transparent 36%),
    linear-gradient(90deg, transparent 49%, rgba(76,201,240,0.12) 50%, transparent 51%),
    var(--bg2);
  background-size: 100% 24px, 24px 100%, 100% 100%;
  padding: 26px 28px 22px;
  margin: 18px 0 20px;
}
.hero-mark {
  position: absolute; right: 14px; top: 8px;
  font-size: 9px; letter-spacing: 3px; color: var(--faint);
  border: 1px solid var(--line); padding: 2px 6px;
}
.hero-tag .plate-tab { margin-left: 0; }
.hero-title {
  font-family: var(--disp); font-weight: 900; font-size: clamp(28px, 5vw, 46px);
  letter-spacing: 2px; line-height: 1; margin: 6px 0 6px; text-transform: uppercase;
}
.hero-sub { font-family: var(--disp); color: var(--muted); letter-spacing: 1px; font-size: 13px; }

.featured-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 18px; }
.featcard { border: 1px solid var(--line); background: var(--bg2); cursor: pointer; overflow: hidden; transition: border-color .12s, transform .12s; }
.featcard:hover { border-color: var(--yellow); transform: translateY(-2px); }
.featcard .feat-img { height: 90px; background: var(--bg); display: block; width: 100%; object-fit: cover; }
.featcard .feat-title { font-family: var(--disp); font-weight: 700; font-size: 14px; padding: 10px 12px 2px; color: var(--fg); }
.featcard:hover .feat-title { color: var(--yellow); }
.featcard .feat-meta { font-size: 10px; color: var(--muted); padding: 0 12px 12px; letter-spacing: 1px; text-transform: uppercase; }

.blocktext { font-size: 12px; color: var(--fg); line-height: 1.5; }
.sidepanel { border: 1px solid var(--line2); border-left: 3px solid var(--cyan); background: var(--bg2); padding: 12px 14px; margin-bottom: 16px; }
.sidepanel .adcap { font-size: 9px; letter-spacing: 2px; color: var(--faint); margin-bottom: 4px; }
.sidepanel .blocktext { font-size: 13px; }
.homeblock { margin-bottom: 4px; }
.homeblock .blockbody { padding: 14px 18px; }
.homeblock .blockbody p { margin: 0 0 10px; }
.homeblock .blockbody p:last-child { margin-bottom: 0; }
.homeblock .blockbody a { color: var(--cyan); }

/* admin home ops */
.featlist { margin-top: 10px; border-top: 1px dashed var(--line); }
.pinrow { display: flex; align-items: center; gap: 8px; padding: 8px 2px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pinrow .t { flex: 1; min-width: 140px; font-size: 13px; }