/* =========================================================
   AHU Vergleich - bereinigte style.css
   Stand: konsolidiert nach v7/v7b/v7c + Kühldeckenkarte
   ========================================================= */

:root {
  --bg: #0b1220;
  --panel: #ffffff;
  --muted: #667085;
  --line: #e5e7eb;
  --text: #101828;
  --brand: #0d6efd;
  --brand-2: #05a7c9;
  --safe: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --shadow: 0 18px 60px rgba(15, 23, 42, 0.14);
  --radius-card: 24px;
  --radius-inner: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(135deg, #07101e, #1d335c 44%, #f4f7fb 44%);
  font-family: Inter, Segoe UI, Arial, sans-serif;
  color: var(--text);
}

/* =========================================================
   Header / Layout
   ========================================================= */

.topbar {
  color: #fff;
  padding: 34px clamp(20px, 4vw, 56px);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #b8c7df;
  font-size: 12px;
  font-weight: 800;
}

.topbar h1 {
  margin: 0.35rem 0 0;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.1;
}

.language-form {
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  padding: 12px 14px;
  border-radius: 14px;
}

.language-form select {
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
}

.shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 clamp(14px, 2.5vw, 36px) 34px;
}

.card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.section-head h2,
.table-card h2 {
  margin: 0;
  font-size: 20px;
}

footer {
  text-align: center;
  color: var(--muted);
  padding: 25px;
}

/* =========================================================
   Forms
   ========================================================= */

.hero-card {
  padding: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 18px;
  min-width: 0;
}

.form-grid fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-inner);
  padding: 16px;
  margin: 0;
  background: #fbfcff;
  min-width: 0;
  overflow: hidden;
}

.form-grid legend {
  font-weight: 800;
  color: #263755;
  padding: 0 8px;
}

.field {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  min-width: 0;
}

.field span {
  font-size: 13px;
  color: #344054;
}

.field input,
.field select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  color: #101828;
  font-family: inherit;
  line-height: 1.35;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.14);
}

.field.check {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field.check input {
  width: auto;
  transform: scale(1.2);
}

.field input[type="range"] {
  padding: 0;
}

.field input[type="range"].is-disabled {
  opacity: 0.35;
}

.field input.is-disabled {
  background: #eef2f7;
  color: #98a2b3;
  cursor: not-allowed;
  opacity: 1;
}

.calculated-field {
  background: #eef2f7 !important;
  color: #445;
  border-color: #cfd8e3;
  cursor: default;
  font-weight: 600;
}

.calculated-field:disabled {
  opacity: 1;
}

.field output {
  font-weight: 400;
}

.field .range-row,
.range-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.range-meta {
  margin-top: 6px;
  font-size: 13px;
  color: #344054;
}

.range-meta span,
.range-meta output {
  font-weight: 400;
}

.range-meta output,
.field .range-output {
  margin-left: auto;
  text-align: right;
  min-width: 32px;
}

.pre-cooler-toggle {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid rgba(13, 110, 253, 0.25);
  background: rgba(13, 110, 253, 0.06);
  border-radius: 12px;
  font-weight: 700;
}

.actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.primary,
.secondary {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}

.secondary {
  background: #eef2f7;
  color: #263755;
}

.alert {
  background: #fff1f2;
  color: #9f1239;
  border: 1px solid #fecdd3;
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 16px;
}

/* =========================================================
   KPI Cards
   ========================================================= */

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

.kpi {
  background: #fff;
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
  border-top: 5px solid var(--brand);
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.kpi strong {
  display: block;
  font-size: clamp(24px, 2.4vw, 34px);
  margin: 6px 0;
}

.kpi small {
  color: var(--muted);
}

/* =========================================================
   Kühldeckenfähigkeit
   ========================================================= */

.chilled-ceiling-card {
  margin: 24px 0;
  overflow: hidden;
  width: 100%;
}

.cc-content {
  padding: 24px 28px 28px;
  width: 100%;
  max-width: none;
}

.cc-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  align-items: stretch;
  width: 100%;
  max-width: none;
}

.cc-case {
  width: 100%;
  min-width: 0;
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e5e7eb;
}

.cc-case.chilled-ceiling-safe {
  border-top: 8px solid var(--safe);
}

.cc-case.chilled-ceiling-critical {
  border-top: 8px solid var(--warning);
}

.cc-case.chilled-ceiling-condensation {
  border-top: 8px solid var(--danger);
}

.cc-case-label {
  padding: 14px 22px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475467;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
}

.cc-status {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 20px 0;
  margin-bottom: 18px;
}

.cc-icon {
  font-size: 42px;
  line-height: 1;
  flex: 0 0 auto;
}

.cc-title {
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.08;
  font-weight: 900;
  color: #0f172a;
}

.cc-subtitle {
  margin-top: 6px;
  color: #667085;
  font-size: 14px;
}

.cc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0 20px;
}
.cc-grid .cc-metric.emphasis {
  grid-column: span 2;
}
.cc-metric {
    min-width: 0;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 92px;
}

