/* Tokens and base rules from ../../STYLE.md */
:root {
  --bg: #F1F3F6; --panel: #FFFFFF; --ink: #17212B; --muted: #5B6976;
  --line: #CBD3DB; --edge: #8492A0; --accent: #2748B8; --accent-soft: #E2E8FA;
  --warn: #A8500C; --warn-soft: #FAEBD9;
  --display: "IBM Plex Sans Condensed", "Arial Narrow", Arial, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10161C; --panel: #18212A; --ink: #E4EAF0; --muted: #97A5B3;
    --line: #2E3B47; --edge: #627281; --accent: #8FA9FF; --accent-soft: #1D2A52;
    --warn: #F0A65A; --warn-soft: #3A2A17; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10161C; --panel: #18212A; --ink: #E4EAF0; --muted: #97A5B3;
  --line: #2E3B47; --edge: #627281; --accent: #8FA9FF; --accent-soft: #1D2A52;
  --warn: #F0A65A; --warn-soft: #3A2A17; color-scheme: dark;
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
*:hover::-webkit-scrollbar-thumb { background: var(--edge); }
*::-webkit-scrollbar-corner { background: transparent; }
/* The editor panes and sidebar show their bar only while the pointer is over them. */
.ed-write textarea, .ed-preview, .nav, .palette-results, .proposal .body { scrollbar-color: transparent transparent; }
.ed-write textarea:hover, .ed-preview:hover, .nav:hover, .palette-results:hover, .proposal .body:hover { scrollbar-color: var(--line) transparent; }
.ed-write textarea::-webkit-scrollbar-thumb, .ed-preview::-webkit-scrollbar-thumb, .nav::-webkit-scrollbar-thumb, .palette-results::-webkit-scrollbar-thumb, .proposal .body::-webkit-scrollbar-thumb { background: transparent; }
.ed-write textarea:hover::-webkit-scrollbar-thumb, .ed-preview:hover::-webkit-scrollbar-thumb, .nav:hover::-webkit-scrollbar-thumb, .palette-results:hover::-webkit-scrollbar-thumb, .proposal .body:hover::-webkit-scrollbar-thumb { background: var(--line); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--body); }
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.page { min-width: 0; padding-inline: 20px 32px; padding-block: 48px 72px; display: grid; gap: 56px; }

