/* NightCore community sections: Handbook and Community. Builds on site.css tokens.
   Paper is for the city's documents (rules, laws, guides, in-character news); the street is for
   navigation and out-of-character pages. */
:root {
  --stamp: #24357f;          /* civic ink on paper: links, numbers */
  --stamp-soft: #d9d3c3;
  --margin-red: rgba(214, 48, 48, .55);
  --mark: #f6d77a;
}

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* --- section sub-navigation ------------------------------------------------------------------ */
.cm-sub { margin: -14px 0 30px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.cm-sub::-webkit-scrollbar { display: none; }
.cm-sub ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; min-width: max-content; }
.cm-sub a { display: block; padding: 10px 12px 11px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .95rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.cm-sub a:hover { color: var(--text); }
.cm-sub a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }

/* --- page heads -------------------------------------------------------------------------------- */
.doc-head { margin-bottom: 26px; max-width: 900px; }
.doc-head h1 { margin-bottom: .25em; }
.doc-lede { font-size: 1.12rem; color: var(--muted); max-width: 64ch; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--muted); font-size: .92rem; margin: 0; max-width: none; }
.doc-meta a { color: var(--text); }

.btn.ghost { background: transparent; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; margin: 8px 0 16px; }
.check input { min-height: 0; width: 18px; height: 18px; }
.hint { color: var(--muted); font-size: .88rem; font-weight: 400; display: block; margin-top: 4px; }
textarea { width: 100%; line-height: 1.5; }
.field input:not([type=checkbox]):not([type=radio]), .field select { width: 100%; }
.field.short input { max-width: 320px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-ui); padding: 18px 20px 6px; margin: 0 0 22px; }
legend { font: 700 1.3rem var(--display); padding: 0 8px; margin-left: -8px; }
.cm-pager { display: flex; gap: 14px; align-items: center; margin-top: 22px; color: var(--muted); }
.empty { color: var(--muted); padding: 20px 0; }
.kpis .kpi a { color: inherit; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 14px; }
.d-add { color: var(--go); font-weight: 700; }
.d-del { color: #ff8a8a; font-weight: 700; }

/* --- Markdown content (on paper and on the street) ------------------------------------------- */
.md-callout { border-left: 4px solid var(--sodium); background: rgba(242, 178, 60, .12); padding: 10px 16px; border-radius: 0 6px 6px 0; margin: 0 0 1.2em; }
.md-callout p:last-child { margin-bottom: 0; }
.md-callout.md-warning, .md-callout.md-important { border-color: var(--signal); background: rgba(255, 74, 74, .1); }
.md-table { overflow-x: auto; margin: 0 0 1.4em; }
.md-table table { border-collapse: collapse; width: 100%; font-size: .94rem; }
.md-table th { text-align: left; font-weight: 700; padding: 8px 10px; border-bottom: 2px solid currentColor; white-space: nowrap; }
.md-table td { padding: 8px 10px; border-bottom: 1px solid rgba(127, 127, 127, .3); vertical-align: top; }
.md-code { background: rgba(0, 0, 0, .25); padding: 12px 14px; border-radius: 6px; overflow-x: auto; }
code { font-size: .9em; background: rgba(127, 127, 127, .18); padding: 1px 5px; border-radius: 4px; }
blockquote { margin: 0 0 1.2em; padding-left: 16px; border-left: 3px solid var(--line); color: var(--muted); }

/* --- staff tabs with counts -------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tabs a { text-decoration: none; padding: 8px 12px 10px; color: var(--muted); font-weight: 600; font-size: .93rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }
.tabs .count { display: inline-block; min-width: 1.6em; padding: 0 6px; border-radius: 999px; background: var(--street-3); color: var(--text); font-size: .8rem; text-align: center; }
.pre { white-space: pre-wrap; word-break: break-word; margin: 4px 0 0; }
code.wrap { word-break: break-all; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: .93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 4px 0; }
.events, .notes { list-style: none; margin: 0 0 14px; padding: 0; font-size: .93rem; }
.events li, .notes li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.notes li.internal { border-left: 3px solid var(--sodium); padding-left: 10px; }
.answers { margin-top: 26px; }
.answers h3 { font-size: 1.5rem; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.answers dt { font-weight: 700; margin-top: 14px; max-width: 70ch; }
.answers dd { margin: 4px 0 0; color: var(--text); max-width: 75ch; }

/* --- news and changelog ------------------------------------------------------------------------ */
.post-row { border-top: 1px solid var(--line); padding: 16px 0 6px; }
.post-row:first-child { border-top: 0; padding-top: 0; }
.post-row h3 { font-size: 1.55rem; margin-bottom: 4px; }
.post-row h3 a { text-decoration: none; }
.post-row h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.post-meta { display: flex; gap: 14px; color: var(--muted); font-size: .88rem; margin-bottom: 6px; }
.post-kicker { margin: 0 0 6px; font-weight: 600; color: var(--muted); }
.post-kicker a { color: var(--muted); }
.post-body { max-width: 72ch; font-size: 1.04rem; }
.post-body h3 { margin-top: 1.2em; }
.changelog-side h2 { font-size: 1.6rem; }
.chg-mini { list-style: none; margin: 0 0 12px; padding: 0; }
.chg-mini li { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--line); }
.chg-mini span { color: var(--muted); font-size: .86rem; }
.chg-list { list-style: none; margin: 0; padding: 0; }
.chg-list > li { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; padding: 22px 0; border-top: 1px solid var(--line); }
.chg-when strong { display: block; font: 800 1.5rem/1 var(--display); }
.chg-when span { color: var(--muted); font-size: .88rem; }
.chg-body h2 { font-size: 1.6rem; }
.chg-body h3 { font-size: 1.1rem; color: var(--muted); margin: 1em 0 .3em; }
.chg-body ul { margin-top: 0; }

