:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --card: #ffffff;
  --ink: #172033;
  --muted: #5d6b82;
  --line: #d9e2ef;
  --brand: #2457c5;
  --brand-dark: #183f92;
  --accent: #e9f1ff;
  --error: #b42318;
  --shadow: 0 20px 45px rgba(24, 47, 86, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, #eef4ff 0%, var(--bg) 44%, #ffffff 100%);
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
}

.intro {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.calculator-card {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 24px;
  align-items: stretch;
  padding: 24px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(217, 226, 239, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.input-panel,
.result-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
}

.field-group {
  margin-bottom: 18px;
}

label {
  display: inline-block;
  margin-bottom: 8px;
  font-weight: 700;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrap:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(36, 87, 197, 0.13);
}

.input-wrap span {
  color: var(--muted);
  font-weight: 700;
}

.input-wrap input {
  width: 100%;
  min-height: 46px;
  border: 0;
  outline: 0;
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  background: transparent;
}

.input-wrap.suffix input {
  text-align: left;
}

.error-message {
  min-height: 1.15rem;
  margin: 6px 0 0;
  color: var(--error);
  font-size: 0.88rem;
  font-weight: 700;
}

.clear-button {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--brand);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.clear-button:hover,
.clear-button:focus-visible {
  background: var(--brand-dark);
}

.clear-button:active {
  transform: translateY(1px);
}

.result-panel {
  display: grid;
  gap: 16px;
  background: linear-gradient(160deg, #173064 0%, #2457c5 100%);
  color: #fff;
}

.result {
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.primary-result {
  background: #fff;
  color: var(--ink);
}

.result-label {
  display: block;
  margin-bottom: 8px;
  color: inherit;
  opacity: 0.78;
  font-weight: 700;
}

.result strong {
  display: block;
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.schedule-card {
  margin-top: 24px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.schedule-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.schedule-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.schedule-actions {
  display: flex;
  gap: 10px;
}

.schedule-actions button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--brand);
  border-radius: 12px;
  color: var(--brand);
  background: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.schedule-actions button:hover:not(:disabled),
.schedule-actions button:focus-visible:not(:disabled) {
  color: #fff;
  background: var(--brand);
}

.schedule-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.schedule-savings {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
}

.schedule-savings:empty {
  display: none;
}

.schedule-details {
  margin-top: 16px;
}

.schedule-details summary {
  padding: 10px 0;
  color: var(--brand);
  font-weight: 800;
  cursor: pointer;
}

.schedule-caption {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.schedule-scroll {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  font-variant-numeric: tabular-nums;
}

.schedule-table th,
.schedule-table td {
  padding: 8px 12px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.schedule-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--accent);
  color: var(--ink);
  text-align: right;
}

.schedule-table thead th:first-child,
.schedule-table tbody th {
  text-align: left;
}

.schedule-table tbody th {
  font-weight: 700;
  color: var(--muted);
}

.schedule-table tbody tr:nth-child(even) {
  background: rgba(233, 241, 255, 0.45);
}

@media print {
  .input-panel,
  .schedule-actions,
  .content-slot,
  .hero .eyebrow {
    display: none;
  }

  .schedule-scroll {
    max-height: none;
    overflow: visible;
    border: 0;
  }

  .schedule-details > summary {
    display: none;
  }

  .schedule-table thead th {
    position: static;
  }

  body {
    background: #fff;
  }
}

.content-slot {
  margin-top: 28px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
}

.content-slot h2 {
  margin: 0 0 8px;
  color: var(--ink);
}

.content-slot p {
  margin: 0;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 20px;
  }

  .calculator-card {
    grid-template-columns: 1fr;
    padding: 16px;
  }
}
