:root {
  --bg: #f4f6f8;
  --panel: #fbfcfd;
  --card: #f5f8fb;
  --ink: #1a232e;
  --muted: #5b6672;
  --line: #d6dde5;
  --border: #d6dde5;
  --soft-shadow: 0 20px 42px rgba(20, 36, 58, 0.08);
  --warn: #9b6a08;
  --safe: #146a3a;
  --danger: #9f2f2f;
  --accent: #2f6ea6;
  --accent-soft: #edf4fb;
  --cobalt: #2f6ea6;
  --teal: #3c8197;
  --amber: #d09332;
  --surface-glow: 0 10px 24px rgba(31, 49, 74, 0.08);
  --deep-shadow: 0 18px 38px rgba(28, 43, 64, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Manrope, sans-serif;
  color: var(--ink);
  line-height: 1.4;
  background:
    radial-gradient(circle at 8% 0%, #f8fbff 0%, rgba(248, 251, 255, 0) 48%),
    radial-gradient(circle at 95% 10%, #eef5fb 0%, rgba(238, 245, 251, 0) 42%),
    linear-gradient(180deg, #f5f7fa 0%, #edf1f5 100%);
}

.page-wrap {
  padding: 1.8rem 0 3rem;
  animation: pageFade 0.45s ease-out;
}

@keyframes pageFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.phase-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(160deg, #f7fafd, #fcfdff);
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
}

.phase-empty {
  border: 1px dashed #cfd7e0;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  padding: 1rem;
}

.phase-empty-card {
  max-width: 62ch;
}

.phase-empty-card strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.35rem;
  color: #2a3644;
}

.phase-empty-card p {
  margin: 0 0 0.6rem;
  color: var(--muted);
  line-height: 1.5;
}

.phase-empty-card ul {
  margin: 0.25rem 0 0 1.1rem;
  color: var(--muted);
}

.phase-empty-card li {
  margin: 0.25rem 0;
}

.phase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.7rem;
}

.phase-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 0.7rem;
  display: grid;
  gap: 0.45rem;
}

.phase-card h4 {
  margin: 0;
  font-size: 0.95rem;
}

.phase-line {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.phase-line span {
  color: var(--muted);
}

.phase-subhead {
  margin: 0;
  font-size: 0.9rem;
}

.slab-graph {
  display: grid;
  gap: 0.5rem;
}

.slab-row {
  display: grid;
  grid-template-columns: minmax(135px, 1fr) minmax(180px, 3fr) minmax(110px, 1fr);
  gap: 0.6rem;
  align-items: center;
}

.slab-label,
.slab-value {
  margin: 0;
  font-size: 0.8rem;
}

.slab-label {
  color: var(--muted);
}

.slab-value {
  text-align: right;
  font-weight: 600;
}

.slab-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(47, 110, 166, 0.14);
  overflow: hidden;
}

.slab-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cobalt), var(--teal));
}

.progress-graph {
  display: grid;
  gap: 0.45rem;
}

.progress-row {
  display: grid;
  grid-template-columns: 42px minmax(180px, 2fr) minmax(210px, 3fr);
  gap: 0.55rem;
  align-items: center;
}

.progress-label,
.progress-value {
  margin: 0;
  font-size: 0.78rem;
}

.progress-label {
  color: var(--muted);
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(47, 110, 166, 0.12);
}

.progress-spent {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--cobalt));
}

.progress-value {
  font-weight: 600;
}

@media (max-width: 700px) {
  .slab-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

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

  .progress-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

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

.container {
  width: min(1220px, calc(100% - 2.2rem));
  margin: 0 auto;
}

.card-shell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  box-shadow: var(--surface-glow);
}

.top-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.93rem;
  color: #373431;
  margin-bottom: 1rem;
}

.top-meta p {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--cobalt);
}

