:root {
  color-scheme: light;
  --bg: #f6f7f2;
  --surface: #ffffff;
  --text: #1f2722;
  --muted: #647067;
  --line: #dde4da;
  --accent: #147a5b;
  --accent-dark: #0c5f45;
  --danger: #b42318;
  --soft: #e9f5ef;
  --shadow: 0 10px 26px rgba(31, 39, 34, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Poppins", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(246, 247, 242, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  text-decoration: none;
}

.brand img {
  width: auto;
  max-width: 68px;
  height: auto;
  max-height: 48px;
  flex: 0 0 auto;
  object-fit: contain;
}

.menu-toggle {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--accent-dark);
  border-radius: 999px;
}

nav {
  position: absolute;
  top: calc(100% + 1px);
  right: 10px;
  display: none;
  width: min(220px, calc(100vw - 20px));
  padding: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

nav a {
  display: block;
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

nav.open {
  display: grid;
  gap: 4px;
}

nav a.active {
  background: var(--soft);
  color: var(--accent-dark);
}

.app {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 22px 14px 38px;
}

.page-title {
  margin: 6px 0 22px;
  font-size: 27px;
  line-height: 1.15;
}

.page-note {
  margin: 0 0 18px;
  color: var(--muted);
}

.existing-deal-cta {
  display: grid;
  gap: 4px;
  margin: 0 0 24px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  outline: 0;
  text-align: center;
}

.existing-deal-cta p {
  margin: 0;
  color: #7d2440;
  font-size: 14px;
  font-weight: 700;
}

.existing-deal-cta p + p {
  color: #8a4b60;
  font-size: 13px;
  font-weight: 500;
}

.lookup-cta-button {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid #8a2f4b;
  border-radius: 8px;
  color: #7d2440;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.lookup-cta-button:hover {
  background: rgba(138, 47, 75, 0.07);
}

.card {
  margin: 14px 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.grid {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-weight: 700;
}

label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid #cfd8d0;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(20, 122, 91, 0.16);
}

.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  background: var(--soft);
  border-radius: 8px;
  font-weight: 800;
}

.total strong {
  font-size: 24px;
}

.step-progress {
  display: grid;
  gap: 9px;
  margin: 12px 0 2px;
}

.step-label {
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  background: var(--line);
  border-radius: 999px;
}

.progress-fill {
  height: 100%;
  width: 25%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 180ms ease;
}

.step-panel[hidden] {
  display: none;
}

.deal-step {
  margin: 18px 0 0;
}

.deal-step h2 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
}

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

.actions .button {
  margin-top: 0;
}

.actions .button:only-child {
  grid-column: 1 / -1;
}

.button {
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 17px;
  font-weight: 800;
}

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

.button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.button.secondary {
  background: #ffffff;
  color: var(--accent-dark);
  border: 1px solid var(--accent);
}

.button.secondary:hover {
  background: var(--soft);
}

.message {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #eef5ff;
  color: #17456f;
  font-weight: 700;
}

.message.error {
  background: #fff1f0;
  color: var(--danger);
}

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

.result-item {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.result-item dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.result-item dd {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.summary-section {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.summary-section h3 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 15px;
}

.summary-line {
  margin: 0;
  color: var(--text);
  font-weight: 700;
}

.summary-line span {
  color: var(--muted);
  font-weight: 600;
}

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

.site-footer {
  margin-top: 12px;
  padding: 24px 16px 30px;
  background: #ffffff;
  border-top: 1px solid var(--line);
  color: var(--accent-dark);
  text-align: center;
}

.site-footer p {
  width: min(100%, 760px);
  margin: 0 auto 8px;
  font-size: 14px;
  font-weight: 700;
}

.site-footer p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 600;
}

@media (min-width: 680px) {
  .topbar {
    padding-inline: 26px;
  }

  .brand img {
    max-width: 78px;
  }

  nav {
    gap: 8px;
  }

  nav a {
    padding-inline: 10px;
    font-size: 14px;
  }

  .app {
    padding-top: 28px;
  }

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

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

  .page-title {
    font-size: 32px;
  }
}

@media (min-width: 769px) {
  .menu-toggle {
    display: none;
  }

  nav {
    position: static;
    display: flex;
    width: auto;
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  nav.open {
    display: flex;
  }

  nav a {
    padding: 8px 10px;
    font-size: 14px;
  }
}
