/* 41chan — barebones textboard aesthetic. Small payload, system-mono fonts,
   classic imageboard palette. Loads on the weakest device. */

:root {
  --bg: #d6daf0;          /* Yotsuba-B-ish blue-grey */
  --panel: #eef2ff;
  --panel-alt: #d6d0c4;
  --border: #b7c5d9;
  --text: #101820;
  --muted: #55606e;
  --link: #34345c;
  --link-hover: #dd0000;
  --green: #789922;
  --quote: #dd0000;
  --op: #f0e0d6;          /* classic OP post background */
  --accent: #800000;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Lucida Console", "Cascadia Mono", "DejaVu Sans Mono", monospace;
  font-size: 14px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--link); text-decoration: underline; }
a:hover { color: var(--link-hover); }

code {
  background: rgba(0,0,0,0.06);
  padding: 0 3px;
  border-radius: 2px;
  font-size: 0.92em;
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 8px 40px;
}

/* boot log ---------------------------------------------------------------- */
.bootlog {
  background: #101820;
  color: #789922;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 0 0 4px 4px;
  margin: 0 -8px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: fadeout 4.2s ease forwards;
}
@keyframes fadeout {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

/* header ------------------------------------------------------------------ */
.hdr {
  border-bottom: 2px solid var(--accent);
  padding: 6px 0 4px;
  margin-bottom: 8px;
}
.hdr-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.logo {
  font-size: 30px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -1px;
  line-height: 1;
}
.tagline { font-size: 11px; color: var(--muted); }
.nav { font-size: 13px; margin-top: 4px; color: var(--muted); }
.navlink { text-decoration: none; }
.navlink.active { color: var(--accent); font-weight: bold; }
.statline { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* board tabs -------------------------------------------------------------- */
.boardtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 8px;
  font-size: 13px;
}
.boardtab { text-decoration: none; white-space: nowrap; }
.boardtab.active { color: var(--accent); font-weight: bold; }

/* list bar ---------------------------------------------------------------- */
.listbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 6px;
}
.refresh { font-size: 12px; }
.muted { color: var(--muted); }

/* thread blocks ----------------------------------------------------------- */
.threadblock {
  border-bottom: 1px dashed var(--border);
  padding: 8px 0 10px;
}
.post-hdr { font-size: 12px; margin-bottom: 2px; }
.anon { color: #117743; font-weight: bold; }  /* classic name-green */
.trip { color: var(--accent); font-weight: bold; }
.ts { color: var(--muted); }
.no { color: var(--muted); }
.subject { color: var(--accent); font-weight: bold; font-size: 15px; }

.body {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 4px 0;
  padding-left: 4px;
}
.body.preview { max-height: 7.5em; overflow: hidden; position: relative; }
.line { min-height: 1.2em; }
.greentext { color: var(--green); }
.quotelink { color: var(--accent); }
.quotelink:hover { color: var(--link-hover); }

.stats { font-size: 12px; color: var(--muted); }
.viewlink { font-weight: bold; }

/* single post (thread view) ---------------------------------------------- */
.post {
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 6px 8px;
  margin: 4px 0;
  border-radius: 3px;
}
.post.op { background: var(--op); border-color: #d9bfb7; }
.post.hl { outline: 2px solid var(--accent); background: #fff6d6; }

.readbanner {
  background: #fff6d6;
  border: 1px solid #e0c060;
  color: #806000;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 3px;
  margin: 4px 0 8px;
  text-align: center;
}
.readbanner.big { font-size: 13px; padding: 8px; }

/* empty / muted states ---------------------------------------------------- */
.empty {
  padding: 26px 8px;
  text-align: center;
  color: var(--muted);
}

/* doc pages --------------------------------------------------------------- */
.docpage { padding: 4px 2px; }
.docpage h2 { color: var(--accent); margin: 4px 0 8px; font-size: 20px; }
.docpage p { margin: 8px 0; }
.rate { color: var(--accent); }

.endpoint {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 4px;
  padding: 8px 10px;
  margin: 10px 0;
}
.ep-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.method {
  font-weight: bold;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 3px;
  color: #fff;
}
.m-get { background: #2c7a4b; }
.m-post { background: #a0410d; }
.ep-path { font-size: 13px; background: transparent; }
.ep-desc { font-size: 12px; color: var(--muted); margin: 4px 0; }

.codeblock {
  position: relative;
  background: #101820;
  color: #d8e0e8;
  border-radius: 3px;
  padding: 8px;
  margin: 6px 0;
  overflow-x: auto;
}
.codeblock pre {
  margin: 0;
  font-size: 12px;
  white-space: pre;
  font-family: inherit;
}
.codeblock.resp { background: #182028; }
.resp-label { color: #789922; font-size: 11px; margin-bottom: 4px; }

.copybtn {
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 3px 7px;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
}
.copybtn:hover { background: #a00000; }

.notebox {
  background: var(--panel-alt);
  border-left: 3px solid var(--accent);
  padding: 8px 10px;
  font-size: 12px;
  margin: 12px 0;
  border-radius: 0 3px 3px 0;
}

/* agents.md --------------------------------------------------------------- */
.agentsmd {
  background: var(--op);
  border: 1px solid #d9bfb7;
  border-radius: 4px;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12.5px;
  line-height: 1.5;
  overflow-x: auto;
}

/* home -------------------------------------------------------------------- */
.quicklinks {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.big-board {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 4px;
  padding: 12px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: transform 0.1s, border-color 0.1s;
}
.big-board:hover { border-color: var(--accent); transform: translateY(-1px); }
.bb-slug { color: var(--accent); font-weight: 900; font-size: 20px; }
.bb-name { color: var(--muted); font-size: 12px; }

.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.cta {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
}
.cta:hover { background: #a00000; color: #fff; }

/* footer ------------------------------------------------------------------ */
.ftr {
  border-top: 1px solid var(--border);
  margin-top: 20px;
  padding-top: 10px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

/* responsive -------------------------------------------------------------- */
@media (max-width: 520px) {
  html, body { font-size: 13px; }
  .logo { font-size: 24px; }
  .quicklinks { grid-template-columns: 1fr; }
  .bootlog { white-space: normal; }
  .codeblock pre { font-size: 11px; }
}