.desk-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.36rem 0.68rem;
  border-radius: 999px;
  border: 1px solid #cfd9e4;
  background: linear-gradient(180deg, #ffffff 0%, #f1f6fc 100%);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.live-clock {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  font-weight: 700;
  color: #2e3f53;
}

.top-nav {
  padding: 1.15rem 1.3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  align-items: center;
  backdrop-filter: blur(8px);
  background:
    radial-gradient(circle at 16% 0%, rgba(47, 110, 166, 0.08) 0%, rgba(47, 110, 166, 0) 38%),
    var(--panel);
}

.logo {
  margin: 0;
  font-family: Anton, sans-serif;
  letter-spacing: 0.09em;
  font-size: 3.6rem;
  line-height: 1;
  text-align: center;
  color: #000;
}

.logo-sub {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  text-align: center;
  max-width: 72ch;
}

.nav-meta {
  margin-top: 0.55rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #cfd8e3;
  border-radius: 999px;
  padding: 0.24rem 0.58rem;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 0%, #edf4fb 100%);
  color: #34516f;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: center;
}

.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  opacity: 0.9;
  transition: opacity 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover {
  opacity: 1;
  color: var(--cobalt);
  transform: translateY(-1px);
}

.hero-grid {
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: 1.45fr 0.95fr;
  gap: 1.15rem;
}

