:root {
  color-scheme: light;
  --bg: #eef4f6;
  --panel: #ffffff;
  --ink: #17212f;
  --muted: #5e6f7d;
  --line: #d4e0e7;
  --blue: #0b75b7;
  --blue-2: #075f96;
  --green: #16835a;
  --yellow: #f5b82e;
  --red: #b42318;
  --soft: #f7fafc;
  --shadow: 0 18px 44px rgba(28, 55, 74, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(232,242,247,.88)),
    #eef4f6;
}

.app-shell {
  width: min(1440px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 36px;
}

.topbar,
.panel,
.summary-bar > div {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow);
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-left: 6px solid var(--green);
  border-radius: 12px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue-2);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; color: #0b2f5f; font-size: clamp(25px, 3vw, 40px); line-height: 1.05; }
h2 { margin-bottom: 6px; font-size: 21px; }
h3 { margin-bottom: 8px; font-size: 17px; }
p { color: var(--muted); line-height: 1.48; }

.lead { max-width: 880px; margin-bottom: 0; font-size: 16px; }

.top-actions,
.button-row,
.footer-links,
.card-actions,
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.variant-results {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.variant-grid {
  display: grid;
  gap: 10px;
}

.variant-card {
  border: 1px solid #c8dce7;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.variant-card h4 {
  margin: 0 0 6px;
  color: #0b2f5f;
  font-size: 16px;
}

.variant-card p {
  margin-bottom: 8px;
  font-size: 13px;
}

.variant-card ul {
  margin: 8px 0 10px;
  padding-left: 18px;
  color: #31485a;
  font-size: 13px;
}

.variant-breakdown {
  margin: 10px 0;
  border: 1px solid #d5e3ec;
  border-radius: 8px;
  padding: 10px;
  background: #f8fbfd;
  color: #1f3445;
  overflow-wrap: anywhere;
}

.acoustic-box {
  margin: 10px 0;
  border: 1px solid #d6e5f0;
  border-left: 4px solid var(--blue-2);
  border-radius: 8px;
  padding: 10px;
  background: #f7fbff;
  color: #21394d;
}

.acoustic-box strong {
  display: block;
  margin-bottom: 5px;
  color: #0b2f5f;
}

.acoustic-box p {
  margin: 0 0 5px;
}

.acoustic-box small {
  display: block;
  color: #53697a;
  font-size: 12px;
  line-height: 1.35;
}

.variant-breakdown strong {
  display: block;
  margin-bottom: 6px;
  color: #0b2f5f;
  font-size: 13px;
}

.variant-breakdown ul {
  margin: 0 0 10px;
  padding-left: 18px;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
}

.breakdown-grid div {
  min-width: 0;
  border: 1px solid #dce8ef;
  border-radius: 7px;
  padding: 8px;
  background: #fff;
}

.breakdown-grid span,
.breakdown-grid b,
.breakdown-grid em,
.breakdown-grid small {
  display: block;
}

.breakdown-grid span {
  color: #5d7180;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.breakdown-grid b {
  margin: 3px 0;
  color: #0b2f5f;
  font-size: 14px;
}

.breakdown-grid em {
  margin-bottom: 3px;
  color: #2f7d3d;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.breakdown-grid small {
  color: #53697a;
  font-size: 11px;
  line-height: 1.35;
}

.assumption-box,
.quote-assumptions {
  margin: 12px 0 14px;
}

.assumption-box {
  border: 1px solid #c8dce7;
  border-left: 5px solid var(--green);
  border-radius: 8px;
  padding: 12px;
  background: #f7fcfa;
}

.assumption-box strong {
  margin: 0 0 7px;
  color: #0b2f5f;
  font-size: 15px;
}

.assumption-box ul,
.decision-box ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #31485a;
  font-size: 13px;
  line-height: 1.38;
}

.assumption-box li,
.decision-box li {
  margin: 4px 0;
}

.air-balance {
  margin: 12px 0 14px;
  border: 1px solid #c8dce7;
  border-radius: 10px;
  padding: 13px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(28,55,74,.07);
}

.air-balance-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.air-balance-head strong {
  margin: 0;
  color: #0b2f5f;
  font-size: 16px;
}

.air-balance-head span {
  width: fit-content;
  border: 1px solid #b8d1df;
  border-radius: 999px;
  padding: 6px 9px;
  background: #eef7fb;
  color: #0b2f5f;
  font-size: 12px;
}

