/* chanops.org — the page is an IRC client. No external resources. */
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/geist-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/geist-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/geist-latin.woff2") format("woff2"); }

:root {
  /* light = paper */
  --bg: #f6f3ea; --pane: #efebdf; --pane2: #e7e2d3; --fg: #1d1c18; --muted: #6b665a; --line: #d5cebd;
  --amber: #a35c00; --green: #1f7a3f; --cyan: #0f6f86; --magenta: #8e3d8a; --red: #b3261e;
  --code-bg: #e9e4d6; --cmd-bg: #1d1c18; --cmd-fg: #f1ead6; --cmd-acc: #ffb000; --sel: rgba(163,92,0,.14);
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
:root.dark {
  /* dark = classic terminal client */
  --bg: #121210; --pane: #191916; --pane2: #20201c; --fg: #e6e1d3; --muted: #8f8a7c; --line: #2c2b25;
  --amber: #ffb000; --green: #5fd38a; --cyan: #5ccfe6; --magenta: #d7a1ff; --red: #ff6b5e;
  --code-bg: #24231e; --cmd-bg: #0b0b09; --cmd-fg: #e6e1d3; --cmd-acc: #ffb000; --sel: rgba(255,176,0,.12);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--mono); font-size: 14.5px; line-height: 1.65; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
::selection { background: var(--sel); }
a { color: var(--cyan); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--amber); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
img { max-width: 100%; height: auto; display: block; }
code, kbd { font-family: var(--mono); font-size: .92em; background: var(--code-bg); padding: .08em .38em; border-radius: 4px; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 10px; top: -50px; z-index: 100; background: var(--amber); color: #121210; padding: 8px 14px; font-weight: 700; }
.skip:focus { top: 10px; }
.icon { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- client frame ---------- */
.client { display: grid; grid-template-columns: 220px minmax(0, 1fr) 210px; grid-template-rows: auto 1fr; grid-template-areas: "title title title" "chans buffer nicks"; min-height: 100vh; }
.titlebar { grid-area: title; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; height: 44px; padding: 0 14px;
  background: var(--pane2); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--fg); text-decoration: none; font-weight: 700; letter-spacing: -.02em; }
.brand b { color: var(--muted); font-weight: 500; }
.logo { width: 24px; height: 24px; }
.logo-bg { fill: var(--fg); } .logo-hash { stroke: var(--amber); stroke-width: 2.4; stroke-linecap: round; fill: none; } .logo-at { fill: var(--green); stroke: var(--pane2); stroke-width: 2; }
.tb-net { color: var(--muted); font-size: .8rem; margin-left: auto; }
.tb-btn { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: var(--pane); color: var(--fg); cursor: pointer; }
.i-light, :root.dark .i-dark { display: none; } :root.dark .i-light { display: block; }

.chans, .nicks { position: sticky; top: 44px; height: calc(100vh - 44px); overflow-y: auto; background: var(--pane); padding: 12px 0 20px; scrollbar-width: thin; }
.chans { grid-area: chans; border-right: 1px solid var(--line); }
.nicks { grid-area: nicks; border-left: 1px solid var(--line); padding: 12px 14px 20px; }
.side-h { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 14px 16px 6px; font-weight: 600; }
.nicks .side-h { padding: 14px 0 4px; }
.ch { display: flex; align-items: center; gap: 6px; padding: 4px 16px; color: var(--fg); text-decoration: none; border-left: 3px solid transparent; font-size: .92rem; }
.ch:hover { background: var(--sel); color: var(--fg); }
.ch.on { border-left-color: var(--amber); background: var(--sel); font-weight: 700; }
.ch .hash { color: var(--muted); width: 1ch; }
.nicks ul { list-style: none; margin: 0; padding: 0; }
.nicks li { padding: 1px 0; font-size: .9rem; }
.netbox { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.side-note { font-size: .72rem; color: var(--muted); margin-top: 18px; line-height: 1.5; }
.sdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.sdot.ok { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); }
.sdot.down { background: var(--red); }

/* nick colours */
.nk { font-weight: 700; white-space: nowrap; }
.nk-op { color: var(--green); } .nk-voice { color: var(--cyan); } .nk-user { color: var(--magenta); } .nk-svc { color: var(--amber); } .nk-sys { color: var(--muted); font-weight: 400; }
.nk-step { color: var(--cmd-bg); background: var(--amber); padding: 0 .5em; border-radius: 3px; }
:root.dark .nk-step { color: #121210; }

/* ---------- buffer ---------- */
.buffer { grid-area: buffer; display: flex; flex-direction: column; min-width: 0; }
.topicbar { position: sticky; top: 44px; z-index: 20; display: flex; gap: 12px; align-items: baseline; padding: 9px 22px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); font-size: .85rem; min-width: 0; }
.tb-chan { color: var(--amber); font-weight: 700; flex: none; }
.tb-topic { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.scroll { flex: 1; padding: 8px 22px 24px; max-width: 980px; width: 100%; }

.ln { display: grid; grid-template-columns: 4.2ch minmax(8ch, max-content) minmax(0, 1fr); column-gap: 12px; padding: 3px 0; align-items: baseline; }
.ln time { color: var(--muted); font-size: .8rem; }
.ln .nk { text-align: right; }
.ln .msg { min-width: 0; overflow-wrap: anywhere; }
.ln-notice .msg { color: var(--amber); }
.ln-join .msg { color: var(--muted); font-style: italic; }
.chan { color: var(--amber); font-weight: 700; }
.blk { padding: 26px 0 8px; border-top: 1px dashed var(--line); margin-top: 18px; }
.blk:first-of-type { border-top: 0; }
.blk-h { font-family: var(--sans); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.035em; }
.blk-h .hash { color: var(--amber); margin-right: 2px; }
.blk-topic { color: var(--muted); font-size: .85rem; margin: 2px 0 12px; }
.sub { font-family: var(--sans); font-size: 1.05rem; margin: 22px 0 8px; }

.motd { margin: 18px 0 8px; padding: 26px 26px 24px; border: 1px solid var(--line); border-left: 4px solid var(--amber); background: var(--pane); border-radius: 0 10px 10px 0; }
.motd-h { color: var(--muted); font-size: .78rem; letter-spacing: .1em; margin-bottom: 12px; }
.motd h1 { font-family: var(--sans); font-size: clamp(2rem, 5.4vw, 3.6rem); font-weight: 850; letter-spacing: -.05em; margin-bottom: 14px; }
.motd h1 em { font-style: normal; color: var(--amber); }
.motd p { max-width: 62ch; }
.motd-cta { margin-top: 14px; color: var(--muted); }

/* commands */
.cmd { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px calc(4.2ch + 12px); background: var(--cmd-bg); color: var(--cmd-fg); border-radius: 6px; padding: 5px 5px 5px 12px; min-width: 0; }
.cmd code { flex: 1; min-width: 0; background: none; padding: 0; color: inherit; white-space: nowrap; overflow-x: auto; scrollbar-width: thin; }
.cmd code::before { content: "› "; color: var(--cmd-acc); }
.copy { flex: none; display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: .72rem; font-weight: 700; color: #121210; background: var(--cmd-acc); border: 0; border-radius: 4px; padding: 5px 9px; cursor: pointer; }
.copy.copied { background: var(--green); }

/* generator */
.gen { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 12px; align-items: center; margin: 10px 0 14px calc(4.2ch + 12px); padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--pane); max-width: 620px; }
.gen label { color: var(--muted); font-size: .85rem; }
.gen input { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); width: 100%; min-width: 0; }
.gen input:focus, .gen-in:focus-within { outline: none; border-color: var(--amber); }
.gen-in { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.gen-in span { padding-left: 10px; color: var(--amber); font-weight: 700; }
.gen-in input { border: 0; background: transparent; padding-left: 3px; }
.gen .form-msg { grid-column: 1 / -1; color: var(--red); font-size: .85rem; }
.gen .form-msg:empty { display: none; }

/* lists inside the buffer */
.rooms, .flags, .ext, .apps, .play { list-style: none; margin: 6px 0 10px calc(4.2ch + 12px); padding: 0; }
.room { display: grid; grid-template-columns: 11ch 1fr auto; gap: 4px 14px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 6px; background: var(--pane); align-items: center; }
.room-d { color: var(--muted); font-size: .9rem; }
.room-a { display: flex; gap: 10px; font-size: .85rem; }
.room-a a, .app-a a { display: inline-flex; align-items: center; gap: 4px; }
.flags { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 18px; }
.flags li, .ext li { display: flex; gap: 10px; align-items: baseline; font-size: .9rem; }
.flags code { color: var(--amber); min-width: 3ch; text-align: center; }
.ext li { padding: 3px 0; }
.ext code { color: var(--amber); min-width: 11ch; }
.ext li > span:last-child { color: var(--muted); }
.tag { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; padding: 1px 6px; border-radius: 3px; border: 1px solid currentColor; flex: none; }
.tag-acting { color: var(--red); } .tag-matching { color: var(--cyan); }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.app { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--pane); }
.app img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; border-bottom: 1px solid var(--line); filter: saturate(.9); }
.app-b { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; padding: 10px 12px 12px; }
.app-b > span { grid-column: 1 / -1; color: var(--muted); font-size: .82rem; }
.app-b .app-a { display: flex; gap: 14px; margin-top: 6px; color: inherit; font-size: .85rem; }
.ladder { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 8px 0 10px calc(4.2ch + 12px); padding: 0; counter-reset: l; }
.ladder li { counter-increment: l; padding: 10px 12px; border: 1px solid var(--line); margin-left: -1px; background: var(--pane); font-size: .85rem; color: var(--muted); }
.ladder li b { display: block; color: var(--fg); }
.ladder li b::before { content: counter(l) ". "; color: var(--amber); }
.ladder li:first-child { border-radius: 6px 0 0 6px; margin-left: 0; } .ladder li:last-child { border-radius: 0 6px 6px 0; }
.play li { position: relative; padding: 6px 0 6px 2.4ch; counter-increment: p; }
.play { counter-reset: p; }
.play li::before { content: counter(p) "."; position: absolute; left: 0; color: var(--amber); font-weight: 700; }

/* tables */
.tbl { overflow-x: auto; margin: 6px 0 12px calc(4.2ch + 12px); border: 1px solid var(--line); border-radius: 8px; }
.tbl table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tbl th, .tbl td { text-align: left; padding: 7px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); background: var(--pane); font-weight: 600; }
.tbl tbody th { white-space: nowrap; font-weight: 400; }
.tbl tbody th code { color: var(--amber); }
.tbl td code.p { white-space: normal; overflow-wrap: anywhere; font-size: .82em; }
.tbl small { color: var(--muted); }
.tbl tr:last-child th, .tbl tr:last-child td { border-bottom: 0; }

/* ---------- input bar (the real start form) ---------- */
.inputbar { position: sticky; bottom: 0; z-index: 25; display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; padding: 10px 22px; background: var(--pane2); border-top: 1px solid var(--line); }
.ib-chan { color: var(--amber); font-weight: 700; flex: none; }
.ib-cmd { color: var(--green); flex: none; }
.inputbar input { flex: 1 1 140px; min-width: 0; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; caret-color: var(--amber); }
.inputbar input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px var(--sel); }
.ib-go { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-weight: 700; color: #121210; background: var(--amber); border: 0; border-radius: 6px; padding: 8px 14px; cursor: pointer; }
:root:not(.dark) .ib-go { background: #ffb000; }
.ib-go:hover { filter: brightness(1.08); }
.inputbar .form-msg { flex-basis: 100%; color: var(--red); font-size: .8rem; }
.inputbar .form-msg:empty { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .client { grid-template-columns: 200px minmax(0, 1fr); grid-template-areas: "title title" "chans buffer" "chans nicks"; }
  .nicks { position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); display: none; }
}
@media (max-width: 760px) {
  body { font-size: 14px; }
  .client { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "chans" "buffer"; }
  .tb-net { display: none; }
  .titlebar .tb-btn { margin-left: auto; }
  .chans { position: sticky; top: 44px; z-index: 28; height: auto; display: flex; gap: 2px; overflow-x: auto; overflow-y: hidden; padding: 6px 8px; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; white-space: nowrap; }
  .chans::-webkit-scrollbar { display: none; }
  .chans .side-h { display: none; }
  .ch { border-left: 0; border-radius: 6px; padding: 4px 10px; flex: none; }
  .ch.on { background: var(--sel); }
  .topicbar { top: 85px; padding: 8px 14px; }
  .scroll { padding: 6px 14px 20px; }
  html { scroll-padding-top: 140px; }
  .ln { grid-template-columns: minmax(0, max-content) minmax(0, 1fr); }
  .ln time { display: none; }
  .ln .nk { text-align: left; }
  .cmd, .gen, .rooms, .flags, .ext, .apps, .play, .tbl, .ladder { margin-left: 0; }
  .gen { grid-template-columns: minmax(0, 1fr); }
  .room { grid-template-columns: minmax(0, 1fr); }
  .ladder { grid-template-columns: minmax(0, 1fr); }
  .ladder li { margin-left: 0; margin-top: -1px; border-radius: 0 !important; }
  .ladder li:first-child { border-radius: 6px 6px 0 0 !important; } .ladder li:last-child { border-radius: 0 0 6px 6px !important; }
  .inputbar { padding: 8px 12px; }
  .ib-chan { display: none; }
  .ib-go span { display: none; }
  .motd { padding: 20px 16px; }
  .tbl-modes thead, .tbl-ext thead { display: none; }
  .tbl-modes tr, .tbl-ext tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
  .tbl-modes tr:last-child, .tbl-ext tr:last-child { border-bottom: 0; }
  .tbl-modes th, .tbl-modes td, .tbl-ext th, .tbl-ext td { border: 0; padding: 0; }
  .tbl-modes td:nth-child(n+3), .tbl-ext td:nth-child(n+4) { grid-column: 1 / -1; color: var(--muted); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } html { scroll-behavior: auto; } }
.ln .nk-step { justify-self: end; min-width: 2.4ch; text-align: center; }
@media (max-width: 760px) { .ln .nk-step { justify-self: start; } }
