/* St. John Church Sound System — styles
   Type scale: site title 40 / page heading 28 / section 19 / model (detail) 44, (card) 20 /
   body 15.5 / navigation 14 / tables 14 / labels 11.5 caps */
:root {
  --bg: #E9ECEF;
  --panel: #F5F7F8;
  --card: #FFFFFF;
  --ink: #131B2C;
  --ink2: #48556A;
  --ink3: #5C687B;
  --line: #D9DEE3;
  --line2: #BFC7CF;
  --card-line: #C3CBD3;
  --accent: #1B6660;
  --accent-ink: #134F4A;
  --accent-soft: #EAF3F1;
  --warn-ink: #734600;
  --warn-soft: #FAF1DD;
  --danger: #A12B2B;
  --side-w: 264px;
  --font: "Inter", "Aptos", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15.5px/1.6 var(--font); overflow-x: hidden; }
h1, h2, h3, h4, p, dl, dd, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Shell ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow-y: auto; z-index: 40; }
.content { margin-left: var(--side-w); min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.brand { display: block; padding: 24px 20px 18px; color: var(--ink); border-bottom: 1px solid var(--line); }
.brand:hover { text-decoration: none; }
.brand-name { display: block; font-size: 18px; font-weight: 800; letter-spacing: .05em; }
.brand-sub { display: block; margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--ink2); line-height: 1.4; white-space: nowrap; }

.nav { padding: 14px 12px 20px; flex: 1; }
.nav-label { padding: 14px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
.nav a, .nav-top { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 5px; font-size: 14px; font-weight: 500; color: var(--ink2); line-height: 1.35; transition: background .15s, color .15s; }
.nav a:hover, .nav-top:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.nav a.cur { color: var(--ink); font-weight: 650; }
.nav a.cur .ic { color: var(--accent); }
.nav a.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; box-shadow: inset 3px 0 0 var(--accent); }
.nav-sep { height: 1px; background: var(--line); margin: 12px 12px 2px; }
.nav-sub { animation: fade .22s ease; }
.nav-row { display: flex; align-items: center; }
.nav-row a { flex: 1; min-width: 0; }
.nav-row button { border: 0; background: none; padding: 6px; border-radius: 5px; cursor: pointer; color: var(--ink3); }
.nav-row button:hover { background: var(--bg); color: var(--ink); }
.nav-row button .ic { width: 15px; height: 15px; transition: transform .18s; }
.nav-row button[aria-expanded="true"] .ic { transform: rotate(90deg); }
.nav-nested { margin: 2px 0 4px 20px; padding-left: 8px; border-left: 1px solid var(--line); animation: fade .2s ease; }
.nav-nested a { font-size: 13.5px; padding: 6px 10px; }
.side-foot { padding: 10px 12px 16px; border-top: 1px solid var(--line); }
.scrim { display: none; }

