:root {
  --bg: #ffffff;
  --text: #17212b;
  --muted: #657181;
  --line: #e5e9ef;
  --soft: #f6f8fb;
  --soft-red: #fff1ef;
  --red: #e13d2f;
  --red-dark: #b82e23;
  --green: #12805c;
  --green-soft: #e8f6ef;
  --amber: #b7791f;
  --amber-soft: #fff7df;
  --shadow: 0 18px 50px rgba(23, 33, 43, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body,
button,
input {
  font: 500 16px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

button,
a.button {
  cursor: pointer;
}

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

h1 {
  max-width: 820px;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  font-size: 19px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: space-between;
  min-height: 76px;
  padding: 14px clamp(18px, 5vw, 72px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(225, 61, 47, 0.2);
}

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

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.site-nav a {
  text-decoration: none;
}

.button {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  text-decoration: none;
  font-weight: 900;
  white-space: normal;
  text-align: center;
}

.button-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 14px 28px rgba(225, 61, 47, 0.21);
}

.button-primary:hover {
  background: var(--red-dark);
}

.button-secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

.button-light {
  background: #fff;
  color: var(--red-dark);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.62fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  min-height: calc(100vh - 76px);
  padding: clamp(36px, 6vw, 84px) clamp(18px, 5vw, 72px) 44px;
  background:
    linear-gradient(90deg, rgba(255, 241, 239, 0.8), rgba(255, 255, 255, 0) 46%),
    radial-gradient(circle at 90% 12%, rgba(18, 128, 92, 0.11), transparent 28%),
    #fff;
}

.hero-copy {
  display: grid;
  gap: 28px;
}

.hero-copy p {
  max-width: 650px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
}

.hero-actions,
.upsell-actions,
.result-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.trust-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.trust-row span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--muted);
  background: #fff;
  font-size: 14px;
  font-weight: 800;
}

.product-panel,
.calculator-form,
.result-panel,
.history-panel,
.diagnosis,
.upsell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.product-panel {
  padding: clamp(18px, 3vw, 28px);
  display: grid;
  gap: 14px;
}

.panel-title {
  display: grid;
  gap: 4px;
}

.panel-title h2 {
  font-size: 24px;
}

.panel-title p,
.muted {
  color: var(--muted);
}

label {
  display: grid;
  gap: 7px;
  color: #3b4654;
  font-size: 13px;
  font-weight: 900;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
}

input:focus {
  outline: 3px solid rgba(225, 61, 47, 0.14);
  border-color: var(--red);
}

.result-box {
  display: none;
  gap: 10px;
  padding: 14px;
  border-radius: 8px;
  background: var(--amber-soft);
  color: #4a3410;
}

.result-box:not(:empty) {
  display: grid;
}

.result-box span {
  color: var(--amber);
  font-weight: 900;
}

.problem-band,
.section-grid,
.video-section,
.examples,
.lead-section,
.faq {
  padding: clamp(36px, 6vw, 80px) clamp(18px, 5vw, 72px);
}

.problem-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background: var(--red);
  color: #fff;
}

.problem-band p {
  max-width: 760px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.82);
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.section-heading {
  display: grid;
  gap: 14px;
}

.section-heading p,
.video-section p,
.faq p,
.examples p {
  color: var(--muted);
}

.benefit-grid,
.examples,
.diagnosis-grid,
.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.benefit-grid article,
.examples article,
.diagnosis-grid article,
.calc-card,
#history-list article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}

.benefit-grid strong,
.benefit-grid span,
.calc-card strong,
.calc-card span,
#history-list strong,
#history-list span {
  display: block;
}

.benefit-grid span,
.calc-card span,
#history-list span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.video-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: 36px;
  align-items: center;
  background: var(--soft);
}

.video-section > div:last-child {
  display: grid;
  gap: 18px;
}

