:root {
  color-scheme: light;
  --bg: #f6f7f7;
  --surface: #fff;
  --ink: #1f2621;
  --muted: #505851;
  --line: #ccd2cc;
  --link: #38634a;
  --primary: #2b4836;
  --primary-ink: #fff;
  --code: #edf1ed;
  --detail: #815334;
  --mono: ui-monospace, Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a1f1c;
  --surface: #212a24;
  --ink: #f0f4f1;
  --muted: #bbc6be;
  --line: #59665c;
  --link: #a9d4b8;
  --primary: #b6d6c0;
  --primary-ink: #24362b;
  --code: #2a342c;
  --detail: #f5bb92;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.5 system-ui, sans-serif; }
a { color: var(--link); }
:is(a,button,input,select,textarea):focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .62; }
code { font-family: var(--mono); }
body > header > div, body > footer > div, .outline-workbench, body > main:not(.outline-workbench) { width: min(100% - 2rem, 72rem); margin-inline: auto; }
body > header > div, body > footer > div:not(.app-meta) { display: flex; justify-content: space-between; align-items: center; padding-block: .8rem; gap: .7rem; }
body > header nav, body > footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
body > header a, body > footer a { font-size: .88rem; }
body > footer { border-top: 1px solid var(--line); }
body > main:not(.outline-workbench) { min-height: 60vh; max-width: 48rem; }
.brand { display: inline-flex; align-items: center; gap: .45rem; color: var(--ink); text-decoration: none; font-weight: 690; }
.brand img { width: 1.7rem; height: 1.7rem; border-radius: 4px; }
.title-band { padding-block: 1.65rem 1.4rem; }
.title-band h1 { margin: 0 0 .35rem; font-size: 2.05rem; line-height: 1.15; }
.title-band p { margin: 0; color: var(--muted); }
.outline-tool { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); border-block: 1px solid var(--line); margin-bottom: 2rem; }
.outline-tool section { min-width: 0; padding-block: 1.15rem; }
#outline-input { padding-right: 1.35rem; border-right: 1px solid var(--line); }
#outline-review { padding-left: 1.35rem; }
.outline-tool h2 { margin: 0 0 .8rem; font-size: 1.15rem; }
.file-line, .source-actions, .result-actions, .section-head { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.section-head { justify-content: space-between; }
.section-head output { color: var(--detail); font: 700 .82rem/1.2 var(--mono); }
.outline-tool button { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: .5rem .75rem; font-weight: 620; min-height: 2.6rem; }
.outline-tool button.primary { color: var(--primary-ink); background: var(--primary); border-color: var(--primary); }
.outline-tool button.quiet { border-color: transparent; color: var(--link); background: transparent; }
.outline-tool p[role="status"] { font-size: .87rem; color: var(--muted); overflow-wrap: anywhere; }
.outline-tool p[role="status"]:empty { display: none; }
.settings-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; padding-top: .65rem; border-top: 1px solid var(--line); }
.settings-fields label, #outline-password label, #outline-result > label { display: block; font-size: .88rem; font-weight: 650; }
.settings-fields span { font-weight: 400; color: var(--muted); }
.outline-tool input:not([type="radio"]), .outline-tool select, .outline-tool textarea { width: 100%; min-width: 0; min-height: 2.6rem; padding: .4rem .55rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.settings-fields input, .settings-fields select { margin-top: .28rem; }
#outline-password input { margin: .25rem 0 .4rem; }
.mode-select { margin: .85rem 0; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 6px; }
.mode-select legend, .mode-select label { font-size: .9rem; }
.mode-select label { display: inline-flex; margin: .2rem .8rem .2rem 0; align-items: center; gap: .3rem; }
.mode-select input { accent-color: var(--link); }
.source-actions { justify-content: space-between; }
.outline-empty { min-height: 14rem; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.outline-empty svg { width: 2.6rem; height: 2.6rem; color: var(--link); }
.outline-table { max-height: 17.5rem; overflow: auto; }
.outline-table table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.outline-table th, .outline-table td { border-bottom: 1px solid var(--line); padding: .4rem .5rem; text-align: left; }
.outline-table th { overflow-wrap: anywhere; font-weight: 520; }
.outline-table tbody th { padding-inline-start: calc(.5rem + var(--indent, 0rem)); }
.outline-table :is(th,td):last-child { text-align: right; white-space: nowrap; }
.outline-table thead th { position: sticky; top: 0; background: var(--bg); color: var(--muted); }
#outline-result { margin-top: .75rem; }
.outline-tool textarea { display: block; margin: .4rem 0 .66rem; min-height: 9.6rem; background: var(--code); resize: vertical; font: .88rem/1.55 var(--mono); }
.result-actions { justify-content: end; }
.result-actions p { margin: 0 auto 0 0; }
@media (max-width: 760px), (max-width: 960px) and (max-height: 500px) and (pointer: coarse) {
  .outline-tool { display: block; }
  #outline-input, #outline-review { padding-inline: 0; border-inline: 0; }
  .title-band { padding-block: 1rem; }
  .title-band h1 { font-size: 1.72rem; }
  .outline-tool button { min-height: 2.75rem; }
}
@media (max-width: 400px) {
  .brand img { width: 1.4rem; height: 1.4rem; }
  body > header a { font-size: .82rem; }
  body > header > div { gap: .35rem; }
}
