:root {
  --bg: #08111f;
  --bg-soft: #0f1b2e;
  --card: #13233a;
  --card-strong: #172a45;
  --text: #f8fafc;
  --muted: #94a3b8;
  --green: #22c55e;
  --cyan: #38bdf8;
  --border: rgba(148, 163, 184, 0.18);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --radius: 8px;
  --container: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 16% 0%, rgba(56, 189, 248, 0.12), transparent 32rem),
    radial-gradient(circle at 88% 18%, rgba(34, 197, 94, 0.1), transparent 28rem),
    linear-gradient(180deg, var(--bg) 0%, #0a1525 54%, var(--bg) 100%);
  line-height: 1.6;
}

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

button {
  font: inherit;
}

input,
textarea,
select {
  font: inherit;
}

:focus-visible {
  outline: 3px solid rgba(56, 189, 248, 0.88);
  outline-offset: 3px;
}

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

.skip-link,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  z-index: 20;
  width: auto;
  height: auto;
  margin: 16px;
  padding: 10px 14px;
  clip: auto;
  color: #04101c;
  background: var(--cyan);
  border-radius: var(--radius);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(8, 17, 31, 0.84);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #03120b;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  border-radius: var(--radius);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav-menu a:hover,
.footer-links a:hover,
.back-link:hover {
  color: var(--text);
}

.nav-cta {
  padding: 9px 14px;
  color: #dffce8;
  border: 1px solid rgba(34, 197, 94, 0.5);
  border-radius: var(--radius);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.nav-toggle span:not(.sr-only) {
  display: block;
  width: 20px;
  height: 2px;
  margin: 3px auto;
  background: var(--text);
}

.section {
  padding: 84px 0;
}

.hero {
  min-height: calc(100vh - 72px);
  display: grid;
  align-items: center;
  padding-top: 48px;
}

.hero-grid,
.tool-layout,
.content-grid,
.footer-grid {
  display: grid;
  gap: 42px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.06fr) minmax(320px, 0.94fr);
  align-items: center;
}

.tool-layout {
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  align-items: center;
}

.content-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 1.1fr);
  align-items: start;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 860px;
  margin-bottom: 22px;
  font-size: clamp(2.35rem, 6.4vw, 5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(1.8rem, 3.8vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
  line-height: 1.25;
}

.hero-subtitle,
.reason-panel p,
.info-card p {
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  font-weight: 800;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.button:hover,
.card-link:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #04130b;
  background: linear-gradient(135deg, var(--green), #7ddf99);
  box-shadow: 0 18px 40px rgba(34, 197, 94, 0.2);
}

.button-secondary {
  color: #dff6ff;
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.34);
}

.hero-panel,
.status-panel,
.info-card,
.reason-panel,
.tool-card {
  background: rgba(19, 35, 58, 0.78);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 24px;
  background:
    linear-gradient(145deg, rgba(19, 35, 58, 0.92), rgba(15, 27, 46, 0.96)),
    url("../img/tools-grid.svg");
}

.panel-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 0.92rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: var(--green);
  border-radius: 999px;
  box-shadow: 0 0 0 7px rgba(34, 197, 94, 0.1);
}

.tool-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.tool-stack span {
  padding: 12px 14px;
  background: rgba(8, 17, 31, 0.55);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.hero-panel p,
.tool-card p,
.status-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 32px;
}

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

.tool-card {
  display: flex;
  min-height: 272px;
  flex-direction: column;
  padding: 22px;
}

.status-badge {
  align-self: flex-start;
  display: inline-flex;
  margin-bottom: 22px;
  padding: 6px 10px;
  color: #dffce8;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 999px;
}

.card-link {
  display: inline-flex;
  justify-content: center;
  margin-top: auto;
  padding: 11px 14px;
  color: #dff6ff;
  font-weight: 800;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: var(--radius);
  transition: transform 180ms ease, border-color 180ms ease;
}

.reason-section {
  background: rgba(15, 27, 46, 0.58);
  border-block: 1px solid var(--border);
}

.reason-panel {
  max-width: 880px;
  padding: 28px;
}

.reason-panel p {
  margin-bottom: 26px;
}