/* --- Night City News: a newsfeed of the city, written in character ----------------------------- */
.ncn-mast { margin: 0 0 18px; }
.ncn-name { display: inline-block; font: 900 clamp(2.8rem, 9vw, 5.6rem)/.86 var(--display); letter-spacing: -.01em; text-decoration: none; color: var(--paper);
  padding-bottom: 8px; border-bottom: 7px solid var(--sodium); }
.ncn-mast p { color: var(--muted); margin: 10px 0 0; }
.ncn-desks { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 26px; scrollbar-width: thin; }
.ncn-desks a { flex: none; text-decoration: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: .9rem; }
.ncn-desks a[aria-current="page"] { background: var(--paper); color: var(--paper-ink); border-color: var(--paper); }
.ncn-desk { color: var(--sodium); font-weight: 700; font-size: .86rem; margin: 0 0 4px; display: block; }
.ncn-lead { padding: 4px 0 26px; border-bottom: 1px solid var(--line); margin-bottom: 8px; max-width: 900px; }
.ncn-lead h2 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin-bottom: .2em; }
.ncn-lead h2 a { text-decoration: none; }
.ncn-lead h2 a:hover { text-decoration: underline; text-underline-offset: 5px; }
.ncn-standfirst { font-size: 1.18rem; line-height: 1.5; max-width: 62ch; }
.ncn-by { color: var(--muted); font-size: .9rem; }
.ncn-wire { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 0 36px; }
.ncn-wire li { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.ncn-wire a { text-decoration: none; }
.ncn-wire a strong { font: 800 1.35rem/1.12 var(--display); }
.ncn-wire a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.ncn-wire.compact { grid-template-columns: 1fr; }
.ncn-foot { margin-top: 30px; }
.ncn-paper h1 { font-size: clamp(2rem, 5vw, 3rem); color: var(--paper-ink); margin-top: 4px; }
.ncn-paper .ncn-desk { color: #8a5600; }
.ncn-paper .ncn-by { color: var(--paper-muted); border-bottom: 1px solid #cfc8b6; padding-bottom: 12px; margin-bottom: 18px; }
.ncn-more { font-size: 1.4rem; }
.ooc-note { font-size: .86rem; margin-top: 18px; }

/* --- applications -------------------------------------------------------------------------------- */
.apply-form { max-width: 860px; }
.apply-form fieldset { padding: 18px 22px 8px; }
.field-err { color: #ff9c9c; font-weight: 600; font-size: .9rem; margin: 6px 0 0; }
.has-err input, .has-err textarea, .has-err select { border-color: var(--signal); }
.counter { display: block; text-align: right; font-size: .8rem; color: var(--muted); margin-top: 4px; }
.counter.short { color: var(--sodium); }
.ident.ok { border-color: rgba(82, 212, 157, .5); }
.ident-ways { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; }
.ident-ways h3 { font-size: 1.15rem; }
.ident-ways input { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.where { margin-top: 10px; font-size: .92rem; }
.where summary { cursor: pointer; font-weight: 600; }
.link-code { font: 800 2rem/1 var(--display); margin: 6px 0 10px; letter-spacing: .02em; }
.apply-send { margin: 6px 0 40px; }
.next-steps { padding-left: 1.3em; }
.next-steps li { margin-bottom: 6px; }
.next-steps li::marker { font-family: var(--display); font-weight: 800; color: var(--signal); }
.app-status { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.app-slip { background: var(--paper); color: var(--paper-ink); border-radius: var(--radius-doc); padding: 26px 28px 20px; border-top: 6px solid var(--paper-ink); }
.app-slip h2, .app-slip h3 { color: var(--paper-ink); }
.app-slip a { color: var(--stamp); }
.app-slip code { background: var(--stamp-soft); }
.app-slip .tag.go { background: #cfe9da; color: #135c3a; }
.app-slip .tag.warn { background: #f3e0b0; color: #6b4500; }
.app-slip .tag.bad { background: #f5cfcf; color: #8a1c1c; }
.app-ref { color: var(--paper-muted); font-weight: 700; margin: 0 0 4px; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0; margin: 10px 0 20px; counter-reset: s; }
.steps li { font-size: .82rem; font-weight: 600; color: var(--paper-muted); padding-top: 10px; border-top: 5px solid var(--stamp-soft); }
.steps li.done { border-color: var(--paper-ink); color: var(--paper-ink); }
.steps li.now { border-color: var(--signal); color: var(--paper-ink); }
.feedback { background: #fff8e6; border-left: 4px solid #c98a12; padding: 10px 14px; margin: 0 0 14px; border-radius: 0 6px 6px 0; }
.feedback h3 { font-size: 1.05rem; margin: 0 0 4px; }
.feedback p { margin: 0; white-space: pre-wrap; }
.timeline { list-style: none; margin: 0 0 18px; padding: 0 0 0 16px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px; }
.timeline li::before { content: ""; position: absolute; left: -22px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--street); border: 2px solid var(--muted); }
.timeline li:last-child::before { border-color: var(--text); background: var(--text); }

/* --- support ---------------------------------------------------------------------------------------- */
.ticket-list { list-style: none; margin: 0; padding: 0; }
.ticket-list li { display: flex; justify-content: space-between; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.ticket-list a { display: flex; flex-direction: column; padding: 12px 0; text-decoration: none; min-width: 0; }
.ticket-list a strong { font-weight: 700; }
.ticket-list a span { color: var(--muted); font-size: .88rem; }
.cat-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 0 32px; }
.cat-grid li { border-top: 1px solid var(--line); }
.cat-grid a { display: flex; flex-direction: column; gap: 3px; padding: 14px 0 16px; text-decoration: none; }
.cat-grid strong { font: 800 1.35rem/1.1 var(--display); }
.cat-grid a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.cat-grid span { color: var(--muted); font-size: .92rem; }
.cat-grid li.appeal { border-top-color: var(--signal); }
.ticket-form { max-width: 760px; }
.thread { list-style: none; margin: 0 0 22px; padding: 0; }
.thread > li { margin-bottom: 14px; border-radius: var(--radius-ui); padding: 12px 16px; border: 1px solid var(--line); }
.thread > li header { font-size: .9rem; color: var(--muted); margin-bottom: 2px; }
.thread > li header strong { color: var(--text); }
.thread > li.from-staff { background: var(--street-2); border-left: 4px solid var(--go); }
.thread > li.internal { background: rgba(242, 178, 60, .08); border-left: 4px solid var(--sodium); }
.thread > li.ev { border: 0; padding: 0 16px; color: var(--muted); font-size: .86rem; }
.reply { border-top: 1px solid var(--line); padding-top: 16px; }
.reply .row { margin-top: 10px; }

/* --- staff team ------------------------------------------------------------------------------------- */
.team-group { margin-bottom: 40px; }
.team-group > header { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.team-group > header h2 { margin: 0; }
.team-group > header p { margin: 0; }
.team { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 0 36px; }
.member { display: grid; grid-template-columns: 56px 1fr; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.member img, .member .avatar { width: 56px; height: 56px; border-radius: 50%; }
.member .avatar { display: grid; place-items: center; background: var(--paper); color: var(--paper-ink); font: 800 1.3rem var(--display); }
.member h3 { margin: 0 0 2px; font-size: 1.4rem; }
.member p { margin: 0 0 4px; font-size: .94rem; }
.m-title { color: var(--sodium); font-weight: 600; }
.m-meta { color: var(--muted); font-size: .86rem; }

/* --- city status --------------------------------------------------------------------------------------- */
.status-head { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 28px; align-items: end; }
.status-state { font: 800 1.6rem/1.1 var(--display); margin: 0 0 12px; }
.status-state.off { color: #ff9c9c; }
.status-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 10px; }
.status-facts dt { color: var(--muted); font-size: .86rem; }
.status-facts dd { margin: 0; font: 800 1.9rem/1.05 var(--display); }
.status-facts dd.cap { text-transform: capitalize; }
.range { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0 18px; }
.range a { text-decoration: none; padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .92rem; border: 1px solid transparent; }
.range a[aria-current="page"] { color: var(--text); border-color: var(--line); background: var(--street-2); }
.status-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0 0 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.status-kpis > div { padding: 12px 14px; border-left: 1px solid var(--line); }
.status-kpis > div:first-child { border-left: 0; padding-left: 0; }
.status-kpis dt { color: var(--muted); font-size: .88rem; }
.status-kpis dd { margin: 0; font-weight: 700; font-size: 2rem; line-height: 1.15; }
.status-kpis span { color: var(--muted); font-size: .82rem; }
.outages { list-style: none; margin: 0 0 12px; padding: 0; }
.outages li { display: flex; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.outages strong { min-width: 90px; }
.outages span { color: var(--muted); }
.status-table summary { cursor: pointer; font-weight: 600; margin: 4px 0 10px; }

.lc { margin: 22px 0 6px; }
.lc-title { font-weight: 700; margin-bottom: 10px; }
.lc-box { position: relative; padding-left: 40px; }
.lc-y { position: absolute; left: 0; top: 0; width: 32px; height: 230px; font-size: .78rem; color: var(--muted); font-feature-settings: "tnum" 1; }
.lc-y span { position: absolute; right: 0; transform: translateY(50%); }
.lc-plot { position: relative; height: 230px; outline-offset: 4px; touch-action: pan-y; cursor: crosshair; }
.lc-plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.lc-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.lc-line { fill: none; stroke: #5f8ff0; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lc-area { fill: #5f8ff0; fill-opacity: .12; }
.lc-gap { fill: rgba(163, 170, 198, .09); }
.lc-gap-l { position: absolute; top: 6px; transform: translateX(-50%); font-size: .78rem; color: var(--muted); pointer-events: none; }
.lc-end, .lc-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #5f8ff0; box-shadow: 0 0 0 2px var(--street); transform: translate(-50%, 50%); pointer-events: none; }
.lc-end-l { position: absolute; transform: translate(calc(-100% - 10px), 50%); font-weight: 700; font-size: .9rem; pointer-events: none; background: var(--street); padding: 0 4px; border-radius: 4px; }
.lc-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--muted); pointer-events: none; }
.lc-tip { position: absolute; top: 6px; z-index: 2; display: flex; flex-direction: column; gap: 1px; min-width: 170px; padding: 8px 11px; font-size: .84rem; color: var(--muted);
  background: var(--street-3); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .6); pointer-events: none; }
.lc-tip strong { color: var(--text); font-size: 1rem; }
.lc-sky { margin-top: 6px; height: 10px; }
.lc-sky svg { display: block; width: 100%; height: 10px; border-radius: 2px; }
.lc-x { position: relative; height: 22px; margin-top: 4px; font-size: .78rem; color: var(--muted); }
.lc-x span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.lc-note { color: var(--muted); font-size: .84rem; margin: 2px 0 0 40px; display: flex; align-items: center; gap: 8px; }
.lc-key { display: inline-block; width: 36px; height: 8px; border-radius: 2px; background: linear-gradient(90deg, #182040, #b9c8f0, #182040); }

/* --- community front page ------------------------------------------------------------------------------ */
.hub { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 300px; gap: 36px; align-items: start; }
.hub h2 { font-size: 1.9rem; }
.hub h2 a { text-decoration: none; }
.hub h2 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.hub-side { display: flex; flex-direction: column; gap: 10px; }
.hub-tile { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: var(--radius-ui); background: var(--street-2); border: 1px solid var(--line); text-decoration: none; }
.hub-tile strong { font: 800 1.35rem/1.05 var(--display); }
.hub-tile span { color: var(--muted); font-size: .92rem; }
.hub-tile:hover { background: var(--street-3); }

@media (max-width: 1000px) {
  .hub { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hub-side { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 760px) {
  .cm-sub { margin-top: -22px; }
  .hub, .app-status, .ident-ways, .status-head { grid-template-columns: 1fr; }
  .chg-list > li { grid-template-columns: 1fr; gap: 6px; }
  .status-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-kpis > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .status-kpis > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .lc-plot, .lc-y { height: 180px; }
  .apply-form fieldset { padding: 14px 14px 4px; }
  .steps li { font-size: .74rem; }
  .app-slip { padding: 20px 18px 16px; }
}
.ident-ways h3 label { font: inherit; margin-bottom: 8px; }
