:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5b6776;
  --line: #d8dee8;
  --soft: #eef3f8;
  --panel: #ffffff;
  --panel-strong: #f8fafc;
  --brand: #11675b;
  --brand-dark: #0b4f48;
  --accent: #c6532d;
  --warning: #8a5d00;
  --shadow: 0 18px 55px rgba(19, 34, 48, 0.12);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #f4f7fa;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto auto;
  gap: 20px;
  align-items: center;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(216, 222, 232, 0.92);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: var(--brand);
  border-radius: 8px;
}

.brand strong,
.brand small {
  display: block;
  white-space: nowrap;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.topnav {
  display: flex;
  gap: 6px;
  align-items: center;
}

.topnav a {
  padding: 9px 11px;
  color: var(--muted);
  font-size: 0.92rem;
  border-radius: 8px;
}

.topnav a:hover {
  color: var(--ink);
  background: var(--soft);
}

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.select-label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

select,
input,
textarea {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

select {
  min-width: 122px;
  padding: 0 34px 0 10px;
}

input {
  padding: 0 12px;
}

textarea {
  padding: 10px 12px;
  resize: vertical;
}

button {
  font: inherit;
}

.workspace-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(580px, 1.65fr);
  gap: 28px;
  align-items: start;
  max-width: 1360px;
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 54px) clamp(18px, 4vw, 56px);
}

.workspace-head {
  position: sticky;
  top: 98px;
  padding: 18px 0 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 560px;
  margin-bottom: 18px;
  font-size: clamp(2.25rem, 4vw, 4.2rem);
  line-height: 1.02;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 2.3vw, 2.15rem);
  line-height: 1.15;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.02rem;
}

.intro {
  max-width: 520px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.calculator-panel,
.section-band,
.workflow-band {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.calculator-panel {
  overflow: hidden;
  border-radius: var(--radius);
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-strong);
}

.status-pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: var(--brand-dark);
  font-size: 0.82rem;
  font-weight: 800;
  border: 1px solid rgba(17, 103, 91, 0.24);
  border-radius: 999px;
  background: #e7f3f0;
}

.calculator-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(260px, 0.78fr);
  gap: 0;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 24px;
  border-right: 1px solid var(--line);
}

.input-grid label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 10px;
  align-items: center;
  min-width: 0;
}

.input-grid label span {
  grid-column: 1 / -1;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.input-grid small {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.result-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  background: #fbfcfe;
}

.result-main {
  display: grid;
  gap: 8px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.result-main span,
.result-list dt {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.result-main strong {
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1;
}

.result-main small {
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 800;
}

.result-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.result-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.result-list dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

.result-note {
  margin: 0;
  padding: 12px;
  color: var(--warning);
  font-size: 0.9rem;
  line-height: 1.55;
  border: 1px solid rgba(138, 93, 0, 0.18);
  border-radius: 8px;
  background: #fff8e5;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
}

.primary-btn,
.secondary-btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.primary-btn {
  color: #fff;
  border: 1px solid var(--brand-dark);
  background: var(--brand);
}

.primary-btn:disabled {
  cursor: wait;
  opacity: 0.68;
}

.secondary-btn {
  color: var(--brand-dark);
  border: 1px solid rgba(17, 103, 91, 0.34);
  background: #fff;
}

.lead-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.82fr) minmax(360px, 1fr);
  gap: 24px;
  padding: 24px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.lead-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

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

.lead-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.lead-form strong {
  color: var(--accent);
}

.lead-message,
.lead-consent,
.lead-actions {
  grid-column: 1 / -1;
}

.lead-consent {
  grid-template-columns: auto 1fr;
  align-items: start;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.45;
}

.lead-consent input {
  width: 18px;
  min-height: 18px;
  margin: 2px 0 0;
}

.lead-actions {
  display: grid;
  grid-template-columns: minmax(190px, auto) 1fr;
  gap: 12px;
  align-items: center;
}

.lead-status {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.lead-status.success {
  color: var(--brand-dark);
}

.lead-status.error {
  color: var(--accent);
}

.lead-status.pending {
  color: var(--muted);
}

.section-band,
.workflow-band {
  max-width: 1360px;
  margin: 0 auto 28px;
  padding: clamp(24px, 4vw, 42px) clamp(18px, 4vw, 56px);
  border-radius: var(--radius);
}

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

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

.tool-card {
  display: grid;
  gap: 12px;
  min-height: 176px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tool-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.tool-card .tool-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  font-weight: 900;
  background: var(--brand-dark);
  border-radius: 8px;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.tool-status {
  align-self: end;
  width: fit-content;
  padding: 5px 8px;
  color: var(--brand-dark);
  font-size: 0.76rem;
  font-weight: 800;
  border-radius: 999px;
  background: #e7f3f0;
}

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

.workflow-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.workflow-grid span {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--accent);
  font-weight: 900;
}

.workflow-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  max-width: 1360px;
  margin: 0 auto;
  padding: 26px clamp(18px, 4vw, 56px) 42px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 14px;
  align-items: center;
  color: var(--brand-dark);
  font-weight: 700;
}

.lead-consent a,
.footer-links a,
.legal-back a {
  color: var(--brand-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-body {
  background: #f4f7fa;
}

.legal-shell {
  max-width: 940px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 54px) clamp(18px, 4vw, 56px);
}

.legal-back {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.legal-card {
  padding: clamp(24px, 5vw, 46px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.legal-card h1 {
  max-width: none;
  margin-bottom: 10px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.legal-updated {
  margin-bottom: 30px;
  color: var(--muted);
}

.legal-section {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.legal-section + .legal-section {
  margin-top: 22px;
}

.legal-section h2 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.legal-section p,
.legal-section li {
  color: var(--muted);
  line-height: 1.7;
}

.legal-section ul {
  margin: 0;
  padding-left: 22px;
}

.legal-section li + li {
  margin-top: 8px;
}

.consent-banner {
  position: fixed;
  right: clamp(14px, 3vw, 32px);
  bottom: clamp(14px, 3vw, 32px);
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 18px;
  align-items: center;
  max-width: 760px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.consent-banner[hidden] {
  display: none;
}

.consent-banner strong {
  display: block;
  margin-bottom: 5px;
}

.consent-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.consent-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

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

  .workspace-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .workspace-head {
    position: static;
  }

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

  .input-grid {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .tool-grid,
  .workflow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lead-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .topnav,
  .controls,
  .result-actions,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .controls,
  .topnav,
  .result-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .brand strong,
  .brand small {
    white-space: normal;
  }

  .input-grid,
  .lead-form,
  .lead-actions,
  .tool-grid,
  .workflow-grid {
    grid-template-columns: 1fr;
  }

  .panel-title-row {
    display: grid;
  }

  h1 {
    font-size: 2.35rem;
  }

  .footer {
    display: grid;
  }

  .footer-links,
  .legal-back {
    flex-wrap: wrap;
  }

  .consent-banner {
    left: 14px;
    right: 14px;
    grid-template-columns: 1fr;
  }

  .consent-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