.air-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.air-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: #f7fbfd;
}

.air-grid b,
.air-grid em {
  display: block;
  overflow-wrap: anywhere;
}

.air-grid b {
  margin-bottom: 4px;
  color: #53697a;
  font-size: 11px;
  text-transform: uppercase;
}

.air-grid em {
  color: #0b2f5f;
  font-style: normal;
  font-size: 17px;
  font-weight: 950;
}

.air-grid em.ok { color: var(--green); }
.air-grid em.plus { color: #0b75b7; }
.air-grid em.minus { color: var(--red); }

.air-balance p {
  margin: 10px 0 0;
  font-size: 13px;
}

.air-exchange-live {
  margin: 4px 0 14px;
  border: 1px solid #b9d9c9;
  border-left: 5px solid var(--green);
  border-radius: 10px;
  padding: 12px;
  background: #f4fbf7;
}

.air-exchange-main {
  margin: 0 0 16px;
  padding: 16px;
  background: #f3fbf7;
  box-shadow: var(--shadow);
}

.air-exchange-live > strong {
  margin: 0 0 9px;
  color: #0b2f5f;
  font-size: 16px;
}

.air-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.air-mini-grid div {
  min-width: 0;
  border: 1px solid #cfe2d8;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.air-mini-grid span {
  font-size: 11px;
}

.air-mini-grid b {
  display: block;
  margin-top: 4px;
  color: #0b2f5f;
  font-size: 16px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.air-exchange-live p {
  margin: 9px 0 0;
  font-size: 12px;
}

.variant-price {
  color: var(--green);
  font-size: 22px;
  font-weight: 900;
}

.variant-system {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 8px;
  border: 1px solid #b8d1df;
  border-radius: 999px;
  padding: 5px 9px;
  color: #0b2f5f;
  background: #eef7fb;
  font-size: 12px;
  font-weight: 900;
}

.variant-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

a,
button {
  min-height: 40px;
  border: 1px solid var(--blue-2);
  border-radius: 8px;
  padding: 9px 12px;
  color: #fff;
  background: var(--blue);
  text-decoration: none;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

button.ghost,
button.secondary {
  color: var(--blue-2);
  background: #fff;
  border-color: #b8d1df;
}

a.table-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 7px 10px;
  white-space: nowrap;
}

.shop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.summary-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.summary-bar {
  display: none;
}

.summary-bar > div {
  min-height: 98px;
  padding: 15px;
  border-radius: 10px;
}

span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

strong {
  display: block;
  margin-top: 6px;
  color: #0b2f5f;
  font-size: 27px;
  line-height: 1.1;
}

.info-box,
.system-explain {
  border: 1px solid #c8dce7;
  background: #f6fbfd;
  border-radius: 8px;
  padding: 12px;
}

.info-box {
  margin-bottom: 14px;
  border-left: 5px solid var(--yellow);
}

.system-explain {
  margin: -4px 0 14px;
  border-left: 5px solid var(--blue);
}

.info-box strong,
.system-explain strong {
  margin: 0 0 5px;
  color: #0b2f5f;
  font-size: 15px;
}

.info-box p,
.system-explain p {
  margin: 0;
  font-size: 14px;
}

.system-explain .small-note {
  margin-top: 6px;
  color: #486274;
  font-size: 12px;
  font-weight: 750;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.controls .panel-head,
.controls .info-box,
.controls .system-explain,
.controls .air-exchange-live,
.controls fieldset,
.controls .button-row,
.controls .variant-results,
.controls .notice {
  grid-column: 1 / -1;
}

.controls label {
  margin-bottom: 0;
}

.controls .split {
  display: contents;
}

.estimate {
  width: 100%;
}

.panel {
  padding: 18px;
  border-radius: 10px;
}

.panel-head {
  margin-bottom: 14px;
}

.estimate-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.estimate-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

label,
fieldset {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
  color: #23384b;
  font-weight: 850;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

legend { padding: 0 6px; color: var(--blue-2); }

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #bfd0da;
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 9px;
  margin: 5px 0;
  font-weight: 750;
}

input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  accent-color: var(--green);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.notice {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(180, 35, 24, .28);
  background: #fff6f3;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th, td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  color: #fff;
  background: var(--blue-2);
}

tbody tr:nth-child(even) td { background: #f7fbfd; }

.qty-input {
  width: 74px;
  min-height: 36px;
}

.quote-text {
  min-height: 230px;
  margin-top: 14px;
  resize: vertical;
  font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.quote-visuals {
  margin-top: 16px;
}

.quote-visuals-wide {
  margin-bottom: 16px;
}

.quote-visuals:empty {
  display: none;
}

.decision-box {
  margin: 0 0 14px;
  border: 1px solid #c8dce7;
  border-left: 5px solid var(--green);
  border-radius: 8px;
  padding: 13px;
  background: #f7fcfa;
}

.decision-box strong {
  margin: 0 0 8px;
  color: #0b2f5f;
  font-size: 17px;
}

.decision-box p {
  margin: 6px 0 0;
  font-size: 14px;
}

.quote-doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 12px;
}

.quote-doc-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  align-items: center;
  min-height: 190px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfd;
}

.quote-doc-card h4 {
  margin: 0 0 5px;
  color: #0b2f5f;
  font-size: 15px;
  line-height: 1.25;
}

.quote-doc-card p {
  margin-bottom: 8px;
  font-size: 13px;
}

.quote-doc-media {
  display: grid;
  place-items: center;
  min-height: 170px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.quote-doc-media img {
  max-width: 165px;
  max-height: 165px;
  object-fit: contain;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.filters {
  position: sticky;
  top: 12px;
}

.catalog-count {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--blue-2);
  font-weight: 900;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.product-card {
  display: grid;
  grid-template-rows: 210px auto;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 26px rgba(28,55,74,.09);
}

.product-media {
  display: grid;
  place-items: center;
  padding: 14px;
  background: linear-gradient(135deg, #f7fbfd, #e8f3f8);
}

.product-media img {
  max-width: 100%;
  max-height: 182px;
  object-fit: contain;
}

.no-photo {
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 10px solid #d8e7ef;
  color: #33546b;
  text-align: center;
  font-weight: 900;
}

.product-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.product-title {
  min-height: 44px;
  margin: 0;
  color: #0b2f5f;
  font-size: 17px;
  line-height: 1.28;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.badge {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #25465d;
  background: #f6fafc;
  font-size: 12px;
  font-weight: 850;
}

.card-desc {
  display: -webkit-box;
  min-height: 58px;
  color: #3d4c59;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  font-size: 13px;
}

.what-is {
  margin: 0;
  padding: 9px 10px;
  border-left: 4px solid var(--green);
  border-radius: 7px;
  background: #f3faf6;
  color: #173d2c;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}

.price {
  color: var(--green);
  font-size: 22px;
  font-weight: 950;
}

.comparison {
  margin-top: 16px;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.compare-grid article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
}

dialog {
  width: min(980px, calc(100% - 24px));
  border: none;
  border-radius: 12px;
  padding: 0;
}

dialog::backdrop { background: rgba(10, 22, 32, .52); }

.dialog-body {
  padding: 18px;
}

.dialog-close {
  float: right;
  color: var(--blue-2);
  background: #fff;
  border-color: var(--line);
}

.dialog-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  clear: both;
}

.dialog-img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7fbfd;
}

.pdf-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pdf-list a {
  color: var(--blue-2);
  background: #fff;
  border-color: var(--line);
}

.doc-explain {
  margin: 8px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.install-notes,
.install-box {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #cfe2d8;
  border-radius: 8px;
  background: #f5fbf7;
  color: #183b2c;
}

.install-notes summary {
  cursor: pointer;
  color: var(--green);
  font-weight: 900;
}

.install-notes ul,
.install-box ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.install-notes li,
.install-box li {
  margin: 4px 0;
  font-size: 13px;
  line-height: 1.35;
}

@media (max-width: 1050px) {
  .workspace,
  .controls,
  .catalog-layout,
  .footer,
  .dialog-grid,
  .compare-grid,
  .air-grid {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
  }
}

@media (max-width: 720px) {
  .topbar,
  .summary-bar,
  .split,
  .air-mini-grid {
    grid-template-columns: 1fr;
  }

  .quote-doc-grid,
  .quote-doc-card {
    grid-template-columns: 1fr;
  }

  .quote-doc-media img {
    max-width: 210px;
  }

  .estimate-head {
    display: block;
  }

  .top-actions,
  .footer-links {
    justify-content: flex-start;
  }
}
