/* WarmUp Docs — light only, WarmUp Scan's tokens (logo palette: blue + a yellow spark). */
:root {
  --blue: #0057ff;
  --blue-700: #0047d1;
  --blue-50: #eef4ff;
  --blue-100: #dbe7ff;
  --yellow: #ffc629;
  --bg: #ffffff;
  --surface: #ffffff;
  --page: #f7f9fc;
  --ink: #081f4a;
  --ink-2: #364766;
  --muted: #66738c;
  --subtle: #97a1b4;
  --line: #e6e9ef;
  --line-soft: #eff1f5;
  --hover: #f2f6ff;
  --ok: #0a8f5a;
  --ok-bg: #e7f6ef;
  --err: #cc2f45;
  --err-bg: #fdeef0;
  --r: 12px;
  --r-sm: 8px;
  --font: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  --top: 60px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15px/1.55 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-700); }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.break { word-break: break-all; }
.grow { flex: 1; min-width: 0; }
.ok { color: var(--ok); }
.bad { color: var(--err); }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------------- top bar ---------------- */
.topbar { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, 0.86); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner { height: var(--top); max-width: 1320px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 7px; flex-shrink: 0; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { display: block; height: 24px; width: auto; }
.brand-word { font-weight: 700; font-size: 20px; letter-spacing: -0.02em; line-height: 1; margin-top: 1px; }
.brand-docs { font-weight: 500; font-size: 20px; letter-spacing: -0.02em; line-height: 1; color: var(--blue); margin-left: -2px; margin-top: 1px; }
.top-search { flex: 1; max-width: 420px; margin-left: 12px; position: relative; display: flex; align-items: center; }
.top-search svg { position: absolute; left: 12px; width: 16px; height: 16px; fill: none; stroke: var(--subtle); stroke-width: 2; stroke-linecap: round; }
.top-search input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 999px; padding: 0 14px 0 36px; background: var(--page); outline: none; transition: border-color .15s, background .15s; }
.top-search input:focus { border-color: var(--blue); background: #fff; }
.top-account { margin-left: auto; position: relative; display: flex; align-items: center; }
.acct-chip { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; max-width: 220px; }
.acct-chip:hover { border-color: var(--blue-100); background: var(--hover); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.acct-label { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 240px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 32px rgba(8, 31, 74, 0.12); padding: 6px; display: flex; flex-direction: column; }
.acct-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.acct-name { font-weight: 700; }
.acct-menu a, .acct-menu button { text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 500; cursor: pointer; }
.acct-menu a:hover, .acct-menu button:hover { background: var(--hover); color: var(--blue); }

/* ---------------- buttons, inputs ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { border-color: var(--blue-100); background: var(--hover); color: var(--blue); }
.btn:disabled { opacity: .55; cursor: default; }
.btn .ic { width: 16px; height: 16px; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--hover); border-color: transparent; }
.btn-ghost.danger, .btn.danger { color: var(--err); }
.btn-ghost.danger:hover { background: var(--err-bg); color: var(--err); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 50px; padding: 0 26px; font-size: 16px; border-radius: 12px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; flex-shrink: 0; }
.icon-btn:hover { color: var(--blue); background: var(--hover); border-color: var(--blue-100); }
.input, .select { height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff; outline: none; min-width: 0; }
.input:focus, .select:focus { border-color: var(--blue); }
.select { appearance: none; -webkit-appearance: none; padding-right: 40px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366738c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.field .input { color: var(--ink); font-size: 15px; }
.pill { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--line-soft); border-radius: 999px; padding: 3px 10px; }
.tag { font-size: 12px; font-weight: 700; color: var(--blue); background: var(--blue-50); border-radius: 6px; padding: 2px 8px; }

/* ---------------- landing ---------------- */
.app { min-height: calc(100vh - var(--top)); }
.boot { padding: 80px 24px; text-align: center; color: var(--muted); }
.landing { max-width: 1320px; margin: 0 auto; padding: 0 24px 96px; }
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; padding: 88px 0 72px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--blue); font-size: 14px; margin: 0 0 20px; background: var(--blue-50); padding: 6px 12px; border-radius: 999px; }
.eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); }
.hero h1 { font-size: clamp(40px, 5.6vw, 68px); line-height: 1.06; font-weight: 800; letter-spacing: -0.035em; }
.lead { font-size: 18px; color: var(--ink-2); max-width: 560px; margin: 24px 0 36px; line-height: 1.65; }
.hero-cta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hero-art { position: relative; height: 380px; }
.sheet { position: absolute; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0, 87, 255, 0.10); }
.sheet-back { inset: 36px 0 0 72px; background: linear-gradient(160deg, var(--blue) 0%, #3d7dff 100%); border: 0; transform: rotate(4deg); }
.sheet-front { inset: 0 64px 40px 0; padding: 22px 26px; display: flex; flex-direction: column; gap: 14px; }
.sheet-bar { display: flex; gap: 6px; margin-bottom: 8px; }
.sheet-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.sheet-h { height: 22px; width: 58%; border-radius: 6px; background: var(--ink); opacity: .9; }
.sheet-l { height: 11px; border-radius: 6px; background: var(--line); }
.w90 { width: 90%; } .w80 { width: 80%; } .w70 { width: 70%; }
.sheet-commit { margin-top: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); background: var(--blue-50); border-radius: 10px; padding: 10px 12px; }
.sheet-commit .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.spark { position: absolute; right: 40px; top: -10px; width: 46px; height: 46px; background: var(--yellow); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spark { animation: none; } }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 1200px) { .features { grid-template-columns: repeat(2, 1fr); } }
.feature { border: 1px solid var(--line); border-radius: 16px; padding: 28px; background: #fff; }
.feature-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--blue-50); color: var(--blue); display: grid; place-items: center; margin-bottom: 18px; }
.feature-ic .ic { width: 22px; height: 22px; }
.feature h3 { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.feature p { margin: 0; color: var(--ink-2); line-height: 1.65; }

/* ---------------- workspace ---------------- */
.workspace { display: grid; grid-template-columns: 280px minmax(0, 1fr); max-width: 1320px; margin: 0 auto; min-height: calc(100vh - var(--top)); }
.side { border-right: 1px solid var(--line); padding: 20px 14px 24px; display: flex; flex-direction: column; gap: 8px; position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow: auto; background: #fff; }
.side-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 0 8px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.side-title { font-weight: 700; font-size: 16px; }
.pad { padding: 8px; }
.tree { list-style: none; margin: 0; padding: 0; }
.tree .tree { padding-left: 14px; }
.tree a, .tree summary { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); font-size: 14px; cursor: pointer; min-width: 0; }
.tree a span, .tree summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree summary { list-style: none; font-weight: 600; }
.tree summary::-webkit-details-marker { display: none; }
.tree a:hover, .tree summary:hover { background: var(--hover); color: var(--blue); }
.tree a.on { background: var(--blue-50); color: var(--blue); font-weight: 600; }
.tree .ic { width: 16px; height: 16px; color: var(--subtle); }
.tree a.on .ic { color: var(--blue); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line-soft); padding-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.side-foot a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.side-foot a:hover { background: var(--hover); color: var(--blue); }
.side-foot .ic { width: 16px; height: 16px; }
.scrim { display: none; }
.content { padding: 24px 40px 72px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; min-height: 34px; }
.crumbs .sep { color: var(--subtle); }
.crumbs .here { color: var(--ink); font-weight: 600; }
.side-toggle { display: none; }
.file-head, .editor-head, .commit-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.commit-head { align-items: flex-start; }
.file-head-md { padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.file-head-md + .block-host { padding-top: 6px; }
.file-title { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; word-break: break-word; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.note { background: #fff8e1; border: 1px solid #ffe7a3; color: #6b4b00; border-radius: 10px; padding: 10px 14px; font-size: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.empty { padding: 56px 0; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }

/* ---------------- rendered Markdown ---------------- */
.doc { font-size: 16px; line-height: 1.75; color: var(--ink); max-width: 820px; word-wrap: break-word; }
.doc > :first-child { margin-top: 0; }
.doc h1, .doc h2, .doc h3, .doc h4 { margin: 1.6em 0 0.6em; line-height: 1.3; font-weight: 750; }
.doc h1 { font-size: 30px; } .doc h2 { font-size: 23px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); } .doc h3 { font-size: 19px; }
.doc p, .doc ul, .doc ol, .doc blockquote, .doc pre, .doc table { margin: 0 0 1em; }
.doc ul, .doc ol { padding-left: 1.5em; }
.doc li + li { margin-top: 0.25em; }
.doc a { text-decoration: underline; text-decoration-color: var(--blue-100); text-underline-offset: 3px; }
.doc a:hover { text-decoration-color: var(--blue); }
.doc code { font-family: var(--mono); font-size: 0.88em; background: var(--page); border: 1px solid var(--line-soft); border-radius: 6px; padding: 1px 6px; }
.doc pre { background: #0b1b3d; color: #e7edf9; border-radius: 12px; padding: 16px 18px; overflow: auto; font-size: 13.5px; line-height: 1.6; }
.doc pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.doc blockquote { border-left: 3px solid var(--blue); background: var(--blue-50); margin-left: 0; padding: 10px 16px; border-radius: 0 10px 10px 0; color: var(--ink-2); }
.doc blockquote > :last-child { margin-bottom: 0; }
.doc table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; }
.doc th, .doc td { border: 1px solid var(--line); padding: 8px 12px; }
.doc th { background: var(--page); font-weight: 650; }
.doc .al-left { text-align: left; } .doc .al-right { text-align: right; } .doc .al-center { text-align: center; }
.doc img { max-width: 100%; border-radius: 10px; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.dead-link { color: var(--muted); text-decoration: line-through dotted; }
.dead-img { color: var(--muted); font-size: 13px; }
.code-view { background: var(--page); border: 1px solid var(--line); border-radius: 12px; padding: 16px; overflow: auto; font: 13.5px/1.6 var(--mono); margin: 0; }
.image-view img { max-width: 100%; border-radius: 12px; border: 1px solid var(--line); }

/* ---------------- HTML page frame ---------------- */
.page-frame { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.frame-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--page); flex-wrap: wrap; }
.page-frame iframe { display: block; width: 100%; height: 70vh; min-height: 420px; border: 0; background: #fff; }

/* ---------------- editor ---------------- */
.editor-tabs { display: none; gap: 4px; background: var(--page); border-radius: 10px; padding: 4px; align-self: flex-start; }
.editor-tabs button { border: 0; background: none; padding: 6px 16px; border-radius: 8px; font-weight: 600; color: var(--muted); cursor: pointer; }
.editor-tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(8, 31, 74, 0.1); }
.editor-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; min-height: 60vh; }
.pane { min-width: 0; display: flex; }
.pane-write { border-right: 1px solid var(--line); }
.editor-text { flex: 1; border: 0; resize: none; outline: none; padding: 20px 22px; font: 14px/1.7 var(--mono); color: var(--ink); background: #fff; min-height: 60vh; tab-size: 2; }
.pane-preview { background: var(--page); overflow: auto; max-height: 75vh; }
.preview { padding: 20px 24px; max-width: none; font-size: 15px; }
.editor-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.editor-foot .input { flex: 1; min-width: 220px; }
.conflict { border: 1px solid #f3c2ca; background: var(--err-bg); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.conflict-head p { margin: 4px 0 0; color: var(--ink-2); }
.conflict-theirs { margin: 0; max-height: 240px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px; font: 13px/1.6 var(--mono); white-space: pre-wrap; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- history, diff, search ---------------- */
.commits, .results { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.commits li + li, .results li + li { border-top: 1px solid var(--line-soft); }
.commits a, .results a { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; color: var(--ink); }
.commits a:hover, .results a:hover { background: var(--hover); }
.c-msg, .r-title { font-weight: 600; }
.c-meta { display: flex; gap: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.c-author { color: var(--ink-2); font-weight: 500; }
.c-id { color: var(--subtle); }
.r-path { font-size: 12px; color: var(--subtle); }
.r-snip { font-size: 14px; color: var(--ink-2); }
.r-snip mark { background: #fff1c2; color: var(--ink); border-radius: 3px; padding: 0 2px; }
.diff { border: 1px solid var(--line); border-radius: 12px; overflow: auto; font: 13px/1.6 var(--mono); background: #fff; }
.diff > div { padding: 0 14px; white-space: pre; min-width: max-content; }
.d-add { background: var(--ok-bg); color: #075e3c; }
.d-del { background: var(--err-bg); color: #8f1d2f; }
.d-hunk { background: var(--blue-50); color: var(--blue); }
.d-head, .d-file { color: var(--muted); background: var(--page); }

/* ---------------- settings ---------------- */
.card { border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; background: #fff; }
.card h2 { font-size: 18px; font-weight: 700; }
.card-text { margin: -6px 0 0; line-height: 1.6; max-width: 760px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-row .input { flex: 1; min-width: 200px; }
.list { display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; }
.list:empty { display: none; }
.list > p { margin: 0; padding: 14px 16px; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.list-row + .list-row { border-top: 1px solid var(--line-soft); }
.list-row.gone { opacity: .6; }
.secret { border: 1px solid #ffe7a3; background: #fffaeb; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.secret-row { display: flex; align-items: center; gap: 10px; background: var(--page); border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 8px 14px; }
.secret-row code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.cmd { margin: 0; background: #0b1b3d; color: #e7edf9; border-radius: 10px; padding: 12px 14px; font: 13px/1.6 var(--mono); overflow: auto; }
.facts { display: grid; grid-template-columns: 92px 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; }
.anchor-box { display: flex; flex-direction: column; gap: 14px; }
.anchor-out { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.anchor-out:empty { display: none; }
.anchor-out p { margin: 0; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: var(--line); position: relative; flex-shrink: 0; transition: background .15s; }
.switch .track::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(8, 31, 74, 0.25); transition: transform .15s; }
.switch input:checked + .track { background: var(--blue); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------------- toast, share, callback ---------------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--err); }
.share-main { max-width: 900px; margin: 0 auto; padding: 32px 24px 80px; display: flex; flex-direction: column; gap: 20px; }
.share-meta { margin: 0; color: var(--muted); font-size: 14px; }
.share-missing { padding: 48px 0; color: var(--ink-2); }
.callback { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }


/* ---------------- phase 3: switcher, invitations, menus, audit, block editor ---------------- */
.top-link { font-weight: 600; font-size: 14px; color: var(--ink-2); margin-right: 14px; }
.top-link:hover { color: var(--blue); }
.avatar { position: relative; }
.avatar .badge { position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); border: 2px solid #fff; }
.avatar-sm { width: 30px; height: 30px; font-size: 13px; }
.side-head { align-items: center; }
.switcher { position: relative; flex: 1; min-width: 0; }
.switch-btn { width: 100%; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 6px 8px; margin: -6px -8px; border-radius: 10px; cursor: pointer; text-align: left; }
.switch-btn:hover { background: var(--hover); }
.switch-btn .ic { width: 16px; height: 16px; color: var(--subtle); margin-left: auto; }
.sw-text { display: flex; flex-direction: column; min-width: 0; }
.sw-text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch-menu { position: absolute; left: -8px; top: calc(100% + 10px); width: 260px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 32px rgba(8, 31, 74, 0.12); padding: 6px; z-index: 35; display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow: auto; }
.switch-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink-2); }
.switch-menu a:hover { background: var(--hover); color: var(--ink); }
.switch-menu a.on { background: var(--blue-50); }
.sw-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--blue-50); color: var(--blue); font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.switch-menu a.on .sw-mark { background: var(--blue); color: #fff; }
.sw-title { font-weight: 600; color: var(--ink); font-size: 14px; }
.sw-sub { font-size: 12px; color: var(--muted); }
.switch-menu .sw-new { border-top: 1px solid var(--line-soft); margin-top: 4px; padding-top: 12px; border-radius: 0 0 var(--r-sm) var(--r-sm); color: var(--blue); font-weight: 600; font-size: 14px; }
.switch-menu .sw-new .ic { width: 16px; height: 16px; margin: 0 7px; }
.invites { display: flex; flex-direction: column; gap: 10px; }
.invite { display: flex; align-items: center; gap: 14px; border: 1px solid var(--blue-100); background: var(--blue-50); border-radius: 14px; padding: 12px 14px; flex-wrap: wrap; }
.invite-ic { width: 36px; height: 36px; border-radius: 10px; background: #fff; color: var(--blue); display: grid; place-items: center; flex-shrink: 0; }
.more { position: relative; }
.more > .btn { letter-spacing: 1px; padding: 0 14px; }
.more-menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 32px rgba(8, 31, 74, 0.12); padding: 6px; z-index: 20; display: flex; flex-direction: column; min-width: 190px; }
.more-menu button { display: flex; align-items: center; gap: 10px; text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 500; cursor: pointer; white-space: nowrap; }
.more-menu button:hover { background: var(--hover); color: var(--blue); }
.more-menu button.danger { color: var(--err); }
.more-menu button.danger:hover { background: var(--err-bg); }
.more-menu .ic { width: 16px; height: 16px; }
.save-state { display: inline-flex; align-items: center; height: 38px; padding: 0 6px; cursor: default; white-space: nowrap; }
.select-sm { height: 32px; font-size: 13px; padding-right: 34px; background-position: right 10px center; }
.tag-agent { margin-left: 8px; font-weight: 600; font-size: 11px; }
.input-agent { max-width: 220px; }
.endpoints { display: flex; flex-direction: column; gap: 8px; }
.ep-label { font-size: 12px; font-weight: 700; color: var(--blue); background: var(--blue-50); border-radius: 6px; padding: 2px 8px; flex-shrink: 0; }
.is-agent { color: var(--blue); }
.c-author.is-agent { color: var(--blue); }
.members-box { display: flex; flex-direction: column; gap: 10px; }
.audit { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.audit li { padding: 12px 18px; display: flex; flex-direction: column; gap: 4px; }
.audit li + li { border-top: 1px solid var(--line-soft); }
.a-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.a-when { margin-left: auto; padding-left: 12px; }
.empty-page { max-width: 1320px; margin: 0 auto; padding: 72px 24px; }
.page-switch a { font-weight: 600; }
.block-host { max-width: 860px; display: flex; flex-direction: column; gap: 14px; }
.block-editor .milkdown { background: transparent; }
.block-editor .milkdown .ProseMirror { padding: 0 0 120px 0 !important; outline: none; }
.block-editor .milkdown .ProseMirror > :first-child, .block-editor .milkdown .ProseMirror > .ProseMirror-widget:first-child + * { margin-top: 0; }
.block-editor .milkdown .ProseMirror blockquote { padding-left: 20px; }
.block-editor .milkdown .milkdown-code-block { padding: 6px 14px 12px; border-radius: 12px; }
.block-editor .milkdown .ProseMirror h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; }
.block-editor .milkdown .ProseMirror h2 { font-size: 23px; font-weight: 750; }
.block-editor .milkdown .ProseMirror h3 { font-size: 19px; font-weight: 700; }
.block-editor .milkdown .ProseMirror a { color: var(--blue); }
@media (max-width: 860px) {
  .block-editor .milkdown .ProseMirror { padding-left: 0; padding-right: 0; }
  .a-when { margin-left: 0; padding-left: 0; width: 100%; }
  .input-agent { max-width: none; }
  .top-link { display: none; }
}

/* ---------------- narrow screens ---------------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding: 56px 0 48px; }
  .hero-art { height: 300px; max-width: 520px; }
  .features { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .topbar-inner { padding: 0 16px; gap: 10px; }
  .top-search { margin-left: 4px; }
  .acct-label { display: none; }
  .acct-chip { padding: 4px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: var(--top); bottom: 0; height: auto; width: min(84vw, 320px); z-index: 30; transform: translateX(-102%); transition: transform .2s ease, visibility .2s; visibility: hidden; }
  .side-open .side { visibility: visible; box-shadow: 0 0 40px rgba(8, 31, 74, 0.14); }
  .side-open .side { transform: none; }
  .side-open .scrim { display: block; position: fixed; inset: var(--top) 0 0 0; background: rgba(8, 31, 74, 0.28); z-index: 25; }
  .side-toggle { display: inline-grid; margin-right: 2px; }
  .content { padding: 16px 16px 56px; gap: 16px; }
  .file-title { font-size: 23px; }
  .editor-tabs { display: flex; }
  .editor-panes { grid-template-columns: 1fr; min-height: 55vh; }
  .editor-panes.show-write .pane-preview, .editor-panes.show-preview .pane-write { display: none; }
  .pane-write { border-right: 0; }
  .editor-text { min-height: 55vh; padding: 16px; }
  .pane-preview { max-height: none; }
  .card { padding: 18px 16px; }
  .list-row { padding: 12px 14px; }
  .page-frame iframe { height: 64vh; }
}
@media (max-width: 520px) {
  .brand-word, .brand-docs { font-size: 18px; }
  .landing { padding: 0 16px 64px; }
  .hero { padding: 40px 0 36px; }
  .lead { font-size: 16px; margin: 18px 0 28px; }
  .hero-art { height: 240px; margin-right: 12px; }
  .sheet-front { inset: 0 40px 30px 0; padding: 18px; }
  .sheet-back { inset: 28px 0 0 48px; }
  .feature { padding: 22px; }
  .actions .btn { padding: 0 12px; }
  .form-row > * { flex: 1 1 100%; }
  .facts { grid-template-columns: 84px 1fr; gap: 8px 10px; }
}
