:root {
  --bg: #000000;
  --panel: #03060f;
  --fg: #c4cad6;
  --dim: #5a78bb;
  --accent: #2f6bff;
  --logo: #1e5bff;
  --answer: #4a7dff;
  --warn: #ff5c5c;
  --amber: #4a7dff;
  --line: #142352;
  --mono: "Cascadia Mono", "Consolas", "SFMono-Regular", "Menlo", "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body {
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}
.wrap { max-width: 820px; margin: 0 auto; padding: 28px 18px 80px; }
a { color: var(--accent); }
.dim { color: var(--dim); }
.accent { color: var(--accent); }
.warn { color: var(--warn); }
.amber { color: var(--amber); }

header.term { border-bottom: 1px dashed var(--line); padding-bottom: 14px; margin-bottom: 22px; }
.logo {
  font-size: clamp(30px, 9vw, 54px); font-weight: 700; letter-spacing: .12em; margin: 0;
  color: var(--logo);
  position: relative; display: inline-block;
}
.boot { color: var(--dim); font-size: 13px; margin: 6px 0 0; min-height: 3.2em; }
.boot .ln { white-space: pre-wrap; min-height: 1.6em; }
.boot .ok { color: var(--accent); }
.boot .hi { color: var(--fg); }
.cursor { display: inline-block; width: .6em; height: 1.1em; background: var(--accent); vertical-align: text-bottom; margin-left: 2px; }

h2 { font-size: 15px; font-weight: 600; color: var(--accent); margin: 34px 0 12px; letter-spacing: .05em; }
h2::before { content: "C:\\CMDX> "; color: var(--dim); font-weight: 400; }

.panel { background: var(--panel); border: 1px solid var(--line); padding: 16px; border-radius: 2px; }
label { display: block; color: var(--dim); font-size: 13px; margin: 10px 0 4px; }
input[type=text], input[type=password], textarea {
  width: 100%; background: #000; color: var(--fg); border: 1px solid var(--line);
  font: inherit; padding: 10px; border-radius: 0; outline: none; resize: vertical;
}
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(47,107,255,.25); }
textarea { min-height: 110px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.counter { font-size: 12px; color: var(--dim); margin-left: auto; }
button {
  font: inherit; background: transparent; color: var(--accent); border: 1px solid var(--accent);
  padding: 8px 16px; cursor: pointer; border-radius: 0; letter-spacing: .05em;
}
button:hover:not(:disabled) { background: var(--accent); color: #000; }
button:disabled { opacity: .45; cursor: wait; }
button.danger { color: var(--warn); border-color: var(--warn); }
button.danger:hover:not(:disabled) { background: var(--warn); color: #000; }
button.ghost { color: var(--dim); border-color: var(--line); }
button.ghost:hover:not(:disabled) { color: #000; background: var(--dim); }
.status { min-height: 1.4em; font-size: 13px; margin-top: 10px; white-space: pre-wrap; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.search { margin-bottom: 14px; }
.entry { border-left: 2px solid var(--line); padding: 4px 0 4px 14px; margin: 0 0 26px; }
.entry .meta { font-size: 12px; color: var(--dim); }
.entry .q { margin: 4px 0 8px; white-space: pre-wrap; word-wrap: break-word; }
.entry .q::before { content: "> "; color: var(--accent); }
.entry .a { white-space: pre-wrap; word-wrap: break-word; color: var(--answer); }
.entry .a::before { content: "CMDX: "; color: var(--dim); }
.empty { color: var(--dim); font-style: italic; }

footer { margin-top: 60px; font-size: 12px; color: var(--dim); text-align: center; }
footer .whisper { opacity: .3; }
footer .whisper:hover { opacity: .8; }

/* first-visit full-screen boot (boot.js) */
html.booting body { overflow: hidden; }
html.booting .wrap, html.booting .admin-link { visibility: hidden; }
#bootscreen {
  position: fixed; inset: 0; z-index: 100; background: #000; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 24px clamp(14px, 4vw, 48px) 48px; font-size: 14px; line-height: 1.55; color: var(--dim);
}
#bootscreen .bs-out { max-width: 900px; width: 100%; }
#bootscreen .ln { white-space: pre-wrap; min-height: 1.55em; word-wrap: break-word; }
#bootscreen .hi { color: var(--fg); }
#bootscreen .ok { color: var(--accent); }
#bootscreen .warn { color: var(--warn); }
#bootscreen .dim2 { color: #3a4f80; }
#bootscreen .big { color: var(--logo); font-weight: 700; font-size: clamp(15px, 2.6vw, 22px); letter-spacing: .06em; margin-top: 6px; }
#bootscreen .bs-skip { position: absolute; right: 12px; bottom: 10px; font-size: 11px; color: #2a3a63; }
@media (max-width: 520px) { #bootscreen { font-size: 12px; padding-bottom: 36px; } }
@media (hover: none) { #bootscreen .bs-skip { display: none; } }

/* tiny admin link, bottom-left */
.admin-link {
  position: fixed; left: 8px; bottom: 6px; z-index: 5;
  font-size: 10px; line-height: 1; padding: 3px 5px; letter-spacing: .05em;
  color: var(--dim); text-decoration: none; border: 1px solid var(--line); background: #000; opacity: .55;
}
.admin-link:hover, .admin-link:focus-visible { opacity: 1; color: var(--accent); border-color: var(--accent); outline: none; }

/* admin */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button.active { background: var(--accent); color: #000; }
.card { background: var(--panel); border: 1px solid var(--line); padding: 14px; margin-bottom: 14px; }
.card .meta { font-size: 12px; color: var(--dim); display: flex; gap: 12px; flex-wrap: wrap; }
.card .q { white-space: pre-wrap; word-wrap: break-word; margin: 8px 0; }
.badge { font-size: 11px; padding: 0 6px; border: 1px solid currentColor; }
.badge.pub { color: var(--accent); } .badge.hid { color: var(--fg); } .badge.pen { color: var(--warn); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

@media (max-width: 520px) {
  body { font-size: 14px; }
  .wrap { padding: 18px 12px 60px; }
  .row button { flex: 1 1 auto; }
}
/* on narrow screens there is no empty margin, so pin the admin link to the bottom-left of the page instead of the screen */
@media (max-width: 880px) {
  body { position: relative; }
  .admin-link { position: absolute; }
}
