:root {
  --bg: #f4f5ef;
  --panel: #fffefb;
  --panel-soft: #f9faf5;
  --ink: #151713;
  --muted: #697064;
  --faint: #8d9489;
  --line: #e0e4d9;
  --brand: #244c39;
  --brand-strong: #173426;
  --brand2: #dcefe4;
  --gold: #c99d48;
  --red: #b42318;
  --green: #137447;
  --shadow: 0 18px 50px rgba(24, 32, 24, .08);
  --shadow-soft: 0 10px 30px rgba(24, 32, 24, .06);
  --radius-lg: 26px;
  --radius-md: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 12% -8%, rgba(36, 76, 57, .12), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(201, 157, 72, .10), transparent 30%),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Arial, sans-serif;
}
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 16px calc(96px + env(safe-area-inset-bottom));
}

.top {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.app-chrome {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px 0;
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mark {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--brand), var(--brand-strong));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 850;
  letter-spacing: -.04em;
  box-shadow: 0 10px 26px rgba(36, 76, 57, .22);
}
.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  font-weight: 800;
}
.title {
  font-size: 25px;
  line-height: 1.1;
  font-weight: 850;
  letter-spacing: -.045em;
}

.btn {
  border-radius: 14px;
  padding: 11px 14px;
  background: var(--brand);
  color: #fff;
  font-weight: 780;
  box-shadow: 0 8px 24px rgba(36, 76, 57, .18);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(36, 76, 57, .20); }
.btn.secondary { background: rgba(255,255,255,.78); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.danger { background: #fff3f1; color: var(--red); border: 1px solid #ffd3cc; box-shadow: none; }
.install-btn { border-color: rgba(36, 76, 57, .22) !important; background: var(--brand2) !important; color: var(--brand) !important; }

.grid { display: grid; gap: 14px; }
.card {
  background: rgba(255, 254, 251, .88);
  border: 1px solid rgba(224, 228, 217, .9);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.hero-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 14px;
  padding: 24px;
  border-radius: 30px;
  background: linear-gradient(135deg, #fffefb 0%, #eef4ec 100%);
  border: 1px solid rgba(36, 76, 57, .10);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero-card::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -90px;
  top: -120px;
  background: radial-gradient(circle, rgba(36,76,57,.13), transparent 68%);
  pointer-events: none;
}
.hero-card h1 { margin: 8px 0 8px; font-size: clamp(28px, 5vw, 46px); line-height: .98; letter-spacing: -.06em; max-width: 720px; }
.hero-card p { margin: 0; color: var(--muted); line-height: 1.55; max-width: 760px; }
.hero-number {
  min-width: 210px;
  border-radius: 24px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 14px 36px rgba(24,32,24,.07);
  position: relative;
  z-index: 1;
}
.hero-number span { display: block; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.hero-number strong { display: block; margin-top: 7px; font-size: 32px; letter-spacing: -.055em; }
.hero-number.good strong, .metric.good { color: var(--green); }
.hero-number.bad strong, .metric.bad { color: var(--red); }

.summary { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.metric-card { min-height: 124px; }
.metric-label { font-size: 12px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.metric { font-size: clamp(24px, 3.3vw, 32px); font-weight: 880; letter-spacing: -.055em; margin-top: 8px; }
.meta { color: var(--muted); font-size: 13px; line-height: 1.45; margin-top: 4px; }

.layout { grid-template-columns: minmax(0, 1.05fr) minmax(340px, .72fr); align-items: start; }
.side-panel { align-self: start; }
.sticky-form { position: sticky; top: 84px; }
.section-title { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 12px; }
.section-title h2 { margin: 0; font-size: 18px; letter-spacing: -.035em; }
.data-section { scroll-margin-top: 92px; }

.list { display: grid; gap: 10px; }
.row {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.86);
  border-radius: var(--radius-md);
  padding: 13px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}
.row strong { display: block; letter-spacing: -.015em; }
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--brand2);
  color: var(--brand);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 780;
  margin-right: 4px;
  margin-top: 6px;
}

.form { display: grid; gap: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 11px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  color: var(--ink);
  outline: none;
  touch-action: manipulation;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(36, 76, 57, .12); }
textarea { min-height: 92px; resize: vertical; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chrome-actions { justify-content: flex-end; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 2px; }
.tab { padding: 9px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 780; color: var(--muted); white-space: nowrap; }
.tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.login-card { width: 100%; max-width: 440px; }
.hidden { display: none !important; }
.advisor { white-space: pre-wrap; font-size: 13px; background: #f2f6ee; border: 1px solid var(--line); border-radius: 16px; padding: 12px; max-height: 260px; overflow: auto; }
.strategy { margin-bottom: 14px; scroll-margin-top: 92px; }
.strategy ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.strategy li { line-height: 1.45; color: #2b3029; }
.empty { color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius-md); padding: 18px; text-align: center; }
.footer-note { margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.4; }

.bottom-nav {
  z-index: 30;
  display: none;
  gap: 4px;
  width: 100%;
  margin: 0 0 14px;
  padding: 7px;
  border-radius: 22px;
  background: rgba(255,254,251,.92);
  border: 1px solid rgba(224, 228, 217, .95);
  box-shadow: 0 14px 34px rgba(24,32,24,.10);
  backdrop-filter: blur(18px);
}
.bottom-nav a {
  flex: 1;
  text-align: center;
  padding: 9px 5px;
  border-radius: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}
.bottom-nav a:active { background: var(--brand2); color: var(--brand); }

@media (max-width: 980px) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout { grid-template-columns: 1fr; }
  .sticky-form { position: static; }
}

@media (max-width: 680px) {
  .shell { padding: 12px 10px calc(28px + env(safe-area-inset-bottom)); }
  .top { align-items: flex-start; }
  .app-chrome { position: static; padding-top: 4px; }
  .brand { gap: 10px; }
  .mark { width: 40px; height: 40px; border-radius: 14px; }
  .title { font-size: 22px; }
  .chrome-actions .btn:not(.install-btn) { display: none; }
  .hero-card { grid-template-columns: 1fr; padding: 18px; border-radius: 24px; }
  .hero-card h1 { font-size: 31px; }
  .hero-number { min-width: 0; }
  .summary { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { border-radius: 21px; padding: 15px; }
  .metric-card { min-height: 104px; }
  .metric { font-size: 23px; }
  .form-grid { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
  .row .actions { justify-content: flex-start; }
  input, select, textarea { font-size: 16px !important; }
  .bottom-nav { display: flex; }
}

@media (max-width: 390px) {
  .summary { grid-template-columns: 1fr; }
  .hero-card h1 { font-size: 28px; }
  .bottom-nav a { font-size: 11px; padding-inline: 3px; }
}
