:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #64716e;
  --line: #dbe4df;
  --paper: #fbfcfa;
  --panel: #ffffff;
  --mint: #1e8a6a;
  --gold: #d99a25;
  --coral: #d85f48;
  --blue: #3478b8;
  --shadow: 0 18px 55px rgba(28, 45, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(30, 138, 106, 0.14), transparent 34%),
    linear-gradient(315deg, rgba(216, 95, 72, 0.13), transparent 28%),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.planner,
.simulator {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.planner {
  border-radius: 8px;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--mint);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.25rem;
}

.currency-toggle {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f8f5;
}

.currency-toggle button {
  min-width: 72px;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.currency-toggle .active {
  background: var(--ink);
  color: white;
}

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 430px) 1fr;
}

.input-panel,
.dashboard,
.simulator {
  padding: 24px;
}

.input-panel {
  border-right: 1px solid var(--line);
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(30, 138, 106, 0.13);
}

.submit-btn {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  background: var(--mint);
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 14px;
  transition: background 0.2s;
}

.submit-btn:hover {
  background: #167a5a;
}

.submit-btn:active {
  background: #136650;
}

.score-row {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 14px;
}

.score-card,
.safe-spend,
.city-card {
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
}

.future-card {
  min-height: 80px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
}

.score-card span,
.safe-spend span,
.city-card span,
.future-card span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.score-card strong,
.safe-spend strong,
.city-card strong {
  display: block;
  margin-top: 9px;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.future-card strong {
  display: block;
  margin-top: 7px;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.city-card {
  min-height: auto;
  margin-top: 14px;
  background: #f8fbfa;
}

.city-card strong {
  font-size: clamp(1.35rem, 3vw, 2rem);
}

small {
  color: var(--muted);
}

.bars {
  display: grid;
  gap: 12px;
  margin: 22px 0;
}

.bar-row {
  display: grid;
  gap: 7px;
}

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

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

.fill {
  height: 100%;
  border-radius: inherit;
}

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

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

.insight-panel li {
  border-left: 4px solid var(--mint);
  padding: 10px 12px;
  background: #f5faf7;
  color: #293532;
  line-height: 1.45;
}

.simulator {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 24px;
  margin-top: 22px;
  border-radius: 8px;
}

.sim-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.sim-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.sim-grid label {
  align-self: end;
}

.enhanced-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fafbf9;
}

.metric-card h3 {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 700;
}

.metric-card div {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #eef3f0;
  border-radius: 999px;
  margin: 8px 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--mint);
  border-radius: inherit;
}

.real-value-note {
  color: var(--mint) !important;
  font-weight: 600;
  margin-top: 4px;
  display: block;
}

.info-text {
  color: var(--muted) !important;
  font-size: 0.75rem;
  margin-top: 6px;
  display: block;
  font-weight: normal;
  line-height: 1.3;
}

@media (max-width: 860px) {
  .layout,
  .simulator,
  .sim-grid,
  .score-row {
    grid-template-columns: 1fr;
  }

  .input-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 10px 0;
  }

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

  .input-panel,
  .dashboard,
  .simulator {
    padding: 18px;
  }

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

  .currency-toggle {
    width: 100%;
  }

  .currency-toggle button {
    flex: 1;
  }
}
