:root {
  color-scheme: light;
  --bg: #f5f7f2;
  --ink: #17201b;
  --muted: #657269;
  --line: #dbe2d9;
  --panel: #ffffff;
  --accent: #146c5c;
  --accent-2: #d26a34;
  --blue: #376d9e;
  --shadow: 0 18px 60px rgba(21, 39, 30, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 28px;
}

.workspace {
  max-width: 1180px;
  margin: 0 auto;
}

.topbar,
.panel-header,
.billing-callout,
.strategy-heading,
.extra-pay,
.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 0;
  font-size: clamp(2.1rem, 5vw, 4.6rem);
  line-height: 0.97;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

p {
  color: var(--muted);
  line-height: 1.5;
}

.control-panel,
.strategy-card,
.insight-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.control-panel {
  padding: 20px;
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
}

.ghost-button {
  border: 1px solid var(--line);
  padding: 0 16px;
  background: #fff;
  color: var(--ink);
}

.icon-button {
  width: 42px;
  flex: 0 0 42px;
  background: #f0f3ef;
  color: var(--muted);
}

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

.billing-callout {
  margin-top: 18px;
  border: 1px solid #c8ddd4;
  border-radius: 8px;
  padding: 14px;
  background: #eef7f2;
}

.billing-callout div {
  display: grid;
  gap: 4px;
}

.billing-callout span {
  color: var(--muted);
}

.billing-callout.is-active {
  border-color: #b9d1ec;
  background: #eef5fb;
}

.debt-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) repeat(3, minmax(96px, 0.8fr)) 42px;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.debt-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.debt-row input {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.debt-name {
  align-self: end;
}

.extra-pay {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.extra-pay label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-weight: 800;
}

.extra-pay input {
  width: min(520px, 100%);
  accent-color: var(--accent);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.strategy-card,
.insight-panel {
  padding: 20px;
}

.strategy-tag {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.strategy-heading > strong {
  color: var(--accent);
  font-size: clamp(1.4rem, 3vw, 2rem);
  white-space: nowrap;
}

.metric-row {
  border-top: 1px solid var(--line);
  padding: 14px 0;
  color: var(--muted);
}

.metric-row strong {
  color: var(--ink);
}

.timeline {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.timeline-item {
  display: grid;
  gap: 7px;
}

.timeline-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1eb;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--blue));
}

.insights-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  margin-top: 18px;
}

ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

li {
  border-left: 4px solid var(--accent);
  padding: 10px 12px;
  border-radius: 0 8px 8px 0;
  background: #f7faf6;
  color: var(--muted);
  line-height: 1.45;
}

li strong {
  color: var(--ink);
}

@media (max-width: 860px) {
  .app-shell {
    padding: 18px;
  }

  .topbar,
  .panel-header,
  .billing-callout,
  .extra-pay,
  .strategy-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .debt-row,
  .summary-grid,
  .insights-grid {
    grid-template-columns: 1fr;
  }

  .ghost-button,
  .primary-button {
    width: 100%;
  }
}
