:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --brand: #2264e5;
  --brand-dark: #1646a3;
  --green: #11845b;
  --amber: #b76e00;
  --red: #c0342b;
  --border: #dce3ef;
  --shadow: 0 18px 45px rgba(23, 32, 51, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #edf4ff 0%, var(--bg) 42%, #fff9ec 100%);
  color: var(--text);
}

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

.hero {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
}

h1, h2 { margin: 0; }
h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1; }
h2 { font-size: 22px; margin-bottom: 18px; }
.subtitle { max-width: 620px; color: var(--muted); font-size: 17px; line-height: 1.6; }

.target-card, .card {
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(220,227,239,.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  border-radius: 24px;
}

.target-card {
  min-width: 230px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.target-card span { color: var(--muted); }
.target-card strong { font-size: 28px; margin-top: 6px; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.card { padding: 24px; }

label {
  display: block;
  color: var(--text);
  font-weight: 650;
  margin-bottom: 14px;
}

input {
  width: 100%;
  margin-top: 7px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 16px;
  outline: none;
  background: #fff;
}
input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(34,100,229,.12); }
small { display: block; color: var(--muted); margin-top: 6px; font-weight: 400; }

.button-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
button {
  border: 0;
  border-radius: 14px;
  padding: 13px 16px;
  background: var(--brand);
  color: white;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(34,100,229,.22);
}
button:hover { background: var(--brand-dark); }
button.secondary { background: #ecf2ff; color: var(--brand-dark); box-shadow: none; }
button.danger { background: #ffecec; color: var(--red); box-shadow: none; padding: 9px 12px; }
.save-status { margin: 14px 0 0; color: var(--muted); line-height: 1.5; }
.save-status.success { color: var(--green); }
.save-status.error { color: var(--red); }

.summary-list { display: grid; gap: 12px; }
.summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.summary-list span { color: var(--muted); }
.summary-list strong { text-align: right; font-size: 18px; }

.progress-wrap { margin-top: 24px; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); }
.progress-bar { height: 15px; background: #e7edf7; border-radius: 999px; overflow: hidden; }
#progressFill { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--green)); border-radius: 999px; transition: width .25s ease; }
.recommendation { margin-top: 22px; line-height: 1.6; padding: 16px; border-radius: 16px; background: #f2f6ff; color: #1f3763; }

.history-card { margin-top: 20px; }
.history-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.history-list { display: grid; gap: 10px; }
.history-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; border: 1px solid var(--border); border-radius: 16px; padding: 14px; background: #fff; }
.history-item small { margin: 0; }
.history-item strong { color: var(--green); }
.empty { color: var(--muted); font-style: italic; }

@media (max-width: 820px) {
  .hero, .grid { grid-template-columns: 1fr; display: grid; }
  .target-card { min-width: 0; }
  .summary-list div { align-items: flex-start; }
}
