/* Project7825 staff handbook. Colours and type follow the brand kit (brand/README.txt). */
:root {
  --ink: #0b0d1a;
  --paper: #f5f3ee;
  --cobalt: #3d6bff;
  --slate: #1a1e33;
  --mist: #9aa0b8;
  --yolk: #ffd23f;

  --bg: var(--ink);
  --surface: var(--slate);
  --surface-2: #232842;
  --border: #2a2f4a;
  --text: var(--paper);
  --text-2: #c9cddb;
  --muted: var(--mist);
  --link: #7c9bff;
  --accent: var(--cobalt);
  /* Height of the sticky header: one row on wide screens, two once the section buttons wrap below. */
  --head: 60px;
  --pad: 20px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: var(--paper);
    --surface: #ffffff;
    --surface-2: #ebe8e1;
    --border: #dcd8cf;
    --text: var(--ink);
    --text-2: #33374d;
    --muted: #5f6680;
    --link: #2448d6;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 "Rubik", system-ui, sans-serif;
}
a { color: var(--link); }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-weight: 800; font-size: clamp(28px, 4vw, 40px); margin: 0 0 12px; letter-spacing: -0.03em; }
.lead { color: var(--muted); font-size: 18px; margin: 0 0 24px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- buttons, pills ---------- */
.button {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: 12px; border: 0;
  background: var(--cobalt); color: #fff; font: 500 16px "Rubik", sans-serif; text-decoration: none; cursor: pointer;
}
.button:hover { filter: brightness(1.1); }
.button.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.button.discord { background: #5865f2; font-size: 17px; padding: 14px 24px; }
.link-button { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.link-button:hover { color: var(--text); }
.pill {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 99px; vertical-align: 2px;
  background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text);
  font-size: 11px; font-weight: 500; letter-spacing: 0.02em; text-transform: none; white-space: nowrap;
}
.pill.muted { background: var(--surface-2); color: var(--muted); }
.pill.audience { background: color-mix(in srgb, var(--yolk) 22%, transparent); }
.viewer { color: var(--muted); font-size: 15px; margin: 0 0 24px; }
.viewer strong { color: var(--text); font-weight: 500; }
.notice { background: color-mix(in srgb, var(--yolk) 18%, transparent); border-radius: 10px; padding: 10px 14px; color: var(--text); }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; column-gap: 16px;
  padding: 0 var(--pad);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; height: 60px; color: var(--text); text-decoration: none; }
.brand .mark { height: 28px; width: auto; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -0.035em; text-transform: lowercase; }
.brand-name b { color: var(--cobalt); }
.brand-tag { color: var(--muted); font-size: 13px; padding-left: 10px; border-left: 1px solid var(--border); }
/* Section buttons: the server's own pages first, then one button per shared category. */
.tabs { display: flex; align-items: center; gap: 4px; height: 60px; min-width: 0; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px; white-space: nowrap;
  color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 14px;
}
.tab:hover { background: var(--surface); color: var(--text); }
.tab.active { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); }
.server-tab-group { display: inline-flex; align-items: center; gap: 2px; margin-right: 6px; padding-right: 10px; border-right: 1px solid var(--border); }
.server-tab { padding-left: 6px; font-weight: 700; }
.switch { padding: 6px 8px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px; }
.switch:hover { background: var(--surface); color: var(--text); }
.sidebar-heading { margin: 0 0 10px; padding: 0 10px; font-size: 17px; font-weight: 700; color: var(--text); }
.spacer { flex: 1; }
.search input {
  width: 260px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: 14px "Rubik", sans-serif;
}
.search.big input { width: 100%; font-size: 17px; padding: 12px 16px; margin-bottom: 16px; }
.user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.user form { margin: 0; }
.avatar { border-radius: 50%; }
.nav-toggle { display: none; }

.server-icon { border-radius: 30%; flex: none; object-fit: cover; }
.server-icon.initials { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; }