.cc-metric span {
    font-size: 12px;
    font-weight: 600;
    color: #667085;
    letter-spacing: 0.02em;
    margin-bottom: 8px;
    line-height: 1.2;
}

.cc-metric strong {
    font-size: 24px;
    line-height: 1;
    font-weight: 700;
    color: #0b1736;
}
.cc-metric.emphasis {
  background: #fff7ed;
  border-color: #fed7aa;
}

.cc-evaluation {
  margin: 18px 20px 20px;
  border-radius: 16px;
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.5;
}

.cc-evaluation strong {
  display: block;
  margin-bottom: 4px;
}

.cc-evaluation-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.cc-evaluation-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.cc-evaluation-safe {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

/* =========================================================
   Workspace / Schema / h-x Diagramm
   ========================================================= */

.workspace {
  display: grid !important;
  grid-template-columns: minmax(620px, 1.08fr) minmax(520px, 0.92fr) !important;
  gap: 22px !important;
  align-items: stretch !important;
}

.diagram-card {
  height: 100%;
  overflow: hidden !important;
}

.right-column {
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100%;
  min-height: 0;
}

.hx-card,
.solar-card {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
}

.schema-wrap,
.schema-imagebox,
.schema-frame {
  background: #ffffff !important;
}

.schema-wrap {
  padding: 28px 42px 34px;
  border-radius: 0 0 24px 24px;
  overflow: visible;
}

.schema-imagebox {
  position: relative;
  display: block;
  width: min(100%, 980px);
  margin: 0 auto;
  border-radius: 18px;
  padding: 18px !important;
  overflow: auto !important;
}

.schema-frame {
  position: relative;
  border-radius: 14px;
  padding: 0 !important;
  overflow: visible !important;
}

.schema-frame img,
.schema-wrap img {
  display: block;
  width: 100%;
  max-width: 980px;
  height: auto;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 8px;
  object-fit: contain;
}

.overlay {
  position: absolute;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  color: #111827 !important;
  font-weight: 500 !important;
  font-size: 11px !important;
  line-height: 1.15 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.overlay.edge-right {
  transform: translate(-100%, -50%);
}

.overlay.edge-left {
  transform: translate(0, -50%);
}

.hx-wrap {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 18px 16px !important;
  background: #fff;
  overflow: hidden !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hx-wrap svg,
.hx-svg {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.svg-bg { fill: #fff; }
.grid { stroke: #e5e7eb; stroke-width: 1; }
.axis { stroke: #111827; stroke-width: 2; }
.axis-label,
.tick { font: 12px Inter, Arial; fill: #475467; }
.rh-curve { stroke: #aab3c2; }
.sat-curve { stroke: #3b27d9; }
.sat-label { font: 13px Inter, Arial; fill: #3b27d9; font-weight: 800; }
.comfort { fill: rgba(4, 167, 119, 0.16); stroke: #04a777; stroke-width: 2; }
.comfort-label { font: 13px Inter, Arial; fill: #039269; font-weight: 900; }
.comfort-label.sub { font-size: 11px; }
.comfort-cap-label { font: 10px Inter, Arial; fill: #039269; font-weight: 800; }
.base-process { stroke: #111827; }
.sorp-process { stroke: #ef0000; }
.pt.base { fill: #111827; }
.pt.sorp { fill: #ef0000; }
.pt-label { font: 14px Georgia, serif; font-weight: 800; }
.pt-label.base { fill: #111827; }
.pt-label.sorp { fill: #ef0000; }

/* =========================================================
   Zustandstabellen
   ========================================================= */

.state-table-wrap {
  margin-top: 18px;
  display: grid;
  gap: 14px;
  overflow-x: auto;
}

.state-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.state-table th,
.state-table td {
  padding: 6px 8px;
  text-align: center;
  white-space: nowrap;
  border-right: 1px solid rgba(15, 23, 42, 0.10);
  border-bottom: 1px solid rgba(15, 23, 42, 0.10);
}

.state-table th:last-child,
.state-table td:last-child {
  border-right: none;
}

.state-table tr:last-child th,
.state-table tr:last-child td {
  border-bottom: none;
}

.state-title-row th {
  background: #0b1f4d !important;
  color: #ffffff !important;
  font-weight: 700;
  text-align: left;
}

.state-title-row.sorp th {
  background: linear-gradient(135deg, #7f1d1d, #dc2626) !important;
}

.state-point-row th {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
}

.state-table th:first-child {
  text-align: left;
  background: rgba(241, 245, 249, 0.95);
  font-weight: 700;
}

.state-table td {
  background: rgba(255, 255, 255, 0.72);
}

.state-table tr:nth-child(even) td {
  background: rgba(248, 250, 252, 0.72);
}

/* =========================================================
   Solarthermie / Regeneration
   ========================================================= */

.solar-content {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.solar-topline,
.solar-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.solar-badge,
.solar-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: linear-gradient(135deg, #ffe082, #ffca28);
  flex: 0 0 auto;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.18);
}

.solar-heading {
  flex: 1;
  min-width: 0;
}

.solar-title {
  font-size: 1.15rem;
  font-weight: 850;
  color: #0f172a;
  line-height: 1.1;
}

.solar-subtitle {
  margin-top: 4px;
  font-size: 0.78rem;
  color: #667085;
}

.solar-share {
  text-align: right;
}

.solar-share strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1;
  font-weight: 900;
  color: #d97706;
  letter-spacing: -0.04em;
}

.solar-share span {
  font-size: 0.72rem;
  color: #92400e;
  font-weight: 700;
}

.solar-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 247, 204, 0.95), rgba(255, 237, 213, 0.92));
  border: 1px solid rgba(245, 158, 11, 0.24);
}

.solar-hero-left span,
.solar-hero span {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 6px;
}

.solar-big-number,
.solar-hero strong {
  display: block;
  font-size: 3.1rem;
  line-height: 0.95;
  font-weight: 950;
  letter-spacing: -0.06em;
  color: #020617;
}

.solar-hero small {
  display: block;
  margin-top: 8px;
  color: #92400e;
  font-weight: 700;
}

.solar-temp-label {
  font-size: 0.72rem;
  color: #667085;
  margin-bottom: 4px;
  text-align: right;
}

.solar-temp {
  font-size: 1.25rem;
  font-weight: 850;
  letter-spacing: -0.03em;
  color: #0f172a;
  text-align: right;
}

.solar-grid,
.solar-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.solar-kpi,
.solar-values div {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.08);
  min-width: 0;
}

.solar-kpi span,
.solar-values span {
  display: block;
  font-size: 0.70rem;
  color: #667085;
  margin-bottom: 4px;
  line-height: 1.15;
}

.solar-kpi strong,
.solar-values strong {
  display: block;
  font-size: 1.02rem;
  line-height: 1.1;
  font-weight: 850;
  letter-spacing: -0.03em;
  color: #020617;
  white-space: nowrap;
}

.solar-kpi.subtle {
  opacity: 0.92;
}

.solar-bar {
  margin-top: 16px;
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.solar-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #facc15, #f59e0b);
}

.solar-note {
  margin: 14px 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #667085;
}

/* =========================================================
   Tabellen / Details
   ========================================================= */

.tables {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.table-card {
  padding: 20px;
}

.table-card table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.table-card th,
.table-card td {
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
  text-align: left;
  vertical-align: top;
}

.table-card th {
  color: #475467;
  font-weight: 600;
  padding-right: 14px;
}

.table-card td {
  text-align: right;
  font-weight: 800;
}

.tech-details {
  grid-column: 1 / -1;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px 20px;
}

.tech-details > summary {
  cursor: pointer;
  font-weight: 900;
  color: #0f172a;
  list-style: none;
}

.tech-details > summary::-webkit-details-marker {
  display: none;
}

.tech-details > summary::after {
  content: "▾";
  float: right;
  color: #667085;
}

.tech-details[open] > summary {
  margin-bottom: 16px;
}

.empty {
  padding: 30px;
  margin-top: 18px;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1280px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .workspace,
  .tables {
    grid-template-columns: 1fr !important;
  }

  .right-column {
    height: auto;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hx-wrap svg {
    max-height: none !important;
  }
}

@media (max-width: 760px) {
  .cc-compare-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .solar-grid,
  .solar-values {
    grid-template-columns: 1fr;
  }

  .solar-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .solar-temp,
  .solar-temp-label {
    text-align: left;
  }
}

@media (max-width: 620px) {
  .topbar {
    display: block;
  }

  .language-form {
    margin-top: 18px;
  }

  .form-grid,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .cc-grid {
    grid-template-columns: 1fr;
  }

  .overlay {
    font-size: 9px !important;
  }

  .table-card td {
    text-align: left;
  }

  .table-card th,
  .table-card td {
    display: block;
  }
}
.chilled-ceiling-card {
  width: 100%;
}

.chilled-ceiling-card .cc-content {
  width: 100%;
}

.chilled-ceiling-card .cc-compare-grid {
  width: 100%;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
/* =========================================================
   Business Card Modal
   ========================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;

  background: rgba(15, 23, 42, 0.58);

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;

  backdrop-filter: blur(4px);
}

.business-card {
  width: min(560px, 100%);

  background: #ffffff;

  border-radius: 30px;

  padding: 38px 36px 34px;

  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.35);

  text-align: center;
}

.bc-logo {
  display: block;

  width: 220px;
  max-width: 80%;

  margin: 0 auto 26px;
}

.business-card h2 {
  margin: 0;

  font-size: 2.2rem;
  line-height: 1.05;

  color: #0f172a;

  font-weight: 900;
}

.bc-role {
  margin: 14px 0 26px;

  color: #667085;

  font-size: 1rem;
  line-height: 1.5;

  font-weight: 700;
}

.bc-contact {
  display: grid;

  gap: 12px;

  margin-bottom: 30px;

  padding: 20px;

  border-radius: 20px;

  background: #f8fafc;

  border: 1px solid #e5e7eb;
}

.bc-line {
  display: flex;

  align-items: center;
  justify-content: center;

  gap: 10px;

  color: #0f172a;

  font-size: 1rem;

  font-weight: 700;
}
