:root {
  --blue: #0659a8;
  --blue-2: #0b75c9;
  --gold: #f4c430;
  --ink: #172033;
  --muted: #64748b;
  --line: #dbe4ef;
  --soft: #f5f8fc;
  --white: #ffffff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--soft); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

/* Public landing */
.landing { background: #fff; color: #13243b; overflow: hidden; }
.landing h1, .landing h2, .landing h3, .landing p { letter-spacing: 0; }
.landing-header {
  position: absolute; z-index: 5; top: 0; left: 0; right: 0;
  height: 88px; display: flex; align-items: center; gap: 40px;
  padding: 0 clamp(24px, 5vw, 76px); color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.22);
}
.landing-logo img { display: block; width: 190px; max-height: 58px; object-fit: contain; background: #fff; padding: 6px 10px; border-radius: 6px; }
.landing-nav { display: flex; gap: 30px; margin-left: auto; }
.landing-nav a { color: #fff; text-decoration: none; font-size: 14px; font-weight: 650; }
.header-login { border: 1px solid rgba(255,255,255,.6); background: rgba(0,31,69,.32); color: #fff; border-radius: 6px; padding: 11px 15px; font-weight: 750; }
.landing-hero { position: relative; min-height: calc(100svh - 24px); display: flex; align-items: center; color: #fff; isolation: isolate; }
.hero-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 58% center; z-index: -2; }
.hero-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(3,32,67,.96) 0%, rgba(4,49,94,.82) 34%, rgba(4,49,94,.18) 63%, rgba(3,32,67,.06) 100%); }
.hero-content { width: min(690px, 52vw); margin-left: clamp(24px, 7vw, 112px); padding: 112px 0 42px; }
.eyebrow { margin: 0 0 16px; text-transform: uppercase; font-size: 12px; font-weight: 850; letter-spacing: 1.8px !important; color: #ffd04a; }
.eyebrow.blue { color: #075aa8; }
.hero-content h1 { max-width: 690px; margin: 0; font-size: clamp(44px, 5vw, 68px); line-height: 1.01; font-weight: 780; }
.hero-copy { max-width: 650px; margin: 25px 0 0; color: #e8f2fc; font-size: 17px; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.landing-btn { border: 1px solid transparent; border-radius: 6px; padding: 14px 19px; text-decoration: none; font-weight: 780; font-size: 14px; line-height: 1; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; }
.landing-btn.gold { background: #f6c832; color: #1f2b3b; }
.landing-btn.glass { color: #fff; border-color: rgba(255,255,255,.58); background: rgba(0,35,73,.28); backdrop-filter: blur(6px); }
.landing-btn.outline { color: #075aa8; border-color: #075aa8; background: #fff; }
.hero-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 0; margin: 30px 0 0; font-size: 12px; color: #e4effa; }
.hero-tags li::before { content: "✓"; color: #ffd04a; margin-right: 7px; font-weight: 900; }
.hero-next { position: absolute; bottom: 23px; left: 50%; color: #fff; text-decoration: none; font-size: 23px; }
.landing-section { padding: 108px clamp(24px, 7vw, 112px); }
.section-heading { max-width: 780px; margin-bottom: 55px; }
.section-heading h2, .spotlight-copy h2, .human-copy h2, .differentials h2 { margin: 0; font-size: clamp(34px, 4vw, 54px); line-height: 1.08; color: #102c4d; }
.section-heading > p:last-child, .spotlight-copy > p, .human-copy > p { color: #5c6f84; font-size: 17px; line-height: 1.75; }
.benefit-row { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid #dce5ee; }
.benefit-item { padding: 30px 28px 10px 0; border-right: 1px solid #dce5ee; }
.benefit-item + .benefit-item { padding-left: 28px; }
.benefit-item:last-child { border: 0; }
.benefit-item > span { color: #e1aa00; font-size: 12px; font-weight: 900; }
.benefit-item h3 { margin: 25px 0 9px; color: #075aa8; font-size: 20px; }
.benefit-item p, .feature-card p, .steps p { color: #64768a; line-height: 1.6; font-size: 14px; }
.features-section { background: #f3f7fa; }
.split-heading { max-width: none; display: grid; grid-template-columns: 1.2fr .8fr; align-items: end; gap: 70px; }
.split-heading > p { margin: 0; }
.feature-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.feature-card { min-height: 220px; padding: 25px 22px; background: #fff; border: 1px solid #e0e8ef; border-radius: 6px; transition: transform .2s, border-color .2s; }
.feature-card:hover { transform: translateY(-3px); border-color: #8eb8dd; }
.feature-icon { width: 39px; height: 39px; display: grid; place-items: center; color: #075aa8; background: #e9f3fb; border-radius: 50%; font-size: 21px; font-weight: 800; }
.feature-card h3 { margin: 30px 0 8px; color: #16395e; font-size: 17px; }
.spotlight-section { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 670px; background: #075aa8; color: #fff; }
.spotlight-visual { display: grid; place-items: center; padding: 70px clamp(24px, 6vw, 90px); background: #eef4f7; }
.metric-preview { width: min(570px, 100%); color: #183550; background: #fff; border: 1px solid #dbe5ec; border-radius: 7px; padding: 28px; box-shadow: 0 24px 55px rgba(15,49,80,.13); }
.metric-head, .metric-main, .metric-list span { display: flex; justify-content: space-between; gap: 20px; }
.metric-head { font-size: 13px; color: #738498; }
.metric-head strong { color: #075aa8; }
.metric-main { margin: 38px 0 22px; align-items: center; }
.metric-main div:first-child { display: grid; gap: 7px; }
.metric-main strong { font-size: 42px; color: #102c4d; }
.metric-main strong i { font-size: 14px; font-style: normal; }
.metric-main div:first-child span { color: #26845b; font-size: 13px; }
.score-ring { width: 92px; aspect-ratio: 1; border: 9px solid #f5c632; border-left-color: #e7eef4; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 850; }
.score-ring small { display: block; font-size: 10px; color: #6c7c8d; }
.chart-bars { height: 150px; display: flex; align-items: end; gap: 9%; padding: 15px 10px 0; border-bottom: 1px solid #d8e2ea; }
.chart-bars i { flex: 1; background: #0a6ab9; border-radius: 3px 3px 0 0; }
.metric-list { display: grid; gap: 12px; margin-top: 24px; font-size: 13px; }
.spotlight-copy { padding: 105px clamp(30px, 7vw, 110px); align-self: center; }
.spotlight-copy h2 { color: #fff; }
.spotlight-copy > p { color: #d9e9f6; }
.check-list { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 14px; }
.check-list li::before { content: "✓"; display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 11px; background: #f5c632; color: #183550; border-radius: 50%; font-weight: 900; }
.human-section { display: grid; grid-template-columns: .92fr 1.08fr; align-items: stretch; }
.human-copy { padding: 110px clamp(30px, 7vw, 112px); align-self: center; }
.human-copy blockquote { margin: 36px 0 0; padding-left: 20px; border-left: 3px solid #f5c632; color: #075aa8; font-size: 19px; line-height: 1.55; font-weight: 700; }
.human-image { min-height: 620px; overflow: hidden; }
.human-image img { width: 100%; height: 100%; object-fit: cover; object-position: 70% center; }
.steps-section { background: #fff; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid #dce5ee; }
.steps li { position: relative; padding: 30px 28px 0 0; }
.steps li:not(:last-child)::after { content: "→"; position: absolute; top: 31px; right: 18px; color: #b2c0ce; }
.steps span { color: #e1aa00; font-size: 12px; font-weight: 900; }
.steps h3 { margin: 42px 0 10px; color: #075aa8; }
.differentials { display: grid; grid-template-columns: .9fr 1.1fr; gap: 90px; padding: 100px clamp(24px, 7vw, 112px); background: #0d3159; color: #fff; }
.differentials h2 { color: #fff; }
.differentials ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0 35px; }
.differentials li { padding: 18px 0; border-bottom: 1px solid rgba(255,255,255,.18); }
.differentials li::before { content: "✓"; color: #f5c632; margin-right: 10px; }
.landing-footer {
  min-height: 150px;
  padding: 30px clamp(24px, 7vw, 112px) 22px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px 32px;
  background: #071d36;
  color: #b9c8d7;
}
.landing-footer > img { width: 190px; padding: 6px 9px; background: #fff; border-radius: 5px; }
.landing-footer address { font-size: 13px; line-height: 1.6; font-style: normal; text-align: right; }
.copyright { grid-column: 1 / -1; margin: 0; border-top: 1px solid rgba(255,255,255,.13); padding-top: 18px; font-size: 12px; text-align: center; }
.login-modal { width: min(460px, 94vw); padding: 32px; }
.login-modal h2 { margin-top: 25px; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand img { width: 45px; height: 45px; object-fit: contain; }
.login-brand div { display: grid; gap: 2px; }
.login-brand span { color: var(--muted); font-size: 12px; }
.modal { position: relative; }
.modal-close { position: absolute; right: 14px; top: 12px; width: 34px; height: 34px; border: 0; background: #eef3f7; border-radius: 50%; color: #345; font-size: 22px; line-height: 1; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: linear-gradient(135deg, #ffffff 0%, #eef6ff 62%, #fff7d2 100%);
}
.brand-panel {
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
}
.brand-panel img { width: min(360px, 82vw); }
.brand-panel h1 { margin: 0; font-size: clamp(34px, 5vw, 68px); line-height: 1; color: var(--blue); letter-spacing: 0; }
.brand-panel p { max-width: 620px; color: #40516c; font-size: 18px; line-height: 1.6; }
.login-box {
  align-self: center;
  justify-self: center;
  width: min(430px, 92vw);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(6, 89, 168, .12);
}
.login-box h2, .panel h2, .modal h2 { margin: 0 0 18px; color: var(--blue); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar { background: var(--blue); color: white; padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.sidebar img { max-width: 190px; background: white; border-radius: 8px; padding: 8px; }
.nav { display: grid; gap: 6px; }
.nav button, .logout {
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  padding: 11px 12px;
  border-radius: 8px;
}
.nav button.active, .nav button:hover, .logout:hover { background: rgba(255,255,255,.16); }
.logout { margin-top: auto; }
.main { padding: 26px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 20px; }
.topbar h1 { margin: 0; font-size: 30px; color: var(--blue); letter-spacing: 0; }
.user-pill { background: white; border: 1px solid var(--line); padding: 10px 14px; border-radius: 999px; color: var(--muted); }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.panel, .card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.soft-panel { background: #fbfdff; }
.metric-card { display: grid; gap: 8px; align-content: start; min-height: 86px; }
.metric-card span { color: var(--muted); font-size: 13px; }
.metric-card strong { color: var(--blue); font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.bio-analysis { margin-bottom: 16px; }
.evolution-card {
  background: #fff;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 12px 30px rgba(18, 56, 93, .08);
}
.evolution-card-header, .compact-evolution-card > header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}
.evolution-card h2, .evolution-card h3 { margin: 4px 0 0; color: var(--blue); }
.evolution-card h2 { font-size: 27px; }
.evolution-card h3 { font-size: 18px; }
.section-kicker { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px; }
.period-control { display: grid; grid-template-columns: auto minmax(170px, 220px); align-items: center; gap: 6px 10px; }
.period-control label { text-align: right; }
.period-badge { display: inline-flex; align-items: center; justify-content: center; min-height: 25px; padding: 4px 8px; border-radius: 999px; background: #eaf4ff; color: var(--blue); font-size: 11px; font-weight: 750; }
.period-control .period-badge { grid-column: 2; justify-self: end; }
.evolution-main { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 30px; align-items: stretch; margin-top: 26px; }
.weight-chart-area { min-width: 0; border-right: 1px solid var(--line); padding-right: 28px; }
.evolution-weight { display: grid; gap: 4px; margin-bottom: 14px; }
.evolution-weight > span { color: var(--muted); font-size: 13px; }
.evolution-weight > strong { color: #16395e; font-size: 38px; line-height: 1.1; }
.evolution-weight > small { min-height: 18px; color: var(--muted); }
.evolution-weight .positive { color: #157347; }
.evolution-weight .attention { color: #a15c00; }
.evolution-bars-scroll, .mini-bars-scroll { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.evolution-bars {
  height: 210px;
  min-width: max(100%, calc(var(--bar-count) * 74px));
  display: grid;
  grid-template-columns: repeat(var(--bar-count), minmax(58px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px 8px 0;
  border-bottom: 1px solid #cad6e2;
}
.evolution-bar {
  height: 100%;
  min-width: 58px;
  display: grid;
  grid-template-rows: 22px 1fr 38px;
  align-items: end;
  justify-items: stretch;
  padding: 0 5px;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.evolution-bar .bar-value { align-self: center; text-align: center; color: #334155; font-size: 11px; font-weight: 750; opacity: 0; transition: opacity .15s; }
.evolution-bar i { width: 100%; min-height: 14px; display: block; align-self: end; background: var(--blue-2); border-radius: 5px 5px 0 0; transition: filter .15s, transform .15s; }
.evolution-bar small { align-self: start; padding-top: 7px; text-align: center; font-size: 10px; line-height: 1.25; white-space: normal; }
.evolution-bar:hover i, .evolution-bar.active i { filter: brightness(.82); transform: translateY(-2px); }
.evolution-bar:hover .bar-value, .evolution-bar.active .bar-value { opacity: 1; }
.imc-panel { display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; }
.imc-panel > b { color: #334155; }
.imc-panel > small { color: var(--muted); }
.imc-donut {
  --donut-color: var(--gold);
  width: 128px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--donut-color) 0 78%, #e9eef3 78% 100%);
}
.imc-donut::before { content: ""; grid-area: 1 / 1; width: 92px; aspect-ratio: 1; border-radius: 50%; background: #fff; }
.imc-donut > div { grid-area: 1 / 1; z-index: 1; display: grid; }
.imc-donut strong { color: #16395e; font-size: 27px; }
.imc-donut span { color: var(--muted); font-size: 11px; font-weight: 800; }
.imc-donut.low { --donut-color: #4b9bd3; }
.imc-donut.normal { --donut-color: var(--gold); }
.imc-donut.warning { --donut-color: #e98b2a; }
.imc-donut.danger { --donut-color: #c63d32; }
.evaluation-detail-slot { min-height: 70px; margin: 20px 0 0; }
.evaluation-detail { display: grid; grid-template-columns: 1.5fr repeat(5, minmax(90px, 1fr)); gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid #dce5ee; border-radius: 6px; background: #f8fbfd; font-size: 12px; }
.evaluation-detail > span { display: grid; gap: 3px; color: var(--muted); }
.evaluation-detail b { color: #334155; }
.metric-rows { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 18px; border-top: 1px solid var(--line); }
.metric-row { display: flex; justify-content: space-between; gap: 14px; padding: 18px 16px 2px; border-right: 1px solid var(--line); }
.metric-row:first-child { padding-left: 0; }
.metric-row:last-child { border-right: 0; padding-right: 0; }
.metric-label { color: var(--muted); font-size: 12px; }
.metric-value { color: #16395e; text-align: right; font-size: 13px; }
.complementary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.compact-evolution-card { min-width: 0; padding: 18px; box-shadow: 0 8px 22px rgba(18, 56, 93, .06); }
.compact-evolution-card > header { min-height: 54px; }
.chart-legend { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.chart-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 2px; background: var(--blue-2); }
.chart-legend .muscle::before { background: var(--gold); }
.grouped-bars, .small-bars {
  height: 155px;
  min-width: max(100%, calc(var(--bar-count) * 52px));
  display: grid;
  grid-template-columns: repeat(var(--bar-count), minmax(42px, 1fr));
  gap: 8px;
  align-items: end;
  margin-top: 15px;
  border-bottom: 1px solid var(--line);
}
.bar-group, .small-bars > div { height: 100%; display: grid; grid-template-rows: 1fr 31px; align-items: end; text-align: center; }
.bar-group > div { height: 100%; display: flex; align-items: end; justify-content: center; gap: 4px; }
.bar-group i, .small-bars i { display: block; min-height: 8px; border-radius: 3px 3px 0 0; background: var(--blue-2); }
.bar-group i { width: 16px; }
.bar-group i.muscle { background: var(--gold); }
.small-bars i { width: 65%; margin: auto; }
.visceral-bars i { background: #2b86b8; }
.age-bars i { background: #6d77ad; }
.bar-group small, .small-bars small { padding-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.15; }
.basal-card { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 20px; }
.basal-card > header { min-height: 0; }
.basal-card > strong { color: var(--blue); font-size: 25px; }
.basal-card > span { color: var(--muted); font-size: 12px; }
.tracking-section, .pharmacy-reading, .evolution-notice { margin-top: 16px; }
.bio-photo-section { margin-top: 26px; padding: 8px 0; }
.bio-photo-section h2 { margin: 0 0 6px; color: var(--blue); }
.photo-gallery-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.photo-evaluation-group { padding: 18px 0; border-top: 1px solid var(--line); }
.photo-evaluation-group > header { display: flex; justify-content: space-between; margin-bottom: 12px; }
.photo-evaluation-group > header div { display: grid; gap: 4px; }
.photo-evaluation-group > header span { color: var(--muted); font-size: 12px; }
.bio-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.bio-photo-card { margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.bio-photo-card > img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; background: #eef3f7; }
.bio-photo-card figcaption { display: grid; gap: 4px; min-height: 60px; padding: 9px 0; }
.bio-photo-card figcaption span:not(.badge) { color: var(--muted); font-size: 12px; }
.bio-photo-card .badge { justify-self: start; }
.photo-select { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 11px; }
.photo-select input { width: auto; }
.bio-photo-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.photo-comparison-controls { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin: 14px 0; }
.photo-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0; }
.photo-comparison article { min-width: 0; }
.photo-comparison h3 { margin: 0 0 5px; color: var(--blue); }
.photo-comparison p { color: var(--muted); font-size: 12px; }
.photo-comparison img { width: 100%; max-height: 560px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #f5f8fc; }
.photo-comparison strong { display: block; margin-top: 7px; }
.photo-fullscreen { display: grid; place-items: center; gap: 10px; }
.photo-fullscreen img { max-width: 100%; max-height: 72vh; object-fit: contain; }
.photo-count { color: var(--blue); font-weight: 750; }
.tracking-section { min-width: 0; max-width: 100%; overflow: hidden; }
.table-scroll { width: 100%; max-width: 100%; overflow-x: auto; }
.bio-table-wrap { width: 100%; overflow-x: auto; }
.bio-compact-table { width: 100%; min-width: 820px; table-layout: fixed; font-size: 12px; }
.bio-compact-table th, .bio-compact-table td { padding: 8px 7px; line-height: 1.35; }
.bio-compact-table th:nth-last-child(1), .bio-compact-table td:nth-last-child(1) { width: 162px; }
.bio-compact-table th:nth-last-child(2), .bio-compact-table td:nth-last-child(2) { width: 78px; }
.bio-compact-table th:nth-last-child(3), .bio-compact-table td:nth-last-child(3) { width: 105px; overflow-wrap: anywhere; }
.bio-actions-cell { position: sticky; right: 0; z-index: 2; background: #fff; box-shadow: -7px 0 10px rgba(23, 32, 51, .05); }
.bio-compact-table thead th:last-child { position: sticky; right: 0; z-index: 3; background: #f8fbff; }
.bio-compact-table tr:hover .bio-actions-cell { background: #fcfdff; }
.bio-table-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.compact-btn { min-height: 28px; padding: 4px 6px; border-radius: 5px; font-size: 11px; line-height: 1.1; }
.charts-section { margin-top: 18px; }
.chart-card { display: grid; gap: 8px; }
.stat strong { display: block; font-size: 34px; color: var(--blue); }
.stat span, .muted { color: var(--muted); }

.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: white;
  border-radius: 8px;
  padding: 10px 13px;
  min-height: 40px;
}
.btn.secondary { background: white; color: var(--blue); }
.btn.gold { background: var(--gold); color: #2d2a13; border-color: var(--gold); }
.btn.danger { background: #b42318; border-color: #b42318; }

.field { display: grid; gap: 6px; }
label { font-size: 13px; color: #334155; font-weight: 650; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cad6e2;
  border-radius: 8px;
  padding: 10px 11px;
  background: white;
  color: var(--ink);
}
input.invalid {
  border-color: #b42318;
  box-shadow: 0 0 0 2px rgba(180, 35, 24, .08);
}
.password-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}
.password-control input {
  border-radius: 8px 0 0 8px;
}
.password-toggle {
  border: 1px solid #cad6e2;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: #f8fbff;
  color: var(--blue);
  font-weight: 750;
  padding: 0 12px;
  min-width: 82px;
  cursor: pointer;
}
.password-toggle:focus-visible {
  outline: 2px solid rgba(6, 89, 168, .25);
  outline-offset: 2px;
}
.field-error {
  min-height: 16px;
  color: #b42318;
  font-size: 12px;
  line-height: 1.3;
}
textarea { min-height: 92px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }

table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; }
th, td { padding: 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #334155; background: #f8fbff; font-size: 13px; }
tr:hover td { background: #fcfdff; }

.profile-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.patient-context { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.patient-context h2 { margin: 8px 0; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; background: #eaf4ff; color: var(--blue); font-size: 12px; font-weight: 700; }
.timeline { display: grid; gap: 10px; }
.timeline-item { border-left: 3px solid var(--gold); padding: 9px 12px; background: white; border-radius: 0 8px 8px 0; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: center; padding: 20px; z-index: 20; }
.modal { background: white; width: min(980px, 96vw); max-height: 92vh; overflow: auto; border-radius: 8px; padding: 22px; border: 1px solid var(--line); }
.toast { position: fixed; right: 20px; bottom: 20px; background: #12385d; color: white; padding: 12px 14px; border-radius: 8px; z-index: 30; }
.empty { border: 1px dashed #b9c7d6; border-radius: 8px; padding: 26px; text-align: center; color: var(--muted); background: #fbfdff; }
.notice { border: 1px solid #f1d37a; background: #fff9db; color: #5d4b00; border-radius: 8px; padding: 10px 12px; }
.chart { width: 100%; min-height: 220px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(#fff, #f8fbff); overflow: hidden; }
.chart svg { width: 100%; height: 230px; display: block; }
.chart .axis { stroke: #cbd8e6; stroke-width: 1; }
.chart .chart-line { fill: none; stroke: var(--blue); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.chart circle { fill: var(--gold); stroke: var(--blue); stroke-width: 2; }
.chart rect { fill: var(--blue-2); rx: 4px; }
.chart text { fill: var(--muted); font-size: 12px; }
.chart .value-label { fill: #334155; font-size: 11px; font-weight: 700; }

.print-page { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; }
  body > *:not(.printing) { display: none !important; }
  .sidebar, .topbar, .no-print, button { display: none !important; }
  .printing { display: block !important; }
  .print-report { width: 100%; max-width: 100%; padding: 0; margin: 0; }
  .print-page { display: block; width: 100%; max-width: 100%; color: #111827; padding: 0; margin: 0; }
  .print-header { display: flex; gap: 18px; align-items: center; border-bottom: 5px solid var(--blue); padding-bottom: 10px; }
  .print-header img { width: 170px; }
  .print-header span, .print-footer span { display: block; color: #475569; margin-top: 4px; }
  .print-footer { margin-top: 36px; border-top: 2px solid var(--gold); padding-top: 14px; }
  .print-metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 22px; }
  .print-metric-grid .metric-card { min-height: 70px; padding: 10px; border: 1px solid #cbd5e1; box-shadow: none; }
  .print-metric-grid .metric-card strong { font-size: 16px; }
  .print-photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; page-break-inside: avoid; }
  .print-photo-grid figure { margin: 0; page-break-inside: avoid; }
  .print-photo-grid img { width: 100%; max-height: 92mm; object-fit: contain; border: 1px solid #cbd5e1; }
  .print-photo-grid figcaption { margin-top: 4px; font-size: 9px; text-align: center; }
  .signature { margin-top: 54px; text-align: center; border-top: 1px solid #111827; padding-top: 8px; width: 300px; margin-left: auto; }
  .print-page h1 { font-size: 22px; color: var(--blue); }
  .print-page h2 { margin-top: 20px; font-size: 16px; color: var(--blue); }
  .print-page table { table-layout: fixed; font-size: 9px; page-break-inside: auto; }
  .print-page tr { page-break-inside: avoid; }
  .print-page th, .print-page td { padding: 6px 5px; overflow-wrap: anywhere; }
}

@media (max-width: 900px) {
  .login-shell, .app-shell { grid-template-columns: 1fr; }
  .brand-panel { padding: 30px 24px 0; }
  .sidebar { position: sticky; top: 0; z-index: 10; }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .topbar, .profile-head { flex-direction: column; align-items: stretch; }
  .main { padding: 18px; }
  .evolution-main { grid-template-columns: 1fr 160px; }
  .evaluation-detail { grid-template-columns: repeat(3, 1fr); }
  .metric-rows { grid-template-columns: repeat(2, 1fr); }
  .metric-row:nth-child(2) { border-right: 0; }
  .complementary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .landing-header { height: 72px; padding: 0 20px; }
  .landing-logo img { width: 155px; max-height: 50px; }
  .landing-nav { display: none; }
  .header-login { margin-left: auto; padding: 9px 11px; font-size: 12px; }
  .landing-hero { min-height: calc(100svh - 24px); align-items: end; }
  .hero-image { object-position: 64% center; }
  .hero-shade { background: linear-gradient(0deg, rgba(3,30,62,.98) 0%, rgba(3,37,75,.88) 50%, rgba(3,37,75,.08) 86%); }
  .hero-content { width: auto; margin: 0; padding: 285px 24px 28px; }
  .hero-content h1 { font-size: clamp(34px, 9.5vw, 46px); }
  .hero-copy { margin-top: 17px; font-size: 14px; line-height: 1.48; }
  .hero-actions { margin-top: 20px; }
  .hero-tags { margin-top: 18px; }
  .hero-next { display: none; }
  .landing-section { padding: 76px 24px; }
  .benefit-row, .feature-grid, .steps, .spotlight-section, .human-section, .differentials, .landing-footer { grid-template-columns: 1fr; }
  .benefit-item, .benefit-item + .benefit-item { padding: 24px 0; border-right: 0; border-bottom: 1px solid #dce5ee; }
  .benefit-item h3 { margin-top: 12px; }
  .split-heading { grid-template-columns: 1fr; gap: 18px; }
  .feature-grid { gap: 10px; }
  .feature-card { min-height: auto; }
  .spotlight-visual, .spotlight-copy, .human-copy { padding: 70px 24px; }
  .human-image { min-height: 440px; order: -1; }
  .steps li { padding: 20px 0; border-bottom: 1px solid #dce5ee; }
  .steps li:not(:last-child)::after { display: none; }
  .steps h3 { margin: 12px 0 5px; }
  .differentials { gap: 40px; padding: 75px 24px; }
  .differentials ul { grid-template-columns: 1fr; }
  .landing-footer { justify-items: center; gap: 18px; padding-top: 28px; }
  .landing-footer address { text-align: center; }
}

@media (max-width: 520px) {
  .evolution-card { padding: 17px; }
  .evolution-card-header, .compact-evolution-card > header { flex-direction: column; align-items: stretch; }
  .period-control { grid-template-columns: 1fr; }
  .period-control label { text-align: left; }
  .period-control .period-badge { grid-column: 1; justify-self: start; }
  .evolution-main { grid-template-columns: 1fr; }
  .weight-chart-area { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 20px; }
  .imc-panel { padding-top: 4px; }
  .evaluation-detail { grid-template-columns: repeat(2, 1fr); }
  .evaluation-detail > strong { grid-column: 1 / -1; }
  .metric-rows, .complementary-grid { grid-template-columns: 1fr; }
  .metric-row, .metric-row:first-child, .metric-row:last-child { padding: 13px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .basal-card { grid-column: auto; grid-template-columns: 1fr; }
  .tracking-section { padding: 14px; overflow: visible; }
  .table-scroll, .bio-table-wrap { overflow: visible; }
  .bio-compact-table, .bio-compact-table tbody, .bio-compact-table tr, .bio-compact-table td { display: block; width: 100%; min-width: 0; }
  .bio-compact-table { background: transparent; }
  .bio-compact-table thead { display: none; }
  .bio-compact-table tbody { display: grid; gap: 10px; }
  .bio-compact-table tr { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
  .bio-compact-table td {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid #edf1f5;
  }
  .bio-compact-table td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 750; }
  .bio-compact-table td:last-child { border-bottom: 0; }
  .bio-actions-cell { position: static; box-shadow: none; background: transparent; }
  .bio-table-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compact-btn { min-height: 34px; }
  .photo-comparison-controls, .photo-comparison { grid-template-columns: 1fr; }
  .bio-photo-grid { grid-template-columns: 1fr 1fr; }
  .hero-content .hero-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .hero-content .hero-actions .landing-btn { width: 100%; padding: 10px 8px; font-size: 11px; }
  .hero-content .hero-tags { display: none; }
  .metric-preview { padding: 19px; }
  .metric-main strong { font-size: 34px; }
  .score-ring { width: 78px; }
  .landing-section .section-heading { margin-bottom: 38px; }
}
