:root {
  --blue: #0f4c81;
  --sky: #1e88e5;
  --ink: #183047;
  --muted: #6d7d8d;
  --bg: #f3f7fb;
  --line: #dbe5ed;
  --ok: #16824b;
  --bad: #d96a12;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }

.app { min-height: 100vh; }

.top {
  height: 74px;
  background: linear-gradient(115deg, #0d3f6e, #1769aa);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 max(22px, calc((100vw - 1240px) / 2));
  gap: 16px;
  box-shadow: 0 2px 8px #15345624;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand img.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  object-fit: contain;
  background: #ffffff;
  padding: 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

.brand small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 1.3px;
}

.top .right {
  margin-left: auto;
  display: flex;
  gap: 9px;
  align-items: center;
}

.badge-web {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 10px;
  border-radius: 20px;
  color: #e3f2fd;
  font-weight: 600;
}

.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px 24px 80px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
}

.hero h1 { font-size: 28px; margin: 0 0 6px; }
.hero p { color: var(--muted); margin: 0; }

.button {
  border: 0;
  border-radius: 10px;
  padding: 12px 17px;
  cursor: pointer;
  background: var(--sky);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 3px 7px #1e88e534;
  transition: all 0.15s ease;
}

.button:hover { filter: brightness(0.94); transform: translateY(-1px); }
.button.outline { color: var(--blue); background: #fff; border: 1px solid #bcd1e0; box-shadow: none; }
.button.danger { background: #c53f35; }
.button.small { padding: 8px 11px; font-size: 13px; }

.summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 22px 0;
}

.metric, .card, .form-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 3px 12px #27445a0a;
}

.metric { padding: 17px; }
.metric b { display: block; font-size: 27px; color: var(--blue); }
.metric span { color: var(--muted); font-size: 13px; }

.list { display: grid; gap: 12px; }

.install {
  padding: 17px 18px;
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 13px;
  align-items: center;
}

.install .stripe {
  height: 46px;
  border-radius: 9px;
  background: var(--ok);
}

.install.bad .stripe { background: var(--bad); }
.install h3 { margin: 0 0 4px; font-size: 17px; }
.install p { margin: 0; color: var(--muted); font-size: 13px; }

.txt-ok { color: var(--ok); }
.txt-bad { color: var(--bad); }

.actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.empty { padding: 58px 24px; text-align: center; color: var(--muted); }

.form-wrap { max-width: 850px; margin: auto; }

.stepper { display: flex; gap: 8px; margin-bottom: 22px; }
.step {
  flex: 1;
  padding: 10px;
  border-radius: 9px;
  background: #e5edf4;
  color: #6d7d8d;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}
.step.active { background: #d9edff; color: #0b5d9c; }

.form-card { padding: 25px; margin-bottom: 18px; }
.form-card h2 { margin: 0 0 5px; font-size: 20px; }
.form-card > p { margin: 0 0 19px; color: var(--muted); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 700; color: #425669; }
.field input, .field select {
  border: 1px solid #bccbd6;
  border-radius: 9px;
  padding: 11px 12px;
  background: white;
  color: var(--ink);
  outline-color: var(--sky);
  width: 100%;
}

.segmented { display: flex; gap: 7px; flex-wrap: wrap; }
.segmented label {
  border: 1px solid #bdcbd8;
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 14px;
}
.segmented input { position: absolute; opacity: 0; }
.segmented label:has(input:checked) {
  background: #dcefff;
  border-color: #398bd0;
  color: #0c5f9f;
  font-weight: 700;
}

.form-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }

.hint {
  padding: 10px 12px;
  border-radius: 8px;
  background: #eaf5ff;
  color: #155d92;
  font-size: 14px;
  margin-top: 12px;
  font-weight: 500;
}

.result {
  padding: 15px;
  border-radius: 11px;
  margin-top: 15px;
  border: 1px solid;
  font-size: 14px;
  line-height: 1.5;
}
.result.ok { background: #effaf3; border-color: #92d6ae; color: #176538; }
.result.bad { background: #fff4eb; border-color: #f0ba90; color: #a74606; }

.charts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.chart { padding: 18px; }
.chart h3 { font-size: 16px; margin: 0 0 13px; color: var(--ink); }
.chart svg { width: 100%; height: 210px; overflow: visible; }

.chart .grid-line { stroke: #e3edf5; stroke-width: 1; stroke-dasharray: 3 3; }
.chart .axis { stroke: #94aab9; stroke-width: 1.5; }
.chart .line { fill: none; stroke: #1e88e5; stroke-width: 3; stroke-linecap: round; }
.chart .point { fill: #fff; stroke: #1e88e5; stroke-width: 3; }
.chart .axis-val { fill: #8397a7; font-size: 10px; font-weight: 500; }
.chart .pt-val { fill: #0f4c81; font-size: 11px; font-weight: 700; }
.chart .axis-title { fill: #687b89; font-size: 11px; font-weight: 700; }

.details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
.detail { padding: 14px; }
.detail.ok { border-left: 5px solid var(--ok); }
.detail.bad { border-left: 5px solid var(--bad); }
.detail span { display: block; color: var(--muted); font-size: 12px; }
.detail b { font-size: 17px; }

.back {
  color: var(--blue);
  background: transparent;
  border: 0;
  padding: 0;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 17px;
  font-size: 14px;
}

.ad-banner {
  margin: 24px auto 0;
  padding: 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  min-height: 90px;
}

@media (max-width: 700px) {
  .top { height: 64px; padding: 0 16px; }
  .brand { font-size: 21px; }
  .brand img.logo-img { width: 34px; height: 34px; }
  .badge-web { display: none; }
  .shell { padding: 22px 15px 50px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .summary, .details, .charts { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .install { grid-template-columns: 7px 1fr; }
  .actions { grid-column: 2; justify-content: flex-start; }
  .form-card { padding: 18px; }
  .step { font-size: 11px; padding: 8px 4px; }
}

@media print {
  body { background: #fff !important; color: #000 !important; }
  .top, .back, .button, .actions, .form-actions, .stepper, .ad-banner, #cancel, #home { display: none !important; }
  .shell { max-width: 100% !important; padding: 0 !important; margin: 0 !important; }
  .hero { align-items: flex-start !important; flex-direction: row !important; }
  .card, .form-card, .metric { box-shadow: none !important; border: 1px solid #ccc !important; page-break-inside: avoid; }
  .charts { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
  .chart svg { height: 180px !important; }
}
