:root {
  --bg: #eef3f5;
  --paper: #fbfcfb;
  --panel: #f7f9f7;
  --ink: #142026;
  --muted: #62717a;
  --line: #cad7db;
  --deep: #173f46;
  --deep-2: #0f2e35;
  --teal: #2f8984;
  --green: #1f7a48;
  --amber: #c97920;
  --red: #b42318;
  --blue: #245d93;
  --shadow: 18px 18px 36px rgba(82, 103, 111, 0.18), -12px -12px 28px rgba(255, 255, 255, 0.85);
  --inset: inset 7px 7px 14px rgba(86, 104, 110, 0.16), inset -7px -7px 14px rgba(255, 255, 255, 0.86);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.72) 0 25%, transparent 25% 50%, rgba(255,255,255,0.35) 50% 75%, transparent 75%) 0 0 / 42px 42px,
    linear-gradient(180deg, #f8fbfb 0%, var(--bg) 52%, #e6eef0 100%);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.snow-app {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 14px 18px;
  border: 1px solid rgba(23, 63, 70, 0.14);
  border-radius: 20px;
  background: rgba(251, 252, 251, 0.92);
  box-shadow: 0 14px 34px rgba(56, 75, 82, 0.11);
}

.brand,
.contact-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, var(--deep), var(--teal));
  font-weight: 900;
  box-shadow: 8px 8px 18px rgba(23, 63, 70, 0.2), inset 0 1px 0 rgba(255,255,255,0.28);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 1.05rem;
}

.brand span,
.hero-copy p,
.panel-title p {
  color: var(--muted);
}

.contact-strip a {
  color: var(--deep);
  font-weight: 800;
  text-decoration: none;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 18px;
}

.hero-copy,
.hero-meter,
.panel,
.notice,
.footer {
  border: 1px solid rgba(23, 63, 70, 0.14);
  border-radius: var(--radius);
  background: rgba(251, 252, 251, 0.94);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: clamp(24px, 4vw, 42px);
  background:
    linear-gradient(120deg, rgba(255,255,255,0.96), rgba(241,247,247,0.94)),
    linear-gradient(135deg, rgba(47,137,132,0.11), rgba(201,121,32,0.10));
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal) !important;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 14px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.05;
}

.hero-copy p:last-child {
  max-width: 920px;
  margin-bottom: 0;
  font-size: 1.08rem;
}

.hero-meter {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: linear-gradient(145deg, #f9fbfa, #e9f1f2);
}

.hero-meter div {
  padding: 18px;
  border-radius: 15px;
  background: #eff5f5;
  box-shadow: var(--inset);
}

.hero-meter strong {
  display: block;
  color: var(--deep);
  font-size: 1.45rem;
}

.hero-meter span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 700;
}

.notice {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-left: 6px solid var(--amber);
  line-height: 1.55;
}

.workspace {
  display: grid;
  gap: 18px;
}

.panel {
  padding: clamp(18px, 3vw, 26px);
}

.panel-title {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 18px;
}

.panel-title > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, var(--deep), var(--teal));
  font-weight: 900;
}

.panel-title h2 {
  margin-bottom: 4px;
  font-size: clamp(1.22rem, 2vw, 1.65rem);
}

.panel-title p {
  margin-bottom: 0;
}

.grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 7px;
  color: var(--deep-2);
  font-size: 0.92rem;
  font-weight: 900;
}

input,
select {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #c5d4d8;
  border-radius: 14px;
  color: var(--ink);
  background: #edf4f4;
  box-shadow: var(--inset);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: var(--inset), 0 0 0 4px rgba(47, 137, 132, 0.15);
}

.field-ok {
  border-color: rgba(31, 122, 72, 0.7) !important;
  background: #edf8f0 !important;
}

.field-bad {
  border-color: rgba(180, 35, 24, 0.8) !important;
  background: #fff0ed !important;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #c5d4d8;
  border-radius: 14px;
  background: #eef5f5;
  box-shadow: var(--inset);
  text-align: center;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented label:has(input:checked) {
  color: #fff;
  background: linear-gradient(145deg, var(--deep), var(--teal));
  box-shadow: 8px 8px 20px rgba(23, 63, 70, 0.2), inset 0 1px 0 rgba(255,255,255,0.25);
}

.calculate-button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  min-height: 78px;
  margin-top: 8px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, #2f8984, #173f46);
  box-shadow: 0 16px 0 #0d2930, 0 24px 42px rgba(23, 63, 70, 0.28), inset 0 1px 0 rgba(255,255,255,0.3);
  cursor: pointer;
  transform: translateY(0);
}

.calculate-button:active {
  transform: translateY(8px);
  box-shadow: 0 8px 0 #0d2930, 0 14px 26px rgba(23, 63, 70, 0.22), inset 0 1px 0 rgba(255,255,255,0.3);
}

.calculate-button span {
  font-size: 1.16rem;
  font-weight: 900;
}