/* landing page with the sign-in widget */
body.landing .shell { grid-template-columns: minmax(0, 1fr); }
body.landing .nav { display: none; }
body.landing .page { max-width: 1120px; margin: 0 auto; padding-inline: 32px; gap: 48px; }
.landing-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.landing-top .eyebrow { font-size: 14px; padding-top: 10px; }
.signin { position: fixed; top: 20px; right: 20px; z-index: 20; width: min(320px, calc(100vw - 40px)); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px; display: grid; gap: 8px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.08); }
body.landing .page { padding-top: 32px; }
.hero { padding-right: 360px; }
.signin { padding: 12px; gap: 10px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: none; border-radius: 3px; padding: 6px 8px; font-size: 0.8125rem; color: var(--muted); }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08); }
.seg button:hover:not(.on) { color: var(--ink); }
.field { display: grid; gap: 4px; }
.field .label { line-height: 1.4; }
.signin input { padding: 8px 10px; font-size: 0.9375rem; }
.signin input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pw { position: relative; display: block; }
.pw input { padding-right: 56px; width: 100%; }
.peek { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; padding: 4px 6px; font-size: 0.75rem; color: var(--muted); }
.peek:hover { color: var(--accent); }
button.wide { width: 100%; padding: 9px 14px; font-size: 0.9375rem; margin-top: 2px; }
.signin-error { color: var(--warn); padding: 6px 8px; background: var(--warn-soft); border-radius: 4px; }
.hero { max-width: 1100px; padding-top: 16px; }
.hero h1 { font-size: 3rem; }
.hero .lede { max-width: 680px; font-size: 1.1875rem; }
.how { gap: 16px; }
.how figure.diagram { max-width: 860px; }
.points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 32px; max-width: 980px; }
.point { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.point h3 { font-size: 1.125rem; }
.point p { color: var(--muted); font-size: 0.9375rem; }
@media (max-width: 900px) { .points { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hero h1 { font-size: 2.25rem; } }
@media (max-width: 900px) { .hero { padding-right: 0; } .signin { position: static; width: 100%; box-shadow: none; } }
@media (max-width: 560px) { .points { grid-template-columns: minmax(0, 1fr); } .landing-top { flex-direction: column; } }
.nav-user { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.nav-user a { color: var(--muted); }
.nav-user span { font-weight: 600; color: var(--ink); }
.nav-user a:hover { color: var(--accent); }

/* search */
.search-open { display: flex; justify-content: space-between; align-items: center; width: 100%; font: 400 0.9375rem var(--body); color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 7px 8px 7px 10px; cursor: pointer; text-align: left; }
.search-open:hover { border-color: var(--edge); color: var(--ink); }
kbd { font: 500 11px var(--mono); color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; }

.palette-backdrop { position: fixed; inset: 0; z-index: 30; background: rgb(23 33 43 / 0.35); display: grid; justify-items: center; align-content: start; padding: 12vh 16px 16px; }
.palette { width: min(640px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 16px 48px rgb(0 0 0 / 0.2); display: grid; overflow: hidden; }
.palette input { font: 400 1.125rem var(--body); color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 16px 18px; outline: none; width: 100%; }
.palette input::placeholder { color: var(--muted); }
.palette-results { max-height: 52vh; overflow: auto; display: grid; }
.palette-empty { padding: 18px; font-size: 0.9375rem; color: var(--muted); }
.palette-row { display: grid; gap: 3px; padding: 11px 18px; text-decoration: none; color: var(--ink); border-left: 3px solid transparent; }
.palette-row.selected { background: var(--accent-soft); border-left-color: var(--accent); }
.palette-title { font-weight: 600; }
.palette-snippet { font-size: 0.875rem; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.palette-all { display: block; padding: 10px 18px; font-size: 0.875rem; color: var(--accent); text-decoration: none; border-top: 1px solid var(--line); }
.palette-all:hover { background: var(--accent-soft); }
.palette-foot { display: flex; gap: 16px; padding: 8px 18px; border-top: 1px solid var(--line); font-size: 0.75rem; color: var(--muted); }
.palette-foot kbd { margin-right: 4px; }
.results { display: grid; gap: 22px; max-width: 860px; }
.result { display: grid; gap: 4px; }
.result .title { font: 600 1.125rem var(--display); color: var(--ink); text-decoration: none; }
.result .title:hover { color: var(--accent); }
.snippet { font-size: 0.9375rem; color: var(--muted); }
mark { background: var(--warn-soft); color: inherit; border-radius: 2px; padding: 0 1px; }
article mark { background: var(--accent-soft); outline: 2px solid var(--accent-soft); }

/* sidebar */
.nav { position: sticky; top: 0; min-height: 100vh; max-height: 100vh; box-sizing: border-box; overflow: auto; padding: 48px 12px 48px 20px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; font-size: 0.9375rem; }
.nav > .tree { flex: 0 0 auto; }
.nav .label { line-height: 1.6; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tree ul { padding-left: 16px; }
.nav-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.nav-top .eyebrow { text-decoration: none; }
.nav-top .eyebrow.current { text-decoration: underline; text-underline-offset: 4px; }
.nav-link { font: 600 12px var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.nav-link:hover, .nav-link.current { color: var(--accent); }
.node { display: flex; align-items: baseline; gap: 2px; border-radius: 4px; padding: 3px 6px 3px 2px; }
.node:hover { background: var(--accent-soft); }
.node.current { background: var(--accent-soft); }
.node.current a { color: var(--accent); font-weight: 600; }
.node a { color: var(--ink); text-decoration: none; min-width: 0; line-height: 1.35; }
.node.folder .folder-name { color: var(--muted); font-weight: 500; text-transform: capitalize; }
.twist { flex: 0 0 18px; width: 18px; text-align: center; border: 0; background: none; padding: 0; color: var(--muted); font-size: 0.875rem; cursor: pointer; }
.headings { list-style: none; margin: 0; padding: 0 0 0 10px; border-left: 2px solid var(--line); display: grid; gap: 4px; }
.headings a { font-size: 0.875rem; color: var(--muted); text-decoration: none; padding-bottom: 1px; border-bottom: 2px solid transparent; transition: border-color 150ms, color 150ms; }
.headings a:hover { color: var(--accent); }
.headings a.active { color: var(--ink); border-bottom-color: var(--accent); }
.headings a:hover { color: var(--accent); }
.page > * { min-width: 0; }
section, header { display: grid; gap: 18px; }
section > *, header > * { min-width: 0; }
.prose { max-width: 720px; display: grid; gap: 12px; }

.eyebrow { font: 600 12px var(--body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: 2.5rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.1875rem; }
p { margin: 0; }
.lede { font-size: 1.125rem; color: var(--muted); max-width: 720px; }
code { font-family: var(--mono); font-size: 0.875em; }
ol, ul { margin: 0; padding-left: 1.25rem; display: grid; gap: 6px; }
a { color: var(--accent); }
.label { font: 600 12px/1.9 var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* tables */
.tablewrap { overflow-x: auto; max-width: 1000px; }
.tablewrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 16px 10px 0; border-bottom: 1px solid var(--line); }
th { font: 600 12px var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--edge); }
td:first-child { font-weight: 600; }
td:last-child, th:last-child { padding-right: 0; }
td a { color: inherit; text-decoration: none; }
td a:hover { color: var(--accent); }

/* books on the home page */
.books { display: grid; gap: 18px; max-width: 860px; }
.book { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; display: grid; gap: 8px; }
.book-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.book h3 { font-size: 1.25rem; }
.book h3 a { color: var(--ink); text-decoration: none; }
.book h3 a:hover { color: var(--accent); }
.book-lead { font-size: 0.9375rem; }
.book-pages { list-style: none; padding: 8px 0 0 10px; margin: 0; border-left: 2px solid var(--line); display: grid; gap: 4px; font-size: 0.9375rem; }
.book-pages a { color: var(--ink); text-decoration: none; }
.book-pages a:hover { color: var(--accent); }

/* forms and buttons */
textarea, input[type="text"] {
  width: 100%; font: 400 1rem/1.5 var(--body); color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px;
}
textarea { resize: vertical; min-height: 92px; }
textarea:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
button {
  font: 600 0.875rem var(--body); color: var(--ink); cursor: pointer;
  background: var(--panel); border: 1px solid var(--edge); border-radius: 4px; padding: 7px 14px;
}
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.warn { color: var(--warn); border-color: var(--warn); }
button:disabled { opacity: 0.5; cursor: wait; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* page layout: article + aside */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; }
aside { display: grid; gap: 28px; position: sticky; top: 24px; }
aside section { gap: 8px; }

.page-actions { justify-content: space-between; }
.spacer { flex: 1; }
.tiny-link { font: 600 0.75rem var(--body); padding: 2px 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); text-decoration: none; background: var(--panel); }
.tiny-link:hover { color: var(--accent); border-color: var(--accent); }
button.tiny.warn { color: var(--warn); border-color: var(--line); }
button.tiny.warn:hover { border-color: var(--warn); }

/* editor */
.editor { display: grid; gap: 8px; max-width: none; }
.ed-top { display: flex; gap: 12px; align-items: center; }
.ed-top input[type="text"] { flex: 1; font: 600 1.375rem/1.2 var(--display); padding: 6px 12px; }
.ed-view { width: 260px; flex: 0 0 auto; grid-template-columns: 1fr 1fr 1fr; }
.ed-tools { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ed-tools button { min-width: 34px; padding: 4px 8px; font-size: 0.8125rem; border-color: var(--line); color: var(--ink); }
.ed-tools button.b { font-weight: 700; } .ed-tools button.i { font-style: italic; }
.ed-tools button:hover { border-color: var(--accent); color: var(--accent); }
.ed-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-height: 240px; }
.ed-panes[data-view="write"] { grid-template-columns: 1fr; } .ed-panes[data-view="write"] .ed-preview { display: none; }
.ed-panes[data-view="preview"] { grid-template-columns: 1fr; } .ed-panes[data-view="preview"] .ed-write { display: none; }
.ed-write { position: relative; display: grid; }
.ed-write textarea { height: 100%; min-height: 0; font: 400 0.9375rem/1.6 var(--mono); resize: none; tab-size: 2; overflow: auto; }
.ed-preview { max-width: none; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 14px 18px; font-size: 0.9375rem; align-content: start; }
.ed-preview h2 { margin-top: 12px; }
.ed-complete { position: absolute; left: 12px; bottom: 12px; z-index: 5; min-width: 220px; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.12); padding: 4px; display: grid; }
.ed-complete[hidden] { display: none; }
.ed-complete div { padding: 6px 10px; border-radius: 4px; font-size: 0.9375rem; cursor: pointer; }
.ed-complete div.on, .ed-complete div:hover { background: var(--accent-soft); color: var(--accent); }
.ed-foot { margin-top: 2px; }
body.editing { overflow: hidden; }
body.editing .page { padding-top: 20px; gap: 0; }
body.editing .page > header { display: none; }
.split.editing { grid-template-columns: minmax(0, 1fr); }
.ed-write textarea { overflow-x: hidden; overflow-wrap: break-word; }
@media (max-width: 900px) { .ed-view { width: 200px; } }

/* article: rendered markdown */
article { max-width: 860px; display: grid; gap: 14px; }
article h2 { margin-top: 20px; }
article h3 { margin-top: 8px; }
article blockquote { margin: 0; padding-left: 14px; border-left: 3px solid var(--line); color: var(--muted); }
article pre { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px; overflow-x: auto; }
article table td:first-child { font-weight: 400; }
a.wl { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-soft); }
a.wl:hover { border-bottom-color: var(--accent); }
.wl.missing { color: var(--muted); border-bottom: 1px dashed var(--edge); }

/* chips: link lists in the aside */
.chips { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.875rem; }
.chips a {
  display: inline-block; padding: 4px 8px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 4px; color: var(--ink); text-decoration: none;
}
.chips a:hover { border-color: var(--accent); color: var(--accent); }
.chips .missing { display: inline-block; padding: 4px 8px; border: 1px dashed var(--edge); border-radius: 4px; color: var(--muted); }

/* changes */
.latest { display: grid; gap: 4px; font-size: 0.9375rem; }
aside .latest { font-size: 0.875rem; }

.timeline { --col: 104px; --spine: 28px; position: relative; max-width: 900px; display: grid; gap: 18px; }
.timeline::before {
  content: ""; position: absolute; left: calc(var(--col) + var(--spine) / 2 - 1px); top: 10px; bottom: 30px; width: 2px;
  background: linear-gradient(to bottom, var(--line) 0, var(--line) calc(100% - 120px), transparent 100%);
}
.event, .origin, .day { position: relative; display: grid; grid-template-columns: var(--col) var(--spine) minmax(0, 1fr); column-gap: 14px; align-items: start; }
.event .when { text-align: right; padding-top: 11px; display: grid; gap: 1px; font-size: 0.8125rem; line-height: 1.3; }
.event .when b { font-weight: 600; color: var(--ink); }
.event .when span { color: var(--muted); }
.mark { display: grid; place-items: center; height: 36px; }
.mark i { display: block; width: 12px; height: 12px; border-radius: 50%; background: var(--panel); border: 2px solid var(--edge); box-sizing: border-box; box-shadow: 0 0 0 3px var(--bg); }
.event.add .mark i { border-color: var(--accent); }
.event.change .mark i { border-color: var(--ink); }
.event.remove .mark i { border-color: var(--warn); }
.event.restore .mark i { border-color: var(--edge); border-style: dashed; }
.event.newest .mark i { background: var(--accent); border-color: var(--accent); width: 14px; height: 14px; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent-soft); }
.event.newest.remove .mark i { background: var(--warn); border-color: var(--warn); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--warn-soft); }
.event .card { position: relative; padding: 9px 0 6px; display: grid; gap: 5px; }
.event.other { opacity: 0.5; }
.event .text { font-weight: 500; line-height: 1.4; }
.event .foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.event .chips a { padding: 1px 7px; font-size: 0.8125rem; }
.event .foot button { border: 0; background: none; padding: 0 0 0 6px; font: 500 0.8125rem var(--body); color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.event .foot button:hover { color: var(--accent); text-decoration-color: var(--accent); }

.day { margin: 6px 0 -2px; }
.day b { justify-self: center; position: relative; z-index: 1; font: 600 11px var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: var(--bg); padding: 2px 0; grid-column: 2; white-space: nowrap; }
.origin .mark i { width: 10px; height: 10px; border-color: var(--edge); background: var(--edge); }
.origin .label { padding-top: 9px; }
.key { display: flex; gap: 16px; margin-top: 6px; padding-left: calc(var(--col) + var(--spine) + 14px); }
.key .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--edge); box-sizing: border-box; margin-right: 5px; vertical-align: -1px; background: var(--panel); }
.key .dot.add { border-color: var(--accent); } .key .dot.change { border-color: var(--ink); } .key .dot.remove { border-color: var(--warn); } .key .dot.restore { border-style: dashed; }
@media (max-width: 720px) {
  .timeline { --col: 64px; }
  .event .when span { display: none; }
}

/* context menu (the dig prompt) */
.menu {
  position: fixed; z-index: 10; width: min(420px, calc(100vw - 32px));
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px;
  display: grid; gap: 10px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
}
.menu .sel { font-size: 0.8125rem; color: var(--muted); max-height: 4.5em; overflow: hidden; border-left: 3px solid var(--accent); padding-left: 10px; }
.menu textarea { min-height: 64px; }
.menu .actions { display: grid; }
.menu .actions button {
  text-align: left; font-weight: 500; font-size: 0.9375rem; border: 0; border-radius: 4px;
  padding: 8px 10px; background: none;
}
.menu .actions button:hover, .menu .actions button:focus-visible { background: var(--accent-soft); color: var(--accent); outline: none; }
.menu .ask:not([hidden]) { display: grid; gap: 10px; }
.menu .label + .actions { margin-top: -4px; }
.menu .suggested { min-height: 28px; }
.menu .suggested .thinking { padding: 4px 10px; }
.menu .suggested button { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.menu .kind { font: 500 11px var(--mono); color: var(--muted); letter-spacing: 0.04em; }
.proposal .sel { border-left: 3px solid var(--line); padding-left: 10px; max-height: 3em; overflow: hidden; }
.proposal details .sel { max-height: 12em; overflow: auto; margin-top: 6px; white-space: pre-wrap; font-size: 0.8125rem; }
.proposal summary { cursor: pointer; }

/* ask about the page */
.ask-page { display: grid; gap: 6px; }
.ask-row { display: flex; gap: 6px; }
.ask-row input { flex: 1; min-width: 0; font-size: 0.9375rem; padding: 7px 10px; }
.ask-row button { padding-inline: 12px; }

.fixes { display: grid; gap: 8px; }
.fixes details { margin-top: 2px; }
.fixes .sel { margin: 6px 0; }

/* proposal panel */
.proposal { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px; display: grid; gap: 12px; }
.proposal .expand { position: absolute; top: 10px; right: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: 0.9375rem; line-height: 1; padding: 3px 6px; border-radius: 4px; }
.proposal .expand:hover { color: var(--accent); border-color: var(--accent); }
.proposal .label { padding-right: 40px; }

/* the expanded preview */
.preview-backdrop { position: fixed; inset: 0; z-index: 25; background: rgb(23 33 43 / 0.35); display: grid; place-items: start center; padding: 6vh 16px 16px; overflow: auto; }
.preview { width: min(1000px, 100%); }
.preview .proposal { padding: 24px 28px; box-shadow: 0 16px 48px rgb(0 0 0 / 0.2); font-size: 1rem; }
.preview .proposal .body { max-height: none; font-size: 1rem; }
.preview .proposal .body h3 { font-size: 1.1875rem; }
.preview .proposal .sel { max-height: none; }
.preview .proposal .q { font-size: 1.125rem; }
.preview figure.diagram { padding: 16px; }
.proposal .label { color: var(--warn); }
.proposal .body { font-size: 0.9375rem; display: grid; gap: 10px; max-height: 50vh; overflow: auto; }
.proposal .body h3 { font-size: 1rem; }
.proposal .q { font-weight: 600; }
.proposal a.wl { pointer-events: none; }

/* status line */
.status {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); font: 500 0.8125rem var(--body);
  padding: 8px 14px; border-radius: 4px; z-index: 20;
}
.status.error { background: var(--warn); color: #fff; }

@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  aside { position: static; }
  .shell { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .nav { position: static; min-height: 0; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); padding: 24px 20px 16px; }
  .page { padding-top: 32px; }
}
@media (max-width: 560px) {
  h1 { font-size: 2rem; }
  .page { padding-block: 32px 56px; gap: 44px; }
}
