:root {
  --bg: #f5f8fc;
  --text: #0a1930;
  --muted: #5b687b;
  --card: #ffffff;
  --accent: #1974ef;
  --accent-dark: #0b4fb8;
  --border: #dfe6ef;
  --soft: #edf4ff;
  --success: #087d61;
  --danger: #a13f00;
}

* { box-sizing: border-box; }

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 50% 0, #ffffff 0, var(--bg) 48%);
  line-height: 1.6;
}

a { color: inherit; }

button,
input,
select { font: inherit; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #ffcc4d;
  outline-offset: 3px;
}

.site-header {
  min-height: 390px;
  padding: 0 6% 74px;
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(2, 15, 36, .96), rgba(5, 48, 82, .78) 58%, rgba(5, 78, 109, .26)),
    linear-gradient(135deg, #04152d, #087d61);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 84px;
  max-width: 1380px;
  margin: 0 auto 42px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.logo::before {
  content: "";
  width: 39px;
  height: 39px;
  background:
    linear-gradient(90deg, transparent 46%, #72d7ce 47% 53%, transparent 54%),
    linear-gradient(63deg, transparent 45%, #72d7ce 46% 50%, transparent 51%),
    linear-gradient(-63deg, transparent 45%, #72d7ce 46% 50%, transparent 51%);
  border-bottom: 2px solid #72d7ce;
}

.navlinks {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.navlinks a {
  color: #eaf1f9;
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none;
}

.hero {
  max-width: 820px;
  margin: 0 auto 0 max(0px, calc((100% - 1380px) / 2));
}

.eyebrow,
.tag {
  margin: 0 0 12px;
  color: #94e0d9;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2.7rem, 6vw, 5rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero p:not(.eyebrow) {
  max-width: 720px;
  margin: 0;
  color: #e6edf8;
  font-size: 1.1rem;
}

main {
  max-width: 1500px;
  margin: auto;
  padding: 0 6% 70px;
}

.tool-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
  gap: 22px;
  align-items: start;
  margin-top: -46px;
}

.panel {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 12px 34px rgba(8, 30, 65, .09);
}

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

.tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #0b5f52;
  background: #e8fbf8;
}

h2,
h3 {
  margin: 0;
  color: #081a34;
  line-height: 1.2;
}

h2 { font-size: clamp(1.45rem, 3vw, 2rem); }

h3 {
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.result-pill {
  flex: none;
  min-width: 124px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--soft);
  color: var(--accent-dark);
  font-weight: 900;
  text-align: center;
}

.result-pill.success {
  background: #e8fbf8;
  color: var(--success);
}

.result-pill.error {
  background: #fff1e8;
  color: var(--danger);
}

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

.form-section + .form-section { margin-top: 24px; }

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

.form-grid.compact { max-width: 620px; }

label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  min-width: 0;
  color: #102346;
  font-size: .88rem;
  font-weight: 800;
}

label span { grid-column: 1 / -1; }

label small {
  align-self: center;
  min-width: 48px;
  color: var(--muted);
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid #cfdbea;
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
}

.profile-sketch {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfdff;
}

.profile-sketch svg {
  display: block;
  width: 100%;
  min-height: 190px;
}

.sketch-grid-line {
  stroke: #dfe6ef;
  stroke-width: 2;
}

.sketch-vpi-guide {
  stroke: #cbd5e1;
  stroke-width: 2;
  stroke-dasharray: 6 8;
}

.sketch-vpi-marker {
  fill: #ffffff;
  stroke: #64748b;
  stroke-width: 2;
}

.sketch-end-marker {
  fill: #ffffff;
  stroke: #0f172a;
  stroke-width: 2.5;
}

.sketch-curve {
  fill: none;
  stroke: #1974ef;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sketch-tangent {
  stroke: #111827;
  stroke-width: 3.5;
  stroke-dasharray: 12 8;
  stroke-linecap: round;
}

.sketch-label,
.sketch-point-label,
.sketch-type {
  fill: #111827;
  font-size: 16px;
  font-weight: 900;
}

.sketch-point-label {
  fill: #475569;
  font-size: 12px;
}

.sketch-type {
  fill: var(--muted);
  font-size: 14px;
}

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

button {
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(4, 72, 165, .22);
}

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

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

.review-panel {
  position: sticky;
  top: 18px;
}

.review-copy {
  margin: 0 0 18px;
  color: var(--muted);
  font-weight: 700;
}

.summary-list {
  display: grid;
  grid-template-columns: minmax(140px, .8fr) minmax(0, 1fr);
  gap: 9px 16px;
  margin: 0 0 18px;
}

.summary-list dt {
  color: var(--muted);
  font-weight: 800;
}

.summary-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.calc-results {
  margin-bottom: 16px;
}

.empty-results {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.calc-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: .86rem;
}

.calc-table th,
.calc-table td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  vertical-align: top;
}

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

.calc-table th {
  background: var(--soft);
  color: #102346;
  font-weight: 900;
}

.calc-table tr:last-child td {
  border-bottom: 0;
}

.calc-note {
  margin: 12px 0 0;
  padding: 12px;
  border: 2px solid #102346;
  color: #081a34;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.json-details {
  margin-top: 12px;
}

.json-details summary {
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 900;
}

.json-details pre {
  margin-top: 10px;
}

pre {
  min-height: 210px;
  overflow: auto;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #081a34;
  color: #dcecff;
  font-size: .84rem;
  line-height: 1.5;
}

footer {
  padding: 32px 7%;
  background: #061b38;
  color: #aebdd0;
  text-align: center;
}

@media (max-width: 1020px) {
  .tool-shell { grid-template-columns: 1fr; }

  .review-panel { position: static; }
}

@media (max-width: 640px) {
  .site-header { padding-inline: 22px; }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 18px;
  }

  main { padding-inline: 18px; }

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

  label { grid-template-columns: 1fr; }

  label small { min-width: 0; }

  .panel-head { flex-direction: column; }

  .result-pill,
  .actions button { width: 100%; }
}
