:root {
  --ink: #10233a;
  --muted: #3d5166;
  --navy: #10233a;
  --navy-2: #0b1929;
  --copper: #e59b12;
  --copper-d: #c4840c;
  --sun: #e59b12;
  --sun-deep: #c4840c;
  --sea: #0e6e6b;
  --paper: #f3efe4;
  --card: #ffffff;
  --line: #d9cfc3;
  --bad: #9b2c2c;
  --ok: #1f7a4d;
  --green-dark: #10233a;
  --green: #0e6e6b;
  --green-mid: #e59b12;
  --green-bright: #f0b43a;
  --green-soft: #efe8d8;
  --top: #ffffff;
  --serif: "Bookman Old Style", "Book Antiqua", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: "Bookman Old Style", "Book Antiqua", Palatino, "Palatino Linotype", Georgia, serif;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(16, 35, 58, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body, button, input, select, textarea {
  font-family: var(--serif);
}
body {
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  background: linear-gradient(90deg, #fff 0%, #fff 32%, #eeeeec 62%, #e4e2de 100%);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  background: #fff;
  border-radius: 10px;
  padding: 4px 10px 4px 8px;
  line-height: 0;
}
.brand-logo {
  display: block;
  height: 56px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}
.logo-settings {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}
.logo-preview {
  height: 64px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
}
.top nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.top nav a,
.top nav .nav-drop-btn {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.top nav a:hover,
.top nav .nav-drop-btn:hover,
.top nav .nav-drop.is-open > .nav-drop-btn {
  background: rgba(16, 35, 58, 0.06);
}
.top nav a.btn,
.top nav a.btn-sm {
  background: #fff;
  color: var(--green-dark);
  border: 0;
  font-weight: 700;
}
.top nav a.btn:hover,
.top nav a.btn-sm:hover { background: var(--green-soft); }
.nav-drop { position: relative; }
.nav-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.85;
}
.nav-sub {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 168px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 40;
}
.nav-sub::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 10px;
}
.nav-drop-user .nav-sub,
.nav-drop-lang .nav-sub { left: auto; right: 0; }
.nav-lang-btn .nav-lang-code {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.nav-flag {
  display: block;
  width: 24px;
  height: 18px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}
.nav-sub-langs {
  min-width: 260px;
  max-height: min(70vh, 420px);
  overflow: auto;
}
.top nav .nav-sub a.nav-lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.top nav .nav-sub a.nav-lang-item.is-on {
  background: var(--green-soft);
  font-weight: 700;
}
.nav-drop.is-open .nav-sub {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.top nav .nav-sub a {
  display: block;
  color: var(--green-dark);
  padding: 8px 10px;
  border-radius: 8px;
  white-space: nowrap;
  background: transparent;
}
.top nav .nav-sub a:hover {
  background: var(--green-soft);
  color: var(--green-dark);
}
.who {
  color: var(--ink);
  font-size: 0.85rem;
  padding: 0 8px;
  opacity: 0.95;
}
.flash-ok { background: var(--green-soft); color: var(--green-dark); }
.form-error { color: var(--bad); font-weight: 650; }
.login-wrap { max-width: 440px; }
.inline-form { display: inline; margin: 0; }
.inline-form button { display: inline; }
.wrap { width: min(1180px, calc(100% - 32px)); margin: 28px auto 80px; }

h1 {
  font-family: var(--serif);
  font-size: 2.05rem;
  color: var(--green-dark);
  margin: 0 0 8px;
}
h2 {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--green-dark);
  margin: 0 0 8px;
}
.lede { color: var(--muted); margin: 0 0 22px; }
.addr-field { position: relative; margin: 0 0 12px; }
.addr-field > label { position: relative; display: block; }
.addr-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  z-index: 800;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-height: 240px;
  overflow: auto;
}
.addr-suggest button {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
}
.addr-suggest button:last-child { border-bottom: 0; }
.addr-suggest button:hover,
.addr-suggest button.is-on { background: var(--green-soft); }
.addr-suggest em {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 2px;
}
.addr-map {
  height: 260px;
  min-height: 260px;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin: 4px 0 8px;
  background: #eef5ef;
  position: relative;
  z-index: 1;
}
.addr-map .leaflet-container {
  height: 100%;
  width: 100%;
  border-radius: 10px;
  font-family: var(--sans);
}
.addr-ok { color: var(--green-dark) !important; font-weight: 600; }
#addr-map { cursor: pointer; }
.field-label {
  display: block;
  margin: 12px 0 8px;
  font-weight: 650;
}
#site-1ph,
#site-3ph {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
}
#site-1ph[hidden],
#site-3ph[hidden] {
  display: none;
}

.toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar h1 { margin: 0; }
.toolbar .btn { white-space: nowrap; flex-shrink: 0; padding-left: 22px; padding-right: 22px; }
.job-find {
  flex: 1 1 16rem;
  min-width: 12rem;
  max-width: 28rem;
  margin: 0;
}
.job-find input[type="search"] { width: 100%; margin: 0; }

.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--sun); color: #1a1408; font-weight: 700;
  border: 0; border-radius: 10px; padding: 10px 16px; cursor: pointer;
  text-decoration: none; font-size: 0.95rem;
  font-family: var(--sans);
}
.btn:hover { background: var(--sun-deep); color: #1a1408; }
.btn-sm { padding: 7px 12px; font-size: 0.85rem; }
.btn-ghost {
  background: #fff;
  border: 1.5px solid var(--green);
  color: var(--green-dark);
}
.btn-ghost:hover { background: var(--green-soft); }
.btn-navy { background: var(--ink); color: #fff; }
.btn-navy:hover { background: var(--navy-2); }
.btn-bad { background: var(--bad); color: #fff; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

table.jobs { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.jobs th, table.jobs td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 0.92rem; vertical-align: top; }
table.jobs th {
  background: var(--ink);
  color: #fff;
  font-family: var(--serif);
  font-weight: 700;
}
table.jobs th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
table.jobs th.sortable:hover { color: #d7efe2; }
table.jobs th.sortable::after {
  content: ' \2195';
  font-size: 0.72em;
  opacity: 0.45;
  font-family: var(--sans);
  font-weight: 600;
}
table.jobs th.sortable.asc::after { content: ' \25B2'; opacity: 1; }
table.jobs th.sortable.desc::after { content: ' \25BC'; opacity: 1; }
table.jobs a { color: var(--sea); font-weight: 650; }
table.jobs .client-link {
  display: block;
  text-decoration: none;
  line-height: 1.35;
}
table.jobs .client-link .client-name,
table.jobs .client-link .muted { display: block; }
table.jobs .client-link .muted { font-weight: 500; }
table.jobs .col-array,
table.jobs .col-inverter,
table.jobs .col-updated {
  white-space: nowrap;
}
table.jobs .stage-pick { margin: 0; }
table.jobs .stage-pick select {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  max-width: 12rem;
}
table.jobs .col-array { min-width: 9.5rem; }
table.jobs .col-inverter { min-width: 11.5rem; }
table.jobs .col-updated { min-width: 7.75rem; }
table.jobs .job-actions {
  white-space: normal;
  width: 1%;
  min-width: 10.25rem;
  line-height: 1.45;
}
table.jobs .job-actions-row { white-space: nowrap; }
table.jobs .job-actions .inline-form button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--bad);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
table.jobs .job-actions .act-copy button { color: var(--sea); }
table.jobs .job-actions .inline-form button:hover { text-decoration: underline; }
table.jobs tr:last-child td { border-bottom: 0; }
.muted { color: var(--muted); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

.wizard { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
.wizard-full { grid-template-columns: 1fr; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.field-beside {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(140px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}
.field-beside > label { margin-bottom: 0; }
.field-beside .choice-inline {
  align-self: end;
  max-width: 11.5rem;
  white-space: normal;
  line-height: 1.25;
}
[hidden] { display: none !important; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
input, select, textarea {
  font: inherit; color: var(--ink); padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid #e59b1266;
  border-color: var(--green-mid);
}
.hint { color: var(--muted); font-size: 0.85rem; margin: 0 0 14px; font-weight: 400; }
.choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
  align-items: stretch;
}
.choice-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  background: #fff;
  margin: 0;
  font-weight: 400;
  height: 100%;
  box-sizing: border-box;
}
.choice-card:not(.choice-inline) {
  display: flex;
  flex-direction: column;
}
.choice-card:has(input:checked) {
  border-color: var(--green-mid);
  background: var(--green-soft);
  box-shadow: 0 0 0 1px var(--green-mid);
}
.choice-card strong { display: block; color: var(--ink); margin: 4px 0; }
.choice-card span { font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.choice-card.choice-inline {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 0;
}
.choice-card.choice-inline input {
  width: auto;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
}
.choice-card.choice-inline strong { display: inline; margin: 0; }
#hybrid-load-box .choice {
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}
.load-both-wrap {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  align-items: stretch;
  min-width: 0;
}
.load-both-wrap .choice-card { flex: 1; min-width: 0; }
.load-both-amps {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 148px;
  max-width: 170px;
}
.load-both-amps[hidden] { display: none !important; }
.load-both-amps label { margin: 0; font-size: 0.8rem; }
.load-both-amps input { margin-top: 2px; }
@media (max-width: 640px) {
  .choice { grid-template-columns: 1fr; }
  #hybrid-load-box .choice { grid-template-columns: 1fr; }
}
.presets { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.presets button {
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer;
  color: var(--green-dark);
}
.presets button:hover { border-color: var(--green-mid); background: var(--green-soft); }
.form-actions { display: flex; gap: 10px; margin: 8px 0 40px; }
.fz-map select { width: 100%; max-width: 420px; }

.live {
  position: sticky; top: 16px;
  background: linear-gradient(135deg, #10233a 0%, #16324f 60%, #0e6e6b 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.live h2 { color: #fff; font-family: var(--serif); }
.live dl { margin: 0; }
.live dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.18); }
.live dt { color: #d9cfc3; font-size: 0.8rem; }
.live dd { margin: 0; font-weight: 700; }
.live dd[data-k="strings"] { white-space: pre; text-align: right; line-height: 1.35; }
.live dl > div:has(dd[data-k="strings"]) { align-items: flex-start; }
.live .hint { color: #d9cfc3; }

.flash { margin: 0; padding: 12px 28px; }
.flash-bad { background: #fee2e2; color: #7f1d1d; }

.manual { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.manual-head {
  background: linear-gradient(135deg, #10233a 0%, #16324f 60%, #0e6e6b 100%);
  color: #fff;
  padding: 28px;
  border-radius: 12px;
  margin: -8px -8px 24px;
}
.set-table { width: 100%; border-collapse: collapse; margin: 0 0 22px; }
.set-table th, .set-table td { border-bottom: 1px solid var(--line); padding: 7px 8px; vertical-align: top; text-align: left; }
.set-table thead th { background: var(--ink); color: #fff; font-family: var(--serif); }
.set-table tbody th { width: 18%; background: var(--green-soft); color: var(--green-dark); font-weight: 700; }
.set-table .set-k { width: 34%; color: var(--muted); }
.earth-test-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  margin: 0 0 18px;
}
.earth-test { display: block; width: 100%; height: auto; }
.inv-screens {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 18px;
}
.inv-lcd {
  background: #12361c;
  color: #c8f5c8;
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 150px;
  box-shadow: inset 0 0 0 2px #2e7a40;
  font-family: var(--serif);
}
.inv-lcd-top {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: #7ed47a;
  margin-bottom: 6px;
}
.inv-lcd h3 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 0.95rem;
  font-family: var(--sans);
}
.inv-lcd-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid #245332;
  font-size: 0.8rem;
}
.inv-lcd-row span { color: #9fd6a6; }
.inv-lcd-row strong { color: #fff; font-weight: 700; }
@media (max-width: 800px) {
  .inv-screens { grid-template-columns: 1fr; }
}
@media print {
  .inv-screens { break-inside: avoid; }
  .earth-test-wrap { break-inside: avoid; border: 0; padding: 0; }
}
.manual-head h1 { color: #fff; }
.manual-head p { margin: 6px 0 0; color: #d9cfc3; }
.kv { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.kv td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.kv td:first-child { width: 38%; color: var(--muted); }
.spec-stack { display: grid; gap: 10px; }
.spec-block strong {
  display: block;
  color: var(--ink);
  margin: 0 0 4px;
}
.spec-block ul {
  margin: 0;
  padding-left: 1.1em;
}
.spec-block li { margin: 2px 0; }
.sld-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 10px; }
.sld-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; margin: 0 0 24px; padding: 8px; }
.sld { display: block; }
.bom { width: 100%; border-collapse: collapse; }
.bom th { text-align: left; background: var(--ink); color: #fff; padding: 8px; font-family: var(--serif); }
.bom-sort {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.bom td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.steps { list-style: none; padding: 0; margin: 0 0 24px; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; margin: 0; padding: 12px 0; }
.steps li + li { border-top: 1px solid var(--line); }
.num { background: var(--sun); color: #1a1408; font-weight: 700; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }
.warn {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #7c2d12;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  line-height: 1.45;
}
.warn ul { margin: 0; padding-left: 1.15em; }
.warn li { margin: 0 0 8px; }
.warn li:last-child { margin-bottom: 0; }
.live .warn {
  background: #fff;
  border: 1px solid #f3c28a;
  color: #7c2d12;
  font-size: 0.88rem;
  font-weight: 600;
}
.live .warn > strong {
  display: block;
  color: #9a3412;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.note-box {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  line-height: 1.45;
}
.note-box > strong {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.note-box ul { margin: 0; padding-left: 1.15em; }
.note-box li { margin: 0 0 8px; }
.note-box li:last-child { margin-bottom: 0; }
.note-error {
  background: #f7ecea;
  border: 1px solid #d4a3a0;
  color: #6e1f1f;
}
.note-error > strong { color: #9b2c2c; }
.note-warning {
  background: #f8efd8;
  border: 1px solid #e59b12;
  color: #6b4a0a;
}
.note-warning > strong { color: #c4840c; }
.note-notice {
  background: #e7f2f1;
  border: 1px solid #7cbcb9;
  color: #0b4f4d;
}
.note-notice > strong { color: #0e6e6b; }
.live .note-box {
  background: #fff;
  font-size: 0.88rem;
  font-weight: 600;
}
.live .note-error { border-color: #d4a3a0; color: #6e1f1f; }
.live .note-warning { border-color: #e59b12; color: #6b4a0a; }
.live .note-notice { border-color: #7cbcb9; color: #0b4f4d; }
.check { list-style: none; padding: 0; }
.check li { margin: 0 0 8px; padding-left: 8px; }
.check input { margin-right: 8px; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

input.is-locked,
select.is-locked,
select:disabled,
input[readonly] {
  background: #eef5ef;
  color: #444;
  cursor: not-allowed;
  pointer-events: none;
}

.spec-box {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--green-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.spec-box h3 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green-dark);
}
.spec-box dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 18px;
  margin: 0;
}
.spec-box dl > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.spec-box dt { color: var(--muted); font-size: 0.85rem; }
.spec-box dd { margin: 0; font-weight: 650; font-size: 0.9rem; text-align: right; }
@media (max-width: 640px) {
  .spec-box dl { grid-template-columns: 1fr; }
}

.foot {
  color: var(--muted);
  text-align: center;
  padding: 24px 16px 40px;
  font-size: 0.85rem;
}

.login-card h1 { color: var(--green-dark); }
.login-extra { margin: 0 0 8px; }
.login-extra a { color: var(--sea); font-weight: 650; }

@media (max-width: 960px) {
  .wizard, .grid-4, .grid-3 { grid-template-columns: 1fr 1fr; }
  .wizard-full { grid-template-columns: 1fr; }
  .live { position: static; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4, .wizard { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media print {
  @page { size: A4 portrait; margin: 10mm; }
  @page sld {
    size: A4 landscape;
    margin: 8mm;
  }
  .top, .foot, .actions-row, .sld-actions, .project-nav, .btn { display: none !important; }
  body { background: #fff; }
  .wrap { width: auto; margin: 0; }
  .manual { box-shadow: none; border: 0; padding: 0; }
  .manual-head { background: #10233a; }
  .print-break {
    break-before: page;
    page-break-before: always;
  }
  .print-sld {
    page: sld;
    break-before: page;
    page-break-before: always;
    break-after: page;
    page-break-after: always;
    break-inside: avoid;
    page-break-inside: avoid;
    width: 281mm;
    height: 194mm;
    max-height: 194mm;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .print-sld h2 {
    flex: 0 0 auto;
    margin: 0 0 3mm;
  }
  .print-sld .sld-wrap {
    flex: 1 1 auto;
    overflow: hidden;
    width: 100%;
    max-width: none;
    border: 0;
    padding: 0;
    margin: 0;
    height: 175mm;
    max-height: 175mm;
  }
  .print-sld .sld {
    display: block;
    width: 100% !important;
    height: 175mm !important;
    max-height: 175mm !important;
  }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(18, 38, 24, 0.45);
  display: grid;
  place-items: center;
  z-index: 40;
  padding: 20px;
}
.modal[hidden] { display: none !important; }
.modal-card {
  background: #fff;
  border-radius: 14px;
  padding: 22px 24px;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow);
}
#flowzio-bind .modal-card,
#flowzio-swap .modal-card,
#breaker-missing .modal-card {
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
#flowzio-swap select, #breaker-missing select { display: block; width: 100%; max-width: 420px; margin: 8px 0; }
.modal-card.term-modal { max-width: 440px; }
.term-modal .choice { margin: 0 0 12px; }
.term-modal .form-actions { margin-bottom: 0; }
.modal-card ul { margin: 10px 0 16px; padding-left: 18px; }
.modal-card li { margin: 8px 0; }

.ds-wrap { max-width: 210mm; }
.ds {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ds-head {
  background: var(--navy);
  color: #fff;
  padding: 12px 16px;
}
.ds-head div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.ds-title { margin: 6px 0 0; font-size: 20px; font-weight: 700; }
.ds-meta { margin: 4px 0 0; font-size: 13px; color: #d9cfc3; }
.ds-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
}
.ds-box { border: 1px solid var(--navy); min-width: 0; }
.ds-box h2 {
  margin: 0;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 5px 8px;
  text-transform: uppercase;
  text-align: left;
}
.ds-box table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.ds-box th {
  width: 16em;
  text-align: left;
  padding: 4px 10px 4px 8px;
  color: var(--green-dark);
  font-weight: 600;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ds-box td {
  padding: 4px 8px 4px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.ds-box tr:nth-child(even) { background: var(--green-soft); }
.ds-foot { margin: 0; padding: 6px 12px 10px; font-size: 11px; color: var(--muted); }

@media print {
  body.datasheet-page .ds-bar { display: none !important; }
  body.datasheet-page .ds-wrap { max-width: none; margin: 0; }
  body.datasheet-page .ds { box-shadow: none; border: 0; border-radius: 0; }
  body.datasheet-page .ds-grid { display: flex; flex-direction: column; gap: 4px; padding: 4px 0 0; }
  body.datasheet-page .ds-box { break-inside: avoid; }
  body.datasheet-page .ds-box table { font-size: 10px; }
  body.datasheet-page .ds-box th {
    width: 16em;
    text-align: left;
    padding: 2px 8px 2px 4px;
  }
  body.datasheet-page .ds-box td { padding: 2px 4px 2px 0; text-align: left; }
  body.datasheet-page .ds-title { font-size: 16px; }
  body.datasheet-page .ds-foot { padding: 4px 0 0; }
}

.project-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}
.project-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--green-dark);
  text-decoration: none;
  font-weight: 650;
  font-size: 0.88rem;
}
.project-nav-link:hover { border-color: var(--green-mid); background: var(--green-soft); }
.project-nav-link.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.rate-box {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: var(--green-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.bill-months {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.bill-chart-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  margin: 0 0 12px;
}
.bill-chart { display: block; width: 100%; height: auto; }
.proposal-ds .ds { box-shadow: none; margin: 0; }
.proposal-brand {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
}
.proposal-brand img {
  height: 56px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}
.os-hero {
  background: #10233a;
  color: #fff;
  border-radius: 14px;
  padding: 22px 24px;
  margin: 0 0 14px;
}
.os-hero-logo {
  height: 52px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  margin: 0 0 14px;
  display: block;
}
.os-kicker {
  margin: 0 0 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: #e59b12;
}
.os-hero h2 {
  margin: 0 0 6px;
  font-size: 1.7rem;
  color: #fff;
}
.os-site { margin: 0 0 8px; color: #d9cfc3; }
.os-hero-row {
  display: grid;
  grid-template-columns: minmax(200px, 0.7fr) minmax(0, 1.8fr);
  gap: 20px;
  align-items: stretch;
  margin: 0;
}
.os-hero-left { min-width: 0; }
.os-site-map {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.28);
  background: #0e2f18;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  min-height: 360px;
}
.os-map-frame {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  min-height: 360px;
  box-sizing: border-box;
}
.os-site-map img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: contain;
  object-position: center;
  background: transparent;
}
.os-compass {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 104px;
  text-align: center;
  pointer-events: none;
  z-index: 2;
}
.os-compass-rose {
  position: relative;
  width: 84px;
  height: 84px;
  margin: 0 auto;
  border-radius: 50%;
  background: rgba(243,239,228,0.96);
  border: 2px solid #10233a;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.os-compass-rose span {
  position: absolute;
  font-size: 12px;
  font-weight: 700;
  color: #10233a;
  line-height: 1;
}
.os-compass-rose .n { top: 5px; left: 0; right: 0; color: #9b2c2c; }
.os-compass-rose .s { bottom: 5px; left: 0; right: 0; }
.os-compass-rose .e { right: 6px; top: 50%; margin-top: -6px; }
.os-compass-rose .w { left: 6px; top: 50%; margin-top: -6px; }
.os-compass-needle {
  position: absolute;
  left: 50%;
  top: 14px;
  width: 0;
  height: 0;
  margin-left: -7px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 28px solid #e59b12;
  transform-origin: 50% 28px;
}
.os-compass-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: #10233a;
}
.os-hero-who {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 22px;
  color: #f3efe4;
  font-size: 1.05rem;
  line-height: 1.45;
  min-height: 0;
  margin-top: 16px;
}
.os-hero-who p { margin: 0; }
.os-hero-who span {
  display: block;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #cfe8d2;
  margin-bottom: 6px;
}
.os-hero-who strong {
  display: block;
  font-size: 1.28rem;
  color: #fff;
  margin-bottom: 4px;
}
@media (max-width: 720px) {
  .os-hero-row { grid-template-columns: 1fr; }
  .os-site-map, .os-map-frame { min-height: 260px; }
  .os-site-map img { max-height: 300px; }
}
.os-site-map figcaption {
  margin: 0;
  padding: 7px 12px 9px;
  font-size: 0.82rem;
  color: #cfe8d2;
}
.share-url {
  font-size: 0.82rem;
  word-break: break-all;
}
body.public-proposal .top nav { display: none; }
.os-hero .muted { color: #cfe8d2; }
.os-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 14px;
}
.os-kpis-4 {
  grid-template-columns: repeat(4, 1fr);
}
.os-kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid #97B57B;
  border-radius: 12px;
  padding: 12px 14px;
}
.os-kpi span, .os-kpi em {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-style: normal;
}
.os-kpi strong {
  display: block;
  font-size: 1.25rem;
  margin: 4px 0;
}
.os-kpis-sm { margin-bottom: 12px; }
.os-hw {
  display: grid;
  gap: 10px;
}
.os-hw article {
  background: #f3f3f3;
  border-radius: 10px;
  padding: 12px 14px;
}
.os-hw span {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
  color: var(--muted);
}
.os-hw strong { display: block; margin: 4px 0 2px; }
.os-hw em { color: var(--muted); font-style: normal; font-size: 0.9rem; }
.os-contract-text {
  white-space: pre-wrap;
  font-family: var(--serif);
  font-size: 0.86rem;
  line-height: 1.45;
  background: #f7f7f7;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  max-height: 420px;
  overflow: auto;
}
@media (max-width: 800px) {
  .os-kpis { grid-template-columns: 1fr; }
  .os-kpis-4 { grid-template-columns: 1fr 1fr; }
}
.bill-totals { margin: 0 0 12px; }
.bill-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.bill-totals dt { color: var(--muted); }
.bill-totals dd { margin: 0; font-weight: 700; }

.settings-sub { margin: 22px 0 10px; font-family: var(--serif); color: var(--green-dark); }
.lang-enable {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0 0 16px;
}
.lang-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 600;
  color: var(--ink);
}
.lang-check input { width: auto; }
.i18n-switch {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  flex-wrap: wrap;
}
.i18n-switch h2 { margin: 0; }
.i18n-lang-form { margin: 0; min-width: 180px; }
.i18n-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.i18n-field-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.i18n-field-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.i18n-insert-wrap,
.i18n-field-top .i18n-insert {
  min-width: 280px;
}
.i18n-insert-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.i18n-save-top {
  align-items: end;
  flex-wrap: wrap;
}
.i18n-field textarea { min-height: 4.6rem; width: 100%; }
.i18n-field .hint { margin-bottom: 4px; }
.i18n-jump {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0 12px;
  margin: 0 0 8px;
  background: var(--paper);
}
.i18n-jump a {
  display: inline-flex;
  align-items: center;
  background: #fff;
  color: var(--green-dark);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.i18n-jump a:hover,
.i18n-jump a:focus {
  background: var(--green-soft);
  border-color: var(--green-mid);
}
.i18n-jump-save {
  margin-left: auto;
  padding: 8px 14px;
}
.i18n-group { scroll-margin-top: 64px; }
.i18n-group:target { box-shadow: 0 0 0 2px #e59b1266, var(--shadow); }
.i18n-switch-card { padding-bottom: 12px; }
.i18n-save-top { margin-top: 0; }
.term-stages { width: 100%; border-collapse: collapse; margin: 0 0 12px; }
.term-stages th {
  text-align: left;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 6px 6px 8px;
}
.term-stages td { padding: 4px 6px 4px 0; vertical-align: top; }
.term-stages input, .term-stages select { width: 100%; }
@media (max-width: 640px) {
  .bill-months { grid-template-columns: 1fr 1fr; }
}

.insp-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  background: var(--green-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 16px;
  font-size: 0.9rem;
}
.insp-summary strong { margin-right: 8px; }
.insp-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) auto minmax(140px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.insp-sec .insp-row:first-of-type { border-top: 0; }
.insp-q { font-weight: 650; color: var(--ink); font-size: 0.92rem; }
.insp-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.insp-opts .choice-card { margin: 0; }
.insp-opts .choice-card:has([value="issue"]:checked) {
  border-color: #b42318;
  background: #fdecea;
  box-shadow: 0 0 0 1px #b42318;
}
@media (max-width: 800px) {
  .insp-row { grid-template-columns: 1fr; }
}
@media print {
  .insp-form .form-actions { display: none !important; }
  .insp-row { break-inside: avoid; }
}
.insp-find { max-width: 28rem; margin: 0 0 14px; }
.insp-list {
  display: grid;
  gap: 10px;
}
.insp-card {
  display: grid;
  gap: 4px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  min-height: 72px;
}
.insp-card:hover { border-color: var(--green-mid); background: var(--green-soft); }
.insp-card strong { font-size: 1.05rem; }
.insp-card em { font-style: normal; font-size: 0.82rem; color: var(--muted); }
.insp-badge {
  display: inline-block;
  width: fit-content;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #eee;
}
.insp-badge-ready { background: #d7f0d3; color: #145c28; }
.insp-badge-work, .insp-badge-progress { background: #fff3cd; color: #7a5b00; }
.insp-badge-hold { background: #fdecea; color: #b42318; }