.video-placeholder {
  min-height: 320px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  background:
    linear-gradient(rgba(23, 33, 43, 0.22), rgba(23, 33, 43, 0.42)),
    url("https://images.unsplash.com/photo-1556911220-bff31c812dba?auto=format&fit=crop&w=1200&q=80") center/cover;
}

.examples {
  background: #fff;
}

.examples article {
  min-height: 150px;
}

.lead-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 0.48fr);
  gap: 32px;
  align-items: center;
  background: var(--text);
  color: #fff;
}

.lead-section p {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.lead-form {
  box-shadow: none;
}

.form-message {
  min-height: 22px;
  color: var(--muted) !important;
  font-size: 14px;
  font-weight: 800;
}

.faq {
  max-width: 960px;
}

details {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}

summary {
  cursor: pointer;
  font-weight: 900;
}

details p {
  margin-top: 10px;
}

.tool-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: calc(100vh - 76px);
  background: var(--soft);
  max-width: 100vw;
}

.tool-sidebar {
  position: sticky;
  top: 76px;
  height: calc(100vh - 76px);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: #fff;
  border-right: 1px solid var(--line);
  min-width: 0;
}

.tool-nav {
  display: grid;
  gap: 6px;
  overflow-y: auto;
  min-width: 0;
  max-width: 100%;
}

.tool-nav a {
  padding: 11px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
}

.tool-nav a:hover,
.tool-nav a.active {
  background: var(--soft-red);
  color: var(--red-dark);
}

.tool-main {
  min-width: 0;
  max-width: 100vw;
  padding: clamp(18px, 4vw, 44px);
}

.tool-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.tool-topbar h1 {
  font-size: clamp(32px, 4vw, 56px);
}

.tool-topbar p {
  margin-top: 8px;
  color: var(--muted);
}

.app-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.calc-card {
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(23, 33, 43, 0.04);
}

.calc-card:hover {
  border-color: rgba(225, 61, 47, 0.45);
  transform: translateY(-1px);
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.58fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.calculator-form,
.result-panel,
.history-panel,
.diagnosis,
.upsell {
  padding: 20px;
}

.calculator-form {
  display: grid;
  gap: 13px;
}

.result-panel {
  display: grid;
  gap: 18px;
  min-height: 260px;
}

.result-panel h2 {
  font-size: 28px;
}

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

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

.metric-grid div {
  border-radius: 8px;
  padding: 14px;
  background: var(--green-soft);
}

.metric-grid span {
  display: block;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.metric-grid strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(20px, 3vw, 30px);
  overflow-wrap: anywhere;
}

.history-panel,
.upsell {
  margin-top: 18px;
}

#history-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

#history-list article {
  display: grid;
  grid-template-columns: minmax(0, 160px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

#history-list button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 36px;
  padding: 0 12px;
  font-weight: 900;
}

.upsell {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  background: var(--text);
  color: #fff;
}

.upsell p {
  max-width: 780px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.72);
}

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

.diagnosis > p {
  color: var(--muted);
}

.alert-text {
  padding: 14px;
  border-radius: 8px;
  background: var(--amber-soft);
  color: #4a3410 !important;
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--text);
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 900;
}

@media (max-width: 980px) {
  .site-nav {
    display: none;
  }

  .hero,
  .section-grid,
  .video-section,
  .lead-section,
  .calculator-layout,
  .tool-shell {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .tool-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
  }

  .tool-nav {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    width: 100%;
  }

  .tool-nav a {
    flex: 0 0 auto;
  }

  .benefit-grid,
  .examples,
  .diagnosis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .site-header {
    min-height: auto;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
  }

  .site-header > .button {
    display: none;
  }

  .brand strong {
    max-width: 170px;
    line-height: 1.1;
  }

  .hero,
  .problem-band,
  .section-grid,
  .video-section,
  .examples,
  .lead-section,
  .faq,
  .tool-main {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero-actions,
  .result-actions,
  .upsell,
  .tool-topbar,
  .problem-band {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .benefit-grid,
  .examples,
  .diagnosis-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  #history-list article {
    grid-template-columns: 1fr;
  }
}
