:root {
  --ink: #181c32; --muted: #545454; --line: #e1e1e1; --bg: #f1f1f1; --card: #fff;
  --accent: #1d5e6e; --accent-soft: #eaf3f5; --field: #cfd8dc;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 Poppins, Helvetica, Arial, sans-serif; }
a { color: #26708a; }
.band { background: var(--accent); color: #fff; padding: 10px 24px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.brand { color: #fff; text-decoration: none; font-weight: 500; }
.band-search { position: relative; flex: 0 1 420px; }
.band-search input { width: 100%; border: 0; border-radius: 3px; padding: 7px 10px; font: inherit; font-size: 14px; }
.results { position: absolute; z-index: 10; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px 0; list-style: none; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 3px; max-height: 60vh; overflow: auto; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.results .group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 12px 2px; }
.results a { display: block; padding: 6px 12px; color: var(--ink); text-decoration: none; font-size: 14px; }
.results a[aria-selected="true"], .results a:hover { background: var(--accent-soft); }
.crumb { padding: 10px 24px 0; font-size: 12px; color: var(--muted); }
.head { padding: 4px 24px 16px; }
.head h1 { margin: 0; font-size: 26px; font-weight: 700; }
.head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.wrap { display: flex; gap: 20px; padding: 0 24px 40px; align-items: flex-start; }
.side { width: 230px; flex: none; }
.side a, .side .soon { display: block; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-bottom: 0; color: var(--ink); text-decoration: none; font-size: 13px; }
.side > :last-child { border-bottom: 1px solid var(--line); }
.side a.on { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 500; }
.side .soon { color: #9a9a9a; cursor: default; }
#content { flex: 1; min-width: 0; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 3px; margin-bottom: 16px; scroll-margin-top: 12px; }
.box > h2 { margin: 0; padding: 10px 14px; font-size: 16px; font-weight: 600; background: #fafafa; border-bottom: 1px solid var(--line); }
.box > .c { padding: 12px 14px; }
.notice { background: #fff6e0; border-left: 4px solid #8a5a00; padding: 8px 12px; margin: 0 0 10px; font-size: 14px; }
table.essays { width: 100%; border-collapse: collapse; font-size: 14px; }
table.essays td { padding: 7px 4px; border-bottom: 1px solid #efefef; vertical-align: top; }
table.essays td.n { color: #7a7a7a; white-space: nowrap; font-size: 12px; text-align: right; }
table.essays tr.row { cursor: pointer; }
table.essays tr.row:hover td, table.essays tr.open td { background: #f4f9fa; }
table.essays td.gen { background: #f4f9fa; padding: 4px 4px 14px; }
.row2 { display: flex; gap: 10px; margin-top: 10px; }
.ed { flex: 1; border: 1px solid var(--field); border-radius: 3px; padding: 8px 10px; background: #fff; display: flex; justify-content: space-between; align-items: center; font-size: 14px; cursor: pointer; }
.ed:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.ed input { margin-right: 6px; }
.info { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #e3edf0; color: var(--accent); font-size: 11px; font-weight: 600; cursor: help; }
.field { flex: 1; }
.field label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 3px; }
.field input[type="text"] { width: 100%; border: 1px solid var(--field); border-radius: 3px; padding: 6px 9px; font: inherit; font-size: 14px; }
.inline { display: flex; gap: 6px; align-items: center; }
.c.inline { flex-wrap: wrap; }
#lookup-input { flex: 1 1 200px; min-width: 0; border: 1px solid var(--field); border-radius: 3px; padding: 6px 9px; font: inherit; font-size: 14px; }
#lookup-btn { margin: 0; flex: none; }
#builder-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 12px; }
label.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.field-label .muted { font-size: inherit; }
.field textarea, #source-type { width: 100%; border: 1px solid var(--field); border-radius: 3px; padding: 6px 9px; font: inherit; font-size: 14px; background: #fff; }
.field textarea { min-height: 64px; resize: vertical; }
#source-type { max-width: 360px; }
.small { font-size: 12px; }
.status { font-size: 13px; }
.status.busy { color: var(--muted); }
.status.ok { color: #1f6b3a; }
.status.err { color: #a12a2a; }
.seg { display: inline-flex; border: 1px solid var(--accent); border-radius: 3px; overflow: hidden; flex: none; }
.seg button { border: 0; background: #fff; color: var(--accent); font: inherit; font-size: 12px; padding: 3px 9px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.out { margin-top: 12px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: 10px 12px; font-size: 14px; }
.out-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 6px; }
.ref { font-family: Georgia, 'Times New Roman', serif; line-height: 1.55; }
.btn { display: inline-block; margin: 8px 6px 0 0; background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 3px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.btn.ghost { background: #fff; color: var(--accent); }
.link-btn { border: 0; background: none; color: #26708a; cursor: pointer; font: inherit; font-size: 12px; padding: 0; }
.muted { color: var(--muted); font-size: 13px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 4px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
@media (max-width: 820px) {
  .band, .crumb, .head, .wrap { padding-left: 16px; padding-right: 16px; }
  .wrap { flex-direction: column; }
  .side { width: 100%; display: flex; flex-wrap: wrap; gap: 4px; }
  .side a, .side .soon { border: 1px solid var(--line); border-radius: 3px; }
  .side .soon { display: none; }
  .row2 { flex-direction: column; }
  #builder-form { grid-template-columns: 1fr; }
}