.calculate-button small {
  opacity: 0.88;
  font-weight: 800;
}

.results {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

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

.metric {
  padding: 18px;
  border: 1px solid rgba(23, 63, 70, 0.12);
  border-radius: 16px;
  background: linear-gradient(145deg, #f9fbfa, #e9f1f2);
  box-shadow: var(--inset);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 5px;
  color: var(--deep);
  font-size: 1.42rem;
}

.recommendation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.48fr);
  gap: 18px;
}

.system-card {
  min-height: 260px;
  padding: 24px;
  border-radius: 20px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.14), transparent 32%),
    linear-gradient(145deg, #12363d, #2f8984);
  box-shadow: 0 28px 60px rgba(23, 63, 70, 0.26);
}

.system-card h3 {
  margin-bottom: 8px;
  font-size: clamp(1.6rem, 3vw, 2.65rem);
}

.system-card p {
  color: rgba(255,255,255,0.86);
  line-height: 1.55;
}

.system-tags {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.system-tags span {
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,0.32);
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  font-weight: 800;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h3 {
  margin-bottom: 3px;
  font-size: 1.25rem;
}

.section-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

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

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

thead th {
  color: #fff;
  background: linear-gradient(145deg, var(--deep), var(--teal));
}

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

tbody tr:last-child td {
  border-bottom: 0;
}

.num {
  text-align: right;
  white-space: nowrap;
  font-weight: 900;
}

.warnings {
  display: grid;
  gap: 10px;
}

.warning {
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(180, 35, 24, 0.22);
  background: #fff2ef;
  color: #6f1d16;
  font-weight: 800;
}

.warning.info {
  border-color: rgba(36, 93, 147, 0.22);
  background: #edf5ff;
  color: #1c436a;
}

.warning.good {
  border-color: rgba(31, 122, 72, 0.22);
  background: #edf8f0;
  color: #1c5f39;
}

.scheme {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(20,32,38,0.06) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(0deg, rgba(20,32,38,0.06) 1px, transparent 1px) 0 0 / 28px 28px,
    #f8fbfb;
}

.slab {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 25%;
  height: 48%;
  border-radius: 24px;
  background: linear-gradient(145deg, #c6b48f, #f0dfb8 48%, #b79563);
  box-shadow: inset 0 12px 22px rgba(255,255,255,0.48), inset 0 -18px 28px rgba(91,62,24,0.2), 0 18px 40px rgba(43, 48, 43, 0.18);
}

.cable-line {
  position: absolute;
  left: 11%;
  right: 11%;
  top: 50%;
  height: 12px;
  border-radius: 999px;
  background: #d92720;
  box-shadow: 0 0 0 4px rgba(217,39,32,0.14);
}

.cable-line.secondary {
  top: 61%;
  background: #b81f1a;
}

.sensor-dot {
  position: absolute;
  left: 50%;
  top: 36%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #163d8f;
  box-shadow: 0 0 0 8px rgba(22,61,143,0.16);
}

.scheme-label {
  position: absolute;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(20,32,38,0.09);
}

.scheme-label.top {
  left: 8%;
  top: 8%;
}

.scheme-label.bottom {
  right: 8%;
  bottom: 8%;
}

.scheme-label.sensor {
  right: 8%;
  top: 19%;
}

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

.action-button {
  min-height: 52px;
  border: 1px solid rgba(23, 63, 70, 0.2);
  border-radius: 14px;
  color: var(--deep);
  background: #eef5f5;
  box-shadow: var(--inset);
  font-weight: 900;
  cursor: pointer;
}

.action-button.primary {
  color: #fff;
  background: linear-gradient(145deg, var(--deep), var(--teal));
  box-shadow: 0 12px 24px rgba(23, 63, 70, 0.18);
}

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

.legend-grid div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f2f7f7;
}

.legend-grid strong,
.legend-grid span {
  display: block;
}

.legend-grid span {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.45;
}

.footer {
  margin-top: 18px;
  padding: 18px;
  color: #fff;
  background: linear-gradient(145deg, var(--deep), var(--deep-2));
}

.footer strong,
.footer span {
  display: block;
}

.footer span {
  margin-top: 5px;
  color: rgba(255,255,255,0.86);
}

@media (max-width: 1100px) {
  .hero-panel,
  .recommendation {
    grid-template-columns: 1fr;
  }

  .grid.three,
  .grid.four,
  .result-grid,
  .legend-grid,
  .actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .snow-app {
    padding: 10px;
  }

  .topbar,
  .segmented {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .grid.three,
  .grid.four,
  .result-grid,
  .legend-grid,
  .actions {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2rem;
  }

  table {
    min-width: 650px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .hero-panel,
  .workspace,
  .legend,
  .actions {
    display: none !important;
  }

  .snow-app {
    width: 100%;
    padding: 0;
  }

  .panel,
  .notice,
  .footer {
    box-shadow: none;
    break-inside: avoid;
  }
}