.tool-hero {
  padding-top: 76px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 30px;
  color: var(--muted);
  font-weight: 800;
}

.status-panel,
.info-card {
  padding: 24px;
}

.feature-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.feature-list li {
  position: relative;
  padding: 14px 14px 14px 40px;
  color: #dbe8f6;
  background: rgba(8, 17, 31, 0.44);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.feature-list li::before {
  content: "";
  position: absolute;
  top: 21px;
  left: 16px;
  width: 9px;
  height: 9px;
  background: var(--green);
  border-radius: 50%;
}

.site-footer {
  padding: 28px 0;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.footer-grid {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.site-footer p {
  margin-bottom: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.tool-summary h2 {
  margin-bottom: 16px;
  font-size: 1.45rem;
}

.summary-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.summary-list li {
  padding: 12px 14px;
  color: #dbe8f6;
  background: rgba(8, 17, 31, 0.44);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.calculator-section {
  background: rgba(15, 27, 46, 0.48);
  border-block: 1px solid var(--border);
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr);
  gap: 24px;
  align-items: start;
}

.calculator-card,
.calculator-help,
.results-empty,
.result-highlight,
.breakdown,
.cta-block {
  background: rgba(19, 35, 58, 0.82);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.calculator-card,
.calculator-help {
  padding: 24px;
}

.calculator-heading {
  margin-bottom: 22px;
}

.calculator-heading h2 {
  margin-bottom: 8px;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
}

.calculator-heading p,
.calculator-help p,
.margin-control p,
.form-message {
  color: var(--muted);
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label,
.margin-control label {
  color: #dce8f4;
  font-weight: 800;
  font-size: 0.94rem;
}

.field label span {
  color: var(--muted);
  font-weight: 500;
}

.field input {
  width: 100%;
  min-height: 46px;
  color: var(--text);
  background: #0b1626;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: var(--radius);
  outline: none;
}

.field input[type="number"] {
  appearance: textfield;
}

.field input[type="number"]::-webkit-inner-spin-button,
.field input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.field input:focus {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.08);
}

.field input::placeholder {
  color: #64748b;
}

.input-wrap {
  position: relative;
}

.input-wrap .prefix,
.input-wrap .suffix {
  position: absolute;
  top: 50%;
  color: var(--muted);
  font-size: 0.88rem;
  pointer-events: none;
  transform: translateY(-50%);
}

.input-wrap .prefix {
  left: 12px;
}

.input-wrap .suffix {
  right: 12px;
}

.input-wrap input {
  padding: 10px 14px 10px 34px;
}

.input-wrap.has-suffix input {
  padding-right: 34px;
  padding-left: 14px;
}

.margin-control {
  display: grid;
  gap: 16px;
  margin-top: 22px;
  padding: 18px;
  background: rgba(8, 17, 31, 0.36);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.margin-control p,
.form-message {
  margin: 6px 0 0;
  font-size: 0.92rem;
}

.slider-row {
  display: grid;
  grid-template-columns: 1fr 64px;
  gap: 14px;
  align-items: center;
}

input[type="range"] {
  width: 100%;
  height: 5px;
  background: rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  cursor: pointer;
  appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  background: var(--green);
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.22);
  appearance: none;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--green);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.22);
}

.slider-value {
  color: var(--green);
  font-size: 1.3rem;
  font-weight: 900;
  text-align: right;
}

.form-message {
  min-height: 24px;
  color: #fecaca;
}

.calculator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.calculator-actions .button {
  flex: 1;
  min-width: 160px;
  cursor: pointer;
}

.calculator-help {
  position: sticky;
  top: 96px;
}

.calculator-help h2 {
  font-size: 1.45rem;
}

.results-section {
  padding-top: 72px;
}

.results-empty {
  padding: 24px;
  color: var(--muted);
}

.results-empty p {
  margin-bottom: 0;
}

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

.result-highlight {
  position: relative;
  overflow: hidden;
  padding: 28px;
  background: linear-gradient(135deg, rgba(23, 42, 69, 0.96), rgba(19, 35, 58, 0.92));
}

.result-highlight::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--green);
}

.result-highlight.is-warn::before {
  background: #fbbf24;
}

.result-highlight.is-danger::before {
  background: #f87171;
}

.result-label,
.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-value {
  display: block;
  margin: 8px 0;
  color: var(--green);
  font-size: clamp(2.35rem, 7vw, 4.6rem);
  line-height: 0.95;
}

.result-value.is-warn,
.metric strong.is-warn {
  color: #fbbf24;
}

.result-value.is-danger,
.metric strong.is-danger {
  color: #f87171;
}

.result-sub {
  display: block;
  color: var(--muted);
}

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

.metric {
  padding: 18px;
  background: rgba(19, 35, 58, 0.82);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 1.25rem;
}

.metric strong.is-good {
  color: var(--green);
}

.breakdown,
.cta-block {
  padding: 24px;
}

.breakdown h3,
.cta-block h3 {
  margin-bottom: 14px;
}

.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.09);
}

