:root {
  --bg-start: #f5f2e8;
  --bg-end: #d9e9f2;
  --panel: #ffffff;
  --ink: #14232e;
  --ink-soft: #456070;
  --accent: #03506f;
  --accent-strong: #012a3a;
  --danger: #8d1f1f;
  --border: #c5d4dc;
  --radius: 14px;
  --shadow: 0 10px 24px rgba(1, 42, 58, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, rgba(3, 80, 111, 0.11) 0, transparent 35%),
    linear-gradient(135deg, var(--bg-start), var(--bg-end));
}

.shell {
  width: min(920px, 92vw);
  margin: 2rem auto 3rem;
  display: grid;
  gap: 1rem;
}

.hero {
  padding: 1rem 0.2rem;
}

.brand {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.75rem;
}

h1 {
  margin: 0.35rem 0;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.1;
}

.lede {
  margin: 0;
  color: var(--ink-soft);
  max-width: 60ch;
}

.card,
.ad-slot,
.notice {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.card,
.notice {
  padding: 1rem;
}

.notice p {
  margin: 0;
}

.grid {
  display: grid;
  gap: 0.9rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.field > span {
  font-weight: 700;
}

.hint {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

input,
select,
button {
  font: inherit;
}

input::placeholder {
  color: #6d8797;
}

input,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.75rem;
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus,
button:focus {
  outline: 3px solid rgba(3, 80, 111, 0.22);
  outline-offset: 1px;
}

.actions {
  margin-top: 1rem;
}

button {
  border: none;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  color: #fff;
  border-radius: 999px;
  padding: 0.72rem 1.3rem;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error {
  margin: 0.65rem 0 0;
  color: var(--danger);
  min-height: 1.25rem;
}

.autocomplete {
  position: relative;
}

.suggestions {
  position: absolute;
  z-index: 15;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(1, 42, 58, 0.18);
  max-height: 260px;
  overflow-y: auto;
}

.suggestion-option {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  text-align: left;
  padding: 0.62rem 0.72rem;
  cursor: pointer;
  border-bottom: 1px solid #e8eef2;
}

.suggestion-option:last-child {
  border-bottom: 0;
}

.suggestion-option:hover,
.suggestion-option.active {
  background: #f2f8fb;
}

.suggestion-label {
  font-weight: 700;
  font-size: 0.93rem;
  display: block;
}

.suggestion-meta {
  color: var(--ink-soft);
  font-size: 0.82rem;
  display: block;
  margin-top: 0.1rem;
}

.result h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3.8vw, 2.2rem);
}

.subtitle {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
}

details {
  margin-top: 0.9rem;
}

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

.breakdown {
  margin: 0.7rem 0 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 0.8rem;
}

.breakdown dt {
  margin: 0;
  color: var(--ink-soft);
}

.breakdown dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.assumptions ul {
  margin: 0.7rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.35rem;
  color: var(--ink-soft);
}

.ad-slot {
  padding: 0.85rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

@media (min-width: 760px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }

  .card {
    padding: 1.2rem;
  }
}

@media (max-width: 759px) {
  body {
    background:
      radial-gradient(circle at 20% 10%, rgba(3, 80, 111, 0.11) 0, transparent 35%),
      linear-gradient(135deg, var(--bg-start), var(--bg-end));
  }

  .shell {
    width: min(920px, 92vw);
    margin: 1.25rem auto 2.2rem;
    gap: 1rem;
  }

  .hero {
    padding: 0.95rem 0.2rem;
  }

  h1 {
    font-size: clamp(2rem, 11vw, 2.35rem);
  }

  .lede {
    font-size: 1.01rem;
    line-height: 1.38;
  }

  .card {
    padding: 1rem;
  }

  input,
  select {
    padding: 0.76rem 0.78rem;
    font-size: 1rem;
  }

  .suggestions {
    max-height: 220px;
  }

  .actions {
    margin-top: 0.95rem;
  }

  button {
    width: 100%;
    padding: 0.82rem 1rem;
  }

  .ad-slot {
    font-size: 0.82rem;
    padding: 0.75rem;
  }
}