/* ---------- landing ---------- */
.landing { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.landing-card { max-width: 520px; text-align: center; position: relative; z-index: 1; padding-bottom: 120px; }
.landing-card h1 { margin-top: 20px; }
.landing-card p { color: var(--text-2); }
.landing-card .fine { color: var(--muted); font-size: 14px; margin-top: 16px; }

/* The peekers: cat heads peeking up from the bottom edge. One Cobalt cat is side-eyeing you. */
.peekers { position: absolute; bottom: 0; right: 8%; display: flex; gap: 14px; align-items: flex-end; pointer-events: none; }
.peekers span {
  --h: 80px; width: 90px; height: var(--h); background: var(--surface); position: relative; border-radius: 6px 6px 0 0;
}
.peekers span:nth-child(2) { --h: 130px; }
.peekers span:nth-child(3) { --h: 100px; }
.peekers span::before, .peekers span::after {
  content: ""; position: absolute; top: -24px; width: 30px; height: 30px; background: var(--surface);
  clip-path: polygon(20% 0, 100% 100%, 0 100%);
}
.peekers span::before { left: 0; }
.peekers span::after { right: 0; transform: scaleX(-1); }
.peekers .accent {
  background: var(--cobalt);
  background-image:
    radial-gradient(circle at 36% 30%, var(--ink) 0 5px, transparent 5.5px),
    radial-gradient(circle at 70% 30%, var(--ink) 0 5px, transparent 5.5px),
    radial-gradient(ellipse 11px 7px at 32% 31%, var(--paper) 0 99%, transparent),
    radial-gradient(ellipse 11px 7px at 66% 31%, var(--paper) 0 99%, transparent);
}
.peekers .accent::before, .peekers .accent::after { background: var(--cobalt); }
.peekers.small { position: static; justify-content: center; margin-bottom: 8px; }
.peekers.small span { --h: 60px; width: 70px; }
.peekers.small span::before, .peekers.small span::after { top: -18px; width: 22px; height: 22px; }
.landing .peekers { right: 50%; transform: translateX(50%); }

/* ---------- picker ---------- */
.picker { max-width: 920px; margin: 0 auto; padding: 56px 24px; }
.server-grid { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.server-card {
  display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 16px; height: 100%;
  background: var(--surface); color: var(--text); text-decoration: none; box-shadow: inset 0 0 0 1px var(--border);
  position: relative;
}
.server-card:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.server-card-body { display: flex; flex-direction: column; min-width: 0; }
.server-card-body span { color: var(--muted); font-size: 14px; line-height: 1.4; }
.server-card .pill { position: absolute; top: 10px; right: 10px; }
.empty { background: var(--surface); border-radius: 16px; padding: 20px 24px; color: var(--text-2); }

/* ---------- handbook shell ---------- */
.shell { display: grid; grid-template-columns: 270px minmax(0, 1fr) 220px; max-width: 1440px; margin: 0 auto; }
.sidebar {
  position: sticky; top: var(--head); height: calc(100vh - var(--head)); overflow-y: auto;
  padding: 24px 16px 40px 20px; border-right: 1px solid var(--border); font-size: 15px;
}
.nav-home { display: block; padding: 6px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 500; margin-bottom: 12px; }
.nav-section { margin-bottom: 18px; }
.nav-title { margin: 0 0 6px; padding: 0 10px; font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.sidebar ul, .toc ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none; line-height: 1.4; }
.sidebar a:hover { background: var(--surface); color: var(--text); }
.sidebar a.active { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--text); font-weight: 500; }

.content { padding: 40px 48px 96px; min-width: 0; }
.doc { max-width: 760px; }
.crumbs { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.crumbs .pill { margin-left: 10px; }

.toc { position: sticky; top: var(--head); height: calc(100vh - var(--head)); overflow-y: auto; padding: 40px 20px; font-size: 14px; }
.toc a { display: block; padding: 3px 0; color: var(--muted); text-decoration: none; line-height: 1.4; }
.toc a:hover { color: var(--text); }
.toc .d3 a { padding-left: 12px; }

.server-hero { display: flex; gap: 20px; align-items: center; margin-bottom: 8px; }
.server-hero h1 { margin: 0; }
.server-hero .lead { margin: 4px 0 0; }

.card-list { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card-list a {
  display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px 18px; border-radius: 14px;
  background: var(--surface); color: var(--text); text-decoration: none; box-shadow: inset 0 0 0 1px var(--border);
}
.card-list a:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.card-list span:not(.pill) { color: var(--muted); font-size: 14px; line-height: 1.45; }

.results { list-style: none; padding: 0; }
.results li { padding: 16px 0; border-bottom: 1px solid var(--border); }
.results a { font-size: 18px; text-decoration: none; }
.results p { margin: 4px 0 0; color: var(--text-2); font-size: 15px; }
mark { background: color-mix(in srgb, var(--yolk) 45%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }

/* ---------- prose ---------- */
.prose { color: var(--text-2); }
.prose h2 { color: var(--text); font-size: 26px; margin: 44px 0 12px; font-weight: 700; }
.prose h3 { color: var(--text); font-size: 20px; margin: 32px 0 8px; font-weight: 700; }
.prose h4 { color: var(--text); font-size: 17px; margin: 24px 0 6px; }
.prose strong { color: var(--text); }
.prose .anchor { margin-left: 8px; color: var(--muted); text-decoration: none; opacity: 0; font-weight: 400; }
.prose :is(h2, h3, h4):hover .anchor { opacity: 1; }
.prose :is(h2, h3, h4) { scroll-margin-top: calc(var(--head) + 20px); }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }
.prose code { font-family: ui-monospace, "Cascadia Code", Menlo, monospace; font-size: 0.9em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: var(--surface); padding: 16px; border-radius: 12px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { margin: 20px 0; padding: 4px 18px; border-left: 4px solid var(--border); color: var(--muted); }
.prose .callout { border-left-width: 4px; border-radius: 0 12px 12px 0; padding: 12px 18px; background: var(--surface); color: var(--text-2); }
.prose .callout p { margin: 4px 0; }
.prose .callout-title { font-weight: 700; color: var(--text); font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; }
.prose .callout-note { border-color: var(--cobalt); }
.prose .callout-tip { border-color: #2fbf71; }
.prose .callout-important { border-color: #a46bff; }
.prose .callout-warning { border-color: var(--yolk); }
.prose .callout-caution { border-color: #ff5a5a; }
.table-wrap { overflow-x: auto; margin: 20px 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--border); }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; }
.prose th, .prose td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { color: var(--text); background: var(--surface); font-weight: 500; }
.prose tr:last-child td { border-bottom: 0; }
.prose td:is([align="center"]), .prose th:is([align="center"]) { text-align: center; }

/* ---------- message pages ---------- */
.message { max-width: 560px; margin: 0 auto; padding: 96px 24px; text-align: center; }
.message .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- edit mode ---------- */
.edit-button {
  padding: 7px 12px; border-radius: 10px; white-space: nowrap; flex: none;
  color: var(--text); text-decoration: none; font-weight: 500; font-size: 14px; box-shadow: inset 0 0 0 1px var(--border);
}
.edit-button:hover { background: var(--surface); }
.edit-button.active { background: var(--yolk); color: var(--ink); box-shadow: none; }
.button.small { padding: 7px 12px; border-radius: 10px; font-size: 14px; gap: 6px; }
.button.danger { background: transparent; color: #ff6b6b; box-shadow: inset 0 0 0 1px color-mix(in srgb, #ff5a5a 50%, transparent); }
.button:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.chip {
  display: inline-block; padding: 2px 10px; margin-right: 6px; border-radius: 99px; white-space: nowrap;
  background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 500; text-decoration: none;
}
.chip.good { background: color-mix(in srgb, #2fbf71 28%, transparent); }
.chip.warn { background: color-mix(in srgb, var(--yolk) 32%, transparent); }
.chip.info { background: color-mix(in srgb, var(--cobalt) 28%, transparent); }

.editbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px var(--pad); font-size: 14px;
  background: color-mix(in srgb, var(--yolk) 10%, var(--bg)); border-bottom: 1px solid color-mix(in srgb, var(--yolk) 35%, var(--border));
}
.editbar-title { display: inline-flex; align-items: center; gap: 8px; }
.editbar-changes { color: var(--text-2); }

.ed-shell { grid-template-columns: 270px minmax(0, 1fr); }
.ed-section-title { display: flex; justify-content: space-between; align-items: center; }
.ed-section-title a { color: var(--muted); text-decoration: none; letter-spacing: 0; font-size: 15px; padding: 0 4px; border-radius: 6px; }
.ed-section-title a:hover { color: var(--text); background: var(--surface); }
.ed-sidebar li a { display: flex; align-items: center; gap: 6px; }
.ed-file-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-sidebar a.gone .ed-file-label { text-decoration: line-through; color: var(--muted); }
.ed-new { margin: 4px 10px; }
.ed-badge { padding: 0 7px; border-radius: 99px; background: var(--surface-2); color: var(--text); font-size: 11px; font-weight: 500; white-space: nowrap; }
.ed-badge.edited { background: color-mix(in srgb, var(--yolk) 32%, transparent); }
.ed-badge.added { background: color-mix(in srgb, #2fbf71 32%, transparent); }
.ed-badge.deleted { background: color-mix(in srgb, #ff5a5a 32%, transparent); }
.crumbs .ed-badge { margin-left: 8px; }
.ed-h2 { font-size: 22px; margin: 36px 0 12px; }
.ed-list { list-style: none; padding: 0; margin: 0; }
.ed-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ed-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ed-actions form { margin: 0; }

.content.ed-wide { padding: 24px 32px 64px; }
.ed-form { display: flex; flex-direction: column; gap: 16px; }
.ed-form [hidden], .ed-new-form [hidden] { display: none !important; }
.ed-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ed-head .crumbs { margin: 0; }
.ed-save { color: var(--muted); font-size: 14px; white-space: nowrap; }
.ed-save.error { color: #ff6b6b; white-space: normal; }
.ed-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }
.ed-fields { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 12px 16px; border: 0; padding: 0; margin: 0; min-width: 0; }
.ed-fields label, .ed-audience, .ed-new-form label, .ed-summary { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--text-2); }
.ed-desc, .ed-audience { grid-column: 1 / -1; }
.ed-audience p { margin: 0; }
.ed-form input:not([type="checkbox"]), .ed-new-form :is(input, select), .ed-summary textarea {
  padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 15px "Rubik", sans-serif;
}
.ed-title input { font-size: 18px; font-weight: 500; }
.ed-groups { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ed-check { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 6px; color: var(--text); }
.ed-panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.ed-pane { display: flex; flex-direction: column; min-width: 0; border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.ed-pane:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.ed-pane-head {
  display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--border);
  color: var(--muted); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
}
.ed-pane-head a { letter-spacing: 0; text-transform: none; }
.ed-text {
  flex: 1; min-height: 62vh; resize: vertical; border: 0; padding: 16px; background: transparent; color: var(--text);
  font: 14px/1.6 ui-monospace, "Cascadia Code", Menlo, monospace; tab-size: 2;
}
.ed-text:focus { outline: none; }
.ed-preview { flex: 1; max-height: 75vh; overflow: auto; padding: 20px 24px; background: var(--bg); max-width: none; }
.ed-preview h1 { font-size: 30px; }
.ed-problem-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.ed-problem-list li { padding: 8px 12px; border-radius: 10px; color: var(--text); }
.ed-problem-list .error { background: color-mix(in srgb, #ff5a5a 18%, transparent); }
.ed-problem-list .warning { background: color-mix(in srgb, var(--yolk) 16%, transparent); }
.ed-foot { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; }
.ed-move summary { list-style: none; }
.ed-move summary::-webkit-details-marker { display: none; }
.ed-move[open] div { display: flex; gap: 8px; margin-top: 8px; }
.ed-new-form { display: flex; flex-direction: column; gap: 16px; max-width: 480px; }

.ed-review { max-width: 1000px; }
.ed-change { margin: 20px 0; border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.ed-change header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ed-change > :is(.ed-problem-list, p, form) { margin: 12px 16px; }
.ed-diff { font: 13px/1.5 ui-monospace, "Cascadia Code", Menlo, monospace; overflow-x: auto; }
.ed-diff-line { display: grid; grid-template-columns: 40px 40px minmax(0, 1fr); white-space: pre-wrap; word-break: break-word; }
.ed-diff-n { padding-right: 8px; color: var(--muted); font-size: 12px; text-align: right; user-select: none; }
.ed-diff-text { padding: 0 12px; }
.ed-diff-line.add { background: color-mix(in srgb, #2fbf71 16%, transparent); }
.ed-diff-line.del { background: color-mix(in srgb, #ff5a5a 16%, transparent); }
.ed-diff-gap { padding: 2px 92px; background: var(--surface-2); color: var(--muted); }
.ed-summary { margin: 24px 0 16px; font-weight: 500; font-size: 16px; }

.ed-pr-summary {
  display: flex; flex-direction: column; gap: 2px; margin: 8px 0 0; padding: 14px 18px; border-radius: 14px;
  background: var(--surface); color: var(--text); text-decoration: none; box-shadow: inset 4px 0 0 var(--cobalt);
}
.ed-pr-summary.warn { box-shadow: inset 4px 0 0 var(--yolk); }
.ed-pr-summary.good { box-shadow: inset 4px 0 0 #2fbf71; }
.ed-pr-summary span { color: var(--muted); font-size: 14px; }
.ed-pr header p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ed-timeline { list-style: none; margin: 20px 0 0 6px; padding: 0 0 0 20px; border-left: 2px solid var(--border); }
.ed-tl { position: relative; padding: 2px 0 18px; }
.ed-tl::before {
  content: ""; position: absolute; left: -28px; top: 7px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface-2); box-shadow: 0 0 0 3px var(--bg);
}
.ed-tl.proposal::before { background: var(--cobalt); }
.ed-tl.changes_requested::before { background: var(--yolk); }
.ed-tl:is(.approved, .merged)::before { background: #2fbf71; }
.ed-tl p { margin: 2px 0; }
.ed-tl .prose { margin-top: 6px; }
.ed-files { list-style: none; padding: 0; margin: 4px 0; font-size: 14px; }
.ed-history { list-style: none; padding: 0; }
.ed-history > li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.ed-history p { margin: 2px 0; }
.prose.small { font-size: 15px; }

.ed-head-actions { display: inline-flex; align-items: center; gap: 12px; }
.ed-badge.ai { background: color-mix(in srgb, #a46bff 32%, transparent); margin-left: 4px; }
.ed-problem-list .note { background: var(--surface-2); }
.ed-ai { border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px color-mix(in srgb, #a46bff 55%, var(--border)); overflow: hidden; }
.ed-ai > header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.ed-ai-ask, .ed-ai-output { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; }
.ed-ai-ask p, .ed-ai-output p { margin: 0; }
.ed-ai-modes { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.ed-ai-brief { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--text-2); }
.ed-ai textarea, .ed-ai-actions input {
  padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: 15px "Rubik", sans-serif;
}
.ed-ai-refs summary { cursor: pointer; font-size: 14px; color: var(--text-2); margin-bottom: 8px; }
.ed-ai-result { max-height: 50vh; overflow: auto; padding: 4px 16px; border-radius: 10px; background: var(--bg); }
.ed-ai-result .ed-ai-title { font-size: 26px; margin: 14px 0 4px; }
.ed-ai-draft { white-space: pre-wrap; font: 14px/1.6 ui-monospace, "Cascadia Code", Menlo, monospace; color: var(--text-2); padding: 12px 0; }
.ed-ai-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ed-ai-actions input { flex: 1 1 220px; min-width: 0; }
.ed-mentions { margin: 24px 0 0; }
.user a.link-button { text-decoration: none; }
.admin { max-width: 1100px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table th { color: var(--muted); font-weight: 500; font-size: 13px; }
.admin-server { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 500; }

/* ---------- responsive ---------- */
@media (max-width: 1500px) {
  .brand-tag { display: none; }
  .search input { width: 200px; }
}
@media (max-width: 1360px) {
  :root { --head: 109px; }
  .tabs {
    order: 99; flex-basis: calc(100% + 2 * var(--pad)); margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad);
    height: 48px; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--border);
  }
  .tabs::-webkit-scrollbar { display: none; }
}
@media (max-width: 1180px) {
  .shell { grid-template-columns: 250px minmax(0, 1fr); }
  .toc { display: none; }
  .ed-panes { grid-template-columns: minmax(0, 1fr); }
  .ed-text { min-height: 40vh; }
}
@media (max-width: 860px) {
  :root { --pad: 12px; }
  .topbar { column-gap: 10px; }
  .user-name { display: none; }
  .search input { width: 140px; }
  .nav-toggle:not([hidden]) {
    display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none;
    border: 0; border-radius: 8px; background: var(--surface); cursor: pointer;
  }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    display: block; width: 16px; height: 2px; background: var(--text); position: relative; content: "";
  }
  .nav-toggle span::before { position: absolute; top: -5px; }
  .nav-toggle span::after { position: absolute; top: 5px; }
  .shell { display: block; }
  .sidebar {
    position: fixed; top: var(--head); left: 0; z-index: 15; width: min(300px, 85vw); background: var(--bg);
    transform: translateX(-100%); transition: transform 0.2s ease;
  }
  .nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgb(0 0 0 / 0.5); }
  .content { padding: 28px 16px 72px; }
  .content.ed-wide { padding: 20px 16px 64px; }
  .ed-fields { grid-template-columns: minmax(0, 1fr) 90px; }
  .edit-button { padding: 6px 10px; }
  .admin-table { display: block; overflow-x: auto; }
}
@media (max-width: 560px) {
  .brand-name { display: none; }
  .edit-label { display: none; }
  .search input { width: 120px; }
}