.breakdown-row:last-child {
  border-bottom: 0;
}

.breakdown-name {
  color: var(--muted);
}

.breakdown-amount {
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.breakdown-total {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.breakdown-total .breakdown-name,
.breakdown-total .breakdown-amount {
  color: var(--text);
}

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

.alert {
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 0.94rem;
}

.alert strong {
  display: block;
  margin-bottom: 2px;
}

.alert.is-danger {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.22);
}

.alert.is-warn {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.22);
}

.alert.is-info {
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.22);
}

.alert.is-success {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.22);
}

.price-m2-section {
  border-block: 1px solid var(--border);
}

.price-m2-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.92fr);
  gap: 24px;
  align-items: start;
}

.price-m2-results-column {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 18px;
}

.price-m2-form .field-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.price-m2-margin input[type="range"]::-webkit-slider-thumb {
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.22);
}

.price-m2-margin input[type="range"]::-moz-range-thumb {
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.22);
}

.price-m2-slider-value {
  color: var(--cyan);
}

.price-m2-results {
  display: grid;
  gap: 18px;
}

.price-m2-hero,
.price-m2-total,
.market-reference {
  background: rgba(19, 35, 58, 0.82);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.price-m2-hero {
  position: relative;
  overflow: hidden;
  padding: 26px;
  background: linear-gradient(135deg, rgba(23, 42, 69, 0.96), rgba(19, 35, 58, 0.92));
}

.price-m2-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--cyan);
}

.price-m2-value {
  display: block;
  margin: 8px 0;
  color: var(--cyan);
  font-size: clamp(2.25rem, 6vw, 4.2rem);
  line-height: 0.98;
}

.price-m2-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.24);
}

.price-m2-total span {
  color: #bbf7d0;
  font-weight: 800;
}

.price-m2-total strong {
  color: var(--green);
  font-size: 1.45rem;
}

.price-m2-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.price-m2-breakdown h3,
.market-reference h3 {
  font-size: 1rem;
}

.price-m2-bar-row {
  display: grid;
  grid-template-columns: 106px minmax(80px, 1fr) minmax(86px, auto);
  gap: 10px;
  align-items: center;
  padding: 9px 0;
}

.price-m2-bar-row span {
  color: var(--muted);
  font-size: 0.88rem;
}

.price-m2-bar-row strong {
  text-align: right;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.price-m2-bar-track {
  height: 7px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.18);
  border-radius: 999px;
}

.price-m2-bar-fill {
  height: 100%;
  border-radius: inherit;
}

.market-reference {
  padding: 20px;
  background: rgba(56, 189, 248, 0.09);
  border-color: rgba(56, 189, 248, 0.24);
}

.market-reference h3 {
  color: #bae6fd;
}

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

.market-reference-grid article {
  padding: 12px;
  text-align: center;
  background: rgba(8, 17, 31, 0.3);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: var(--radius);
}

.market-reference-grid span {
  display: block;
  margin-bottom: 4px;
  color: rgba(186, 230, 253, 0.78);
  font-size: 0.78rem;
}

.market-reference-grid strong {
  color: #bae6fd;
  font-size: 0.95rem;
}

.market-reference p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.cta-block {
  text-align: center;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(56, 189, 248, 0.07));
  border-color: rgba(34, 197, 94, 0.24);
}

.cta-block p {
  max-width: 520px;
  margin: 0 auto 20px;
  color: var(--muted);
}

