:root {
  --bg: #f4f7fc;
  --panel: rgba(255, 255, 255, 0.94);
  --line: #d8e3f2;
  --text: #1f2937;
  --muted: #5c6b7c;
  --brand: #1747a6;
  --brand-2: #0e8f88;
  --accent: #d97706;
  --shadow: 0 18px 48px rgba(20, 60, 120, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Manrope, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(108, 160, 255, 0.18) 0%, rgba(108, 160, 255, 0) 60%),
    radial-gradient(700px 360px at 100% 0%, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0) 55%),
    var(--bg);
}

.shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 18px 40px;
}

.hero {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(135deg, #ffffff, #edf5ff 55%, #ffffff 100%);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.08;
  color: #12315f;
}

.lead {
  margin: 0;
  max-width: 78ch;
  font-size: 18px;
  line-height: 1.7;
  color: #405368;
}

.hero-note {
  margin-top: 16px;
  display: inline-flex;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #f6d6a8;
  background: #fff8eb;
  color: #9a5800;
  font-weight: 700;
  font-size: 13px;
}

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

.panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 20px;
  backdrop-filter: blur(8px);
}

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

.actions-inline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.panel h2,
.panel h3 {
  margin: 0 0 8px;
  color: #12315f;
}

.panel p {
  margin: 0;
  color: var(--muted);
}

.subsection {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #dce6f2;
}

.subsection.no-border {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.sub-note {
  margin-top: 10px !important;
  font-size: 13px;
  line-height: 1.6;
}

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

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #29405f;
}

.switch-row {
  align-content: start;
}

.switch-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 6px 0 0;
}

.pill-note {
  margin-top: 12px;
  display: inline-flex;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid #dbe6f3;
  background: #f8fbff;
  color: #34506f;
  font-size: 13px;
  line-height: 1.6;
}

.pill-note.profile-conservative {
  background: #eef7f1;
  border-color: #b8d8c1;
  color: #234b31;
}

.pill-note.profile-balanced {
  background: #eef4ff;
  border-color: #bfd4fb;
  color: #184281;
}

.pill-note.profile-optimistic {
  background: #fff4e8;
  border-color: #f3c690;
  color: #8a4a0f;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid #cbd8ea;
  background: #ffffff;
  padding: 10px 14px;
  color: #162435;
}

input:focus,
select:focus {
  outline: none;
  border-color: #4b83e8;
  box-shadow: 0 0 0 4px rgba(75, 131, 232, 0.12);
}

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

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  border: 1px solid #dbe6f3;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  padding: 16px;
}

.metric-label {
  display: block;
  color: #5b6b7b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-value {
  display: block;
  margin-top: 8px;
  color: #173761;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
}

.metric-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.metric.positive .metric-value { color: #0d7a4b; }
.metric.warning .metric-value { color: #b45309; }
.metric.negative .metric-value { color: #b42318; }

.explanation {
  color: #31465f;
  line-height: 1.75;
}

.explanation p + p {
  margin-top: 10px;
}

.explanation strong {
  color: #12315f;
}

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

.annual-breakdown {
  margin-top: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid #e4ebf4;
  font-size: 14px;
}

th {
  color: #516375;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tips {
  margin: 0;
  padding-left: 18px;
  color: #42566f;
  line-height: 1.75;
}

.sources {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sources a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #d6e2f1;
  background: #f8fbff;
  color: #173761;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}

.sources a:hover {
  background: #eef5ff;
}

button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
}

.ghost {
  background: #ffffff;
  color: #23416a;
  border-color: #cdd9eb;
}

.ghost:hover {
  background: #f8fbff;
}

.visitor-counter {
  position: static;
  display: inline-grid;
  width: fit-content;
  max-width: calc(100% - 24px);
  min-width: 228px;
  padding: 6px 7px;
  margin: 0 0 10px 16px;
  border: 1px solid rgba(23, 71, 166, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 22px rgba(20, 60, 120, 0.12);
  backdrop-filter: blur(14px);
}

.visitor-counter__title {
  margin-bottom: 5px;
  color: #34506f;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.visitor-counter__item {
  display: grid;
  gap: 2px;
  justify-items: center;
  padding: 4px 4px 3px;
  border: 1px solid rgba(23, 71, 166, 0.14);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(244, 248, 255, 0.98), rgba(255, 255, 255, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.visitor-counter__value {
  color: #12315f;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.visitor-counter__label {
  color: #4f6581;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 16px;
  }

  .hero,
  .panel {
    border-radius: 18px;
    padding: 16px;
  }

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

  .sources {
    flex-direction: column;
  }

  .visitor-counter {
    display: grid;
    width: auto;
    max-width: none;
    min-width: 0;
    margin: 0 12px 10px;
  }
}