.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 40px; background: rgba(233, 236, 239, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.icon-btn.menu-btn { display: none; }
.crumbs { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 13.5px; color: var(--ink2); }
.crumbs a { color: var(--ink2); font-weight: 500; }
.crumbs .sep { color: var(--line2); }
.crumbs [aria-current] { color: var(--ink); font-weight: 650; }
.save-state { flex: none; font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.save-state a, .save-state button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line2); border-radius: 99px; background: var(--card); color: var(--ink2); cursor: pointer; font-size: 12.5px; font-weight: 600; }
.save-state a:hover { text-decoration: none; border-color: var(--ink3); }
.save-state .short { display: none; }
.save-state .dot { width: 7px; height: 7px; border-radius: 50%; background: #B7862B; }
.save-state .folder .dot { background: var(--accent); }
.save-state .warn { color: var(--warn-ink); border-color: #DDBf80; background: var(--warn-soft); }

main { position: relative; flex: 1; width: 100%; max-width: 1360px; padding: 34px 40px 56px; outline: none; animation: fade .22s ease; }
.foot { padding: 18px 40px 28px; font-size: 12.5px; color: var(--ink3); border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Page furniture ---------- */
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; margin-bottom: 26px; }
.page-head h1 { font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; margin-top: 6px; }
.page-head .lead { margin-top: 8px; max-width: 74ch; color: var(--ink2); font-size: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
h2.sec { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; margin-bottom: 12px; }
h3.sub { font-size: 16px; font-weight: 650; margin-bottom: 4px; }
.muted { color: var(--ink2); }
.prose { max-width: 76ch; }
.prose p + p { margin-top: 10px; }
.card { background: var(--card); border: 1px solid var(--card-line); border-radius: 10px; box-shadow: 0 1px 2px rgba(19, 27, 44, .05); }
.pad { padding: 22px 24px; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: var(--warn-soft); color: var(--warn-ink); white-space: nowrap; }
.tag.plain { background: var(--bg); color: var(--ink2); border: 1px solid var(--line); }
.tag.ok { background: var(--accent-soft); color: var(--accent-ink); }
.note { border-left: 3px solid var(--line2); padding: 4px 0 4px 14px; color: var(--ink2); font-size: 14.5px; max-width: 80ch; }
.note.accent { border-color: var(--accent); color: var(--ink); }
.note.warn { border-color: #C99A3C; }
ul.dots li { position: relative; padding-left: 16px; }
ul.dots li + li { margin-top: 6px; }
ul.dots li::before { content: ""; position: absolute; left: 2px; top: .68em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line2); border-radius: 6px; background: var(--card); color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; line-height: 1.3; }
.btn:hover { border-color: var(--ink3); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn .ic { width: 16px; height: 16px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--ink2); cursor: pointer; }
.icon-btn:hover { background: var(--card); border-color: var(--line2); color: var(--ink); }

/* Key/value facts */
dl.kv { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; }
dl.kv dt, dl.kv dd { padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
dl.kv dt { font-size: 13px; font-weight: 650; color: var(--ink2); padding-right: 16px; }
dl.kv > :nth-last-child(-n+2) { border-bottom: 0; }
.undoc { color: var(--ink3); font-style: italic; }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 48px; }
.cols2 > * { margin-top: 0 !important; }

/* ---------- Home ---------- */
.hero { padding: 14px 0 6px; }
.hero h1 { font-size: clamp(30px, 4vw, 40px); line-height: 1.12; font-weight: 700; letter-spacing: -0.025em; margin-top: 10px; }
.hero p { margin-top: 14px; max-width: 68ch; font-size: 17px; color: var(--ink2); }
.sys-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.sys-card { display: flex; flex-direction: column; padding: 28px 28px 22px; color: var(--ink); min-height: 232px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.sys-card:hover { text-decoration: none; border-color: var(--accent); box-shadow: 0 6px 22px rgba(19, 27, 44, .07); transform: translateY(-1px); }
.sys-card .num { font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--accent); display: flex; align-items: center; gap: 10px; }
.sys-card h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; margin-top: 14px; line-height: 1.25; }
.sys-card p { margin-top: 8px; color: var(--ink2); flex: 1; }
.sys-card .go { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 650; color: var(--accent-ink); }

/* ---------- Catalog ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 20px; }
.search { position: relative; flex: 1 1 280px; max-width: 420px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink3); }
.search input { width: 100%; padding: 9px 12px 9px 38px; border: 1px solid var(--line2); border-radius: 6px; background: var(--card); }
.search input::placeholder { color: var(--ink3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 12px; border: 1px solid var(--line2); border-radius: 99px; background: none; font-size: 13px; font-weight: 600; color: var(--ink2); cursor: pointer; }
.chip:hover { border-color: var(--ink3); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.count { font-size: 13px; color: var(--ink2); font-weight: 600; margin-bottom: 14px; }
.eq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 20px; }
.eq-card { display: flex; flex-direction: column; overflow: hidden; color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.eq-card:hover { text-decoration: none; border-color: var(--line2); box-shadow: 0 8px 26px rgba(19, 27, 44, .08); transform: translateY(-2px); }
.eq-img { position: relative; display: flex; align-items: center; justify-content: center; background: #fff; aspect-ratio: 4 / 3; padding: 22px; }
.eq-card .eq-img { border-bottom: 1px solid var(--line); }
.eq-img { --pad: 22px; }
.eq-img img { position: absolute; inset: var(--pad); width: calc(100% - 2 * var(--pad)); height: calc(100% - 2 * var(--pad)); object-fit: contain; mix-blend-mode: multiply; }
.eq-img.zoomable { cursor: zoom-in; }
.fallback { text-align: center; padding: 8px; }
.fallback .f-mfr { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); }
.fallback .f-model { margin-top: 6px; font-size: 21px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); overflow-wrap: anywhere; line-height: 1.2; }
.fallback .f-cat { margin-top: 8px; font-size: 12.5px; color: var(--ink2); }
.eq-body { padding: 18px 20px 16px; display: flex; flex-direction: column; flex: 1; }
.eq-model { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; margin-top: 5px; overflow-wrap: anywhere; }
.eq-name { font-weight: 600; margin-top: 3px; font-size: 14.5px; }
.eq-desc { margin-top: 8px; font-size: 14px; color: var(--ink2); line-height: 1.5; flex: 1; }
.eq-meta { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--ink2); font-weight: 600; }
.eq-meta b { color: var(--ink); }
.empty { padding: 44px 20px; text-align: center; color: var(--ink2); border: 1px dashed var(--line2); border-radius: 10px; }

/* ---------- Equipment detail ---------- */
.detail { overflow: hidden; }
.detail-top { display: grid; grid-template-columns: minmax(240px, 30%) 1fr; }
.detail-media { background: #fff; border-right: 1px solid var(--line); padding: 28px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.detail-media .eq-img { --pad: 0px; padding: 0; aspect-ratio: 4 / 3; background: none; }
.thumbs .eq-img { --pad: 4px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.thumbs figure { border: 1px solid var(--line); border-radius: 6px; background: var(--card); padding: 8px; }
.thumbs .eq-img { aspect-ratio: 16 / 9; }
.thumbs figcaption { font-size: 12px; color: var(--ink2); text-align: center; margin-top: 6px; line-height: 1.35; }
.thumbs .fallback .f-model { font-size: 13px; }
.detail-info { padding: 38px 44px 34px; min-width: 0; }
.detail-info h1 { font-size: clamp(30px, 4.2vw, 44px); font-weight: 750; letter-spacing: -0.03em; line-height: 1.08; margin-top: 12px; overflow-wrap: anywhere; }
.detail-info .pname { font-size: 21px; font-weight: 650; letter-spacing: -0.01em; margin-top: 12px; line-height: 1.3; }
.detail-info .pdesc { font-size: 17px; color: var(--ink2); margin-top: 12px; max-width: 62ch; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.pill { padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); font-size: 13.5px; font-weight: 650; color: var(--accent-ink); }
.pill span { color: var(--ink2); font-weight: 600; }
.pn { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.tabs { display: flex; gap: 4px; padding: 0 32px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); overflow-x: auto; }
.tabs a { padding: 14px 14px 12px; font-size: 14.5px; font-weight: 600; color: var(--ink2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabpanel { padding: 30px 44px 38px; }
.tabpanel > h2 { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.tabpanel > .tab-lead { color: var(--ink2); margin-bottom: 22px; max-width: 76ch; }
.tabpanel h3 { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); margin: 26px 0 10px; }
.tabpanel > h3:first-child { margin-top: 0; }
.links { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.links a { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; overflow-wrap: anywhere; }
table.spec { width: 100%; border-collapse: collapse; font-size: 14px; }
table.spec th, table.spec td { text-align: left; vertical-align: top; padding: 11px 16px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
table.spec th { width: 32%; font-weight: 650; color: var(--ink2); background: var(--panel); }
table.spec tr:first-child th, table.spec tr:first-child td { border-top: 1px solid var(--line); }

/* ---------- Editable fields ---------- */
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; }
.field.wide { grid-column: 1 / -1; }
.field label, .lbl { display: block; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink2); margin-bottom: 6px; }
.field textarea, .field input, .field select, .inp { width: 100%; padding: 9px 12px; border: 1px solid var(--line2); border-radius: 6px; background: var(--card); line-height: 1.5; color: var(--ink); }
.field textarea { resize: vertical; min-height: 42px; field-sizing: content; display: block; }
.field textarea::placeholder, .field input::placeholder { color: var(--ink3); font-style: italic; opacity: 1; }
.field textarea:hover, .field input:hover, .field select:hover { border-color: var(--ink3); }
.hint { margin-top: 5px; font-size: 12.5px; color: var(--ink2); }
.plan-sec { padding: 22px 0; border-bottom: 1px solid var(--line); }
.plan-sec:first-of-type { padding-top: 0; }
.plan-sec > p { color: var(--ink2); max-width: 76ch; margin-bottom: 12px; }
.prop-list { margin: 14px 0 12px; display: grid; gap: 8px; }
.prop { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 12px 16px; color: var(--ink); align-items: center; }
.prop:hover { text-decoration: none; border-color: var(--accent); }
.prop b { font-weight: 650; }
.prop small { font-size: 13px; color: var(--ink2); }
.prop .right { text-align: right; font-size: 13px; color: var(--ink2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Documents ---------- */
.attach { margin-top: 12px; }
.attach-list { display: grid; gap: 6px; margin-bottom: 10px; }
.file-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); font-size: 14px; }
.file-row .fname { flex: 1 1 200px; min-width: 0; font-weight: 600; overflow-wrap: anywhere; display: flex; gap: 8px; align-items: center; }
.file-row .fmeta { font-size: 12.5px; color: var(--ink2); }
.attach-view { margin-top: 10px; }
.attach-view iframe { width: 100%; height: min(78vh, 900px); border: 1px solid var(--line2); border-radius: 6px; background: #fff; }
.attach-view img { max-height: 78vh; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.store-note { font-size: 12.5px; color: var(--ink2); margin-top: 6px; }

/* ---------- Diagrams ---------- */
.diagram-wrap { padding: 20px; overflow-x: auto; }
.diagram { min-width: 700px; width: 100%; height: auto; margin: 0 auto; font-family: var(--font); }
.dg-node { fill: #fff; stroke: var(--line2); stroke-width: 1.2; }
.dg-node.ext { fill: var(--panel); }
.dg-node.key { stroke: var(--accent); stroke-width: 1.6; }
.dg-node.tbd { stroke-dasharray: 5 4; }
.dg-title { font-size: 14px; font-weight: 650; fill: var(--ink); }
.dg-sub { font-size: 12px; fill: var(--ink2); }
.dg-link:hover .dg-node { stroke: var(--accent); }
.dg-link:hover .dg-title { fill: var(--accent-ink); }
.dg-edge { fill: none; stroke-width: 1.6; }
.dg-edge.ok { stroke: var(--accent); stroke-width: 2.4; }
.dg-edge.tbd { stroke: #7C8798; stroke-dasharray: 6 5; }
.dg-head.ok { fill: var(--accent); }
.dg-head.tbd { fill: #7C8798; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 26px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink2); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 10px; }
.legend i { display: inline-block; width: 34px; border-top: 2.4px solid var(--accent); }
.legend i.tbd { border-top: 1.6px dashed #7C8798; }

/* ---------- Tables ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink2); padding: 10px 12px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
table.data tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-card { overflow: hidden; }
table.bom { table-layout: fixed; }
table.bom th, table.bom td { padding: 6px 5px; }
table.bom th:first-child, table.bom td:first-child { padding-left: 14px; }
table.bom input, table.bom select { width: 100%; padding: 6px 7px; border: 1px solid transparent; border-radius: 5px; background: transparent; font-size: 13.5px; min-width: 0; }
table.bom select { padding-left: 3px; }
table.bom input:hover, table.bom select:hover { border-color: var(--line2); }
table.bom input:focus, table.bom select:focus { border-color: var(--accent); background: #fff; outline: none; }
table.bom input::placeholder { color: var(--ink3); }
table.bom td.ext { padding-top: 12px; font-weight: 650; white-space: nowrap; }
table.bom td.act { white-space: nowrap; padding-right: 10px; text-align: right; }
table.bom .icon-btn { width: 30px; height: 30px; }
.bom-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding: 14px 18px; border-top: 1px solid var(--line2); font-weight: 650; background: var(--panel); }
.phase-sum { font-size: 14px; }
.phase-sum li:last-child { border-bottom: 0; }
.phase-sum li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.phase-sum b { font-variant-numeric: tabular-nums; }

/* ---------- Log ---------- */
.log-entry { padding: 18px 22px; }
.log-entry + .log-entry { margin-top: 12px; }
.log-entry header { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 8px; }
.log-entry header b { font-size: 15.5px; }
.log-entry dl { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; font-size: 14.5px; }
.log-entry dt { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); padding-top: 3px; }
.log-entry dd { white-space: pre-wrap; overflow-wrap: anywhere; }

details.acc { border-bottom: 1px solid var(--line); }
details.acc:first-of-type { border-top: 1px solid var(--line); }
details.acc summary { display: flex; align-items: center; gap: 12px; padding: 15px 4px; cursor: pointer; font-weight: 650; font-size: 16px; list-style: none; }
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary .ic { color: var(--ink3); transition: transform .18s; }
details.acc[open] summary .ic { transform: rotate(90deg); }
details.acc summary .tag { margin-left: auto; }
details.acc .acc-body { padding: 0 4px 20px 34px; }
details.acc .acc-body > p { color: var(--ink2); margin-bottom: 12px; max-width: 76ch; }

.store-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.store-grid h3 { font-size: 17px; font-weight: 700; margin: 8px 0 6px; }
.store-grid p { color: var(--ink2); font-size: 14.5px; }
.store-grid .actions { margin-top: 14px; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(15, 20, 32, .86); display: flex; align-items: center; justify-content: center; padding: 48px 24px; cursor: zoom-out; }
.lightbox img { max-width: min(1100px, 100%); max-height: 100%; background: #fff; border-radius: 6px; padding: 20px; object-fit: contain; }
.lightbox-close { position: absolute; top: 14px; right: 14px; color: #fff; }
.lightbox-close:hover { background: rgba(255, 255, 255, .14); border-color: transparent; color: #fff; }

/* ---------- Back link ---------- */
.back-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-bottom: -8px; padding: 6px 12px 6px 8px; border: 1px solid var(--line2); border-radius: 6px; background: var(--card); font-size: 14px; font-weight: 600; color: var(--ink); }
.back-link:hover { text-decoration: none; border-color: var(--ink3); }
.back-link .ic { width: 16px; height: 16px; color: var(--accent); }

/* ---------- Containers ---------- */
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack > .page-head { margin-bottom: 0; }
.panel { overflow: hidden; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.35; }
.panel-body { padding: 18px 22px 20px; }
.panel-body > * + * { margin-top: 14px; }
.panel-body.flush { padding: 0; }
.panel-body.flush > * + * { margin-top: 0; }
.panel dl.kv dt:first-of-type, .panel dl.kv dt:first-of-type + dd { padding-top: 2px; }
.panel-body.flush table.data th { background: var(--panel); }
.panel-body.flush table.data th:first-child, .panel-body.flush table.data td:first-child { padding-left: 22px; }
.panel-body.flush table.data th:last-child, .panel-body.flush table.data td:last-child { padding-right: 22px; }
.panel .diagram-wrap { padding: 24px 22px; }
.panel details.acc summary { padding: 15px 22px; }
.panel details.acc:first-of-type { border-top: 0; }
.panel details.acc:last-of-type { border-bottom: 0; }
.panel details.acc .acc-body { padding: 0 22px 22px 52px; }
.manifest-intro { padding: 16px 22px; border-bottom: 1px solid var(--line); }
.grid2, .grid3 { display: grid; gap: 20px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid2 > .wide { grid-column: 1 / -1; }
.grid3 .card h3 { margin-bottom: 6px; }
.catalog .toolbar { margin-bottom: 18px; }
.link-card { display: flex; flex-direction: column; gap: 6px; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.link-card:hover { text-decoration: none; border-color: var(--accent); box-shadow: 0 6px 20px rgba(19, 27, 44, .06); }
.link-card h3 { display: flex; align-items: center; gap: 10px; color: var(--accent-ink); margin: 0; }
.link-card h3 .ic { color: var(--accent); }
.link-meta { margin-top: auto; padding-top: 6px; font-size: 12.5px; font-weight: 650; color: var(--ink2); }

/* Navigation icons */
.nav-sub a .ic { width: 16px; height: 16px; color: var(--ink3); }
.nav-sub a:hover .ic { color: var(--ink2); }
.nav-sub a.on .ic { color: var(--accent); }
.nav-nested a .ic { width: 15px; height: 15px; }

/* Home system cards */
.sys-card { padding: 0; overflow: hidden; min-height: 0; }
.sys-media { height: 200px; display: flex; align-items: center; justify-content: center; padding: 18px 24px; background: var(--accent-soft); border-bottom: 1px solid var(--line); }
.sys-media svg { height: 100%; width: auto; max-width: 100%; transition: transform .25s ease; }
.sys-card:hover .sys-media svg { transform: scale(1.04); }
.sys-body { display: flex; flex-direction: column; flex: 1; padding: 20px 26px 18px; }
.ill .s, .ill .p { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ill .p { stroke-width: 1.6; stroke: #5C687B; }
.ill .f { fill: #fff; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.ill .a { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ill .dash { stroke-dasharray: 6 6; }
.ill .af { fill: var(--accent); }
.ill .cap { stroke: var(--accent); stroke-width: 10; stroke-linecap: round; }
.ill .fov { fill: var(--accent); opacity: .14; }
.ill .live { fill: #fff; font: 700 8px var(--font); text-anchor: middle; letter-spacing: .06em; }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  table.bom thead { display: none; }
  table.bom, table.bom tbody { display: block; }
  table.bom tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 16px; border-bottom: 1px solid var(--line2); }
  table.bom td { display: block; padding: 0 !important; border: 0; }
  table.bom td::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink2); margin-bottom: 3px; }
  table.bom td.wide { grid-column: 1 / -1; }
  table.bom input, table.bom select { border-color: var(--line2); background: #fff; }
  table.bom td.num { text-align: left; }
  table.bom td.act { text-align: left; }
  table.bom td.act::before { content: none; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: none; width: min(300px, 86vw); }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 20, 32, .45); z-index: 35; }
  .content { margin-left: 0; }
  .icon-btn.menu-btn { display: inline-flex; }
  .topbar { padding: 8px 16px; }
  main { padding: 24px 16px 44px; }
  .foot { padding: 16px; }
  .cols2, .store-grid { grid-template-columns: 1fr; }
  .detail-top { grid-template-columns: 1fr; }
  .detail-media { border-right: 0; border-bottom: 1px solid var(--line); padding: 22px; }
  .detail-media .eq-img { aspect-ratio: 16 / 10; }
  .detail-info, .tabpanel { padding: 24px 20px 28px; }
  .tabs { padding: 0 10px; }
}
@media (max-width: 640px) {
  .sys-grid, .fields { grid-template-columns: 1fr; }
  .sys-card { min-height: 0; padding: 22px 20px 18px; }
  dl.kv { grid-template-columns: 1fr; }
  dl.kv dt { border-bottom: 0; padding-bottom: 0; }
  dl.kv dd { padding-top: 2px; }
  dl.kv > :nth-last-child(2) { border-bottom: 0; }
  table.spec th { width: 40%; padding: 10px; }
  table.spec td { padding: 10px; }
  .log-entry dl { grid-template-columns: 1fr; gap: 2px; }
  .log-entry dd { margin-bottom: 8px; }
  .save-state .long { display: none; }
  .save-state .short { display: inline; }
  .tabs { padding: 0 8px; gap: 0; justify-content: space-between; }
  .tabs a { padding: 13px 5px 11px; font-size: 13px; }
  .crumbs { font-size: 12.5px; }
  .crumbs > :not(:nth-last-child(-n+3)) { display: none; }
  table.resp thead { display: none; }
  table.resp tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.resp td { display: block; border: 0; padding: 2px 14px; }
  table.resp td::before { content: attr(data-label) ": "; font-weight: 650; color: var(--ink2); }
  details.acc .acc-body { padding-left: 4px; }
}

/* ---------- Print: equipment sheets ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 11pt; }
  .sidebar, .topbar, .foot, .scrim, .no-print, .tabs, .pn, .lightbox { display: none !important; }
  .content { margin: 0; }
  main { padding: 0; max-width: none; animation: none; }
  .card { border-color: #bbb; }
  .detail { border: 0; }
  .detail-top { grid-template-columns: 30% 1fr; }
  .detail-media { background: none; border-right: 0; padding: 0 16px 0 0; }
  .detail-info { padding: 0 0 16px; }
  .detail-info h1 { font-size: 26pt; }
  .tabpanel { display: block !important; padding: 16px 0 0; border-top: 1px solid #bbb; break-inside: avoid-page; }
  .field textarea { border-color: #bbb; }
  a { color: inherit; }
  .links a::after { content: " (" attr(href) ")"; font-weight: 400; font-size: 9pt; }
}

@media (max-width: 960px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sys-media { height: 160px; }
  .sys-body { padding: 18px 20px 16px; }
  .panel-head, .panel-body { padding-left: 16px; padding-right: 16px; }
  .panel-body.flush { padding: 0; }
  .panel details.acc summary { padding: 14px 16px; }
  .panel details.acc .acc-body { padding: 0 16px 18px; }
  .manifest-intro { padding: 14px 16px; }
}

/* ---------- Home: title and church photo ---------- */
.home-art { position: absolute; top: 0; right: 0; width: min(780px, 64%); height: 560px; z-index: 0; pointer-events: none;
  background: url(../images/church.jpg) 60% 30% / cover no-repeat; opacity: .38;
  -webkit-mask-image: radial-gradient(ellipse 68% 72% at 72% 30%, #000 22%, rgba(0,0,0,.55) 48%, transparent 74%);
          mask-image: radial-gradient(ellipse 68% 72% at 72% 30%, #000 22%, rgba(0,0,0,.55) 48%, transparent 74%); }
.stack > :not(.home-art) { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(32px, 4.4vw, 46px); font-weight: 800; letter-spacing: .02em; margin-top: 0; }
.hero .hero-sub { margin-top: 6px; font-size: 17px; font-weight: 600; color: var(--accent-ink); max-width: none; }
.hero p:last-child { margin-top: 12px; }
.sys-media { position: relative; }
.media-tag { position: absolute; top: 14px; right: 14px; }

/* ---------- Category dropdown (multi-select) ---------- */
.ms { position: relative; flex: 0 1 320px; }
.ms summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line2); border-radius: 6px; background: var(--card); cursor: pointer; font-size: 14px; }
.ms summary::-webkit-details-marker { display: none; }
.ms summary:hover { border-color: var(--ink3); }
.ms[open] summary { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ms-label { color: var(--ink2); font-weight: 600; }
.ms-val { flex: 1; min-width: 0; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms summary .ic { width: 16px; height: 16px; color: var(--ink3); transform: rotate(90deg); transition: transform .15s; }
.ms[open] summary .ic { transform: rotate(-90deg); }
.ms-pop { position: absolute; z-index: 25; top: calc(100% + 6px); left: 0; right: 0; min-width: 260px; padding: 6px; background: var(--card); border: 1px solid var(--card-line); border-radius: 8px; box-shadow: 0 14px 34px rgba(19, 27, 44, .16); }
.ms-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 5px; cursor: pointer; font-size: 14px; }
.ms-opt:hover { background: var(--bg); }
.ms-opt input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex: none; }
.ms-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; padding: 8px 4px 2px; border-top: 1px solid var(--line); }

/* ---------- Product image fills its box ---------- */
.detail-top { grid-template-columns: minmax(260px, 36%) 1fr; }
.detail-media { padding: 0; gap: 0; justify-content: stretch; }
.detail-media > .eq-img { flex: 1; aspect-ratio: auto; min-height: 360px; --pad: 20px; }
.detail-media .thumbs { padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.detail-media .thumbs .eq-img { --pad: 4px; }

/* ---------- Acoustic study ---------- */
.fig { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.fig img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.fig.sq img { aspect-ratio: 1; object-fit: contain; padding: 8px; }
.fig figcaption { padding: 7px 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink2); }
.fig-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.study-split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.study-split .fig-row { margin-top: 14px; }
.glance { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.glance li { padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.glance b { display: block; font-size: 22px; font-weight: 750; letter-spacing: -0.01em; line-height: 1.2; }
.glance span { display: block; margin-top: 4px; font-size: 13px; color: var(--ink2); line-height: 1.4; }
.mini { padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.mini h3 { margin-bottom: 4px; }
.mini p { font-size: 14px; }
ol.steps { counter-reset: step; display: grid; gap: 12px; }
ol.steps li { counter-increment: step; position: relative; padding-left: 44px; min-height: 30px; }
ol.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 750; font-size: 14px; display: flex; align-items: center; justify-content: center; }
ol.steps b { display: block; }
ol.steps span { color: var(--ink2); font-size: 14.5px; }
.ls-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 22px; align-items: start; }
.ls-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.h-sm { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); margin-top: 22px !important; }
.spl { display: flex; flex-direction: column; gap: 12px; }
.spl h3 { margin: 0; }
.bom-note { padding: 14px 22px; border-top: 1px solid var(--line); background: var(--panel); font-size: 14px; font-weight: 600; }

@media (max-width: 1100px) {
  .study-split, .ls-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .home-art { width: 100%; height: 420px; opacity: .26; }
  .detail-media > .eq-img { min-height: 280px; }
}
@media (max-width: 640px) {
  .fig-row, .glance, .ls-gallery { grid-template-columns: 1fr 1fr; }
  .glance b { font-size: 18px; }
  .ms { flex: 1 1 100%; }
  .bom-note { padding: 12px 16px; }
}