.hero-main {
  padding: 2.2rem 2.2rem 2rem;
  background:
    radial-gradient(circle at 92% 12%, rgba(47, 110, 166, 0.1), rgba(47, 110, 166, 0) 42%),
    linear-gradient(180deg, #fcfdff 0%, #f2f6fa 100%);
}

.hero-kicker {
  margin: 0;
  color: var(--cobalt);
  letter-spacing: 0.12em;
  font-weight: 700;
}

h1 {
  margin: 0.4rem 0 0;
  font-family: Sora, sans-serif;
  font-size: clamp(3.1rem, 8.4vw, 7.2rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  max-width: 8.4ch;
}

.hero-copy {
  margin: 1.3rem 0 0;
  color: var(--muted);
  font-size: clamp(1.1rem, 2.2vw, 1.23rem);
  max-width: 37ch;
  line-height: 1.55;
}

.hero-proof {
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  max-width: 780px;
}

.hero-proof-card {
  border: 1px solid #d4d1ce;
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.62rem 0.72rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: riseIn 0.45s ease-out both;
}

.hero-proof-card:nth-child(1) {
  animation-delay: 0.02s;
}

.hero-proof-card:nth-child(2) {
  animation-delay: 0.08s;
}

.hero-proof-card:nth-child(3) {
  animation-delay: 0.14s;
}

.hero-proof-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(40, 34, 30, 0.08);
}

.hero-proof-card:nth-child(1) {
  border-color: #d5dde6;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
}

.hero-proof-card:nth-child(2) {
  border-color: #d5dde6;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
}

.hero-proof-card:nth-child(3) {
  border-color: #d5dde6;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
}

.proof-value {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.proof-label {
  margin: 0.2rem 0 0;
  font-size: 0.79rem;
  color: #55504c;
  line-height: 1.35;
}

.hero-actions {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.soft-btn {
  border: 1px solid #d0cdcb;
  border-radius: 999px;
  padding: 0.78rem 1.28rem;
  color: #262221;
  text-decoration: none;
  font-weight: 700;
  background: linear-gradient(180deg, #ffffff 0%, #f1f6fc 100%);
  transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.soft-btn:hover {
  background: linear-gradient(180deg, #ffffff 0%, #eaf2fb 100%);
  border-color: #abc0d8;
  transform: translateY(-1px);
}

.soft-btn:active,
.unit-btn:active,
.tier:active,
.ghost:active,
.primary:active {
  transform: translateY(0);
}

.hero-side {
  padding: 1.5rem;
  display: grid;
  gap: 1rem;
  align-content: start;
}

.feature-card {
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
  padding: 1.35rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: riseIn 0.5s ease-out both;
}

.feature-card:nth-child(1) {
  animation-delay: 0.03s;
}

.feature-card:nth-child(2) {
  animation-delay: 0.09s;
}

.feature-card:nth-child(3) {
  animation-delay: 0.15s;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(41, 34, 30, 0.08);
}

.feature-card:nth-child(1) {
  border-color: #d5dde6;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
}

.feature-card:nth-child(2) {
  border-color: #d5dde6;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
}

.feature-card:nth-child(3) {
  border-color: #d5dde6;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
}

.feature-card h3 {
  margin: 0;
  font-size: clamp(1.15rem, 2.2vw, 2.9rem);
  line-height: 1;
}

.feature-tag {
  margin: 0 0 0.45rem;
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--cobalt);
}

.feature-card p {
  margin: 0.65rem 0 0;
  color: #3b3734;
  font-size: 1rem;
  line-height: 1.4;
}

.calculator-shell {
  margin-top: 1.2rem;
  padding: 1.5rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66) 0%, rgba(255, 255, 255, 0.48) 100%),
    radial-gradient(circle at 85% 10%, rgba(47, 110, 166, 0.06) 0%, rgba(47, 110, 166, 0) 44%);
  box-shadow: var(--deep-shadow);
}

.section-head h2 {
  margin: 0;
  font-size: 2.1rem;
}

.section-head p {
  margin: 0.55rem 0 1.25rem;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 1rem;
  align-items: start;
}

.form-card,
.output-card {
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(244, 248, 252, 0.9) 100%),
    radial-gradient(circle at 85% 8%, rgba(47, 110, 166, 0.05) 0%, rgba(47, 110, 166, 0) 36%);
  padding: 1.1rem;
}

.form-card {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  scroll-padding-top: 5.5rem;
}

.form-card::-webkit-scrollbar {
  width: 8px;
}

.form-card::-webkit-scrollbar-thumb {
  background: #cbc5be;
  border-radius: 999px;
}

h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

h3 {
  margin: 1.1rem 0 0.5rem;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--cobalt);
}

.form-ux-head {
  position: sticky;
  top: -0.1rem;
  z-index: 8;
  background: linear-gradient(180deg, rgba(247, 251, 255, 0.98) 0%, rgba(247, 251, 255, 0.95) 88%, rgba(247, 251, 255, 0) 100%);
  padding: 0 0 0.7rem;
  margin-bottom: 0.5rem;
}

.form-title {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.01em;
  font-size: 1rem;
  color: #1e2f45;
}

.form-jump {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.form-jump a {
  text-decoration: none;
  border: 1px solid #cfd9e4;
  border-radius: 999px;
  padding: 0.24rem 0.56rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #35597b;
  background: linear-gradient(180deg, #ffffff 0%, #edf4fb 100%);
}

.form-jump a:hover {
  border-color: #b5c7db;
  color: #1f4d76;
}

.form-card h3 {
  position: relative;
  margin: 1.25rem 0 0.65rem;
  padding: 0.42rem 0.62rem;
  border: 1px solid #d2dbe5;
  border-radius: 0.6rem;
  background: linear-gradient(180deg, #ffffff 0%, #f0f6fd 100%);
  font-size: 0.86rem;
}

.form-card h3::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(180deg, #2f6ea6 0%, #3c8197 100%);
  margin-right: 0.48rem;
  transform: translateY(-1px);
}

.muted {
  margin: 0.35rem 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.unit-switch,
.tier-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.unit-btn,
.tier,
.ghost,
.primary {
  border: 1px solid #ccc8c5;
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.48rem 0.8rem;
  cursor: pointer;
  font: inherit;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.mode-switch {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.mode-switch label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.35rem 0.6rem;
  border: 1px solid #ccc8c5;
  border-radius: 999px;
  background: #fff;
}

.mode-switch input {
  width: auto;
  margin: 0;
}

.head-actions {
  display: flex;
  gap: 0.45rem;
}

.ghost:hover,
.unit-btn:hover,
.tier:hover {
  transform: translateY(-1px);
  border-color: #b8b2ab;
}

.unit-btn.active,
.tier.active {
  background: linear-gradient(90deg, var(--cobalt) 0%, #3f78ad 100%);
  color: #fff;
  border-color: transparent;
}

label {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.84rem;
  font-weight: 600;
  color: #2b3745;
}

input,
select {
  width: 100%;
  border: 1px solid #cdcac8;
  border-radius: 0.6rem;
  padding: 0.66rem 0.7rem;
  margin-top: 0.35rem;
  font: inherit;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(44, 110, 145, 0.3);
  outline-offset: 1px;
  border-color: #5f8fc7;
  box-shadow: 0 0 0 3px rgba(43, 95, 171, 0.14);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.25rem 0 0.8rem;
  font-weight: 600;
  border: 1px solid #d4dde7;
  border-radius: 0.65rem;
  background: linear-gradient(180deg, #ffffff 0%, #f3f8fd 100%);
  padding: 0.5rem 0.62rem;
}

.toggle-row input {
  width: auto;
  margin: 0;
}

.smart-tools {
  border: 1px solid #d4d1ce;
  border-radius: 0.9rem;
  background: #fcfbf8;
  padding: 0.75rem;
  margin-bottom: 0.9rem;
}

.smart-tools.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.preset-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.preset-btn {
  border: 1px solid #ccc8c5;
  border-radius: 999px;
  background: #fff;
  padding: 0.44rem 0.8rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.preset-btn:hover {
  background: #edf4fb;
  border-color: #b1c6dd;
}

.slider-grid label {
  margin-bottom: 0.55rem;
}

.area-guide {
  border: 1px solid #d4d1ce;
  border-radius: 0.8rem;
  background: linear-gradient(180deg, #ffffff 0%, #edf5fd 100%);
  padding: 0.65rem 0.75rem;
  margin: 0.2rem 0 0.9rem;
}

.area-guide p {
  margin: 0;
  color: #3f3a36;
  font-size: 0.88rem;
  line-height: 1.45;
}

.mix-note {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px dashed #d7d3d0;
}

.cashflow-panel {
  border: 1px solid #d4d1ce;
  border-radius: 0.8rem;
  background: #fbfbfb;
  padding: 0.8rem;
  margin: 0.3rem 0 0.9rem;
}

.loan-panel {
  border: 1px solid #d4d1ce;
  border-radius: 0.8rem;
  background: #fbfbfb;
  padding: 0.8rem;
  margin: 0.3rem 0 0.9rem;
}

.loan-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 0.55rem;
  margin: 0.45rem 0 0.75rem;
}

.loan-table-wrap {
  overflow: auto;
  border: 1px solid #d7d3d0;
  border-radius: 0.7rem;
}

.loan-table {
  min-width: 1050px;
  font-size: 0.8rem;
}

.loan-table.compact {
  min-width: 700px;
}

.loan-table th,
.loan-table td {
  white-space: nowrap;
}

.loan-table th {
  background: #ece9e7;
  position: sticky;
  top: 0;
  z-index: 1;
}

.loan-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.loan-table tbody tr:nth-child(even) {
  background: #fbfaf9;
}

.cashflow-cell.pos {
  color: #1f6a3a;
  font-weight: 700;
}

.cashflow-cell.neg {
  color: #8f2f2f;
  font-weight: 700;
}

.compare-panel {
  border: 1px solid #d4d1ce;
  border-radius: 0.8rem;
  background: #fbfbfb;
  padding: 0.8rem;
  margin: 0.3rem 0 0.9rem;
}

.compare-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.compare-head h3 {
  margin: 0;
}

.compare-head p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.compare-card {
  border: 1px solid #d4d1ce;
  border-radius: 0.8rem;
  background: linear-gradient(180deg, #ffffff 0%, #faf9f7 100%);
  padding: 0.85rem;
}

.compare-card pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
}

.compare-card.empty {
  background: #f8f5f0;
  color: var(--muted);
}

.compare-card h4 {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
}

.compare-value {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.42rem 0;
  border-top: 1px solid #ece8e3;
  font-size: 0.86rem;
}

.compare-value:first-of-type {
  border-top: 0;
}

.compare-value span {
  color: var(--muted);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid #d4d1ce;
}

.status-chip.ok {
  color: #1f6a3a;
  background: #eef9f2;
  border-color: #b7dcc7;
}

.status-chip.na {
  color: #58524d;
  background: #f5f2ee;
}

.status-chip.warn {
  color: #8c5e06;
  background: #fff5e6;
  border-color: #f2d6ab;
}

.trace-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.trace-item {
  border: 1px solid #d4d1ce;
  border-radius: 0.7rem;
  background: #fff;
  padding: 0.7rem;
}

.trace-item summary {
  cursor: pointer;
  font-weight: 700;
  color: #2a3644;
}

.trace-item p {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.viz-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.viz-card {
  border: 1px solid #d4d1ce;
  border-radius: 0.85rem;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  padding: 0.85rem;
}

.viz-card h4 {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
}

.viz-card p {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.4;
}

.gauge-wrap {
  display: flex;
  justify-content: center;
  margin: 0.3rem 0 0;
}

.gauge {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  padding: 10px;
}

.gauge-hole {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-content: center;
  text-align: center;
  border: 1px solid #d8dde3;
}

.gauge-hole strong {
  font-size: 1rem;
  line-height: 1.05;
}

.gauge-hole span {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.74rem;
}

.stack-track {
  margin-top: 0.45rem;
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  background: #e8edf2;
}

.stack-track span {
  height: 100%;
}

.stack-land {
  background: #2f7f4f;
}

.stack-construction {
  background: #2f6ea6;
}

.stack-finance {
  background: #d09332;
}

.stack-legend {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.25rem;
}

.stack-legend p {
  margin: 0;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.stack-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.35rem;
  display: inline-block;
}

.stack-legend .dot.land {
  background: #2f7f4f;
}

.stack-legend .dot.construction {
  background: #2f6ea6;
}

.stack-legend .dot.finance {
  background: #d09332;
}

.scenario-bar-grid {
  display: grid;
  gap: 0.45rem;
}

.scenario-bar-row {
  display: grid;
  grid-template-columns: 88px 1fr 92px;
  align-items: center;
  gap: 0.5rem;
}

.scenario-bar-row p,
.scenario-bar-row strong {
  margin: 0;
  font-size: 0.79rem;
}

.scenario-bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e9edf3;
  overflow: hidden;
}

.scenario-bar {
  display: block;
  height: 100%;
}

.scenario-bar.pos {
  background: linear-gradient(90deg, #2b8a66, #2f6ea6);
}

.scenario-bar.neg {
  background: linear-gradient(90deg, #a4473d, #cc6a54);
}

.trend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.trend-card {
  border: 1px solid #d4d1ce;
  border-radius: 0.8rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 0.75rem;
}

.trend-card h4 {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
}

.sparkline {
  width: 100%;
  height: 110px;
  border-radius: 0.6rem;
  background: #f4f8fd;
  border: 1px solid #e2e8f0;
}

.sparkline .spark-line {
  stroke-width: 2.5;
}

.sparkline .spark-area {
  opacity: 0.2;
}

.sparkline.blue .spark-line {
  stroke: #2f6ea6;
}

.sparkline.blue .spark-area {
  fill: #2f6ea6;
}

.sparkline.teal .spark-line {
  stroke: #2b8a66;
}

.sparkline.teal .spark-area {
  fill: #2b8a66;
}

.sparkline.amber .spark-line {
  stroke: #d09332;
}

.sparkline.amber .spark-area {
  fill: #d09332;
}

.sparkline.slate .spark-line {
  stroke: #5a6f84;
}

.sparkline.slate .spark-area {
  fill: #5a6f84;
}

.trend-meta {
  margin-top: 0.45rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8rem;
}

.trend-meta span {
  color: var(--muted);
}

.trend-meta .pos {
  color: #1f6a3a;
}

.trend-meta .neg {
  color: #8f2f2f;
}

.trend-foot {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.trend-foot p {
  margin: 0;
}

.risk-score-panel {
  border: 1px solid #d4d1ce;
  border-radius: 0.8rem;
  background: linear-gradient(180deg, #ffffff 0%, #f9f7f4 100%);
  padding: 0.9rem;
  margin: 0.3rem 0 0.9rem;
}

.risk-score-panel.safe {
  border-color: #a8d3b8;
}

.risk-score-panel.borderline {
  border-color: #dfc27b;
}

.risk-score-panel.weak {
  border-color: #d69b9b;
}

.risk-score-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.risk-score-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.risk-score-head h3 {
  margin: 0.15rem 0 0;
  font-size: 1.15rem;
}

.risk-score-badge {
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cobalt) 0%, var(--teal) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 4px 12px rgba(47, 110, 166, 0.28);
}

.risk-score-track {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #ece7e1;
  margin: 0.7rem 0 0.5rem;
}

.risk-score-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #b24747 0%, #b4871f 52%, #2f7f4f 100%);
}

.risk-score-foot {
  display: grid;
  gap: 0.2rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.risk-score-foot p {
  margin: 0;
}

.pricing-panel {
  margin: 0.3rem 0 0.9rem;
}

.pricing-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pricing-card {
  border: 1px solid #d4d1ce;
  border-radius: 0.8rem;
  background: linear-gradient(180deg, #ffffff 0%, #f2f7fc 100%);
  padding: 0.9rem 1rem;
  width: min(100%, 560px);
  text-align: center;
}

.pricing-card:nth-child(2) {
  background: linear-gradient(180deg, #ffffff 0%, #f2f7fc 100%);
  border-color: #d4dce5;
}

.pricing-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pricing-value {
  margin: 0.35rem 0 0;
  font-size: 1.45rem;
  line-height: 1.1;
  font-weight: 800;
}

.pricing-note {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.mix-panel {
  border: 1px solid #d4d1ce;
  border-radius: 0.8rem;
  background: #fbfbfb;
  padding: 0.8rem;
  margin: 0.3rem 0 0.9rem;
}

.mix-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.65rem 0;
}

.mix-card {
  border: 1px solid #d7d3d0;
  border-radius: 0.75rem;
  background: #fff;
  padding: 0.75rem;
}

.mix-card h4 {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
}

.mix-line {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  border-top: 1px solid #ece8e3;
  padding: 0.32rem 0;
  font-size: 0.83rem;
}

.mix-line:first-of-type {
  border-top: 0;
}

.mix-line span {
  color: var(--muted);
}

.mix-footer {
  display: grid;
  gap: 0.45rem;
}

.cashflow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 0.55rem;
}

.heatmap-panel {
  border: 1px solid #d4d1ce;
  border-radius: 0.8rem;
  background: #fbfbfb;
  padding: 0.8rem;
  margin: 0.3rem 0 0.9rem;
}

.heatmap-legend {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  font-size: 0.84rem;
  margin: 0.35rem 0 0.6rem;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.35rem;
}

.dot.safe {
  background: #2f7f4f;
}

.dot.caution {
  background: #b4871f;
}

.dot.risky {
  background: #b24747;
}

.heatmap-wrap {
  overflow: auto;
}

.heatmap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.heatmap-table th,
.heatmap-table td {
  border: 1px solid #d7d3d0;
  padding: 0.45rem;
  text-align: center;
}

.heat-safe {
  background: #e6f6ea;
}

.heat-caution {
  background: #fff6df;
}

.heat-risky {
  background: #fde8e8;
}

.inline-value {
  display: inline-block;
  margin-top: 0.35rem;
  color: #292624;
  font-weight: 600;
}

.primary {
  margin-top: 0.4rem;
  width: 100%;
  border-radius: 0.85rem;
  font-weight: 700;
  background: linear-gradient(110deg, var(--cobalt) 0%, var(--teal) 100%);
  color: #fff;
  border-color: transparent;
}

.primary:hover {
  background: linear-gradient(110deg, #285f8f 0%, #356f81 100%);
}

.output-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f8f7f4;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid #ddd8d2;
  margin-bottom: 0.7rem;
}

.head-actions {
  flex-wrap: wrap;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 0.6rem;
  margin: 0.9rem 0;
}

.split-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
  margin: 0.6rem 0 0.9rem;
}

.split-chart-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border: 1px solid #d4d1ce;
  border-radius: 1rem;
  background: linear-gradient(180deg, #fffdfb 0%, #f2f6fc 100%);
}

.split-pie {
  width: 140px;
  aspect-ratio: 1;
  border-radius: 50%;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75);
}

.split-pie-hole {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #fbfaf8;
  border: 1px solid #e3dfdb;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  text-align: center;
  box-shadow: 0 6px 16px rgba(34, 29, 26, 0.08);
}

.split-pie-hole span {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.split-pie-hole strong {
  font-size: 1.05rem;
  line-height: 1;
}

.split-summary {
  display: grid;
  gap: 0.5rem;
}

.split-summary p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.dot.land {
  background: #2f7f4f;
}

.dot.construction {
  background: #6f6f6f;
}

.dot.finance {
  background: #2b6cb0;
}

@media (max-width: 760px) {
  .split-chart-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .split-summary {
    justify-self: start;
  }
}

.waterfall-panel {
  border: 1px solid #d4d1ce;
  border-radius: 0.8rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8f8f8 100%);
  padding: 0.8rem;
  margin: 0.3rem 0 0.9rem;
}

.waterfall-grid {
  display: grid;
  gap: 0.45rem;
}

.wf-row {
  display: grid;
  grid-template-columns: 170px 1fr 150px;
  gap: 0.55rem;
  align-items: center;
}

.wf-label,
.wf-value {
  margin: 0;
  font-size: 0.84rem;
}

.wf-label {
  color: #3e3a37;
  font-weight: 600;
}

.wf-value {
  text-align: right;
  font-weight: 700;
  color: #252220;
}

.wf-track {
  width: 100%;
  height: 13px;
  border-radius: 999px;
  background: #ebe9e7;
  overflow: hidden;
}

.wf-bar {
  height: 100%;
  border-radius: 999px;
}

.wf-revenue {
  background: #2f7f4f;
}

.wf-deduction {
  background: #b4871f;
}

.wf-net {
  background: #24695f;
}

.wf-cost {
  background: #8b5a4a;
}

.wf-profit {
  background: #2b7a3e;
}

.wf-loss {
  background: #b24747;
}

.scenarios {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.scenario {
  border: 1px solid #d4d1ce;
  border-radius: 0.7rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8f6f2 100%);
  padding: 0.55rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.scenario:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(36, 30, 27, 0.09);
}

.scenario:nth-child(1) {
  border-color: #d5dde6;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
}

.scenario:nth-child(2) {
  border-color: #d5dde6;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
}

.scenario:nth-child(3) {
  border-color: #d5dde6;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
}

.scenario h4 {
  margin: 0;
  font-size: 0.9rem;
}

.scenario p {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.kpi {
  border: 1px solid #d4d1ce;
  border-radius: 0.75rem;
  padding: 0.6rem;
  background: linear-gradient(180deg, #fff 0%, #f8f7f3 100%);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(38, 31, 26, 0.09);
}

.kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 3px;
  width: 100%;
  border-radius: 0.75rem 0.75rem 0 0;
  background: linear-gradient(90deg, rgba(43, 95, 171, 0.62), rgba(31, 136, 113, 0.62));
}

.kpi .k {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.kpi .v {
  margin: 0.25rem 0 0;
  font-weight: 700;
  font-size: 1rem;
}

.risk-panel {
  border-left: 4px solid var(--warn);
  background: #fff6df;
  border-radius: 0.6rem;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.9rem;
  font-size: 0.9rem;
}

.risk-panel.safe {
  border-left-color: var(--safe);
  background: #eaf8ef;
}

.risk-panel.risky {
  border-left-color: var(--danger);
  background: #fceaea;
}

.table-wrap {
  overflow: auto;
  max-height: 58vh;
  border: 1px solid #d6d1ca;
  border-radius: 0.85rem;
  background: #fff;
}

.boq-empty {
  padding: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  color: #2a3644;
}

.boq-empty strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.98rem;
}

.boq-empty p {
  margin: 0 0 0.6rem;
  color: var(--muted);
  line-height: 1.5;
}

.boq-empty ul {
  margin: 0.25rem 0 0 1.1rem;
  color: var(--muted);
}

.boq-empty li {
  margin: 0.25rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}

th,
td {
  border-bottom: 1px solid #d4d1ce;
  padding: 0.52rem;
  text-align: left;
}

.rate-edit {
  width: 110px;
  margin: 0;
  padding: 0.32rem 0.4rem;
  border-radius: 0.45rem;
}

th {
  position: sticky;
  top: 0;
  background: #ece9e7;
  backdrop-filter: blur(2px);
}

tbody tr:nth-child(even) {
  background: #fafafa;
}

tfoot td {
  font-weight: 700;
}

.disclaimer {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0.85rem 0 0;
}

.site-footer {
  margin-top: 1rem;
  padding: 0.45rem 0 0.2rem;
  text-align: center;
}

.footer-brand {
  margin: 0;
  font-family: Anton, sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.08em;
  color: #000;
}

.info-card {
  margin-top: 1rem;
  padding: 1.35rem;
}

.about-logo {
  margin: 0 0 0.55rem;
  font-family: Anton, sans-serif;
  font-size: clamp(3.6rem, 10vw, 6rem);
  letter-spacing: 0.08em;
  text-align: center;
  color: #000;
}

.about-intro {
  margin: 0.35rem 0;
  color: var(--cobalt);
  text-align: center;
  font-size: 1.01rem;
}

.about-points {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.6rem;
}

.about-points p {
  margin: 0;
  color: #3f3a36;
  text-align: center;
  border: 1px solid #d5d1cc;
  border-radius: 0.75rem;
  padding: 0.62rem 0.75rem;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9fc 100%);
}

.about-points p:nth-child(2) {
  background: linear-gradient(180deg, #ffffff 0%, #f5f9fc 100%);
}

.about-points p:nth-child(3) {
  background: linear-gradient(180deg, #ffffff 0%, #f5f9fc 100%);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

  .form-card {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .summary {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

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

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

  .cashflow-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

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

  .viz-grid,
  .trend-grid {
    grid-template-columns: 1fr;
  }

  .wf-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

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

@media (max-width: 760px) {
  .top-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
  }

  .top-nav {
    flex-direction: column;
    align-items: center;
  }

  .nav-links {
    gap: 1.1rem;
  }

  .logo {
    font-size: 2.9rem;
  }

  h1 {
    font-size: clamp(2.3rem, 14vw, 3.8rem);
  }

  .hero-main {
    padding: 1.45rem;
  }

  .calculator-shell {
    padding: 1rem;
  }

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

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

  .scenario-bar-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
}