.generator-section {
  background: rgba(15, 27, 46, 0.48);
  border-block: 1px solid var(--border);
}

.generator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 24px;
  align-items: start;
}

.generator-form,
.preview-placeholder,
.preview-card {
  background: rgba(19, 35, 58, 0.82);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.generator-form,
.preview-placeholder,
.preview-card {
  padding: 24px;
}

.form-block {
  padding: 18px;
  margin-top: 16px;
  background: rgba(8, 17, 31, 0.26);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.form-block h3 {
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.form-grid.compact {
  gap: 12px;
}

.field textarea,
.field select {
  width: 100%;
  color: var(--text);
  background: #0b1626;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: var(--radius);
  outline: none;
}

.field textarea {
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
}

.field select {
  min-height: 46px;
  padding: 10px 36px 10px 14px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 20px,
    calc(100% - 13px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.field textarea:focus,
.field select:focus {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.08);
}

.budget-items {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.budget-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 44px;
  gap: 8px;
  align-items: end;
}

.budget-item-row .field {
  gap: 5px;
}

.budget-item-row input {
  min-height: 42px;
}

.remove-item-button {
  width: 44px;
  min-height: 42px;
  color: #fecaca;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: var(--radius);
  cursor: pointer;
}

.add-item-button {
  width: 100%;
  cursor: pointer;
}

.preview-column {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 16px;
}

.preview-placeholder {
  display: grid;
  min-height: 260px;
  place-items: center;
  text-align: center;
}

.preview-placeholder span {
  display: grid;
  width: 66px;
  height: 66px;
  margin-bottom: 16px;
  place-items: center;
  color: #03120b;
  font-weight: 900;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  border-radius: var(--radius);
}

.preview-placeholder h2 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.preview-placeholder p {
  max-width: 300px;
  margin-bottom: 0;
  color: var(--muted);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.preview-header h2 {
  margin-bottom: 0;
  font-size: 1.4rem;
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.small-button {
  min-height: 40px;
  padding: 9px 13px;
  font-size: 0.9rem;
  cursor: pointer;
}

.preview-box {
  max-height: 560px;
  min-height: 260px;
  padding: 18px;
  overflow: auto;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  background: #0b1626;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.94rem;
}

.contract-generator-section {
  --tool-accent: #2dd4bf;
}

.legal-warning,
.legal-note {
  padding: 14px 16px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-left: 3px solid #fbbf24;
  border-radius: var(--radius);
}

.legal-warning {
  max-width: 620px;
  margin: 16px 0 0;
  font-size: 0.92rem;
}

.legal-note {
  font-size: 0.92rem;
}

.legal-note strong {
  display: block;
  margin-bottom: 4px;
}

.contract-services {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.contract-service-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: end;
}

.contract-service-row .field {
  gap: 5px;
}

.contract-preview-box {
  font-family: "Courier New", Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.75;
}

.faq-section {
  background: rgba(8, 17, 31, 0.36);
}

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

.faq-item {
  padding: 16px 18px;
  background: rgba(19, 35, 58, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.faq-item summary {
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.faq-item p {
  margin: 12px 0 0;
  color: var(--muted);
}

.related-tools-section {
  padding-top: 0;
}

.related-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mdf-section {
  background: rgba(15, 27, 46, 0.48);
  border-block: 1px solid var(--border);
}

.first-block {
  margin-top: 0;
}

.help-text {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.amber-value {
  color: #f59e0b;
}

.mdf-items {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.mdf-piece-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px 96px 72px 44px;
  gap: 8px;
  align-items: end;
}

.mdf-piece-row .field {
  gap: 5px;
}

.mdf-piece-row input {
  min-height: 42px;
}

.mdf-result-hero {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(23, 42, 69, 0.96), rgba(19, 35, 58, 0.92));
  border: 1px solid var(--border);
  border-top: 3px solid #f59e0b;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.mdf-result-hero span,
.mdf-result-hero small {
  display: block;
  color: var(--muted);
}

.mdf-result-hero span {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mdf-result-hero strong {
  display: block;
  margin: 8px 0 4px;
  color: #f59e0b;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1;
}

.mdf-result-hero article:nth-child(2) strong {
  color: var(--green);
}

.mdf-result-hero article:nth-child(3) strong {
  color: var(--cyan);
}

.aprov-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.aprov-header h3 {
  margin-bottom: 0;
}

.aprov-header strong {
  font-size: 1.45rem;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.18);
  border-radius: 999px;
}

.bar-fill {
  width: 0;
  height: 100%;
  background: var(--cyan);
  border-radius: inherit;
  transition: width 420ms ease;
}

.bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.bar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bar-legend i {
  width: 8px;
  height: 8px;
  background: rgba(148, 163, 184, 0.32);
  border-radius: 50%;
}

.bar-legend .legend-blue {
  background: var(--cyan);
}

.bar-legend .legend-amber {
  background: #f59e0b;
}

.table-card {
  padding: 24px;
  background: rgba(19, 35, 58, 0.82);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.mdf-visual-card {
  padding: 24px;
  background: rgba(19, 35, 58, 0.82);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.mdf-visual-note {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.mdf-visual-wrap {
  overflow-x: auto;
}

.mdf-sheet-svg {
  display: block;
  width: 100%;
  min-width: 520px;
  height: auto;
  background: #0b1626;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.mdf-sheet-label {
  fill: #f8fafc;
  font-size: 12px;
  font-weight: 800;
}

.mdf-sheet-small {
  fill: #94a3b8;
  font-size: 10px;
}

.mdf-piece-label {
  fill: #06101c;
  font-size: 10px;
  font-weight: 900;
  pointer-events: none;
}

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

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

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.09);
  text-align: right;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  font-variant-numeric: tabular-nums;
}

.disclaimer {
  padding: 16px;
  color: var(--muted);
  background: #0b1626;
  border: 1px solid var(--border);
  border-left: 3px solid #f59e0b;
  border-radius: var(--radius);
}

.disclaimer strong {
  color: #f59e0b;
}

.profit-section {
  background: rgba(15, 27, 46, 0.48);
  border-block: 1px solid var(--border);
}

.profit-result-column {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 16px;
}

.profit-results {
  display: grid;
  gap: 16px;
}

.diag-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius);
}

.diag-banner strong {
  display: grid;
  min-width: 44px;
  height: 44px;
  place-items: center;
  border-radius: var(--radius);
  font-size: 0.82rem;
}

.diag-banner h2 {
  margin-bottom: 2px;
  font-size: 1.08rem;
}

.diag-banner p {
  margin-bottom: 0;
  color: var(--muted);
}

.diag-banner.is-good {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.22);
}

.diag-banner.is-good strong {
  color: #04130b;
  background: var(--green);
}

.diag-banner.is-warn {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.22);
}

.diag-banner.is-warn strong {
  color: #1d1402;
  background: #fbbf24;
}

.diag-banner.is-danger {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.22);
}

.diag-banner.is-danger strong {
  color: #230607;
  background: #f87171;
}

.profit-highlight .result-value.is-good {
  color: var(--green);
}

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

.stack-bar {
  display: flex;
  height: 12px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.18);
  border-radius: 999px;
}

.stack-bar span {
  min-width: 0;
  height: 100%;
}

.stack-bar [data-sb-fixos] {
  background: var(--cyan);
}

.stack-bar [data-sb-var] {
  background: #f87171;
}

.stack-bar [data-sb-lucro] {
  background: var(--green);
}

.stack-legend {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.stack-legend p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.stack-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
}

.legend-red {
  background: #f87171;
}

.legend-green {
  background: var(--green);
}

.pe-block,
.projection-card {
  padding: 20px;
  background: rgba(19, 35, 58, 0.82);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.pe-block span,
.projection-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pe-block strong {
  display: block;
  margin-top: 8px;
  color: #a78bfa;
  font-size: 1.6rem;
}

.pe-block p {
  margin: 6px 0 0;
  color: var(--muted);
}

.projection-card h3 {
  margin-bottom: 14px;
}

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

.projection-grid article {
  padding: 14px;
  text-align: center;
  background: #0b1626;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.projection-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 0.98rem;
}

.checklist-section {
  background: rgba(15, 27, 46, 0.48);
  border-block: 1px solid var(--border);
}

.checklist-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(310px, 0.9fr);
  gap: 24px;
  align-items: start;
}

.checklist-main,
.progress-card,
.checklist-actions-card {
  padding: 24px;
  background: rgba(19, 35, 58, 0.82);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.checklist-sidebar {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 16px;
}

.checklist-sections {
  display: grid;
  gap: 16px;
}

.checklist-group {
  padding: 18px;
  background: rgba(8, 17, 31, 0.28);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.checklist-group-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.checklist-group-header h3 {
  margin-bottom: 2px;
}

.checklist-group-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.checklist-count {
  flex: 0 0 auto;
  padding: 5px 9px;
  color: #dffce8;
  font-size: 0.78rem;
  font-weight: 900;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 999px;
}

.checklist-items {
  display: grid;
  gap: 8px;
}

.checklist-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  background: #0b1626;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--radius);
}

.checklist-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--green);
}

.checklist-item label {
  color: #dce8f4;
  font-size: 0.96rem;
  line-height: 1.45;
  cursor: pointer;
}

.checklist-item.is-done label {
  color: var(--muted);
  text-decoration: line-through;
}

.remove-custom-item {
  min-width: 32px;
  height: 32px;
  color: #fecaca;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: var(--radius);
  cursor: pointer;
}

.progress-card strong {
  display: block;
  margin-bottom: 14px;
  color: var(--green);
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1;
}

.progress-card p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
}

.checklist-progress-fill {
  background: linear-gradient(90deg, var(--cyan), var(--green));
}

.checklist-actions-card {
  display: grid;
  gap: 10px;
}

.checklist-actions-card .button,
.progress-card .button {
  width: 100%;
}

@media (max-width: 960px) {
  .hero-grid,
  .tool-layout,
  .content-grid,
  .calculator-layout,
  .generator-layout,
  .price-m2-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

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

  .calculator-help {
    position: static;
  }

  .preview-column {
    position: static;
  }

  .profit-result-column {
    position: static;
  }

  .price-m2-results-column {
    position: static;
  }

  .checklist-layout {
    grid-template-columns: 1fr;
  }

  .checklist-sidebar {
    position: static;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: 72px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px;
    background: #0d192a;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  .nav-menu.is-open {
    display: flex;
  }

  .nav-menu a {
    padding: 13px 12px;
  }

  .section {
    padding: 62px 0;
  }

  .hero {
    min-height: auto;
    padding-top: 42px;
  }

  .hero-actions,
  .footer-links {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

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

  .tool-card {
    min-height: auto;
  }

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

  .budget-item-row {
    grid-template-columns: minmax(0, 1fr) 64px 42px;
  }

  .mdf-piece-row {
    grid-template-columns: minmax(0, 1fr) 74px 74px 58px 42px;
  }

  .mdf-result-hero {
    grid-template-columns: 1fr;
  }

  .profit-metrics,
  .price-m2-metrics,
  .market-reference-grid,
  .projection-grid {
    grid-template-columns: 1fr;
  }

  .preview-header {
    display: grid;
  }

  .slider-row {
    grid-template-columns: 1fr;
  }

  .slider-value {
    text-align: left;
  }

  .calculator-card,
  .calculator-help,
  .price-m2-hero,
  .price-m2-total,
  .market-reference,
  .result-highlight,
  .breakdown,
  .cta-block {
    padding: 20px;
  }

  .price-m2-total,
  .price-m2-bar-row {
    grid-template-columns: 1fr;
  }

  .price-m2-total {
    display: grid;
  }

  .price-m2-bar-row strong {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  .site-header,
  .tool-hero,
  .generator-form,
  .preview-header,
  .preview-placeholder,
  .legal-note,
  .cta-block,
  .faq-section,
  .related-tools-section,
  .site-footer {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }

  .generator-section,
  .generator-layout,
  .preview-column,
  .preview-card {
    display: block;
    padding: 0;
    background: #fff;
    border: 0;
    box-shadow: none;
  }

  .preview-box {
    max-height: none;
    min-height: 0;
    padding: 0;
    color: #000;
    background: #fff;
    border: 0;
    font-size: 11pt;
  }
}
