:root {
  --ink: #172631;
  --muted: #667883;
  --soft: #eff4f5;
  --line: #dce6e8;
  --paper: #ffffff;
  --canvas: #f5f8f8;
  --navy: #122c3a;
  --teal: #0b7b75;
  --teal-2: #0f948b;
  --mint: #dff5f1;
  --amber: #ad6b13;
  --amber-bg: #fff4dd;
  --red: #b54747;
  --red-bg: #fff0ef;
  --shadow: 0 18px 50px rgba(25, 51, 61, .08);
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: "DM Sans", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--navy); color: #fff; padding: 28px 20px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 30px; font-family: Manrope, sans-serif; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--navy); background: #77d8cf; font-weight: 800; font-size: 1.15rem; }
.brand div { display: flex; flex-direction: column; line-height: 1.05; }
.brand strong { font-size: 1rem; }
.brand div span { color: #77d8cf; font-size: .65rem; letter-spacing: .2em; margin-top: 5px; }
.sidebar nav { display: grid; gap: 7px; }
.nav-item { border: 0; background: transparent; color: #b9cbd2; padding: 13px 14px; border-radius: 10px; display: flex; gap: 12px; align-items: center; text-align: left; font-size: .92rem; }
.nav-item span { font-size: 1.1rem; width: 20px; text-align: center; }
.nav-item.active, .nav-item:hover { background: rgba(119,216,207,.12); color: #fff; }
.nav-item.active { box-shadow: inset 3px 0 #77d8cf; }
.sidebar-note { margin-top: auto; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 16px; background: rgba(255,255,255,.04); }
.note-kicker { display: block; color: #77d8cf; font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; }
.sidebar-note strong { font-size: .9rem; }
.sidebar-note p { color: #9db2ba; font-size: .78rem; margin: 5px 0 0; }
.profile { border: 0; background: transparent; color: white; display: flex; align-items: center; gap: 10px; padding: 18px 5px 0; text-align: left; }
.profile > span:last-child { display: grid; }
.profile strong { font-size: .78rem; }
.profile small { color: #8fa7b0; font-size: .7rem; margin-top: 2px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #275266; font-weight: 700; font-size: .7rem; }

main { min-width: 0; padding-bottom: 96px; }
.topbar { min-height: 92px; padding: 22px 4vw 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.88); backdrop-filter: blur(12px); }
.eyebrow { font-size: .68rem; letter-spacing: .14em; font-weight: 800; color: var(--teal); }
h1, h2, h3 { font-family: Manrope, sans-serif; }
h1 { font-size: 1.45rem; margin: 4px 0 0; letter-spacing: -.035em; }
.top-actions { display: flex; align-items: center; gap: 18px; }
.save-status { font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.save-status i { width: 7px; height: 7px; border-radius: 50%; background: #e2a23b; }
.ghost-button { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px 14px; color: var(--ink); font-weight: 600; font-size: .82rem; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 1.25rem; }

.stepper-wrap { padding: 20px 4vw 6px; background: white; border-bottom: 1px solid var(--line); }
.progress-track { height: 3px; background: var(--line); overflow: hidden; border-radius: 999px; }
.progress-track div { width: 14%; height: 100%; background: var(--teal); transition: width .25s ease; }
.stepper { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-top: 12px; }
.step-label { position: relative; color: #91a0a7; font-size: .69rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 8px; }
.step-label.active { color: var(--teal); }
.step-label.done { color: var(--ink); }

.workspace { max-width: 1240px; margin: 0 auto; padding: 30px 4vw; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.form-card, .context-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.form-card { padding: 30px; min-height: 560px; }
.context-panel { padding: 22px; position: sticky; top: 116px; }
.section-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 24px; }
.section-head h2 { font-size: 1.2rem; margin: 0 0 7px; letter-spacing: -.025em; }
.section-head p { margin: 0; color: var(--muted); line-height: 1.55; font-size: .88rem; max-width: 620px; }
.section-badge { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; background: var(--mint); color: var(--teal); font-size: .72rem; font-weight: 700; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .78rem; font-weight: 700; color: #3f535e; }
.field label small { color: var(--muted); font-weight: 400; }
input, select, textarea { width: 100%; border: 1px solid #ccdade; background: #fbfdfd; border-radius: 10px; padding: 12px 13px; color: var(--ink); outline: none; transition: .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--teal-2); box-shadow: 0 0 0 3px rgba(15,148,139,.12); background: white; }
textarea { min-height: 86px; resize: vertical; }
.helper { font-size: .7rem; color: var(--muted); }
.measure-grid { display: grid; grid-template-columns: 1.3fr repeat(3, .8fr) .8fr; gap: 8px; align-items: center; }
.measure-grid.header { color: var(--muted); font-size: .68rem; padding: 0 6px 7px; }
.measure-row { display: contents; }
.measure-name { display: flex; flex-direction: column; padding: 9px 6px; font-weight: 700; font-size: .78rem; }
.measure-name small { color: var(--muted); font-weight: 400; margin-top: 3px; }
.measure-grid input { padding: 9px 8px; font-size: .8rem; }
.computed { border-radius: 8px; background: var(--soft); padding: 10px 8px; text-align: center; font-size: .78rem; font-weight: 700; }
.computed .quality-note { display: block; margin-top: 4px; font-size: .6rem; font-weight: 700; line-height: 1.25; }
.quality-note.ok { color: var(--teal); }
.quality-note.warn { color: #9a6417; }
.quality-note.neutral { color: var(--muted); }
.measure-grid input.needs-attention { border-color: #d99125; background: #fff9ee; box-shadow: 0 0 0 2px rgba(217,145,37,.1); }
.info-button { border: 0; background: transparent; color: var(--teal); font-size: .72rem; padding: 0; text-align: left; margin-top: 4px; }
.callout { border-radius: 12px; padding: 14px 15px; font-size: .8rem; line-height: 1.45; margin-top: 20px; }
.callout.info { background: #eef8fa; color: #285667; border: 1px solid #d2ebef; }
.callout.warn { background: var(--amber-bg); color: #7b531d; border: 1px solid #f0d9ab; }
.callout.danger { background: var(--red-bg); color: var(--red); border: 1px solid #f0cfcc; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.choice-card { border: 1px solid var(--line); border-radius: 13px; padding: 16px; text-align: left; background: white; color: var(--ink); }
.choice-card:hover, .choice-card.selected { border-color: var(--teal); background: #f2fbf9; box-shadow: 0 0 0 2px rgba(11,123,117,.08); }
.choice-card strong { display: block; font-size: .88rem; margin-bottom: 5px; }
.choice-card span { display: block; color: var(--muted); font-size: .75rem; line-height: 1.4; }
.choice-card em { display: inline-block; margin-top: 11px; color: var(--teal); font-size: .68rem; font-style: normal; font-weight: 700; }
.section-divider { display: flex; align-items: center; gap: 12px; margin: 26px 0 16px; color: var(--ink); font-family: Manrope,sans-serif; font-size: .78rem; font-weight: 800; }
.section-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.section-divider.major { margin-top: 34px; font-size: .92rem; }
.source-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.source-card { min-height: 112px; position: relative; display: grid; align-content: start; gap: 7px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--ink); text-align: left; }
.source-card:hover, .source-card.selected { border-color: var(--teal); background: #f2fbf9; box-shadow: 0 0 0 2px rgba(11,123,117,.08); }
.source-card strong { padding-right: 22px; font-size: .82rem; }
.source-card small { color: var(--muted); font-size: .71rem; line-height: 1.4; }
.selection-mark { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #bfd0d3; border-radius: 50%; color: white; font-size: .7rem; font-weight: 800; }
.source-card.selected .selection-mark { border-color: var(--teal); background: var(--teal); }
.source-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #f8fbfb; }
.protocol-card { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 12px; position: relative; background: white; text-align: left; color: var(--ink); }
.protocol-card:hover, .protocol-card.selected { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(11,123,117,.08); }
.protocol-card.recommended { border-color: var(--teal); background: #f5fcfb; }
.protocol-card:disabled { cursor: not-allowed; opacity: .58; }
.protocol-card h3 { margin: 0 0 6px; font-size: .95rem; }
.protocol-card p { color: var(--muted); font-size: .76rem; margin: 0; line-height: 1.45; }
.protocol-tag { display: inline-block; margin-top: 12px; padding: 5px 8px; border-radius: 999px; background: var(--mint); color: var(--teal); font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.protocol-tag.muted { background: #eef2f3; color: #6a7b83; }
.mode-switch { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px; margin: -4px 0 18px; border: 1px solid var(--line); border-radius: 13px; background: #f7fafb; }
.mode-switch div { display: grid; gap: 4px; }
.mode-switch strong { font-size: .84rem; }
.mode-switch span { color: var(--muted); font-size: .73rem; }
.status-list { display: grid; gap: 10px; margin-top: 18px; }
.status-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid #edf2f3; font-size: .77rem; }
.status-row:last-child { border-bottom: 0; padding-bottom: 0; }
.pill { padding: 4px 8px; border-radius: 999px; font-size: .64rem; font-weight: 700; }
.pill.ok { background: var(--mint); color: var(--teal); }
.pill.warn { background: var(--amber-bg); color: var(--amber); }
.pill.neutral { background: #eef2f3; color: #60727a; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.result-card { background: #f7fafb; border: 1px solid var(--line); border-radius: 13px; padding: 16px; }
.result-card span { display: block; color: var(--muted); font-size: .68rem; margin-bottom: 8px; }
.result-card strong { font-family: Manrope, sans-serif; font-size: 1.25rem; letter-spacing: -.04em; }
.result-card small { display: block; color: var(--teal); font-size: .65rem; margin-top: 6px; }
.composition-masses { grid-template-columns: repeat(2, 1fr); margin-top: 14px; }
.content-heading { margin: 0 0 12px; font-size: .92rem; }
.body-composition { margin-top: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #f8fbfb; }
.body-composition-head { display: flex; justify-content: space-between; gap: 24px; align-items: end; }
.body-composition-head div { display: grid; gap: 3px; }
.body-composition-head span, .body-composition-head small { color: var(--muted); font-size: .72rem; }
.body-composition-head strong { font-family: Manrope,sans-serif; font-size: 1.2rem; }
.body-composition-head small { max-width: 370px; line-height: 1.4; text-align: right; }
.body-composition-bar { display: flex; height: 28px; margin-top: 16px; overflow: hidden; border: 3px solid white; border-radius: 999px; background: #e7edef; box-shadow: 0 0 0 1px var(--line); }
.body-composition-bar span { display: block; min-width: 2px; transition: width .25s ease; }
.lean-segment { background: var(--teal); }
.fat-segment { background: #e6a33d; }
.body-composition-legend { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.body-composition-legend div { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: white; border: 1px solid var(--line); }
.body-composition-legend i { width: 10px; height: 10px; border-radius: 50%; }
.body-composition-legend i.lean { background: var(--teal); }
.body-composition-legend i.fat { background: #e6a33d; }
.body-composition-legend span { color: var(--muted); font-size: .7rem; }
.body-composition-legend strong { font-size: .76rem; }
.body-composition.compact { margin: 0 0 14px; padding: 15px; }
.body-composition.compact .body-composition-bar { height: 22px; margin-top: 12px; }
.collection-grid { margin-top: 14px; }
.status-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.status-metric { --tone: #77858c; --tone-bg: #f3f6f7; border: 1px solid var(--line); border-left: 4px solid var(--tone); border-radius: 13px; padding: 16px; background: white; }
.status-metric.normal { --tone: var(--teal); --tone-bg: var(--mint); }
.status-metric.attention { --tone: #c47b18; --tone-bg: var(--amber-bg); }
.status-metric.high { --tone: var(--red); --tone-bg: var(--red-bg); }
.status-metric.low { --tone: #3079a6; --tone-bg: #eaf5fb; }
.status-metric.neutral { --tone: #77858c; --tone-bg: #eef2f3; }
.status-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.status-top > span:first-child { color: var(--muted); font-size: .68rem; }
.status-chip { padding: 4px 7px; border-radius: 999px; color: var(--tone); background: var(--tone-bg); font-size: .6rem; font-weight: 800; text-align: right; }
.status-metric > strong { display: block; margin-top: 10px; font-family: Manrope,sans-serif; font-size: 1.25rem; }
.status-metric > small { display: block; margin-top: 7px; color: var(--tone); font-size: .65rem; font-weight: 700; }
.range-bar { position: relative; height: 5px; margin-top: 14px; border-radius: 999px; background: linear-gradient(90deg,#dcecf5 0 25%,#bce8df 25% 55%,#f4d399 55% 78%,#edb7b2 78%); }
.range-marker { position: absolute; top: 50%; width: 12px; height: 12px; border: 2px solid white; border-radius: 50%; background: var(--tone); box-shadow: 0 1px 4px rgba(0,0,0,.25); transform: translate(-50%,-50%); }
.validation-card { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: #f7fafb; }
.validation-card div { display: grid; gap: 5px; }
.validation-card div span { color: var(--muted); font-size: .68rem; }
.validation-card strong { font-size: .9rem; }
.fold-checks { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.fold-checks > div { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: .72rem; }
.muscle-pending { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-top: 14px; padding: 15px 16px; border: 1px dashed #bac9cd; border-radius: 12px; background: #f7fafb; }
.muscle-pending div { display: grid; gap: 4px; }
.muscle-pending strong { font-size: .82rem; }
.muscle-pending span, .muscle-pending p { color: var(--muted); font-size: .72rem; }
.muscle-pending p { max-width: 360px; margin: 0; line-height: 1.45; }
.recommended-equation { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px; border: 1px solid #b9ddd9; border-left: 4px solid var(--teal); border-radius: 13px; background: #f4fbfa; }
.recommended-equation > div { display: grid; gap: 5px; }
.recommended-equation > div:last-child { text-align: right; }
.recommended-equation span { color: var(--teal); font-size: .69rem; font-weight: 700; }
.recommended-equation strong { font-family: Manrope,sans-serif; font-size: 1rem; }
.recommended-equation p { margin: 0; color: var(--muted); font-size: .73rem; line-height: 1.4; }
.equation-compare { margin-top: 12px; border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; }
.equation-compare summary { color: var(--teal); font-size: .75rem; font-weight: 700; cursor: pointer; }
.subheading { margin: 24px 0 10px; font-size: .9rem; }
.factor-panel, .detailed-panel { margin-top: 14px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: #f8fbfb; }
.factor-panel h3 { margin: 0 0 4px; font-size: .85rem; }
.factor-panel h3 small { color: var(--muted); font-family: "DM Sans",sans-serif; font-size: .67rem; font-weight: 500; }
.factor-panel > p { margin: 0 0 14px; color: var(--muted); font-size: .72rem; }
.factor-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.factor-option { position: relative; min-height: 94px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); text-align: left; }
.factor-option.selected { border-color: var(--teal); background: var(--mint); box-shadow: 0 0 0 2px rgba(11,123,117,.08); }
.choice-card:disabled { cursor: not-allowed; opacity: .58; }
.factor-option strong, .factor-option span { display: block; }
.factor-option strong { font-size: .75rem; }
.factor-option span { margin-top: 4px; color: var(--muted); font-size: .65rem; line-height: 1.35; }
.factor-option em { display: block; margin-top: 9px; color: var(--teal); font-size: .7rem; font-style: normal; font-weight: 800; }
.routine-note { display: grid; grid-template-columns: 1fr auto; gap: 3px 14px; padding-bottom: 13px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.routine-note span, .routine-note small { color: var(--muted); font-size: .68rem; }
.routine-note small { grid-column: 1/-1; }
.routine-note strong { font-size: .76rem; }
.exercise-row { display: grid; grid-template-columns: minmax(0,1.7fr) repeat(2,minmax(110px,.6fr)); gap: 12px; align-items: end; padding: 13px 0; border-bottom: 1px solid var(--line); }
.exercise-row > div, .exercise-row label { display: grid; gap: 5px; }
.exercise-row strong, .exercise-row label { color: #3f535e; font-size: .69rem; }
.exercise-row input, .exercise-row select { padding: 9px 10px; font-size: .73rem; }
.exercise-row label { position: relative; }
.exercise-row label span { position: absolute; right: 9px; bottom: 10px; color: var(--muted); font-size: .62rem; }
.exercise-row label input { padding-right: 42px; }
.exercise-list { display: grid; gap: 12px; margin-top: 12px; }
.exercise-card { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.exercise-card-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.exercise-card-head > div { display: grid; gap: 3px; }
.exercise-card-head span { color: var(--muted); font-size: .68rem; }
.exercise-card-head strong { font-size: .86rem; }
.variable-toggle { display: flex; align-items: center; gap: 7px; color: #3f535e; font-size: .72rem; font-weight: 700; }
.variable-toggle input { width: 17px; height: 17px; accent-color: var(--teal); }
.exercise-fields { display: grid; grid-template-columns: minmax(0,1.8fr) minmax(140px,.7fr); gap: 12px; margin-top: 13px; }
.exercise-fields label { display: grid; gap: 6px; color: #3f535e; font-size: .72rem; font-weight: 700; }
.exercise-fields input, .exercise-fields select { padding: 10px; font-size: .76rem; }
.unit-input { position: relative; }
.unit-input span { position: absolute; right: 10px; bottom: 11px; color: var(--muted); font-size: .66rem; }
.unit-input input { padding-right: 44px; }
.schedule-block { margin-top: 13px; padding: 13px; border-radius: 11px; background: #f4f8f8; }
.schedule-label { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 9px; }
.schedule-label span { color: #3f535e; font-size: .72rem; font-weight: 700; }
.schedule-label small { color: var(--teal); font-size: .68rem; font-weight: 700; }
.weekday-picker { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 6px; }
.weekday { min-height: 38px; padding: 7px 4px; border: 1px solid #cbdadd; border-radius: 9px; background: white; color: #40545e; font-size: .7rem; font-weight: 700; }
.weekday span { display: inline-block; width: 10px; margin-right: 2px; color: white; }
.weekday:hover, .weekday.selected { border-color: var(--teal); background: var(--teal); color: white; }
.frequency-input { max-width: 160px; }
.exercise-estimate { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)) auto; gap: 8px 14px; align-items: center; margin-top: 12px; }
.exercise-estimate div { display: grid; gap: 2px; }
.exercise-estimate span, .exercise-estimate small { color: var(--muted); font-size: .66rem; }
.exercise-estimate strong { color: var(--teal); font-size: .78rem; }
.exercise-estimate small { text-align: right; }
.estimate-note { margin: 11px 0 0; color: var(--muted); font-size: .69rem; line-height: 1.45; }
.calculation-line { display: flex; justify-content: space-between; gap: 16px; padding-top: 14px; font-size: .74rem; }
.weekly-distribution { align-items: center; margin-top: 4px; padding: 14px; border-radius: 10px; background: #edf8f7; }
.weekly-distribution strong { color: var(--teal); }
.energy-path { margin-top: 18px; padding: 17px; border: 1px solid #bcd8dc; border-radius: 13px; background: #f8fbfc; }
.energy-path-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 13px; }
.energy-path-head > div { display: grid; gap: 4px; }
.energy-path-head span { color: var(--teal); font-size: .67rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.energy-path-head h3 { margin: 0; font-size: .94rem; }
.energy-path-head > small { max-width: 290px; color: var(--muted); font-size: .7rem; line-height: 1.45; text-align: right; }
.energy-ledger { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.energy-ledger > div, .energy-path-grid > div:not(.path-operator) { display: grid; align-content: start; gap: 5px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.energy-ledger span, .energy-path-grid span { color: #55717d; font-size: .68rem; }
.energy-ledger strong, .energy-path-grid strong { font-family: Manrope,sans-serif; font-size: .9rem; }
.energy-ledger small, .energy-path-grid small { color: var(--muted); font-size: .66rem; line-height: 1.4; }
.energy-ledger .ledger-total, .energy-path-grid .path-total { border-color: #8ccbc5; background: var(--mint); }
.energy-ledger .ledger-total strong, .energy-path-grid .path-total strong { color: var(--teal); }
.energy-path-grid.simple-path { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,.75fr) auto minmax(0,1.15fr); gap: 8px; align-items: stretch; }
.path-operator { display: grid; place-items: center; color: var(--teal); font-size: 1.1rem; font-weight: 800; }
.met-trace { margin-top: 12px; border-top: 1px solid var(--line); }
.met-trace > summary { padding: 13px 2px 3px; color: var(--teal); cursor: pointer; font-size: .72rem; font-weight: 800; }
.met-formula { display: grid; gap: 6px; margin-top: 12px; padding: 13px; border-left: 3px solid var(--teal); background: white; }
.met-formula strong { font-size: .75rem; }
.met-formula code { color: #174e60; font-size: .75rem; line-height: 1.5; white-space: normal; }
.met-formula p { margin: 0; color: var(--muted); font-size: .68rem; line-height: 1.45; }
.met-table { min-width: 650px; }
.manual-adjustment { margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fbfdfd; }
.manual-adjustment.selected { border-color: #78c5be; background: #f1faf8; box-shadow: 0 0 0 2px rgba(11,123,117,.06); }
.manual-adjustment-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.manual-adjustment-head > div:first-child { display: grid; gap: 4px; }
.manual-adjustment-head strong { font-size: .82rem; }
.manual-adjustment-head span, .manual-hint { color: var(--muted); font-size: .69rem; line-height: 1.4; }
.direction-toggle { display: inline-flex; padding: 3px; border-radius: 9px; background: #e8eff0; }
.direction-toggle button { padding: 7px 10px; border: 0; border-radius: 7px; background: transparent; color: #52666f; font-size: .68rem; font-weight: 800; }
.direction-toggle button.selected { background: white; color: var(--teal); box-shadow: 0 1px 4px rgba(19,50,63,.12); }
.manual-adjustment-body { display: grid; grid-template-columns: minmax(180px,1fr) repeat(2,minmax(140px,.8fr)); gap: 10px; align-items: end; margin-top: 13px; }
.manual-adjustment-body > label, .manual-adjustment-body > div { display: grid; gap: 5px; }
.manual-adjustment-body > label, .manual-adjustment-body span { color: #55717d; font-size: .7rem; font-weight: 700; }
.manual-adjustment-body > div { padding: 10px 12px; border-radius: 9px; background: white; }
.manual-adjustment-body strong { color: #174e60; font-size: .79rem; }
.manual-adjustment-body .unit-input input { width: 100%; padding: 10px 78px 10px 10px; }
.manual-adjustment-body .unit-input span { right: 10px; bottom: 11px; }
.manual-hint { margin: 10px 0 0; }
.energy-result { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-top: 15px; }
.energy-result div { padding: 15px; border-radius: 11px; background: #eaf7fa; border: 1px solid #cbe7ec; }
.energy-result span, .energy-result strong { display: block; }
.energy-result span { color: #55717d; font-size: .68rem; }
.energy-result strong { margin-top: 5px; color: #174e60; font-family: Manrope,sans-serif; font-size: 1rem; }
.energy-result small { display: block; margin-top: 5px; color: var(--muted); font-size: .66rem; }
.report-overview { margin-bottom: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #f8fbfb; }
.overview-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.overview-head > div:first-child span { color: var(--teal); font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.overview-head h3 { margin: 4px 0 0; font-size: .94rem; }
.overview-counts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.overview-counts span { padding: 5px 8px; border-radius: 999px; background: #eef2f3; color: var(--muted); font-size: .63rem; font-weight: 700; }
.overview-counts .ok { background: var(--mint); color: var(--teal); }
.overview-counts .warn { background: var(--amber-bg); color: var(--amber); }
.report-status-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; }
.report-metric { --tone:#77858c; padding: 11px; border-radius: 10px; border: 1px solid var(--line); border-top: 3px solid var(--tone); background: white; }
.report-metric.normal { --tone:var(--teal); }
.report-metric.attention { --tone:#c47b18; }
.report-metric.high { --tone:var(--red); }
.report-metric.low { --tone:#3079a6; }
.report-metric span, .report-metric strong, .report-metric em { display: block; }
.report-metric span { color: var(--muted); font-size: .61rem; }
.report-metric strong { margin-top: 5px; font-size: .78rem; }
.report-metric em { margin-top: 6px; color: var(--tone); font-size: .6rem; font-style: normal; font-weight: 700; line-height: 1.3; }
.report-results { grid-template-columns: repeat(2,1fr); margin-bottom: 14px; }
.equation { margin-top: 18px; padding: 18px; border-left: 3px solid var(--teal); background: #f5f9fa; border-radius: 0 10px 10px 0; }
.equation code { display: block; color: #264d5b; font-size: .76rem; white-space: normal; line-height: 1.6; }
.metric-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: .76rem; }
.metric-table th, .metric-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.metric-table th { color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; }
.metric-table td:last-child, .metric-table th:last-child { text-align: right; }
.context-panel h3 { margin: 0 0 8px; font-size: .92rem; }
.context-panel > p { color: var(--muted); line-height: 1.5; font-size: .76rem; margin: 0 0 18px; }
.mini-card { border-top: 1px solid var(--line); padding: 15px 0 0; margin-top: 15px; }
.mini-card strong { display: block; font-size: .76rem; margin-bottom: 6px; }
.mini-card p { color: var(--muted); font-size: .71rem; line-height: 1.45; margin: 0; }
.tips { margin: 10px 0 0; padding-left: 16px; color: var(--muted); font-size: .72rem; line-height: 1.7; }
.summary-hero { background: var(--navy); color: white; border-radius: 15px; padding: 22px; margin-bottom: 18px; }
.summary-hero span { color: #8fcfc9; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.summary-hero h2 { margin: 8px 0 5px; font-size: 1.25rem; }
.summary-hero p { color: #b7c9cf; font-size: .75rem; margin: 0; }
.actions-bar { position: fixed; left: 250px; right: 0; bottom: 0; z-index: 20; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); border-top: 1px solid var(--line); min-height: 76px; padding: 14px 4vw; display: flex; justify-content: space-between; align-items: center; }
.actions-bar > span { color: var(--muted); font-size: .74rem; }
.primary-button, .secondary-button { border-radius: 10px; padding: 11px 17px; font-weight: 700; font-size: .82rem; }
.primary-button { border: 0; background: var(--teal); color: white; min-width: 130px; }
.primary-button:hover { background: #086a65; }
.primary-button span { margin-left: 8px; }
.secondary-button { border: 1px solid var(--line); background: white; color: var(--ink); }
.secondary-button:disabled { opacity: .35; cursor: default; }
.toast { position: fixed; right: 28px; bottom: 94px; background: var(--navy); color: white; padding: 12px 16px; border-radius: 10px; font-size: .78rem; box-shadow: var(--shadow); transform: translateY(20px); opacity: 0; pointer-events: none; transition: .2s; z-index: 40; }
.toast.show { transform: translateY(0); opacity: 1; }
.nav-count { margin-left: auto; min-width: 22px; padding: 2px 6px; border-radius: 999px; background: rgba(115,225,214,.15); color: #8de7de; font-size: .68rem; text-align: center; }
.session-modal[hidden] { display: none; }
.session-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 22px; }
.session-modal-backdrop { position: absolute; inset: 0; border: 0; background: rgba(9,35,48,.58); backdrop-filter: blur(4px); }
.session-modal-card { position: relative; width: min(820px,100%); max-height: calc(100vh - 44px); overflow: auto; border-radius: 18px; background: white; padding: 24px; box-shadow: 0 24px 70px rgba(9,35,48,.3); }
.session-modal-card > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.session-modal-card h2 { margin: 5px 0 0; font-size: 1.25rem; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font-size: 1.4rem; }
.session-records { display: grid; gap: 10px; }
.session-record { display: grid; grid-template-columns: minmax(180px,1.2fr) 1fr auto; align-items: center; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fbfdfd; }
.session-record > div { display: grid; gap: 3px; }
.session-record > div span { color: var(--teal); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.session-record > div small { color: var(--muted); font-size: .72rem; }
.session-record dl { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 0; }
.session-record dl div { display: grid; gap: 2px; }
.session-record dt { color: var(--muted); font-size: .66rem; }
.session-record dd { margin: 0; font-size: .78rem; font-weight: 800; }
.session-empty { padding: 34px 20px; border: 1px dashed #b8c9cd; border-radius: 13px; text-align: center; color: var(--muted); }
.session-empty strong { color: var(--ink); }
.session-empty p { margin: 6px 0 0; font-size: .78rem; }
.session-new-button { width: 100%; margin-top: 14px; }
.third-button { min-height: 38px; padding: 7px; border: 1px dashed #b8c9cd; border-radius: 9px; background: #f8fbfb; color: var(--teal); font-size: .67rem; font-weight: 700; }
.additional-measures, .protocol-options, .technical-details { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfd; }
.additional-measures > summary, .protocol-options > summary, .technical-details > summary { padding: 14px 16px; color: var(--teal); cursor: pointer; font-size: .76rem; font-weight: 800; }
.additional-measures > .measure-grid { padding: 0 14px 14px; }
.protocol-options { padding: 0 12px 12px; }
.protocol-options > summary { margin: 0 -12px 10px; }
.protocol-options .protocol-card { padding: 13px 15px; margin-bottom: 8px; border-radius: 10px; }
.protocol-options .protocol-card h3 { font-size: .8rem; }
.protocol-options .protocol-card p { font-size: .69rem; }
.protocol-hero { display: flex; justify-content: space-between; gap: 22px; align-items: center; padding: 20px; border: 1px solid #a9d7d2; border-left: 5px solid var(--teal); border-radius: 14px; background: #f2fbf9; }
.protocol-hero > div { display: grid; gap: 5px; }
.protocol-hero span { color: var(--teal); font-size: .67rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.protocol-hero h3, .protocol-hero p { margin: 0; }
.protocol-hero h3 { font-size: 1rem; }
.protocol-hero p, .protocol-hero small { color: var(--muted); font-size: .72rem; line-height: 1.45; }
.protocol-hero.chosen-protocol, .recommended-equation.chosen-equation { border-color: #77c5be; background: #eefaf8; box-shadow: 0 0 0 2px rgba(11,123,117,.06); }
.selection-pill { flex: 0 0 auto; padding: 7px 11px; border-radius: 999px; background: var(--teal); color: white !important; font-size: .68rem !important; font-weight: 800; text-transform: none !important; letter-spacing: 0 !important; }
.selection-pill.warn { background: #b87416; }
.protocol-hero.outside-reference { border-color: #e1b56f; background: #fff9ee; }
.current-protocol, .selected-formula { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 10px; padding: 11px 13px; border-radius: 10px; background: #f4f7f8; font-size: .72rem; }
.current-protocol span, .selected-formula span { color: var(--muted); }
.guide-card { display: grid; gap: 12px; }
.guide-kicker { color: var(--teal); font-size: .63rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.guide-image { width: 100%; aspect-ratio: 1/1; border-radius: 13px; background-image: url('./assets/fold-guide-sprite-v2.webp'); background-size: 300% 300%; background-repeat: no-repeat; border: 1px solid var(--line); }
.circumference-guide-image { background-image: url('./assets/circumference-guide-sprite-v2.webp'); background-size: 300% 200%; }
.basic-fields { margin-bottom: 12px; }
.basic-guides { margin: 0 0 24px; border: 1px solid var(--line); border-radius: 13px; background: #f8fbfb; }
.basic-guides > summary { padding: 13px 15px; color: var(--teal); cursor: pointer; font-size: .75rem; font-weight: 800; }
.guide-intro { margin: 0 15px 12px; color: var(--muted); font-size: .7rem; }
.basic-guide-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 0 15px 14px; }
.basic-guide-card { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.basic-guide-image { aspect-ratio: 2/1; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background-image: url('./assets/basic-measurement-guide-v2.webp'); background-size: 200% 100%; }
.basic-guide-copy { display: grid; gap: 10px; padding: 13px; }
.basic-guide-copy dl { display: grid; gap: 8px; margin: 0; }
.basic-guide-copy dl div { display: grid; gap: 2px; }
.basic-guide-copy dt { color: var(--ink); font-size: .64rem; font-weight: 800; }
.basic-guide-copy dd { margin: 0; color: var(--muted); font-size: .68rem; line-height: 1.42; }
.guide-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.guide-title strong { font-size: .94rem; }
.guide-title span { padding: 4px 7px; border-radius: 999px; background: var(--mint); color: var(--teal); font-size: .62rem; font-weight: 800; }
.guide-card dl { display: grid; gap: 9px; margin: 0; }
.guide-card dl div { display: grid; gap: 2px; }
.guide-card dt { color: var(--ink); font-size: .66rem; font-weight: 800; }
.guide-card dd, .guide-card > small { margin: 0; color: var(--muted); font-size: .69rem; line-height: 1.42; }
.guide-card > small { padding-top: 10px; border-top: 1px solid var(--line); }
.guide-source { color: var(--muted); font-size: .64rem; line-height: 1.4; }
.guide-source a { color: var(--teal); font-weight: 800; }
.basic-guides > .guide-source { display: block; margin: 0 15px 14px; }
.mobile-guide { display: none; }
.guide-active { color: var(--teal); }
.table-scroll { overflow-x: auto; }
.reference-table { min-width: 700px; margin-top: 0; }
.reference-table td:nth-child(2) { font-weight: 700; }
.status-chip.normal { color: var(--teal); background: var(--mint); }
.status-chip.attention { color: #a7640b; background: var(--amber-bg); }
.status-chip.high { color: var(--red); background: var(--red-bg); }
.status-chip.low { color: #3079a6; background: #eaf5fb; }
.status-chip.neutral { color: #60727a; background: #eef2f3; }
.technical-details { padding-bottom: 0; }
.technical-details .equation { margin: 0 14px 14px; }
.evidence-details .table-scroll { margin: 0 14px 14px; }
.clinical-matrix th { width: 175px; color: var(--muted); font-size: .65rem; text-align: left; vertical-align: top; }
.clinical-matrix td { font-size: .69rem; line-height: 1.5; }
.clinical-matrix a { color: var(--teal); font-weight: 700; }
.selected-row { background: #f3fbfa; }
.table-recommended { display: block; margin-top: 3px; color: var(--teal); font-size: .61rem; }
.compatibility-note { display: block; max-width: 330px; margin-top: 6px; color: var(--muted); font-size: .64rem; line-height: 1.4; }
.table-action { padding: 6px 9px; border: 1px solid #b9d6d3; border-radius: 7px; background: white; color: var(--teal); font-size: .66rem; font-weight: 800; white-space: nowrap; }
.recommended-equation .table-action { margin-top: 7px; justify-self: end; }
.table-action:disabled { cursor: default; opacity: .55; }
.primary-button:disabled { cursor: not-allowed; opacity: .45; }
.energy-context { display: grid; gap: 16px; margin-bottom: 18px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: #f8fbfb; }
.energy-context > div:first-child { display: grid; gap: 4px; }
.energy-context h3, .energy-context p { margin: 0; }
.energy-context h3 { font-size: .92rem; }
.energy-context p { color: var(--muted); font-size: .72rem; line-height: 1.45; }
.context-kicker { color: var(--teal); font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.energy-context .fields { margin: 0; }
.clinical-review { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin: 0 0 18px; padding: 15px 16px; border: 1px solid #bcdad7; border-radius: 13px; background: #f3fbfa; }
.clinical-review.warn { border-color: #e4bf82; background: #fff9ef; }
.clinical-review.neutral { border-color: var(--line); background: #f7fafb; }
.clinical-review.compact { margin-top: 10px; }
.clinical-review > div { display: grid; gap: 4px; }
.clinical-review > div > span:first-child { color: var(--muted); font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.clinical-review strong { font-size: .84rem; }
.clinical-review p { margin: 0; color: var(--muted); font-size: .69rem; line-height: 1.45; }
.clinical-audit { margin: 26px 0 18px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #f8fbfb; }
.clinical-audit-head { display: grid; gap: 3px; margin-bottom: 14px; }
.clinical-audit-head span { color: var(--teal); font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.clinical-audit-head h3 { margin: 0; font-size: .94rem; }
.clinical-audit-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.clinical-audit-grid > div { display: grid; align-content: start; gap: 7px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.clinical-audit-grid > div > span { color: var(--muted); font-size: .65rem; }
.clinical-audit-grid strong { font-size: .82rem; }
.clinical-audit-grid em { width: max-content; font-style: normal; }
.clinical-audit-grid p { margin: 0; color: var(--muted); font-size: .68rem; line-height: 1.45; }
.activity-builder { display: grid; grid-template-columns: minmax(0,1fr) minmax(300px,.9fr); gap: 16px; align-items: end; margin-top: 16px; padding: 16px; border: 1px solid #bcdad7; border-radius: 13px; background: #f1faf8; }
.activity-builder > div:first-child { display: grid; gap: 4px; }
.activity-builder strong { font-size: .82rem; }
.activity-builder span { color: var(--muted); font-size: .69rem; line-height: 1.4; }
.activity-picker-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.activity-picker-row select { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); font-size: .75rem; }
.activity-picker-row .primary-button { min-width: auto; white-space: nowrap; }
.activity-card-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.remove-activity { padding: 6px 9px; border: 1px solid #efc4c4; border-radius: 7px; background: #fff8f8; color: #a94343; font-size: .66rem; font-weight: 800; }
.custom-activity-fields { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(130px,.7fr); gap: 10px; }
.empty-activities { margin-top: 12px; padding: 20px; border: 1px dashed #b8c9cd; border-radius: 11px; background: #fbfdfd; color: var(--muted); font-size: .72rem; text-align: center; }
.exercise-card { padding: 0; overflow: hidden; }
.exercise-card > summary { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 15px 16px; cursor: pointer; list-style: none; }
.exercise-card > summary::-webkit-details-marker { display: none; }
.exercise-card > summary::after { content: '⌄'; color: var(--teal); font-weight: 800; }
.exercise-card[open] > summary::after { transform: rotate(180deg); }
.exercise-card > summary > div { display: grid; gap: 3px; }
.exercise-card > summary > div:nth-child(2) { margin-left: auto; text-align: right; }
.exercise-card > summary span, .exercise-card > summary small { color: var(--muted); font-size: .65rem; }
.exercise-card > summary strong { font-size: .8rem; }
.exercise-card-body { padding: 0 16px 16px; border-top: 1px solid var(--line); }
.exercise-card-body .exercise-card-head { padding-top: 12px; }
.energy-result { grid-template-columns: repeat(2,1fr); }
.report-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.report-actions > div { display: grid; gap: 2px; }
.report-actions strong { font-size: .82rem; }
.report-actions span { color: var(--muted); font-size: .68rem; }

.auth-gate { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg,#edf7f6 0%,#f8fbfb 48%,#e8f1f2 100%); }
.auth-gate[hidden] { display: none; }
.auth-card { width: min(100%,430px); padding: 34px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: 0 24px 70px rgba(18,52,58,.14); }
.auth-brand { margin-bottom: 30px; color: var(--ink); }
.auth-card h1 { margin: 7px 0 8px; font-size: 1.6rem; }
.auth-card > p { margin: 0 0 22px; color: var(--muted); font-size: .83rem; line-height: 1.55; }
.auth-mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0 0 18px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: #f3f7f7; }
.auth-mode-tab { min-height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: .82rem; font-weight: 800; cursor: pointer; }
.auth-mode-tab.active { background: white; color: var(--teal); box-shadow: 0 2px 8px rgba(18,52,58,.1); }
.auth-mode-tab:focus-visible { outline: 2px solid rgba(10,119,111,.28); outline-offset: 1px; }
.auth-card form { display: grid; gap: 14px; }
.auth-card label { display: grid; gap: 7px; color: var(--ink); font-size: .75rem; font-weight: 700; }
.auth-card .activation-name[hidden] { display: none; }
.auth-card input { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); font: inherit; }
.auth-card input:focus { outline: 2px solid rgba(10,119,111,.18); border-color: var(--teal); }
.auth-card .primary-button { width: 100%; margin-top: 4px; }
.auth-card .auth-security { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: .68rem; text-align: center; }
.auth-error { margin: 0!important; padding: 10px 12px; border: 1px solid #efc4c4; border-radius: 8px; background: #fff8f8; color: #9d3434!important; font-size: .72rem!important; }
.pilot-modal-card { width: min(94vw,780px); max-height: min(88vh,880px); overflow-y: auto; }
.pilot-intro { margin: -4px 0 20px; color: var(--muted); font-size: .82rem; line-height: 1.55; }
.pilot-link-form { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #f8fbfb; }
.pilot-link-form label { display: grid; gap: 7px; color: var(--ink); font-size: .75rem; font-weight: 700; }
.pilot-link-form input,.pilot-copy-row input { min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); font: inherit; }
.pilot-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pilot-generated { display: grid; gap: 12px; margin-top: 14px; padding: 16px; border: 1px solid #8bd4cc; border-radius: 12px; background: #edf9f7; }
.pilot-generated > div:first-child { display: grid; gap: 3px; }
.pilot-generated small,.pilot-row small { color: var(--muted); line-height: 1.4; }
.pilot-copy-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.pilot-section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 26px 0 10px; }
.pilot-section-head h3 { margin: 2px 0 0; }
.text-button { border: 0; background: transparent; color: var(--teal); font: inherit; font-size: .75rem; font-weight: 800; cursor: pointer; }
.pilot-list { display: grid; gap: 8px; }
.pilot-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.pilot-row > div:first-child { display: grid; gap: 4px; }
.pilot-row-actions,.pilot-user-stats { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; text-align: right; }
.status-pill { padding: 5px 8px; border-radius: 999px; font-size: .66rem; font-weight: 800; }
.status-pill.success { background: #dcf5ef; color: #087268; }
.status-pill.warn { background: #fff1cc; color: #835d00; }
.status-pill.danger { background: #fde4e4; color: #a43636; }
.status-pill.muted { background: #edf1f2; color: #63747a; }
.danger-text { color: #b23c3c; }
.pilot-user-stats span { font-size: .68rem; font-weight: 700; color: var(--ink); }
.empty-state { margin: 0; padding: 20px; border: 1px dashed var(--line); border-radius: 11px; color: var(--muted); text-align: center; }
@media (max-width:680px){
  .auth-gate { align-items: start; overflow-y: auto; padding: 16px; }
  .auth-card { margin: 14px 0; padding: 24px 20px; }
  .pilot-modal-card { width: calc(100vw - 20px); max-height: calc(100vh - 20px); padding: 20px 16px; }
  .pilot-form-row { grid-template-columns: 1fr; }
  .pilot-copy-row { grid-template-columns: 1fr; }
  .pilot-row { align-items: flex-start; flex-direction: column; }
  .pilot-row-actions,.pilot-user-stats { justify-content: flex-start; text-align: left; }
}

@media (max-width: 1050px) {
  .workspace { grid-template-columns: 1fr; }
  .context-panel { position: static; }
  .source-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mobile-guide { display: block; margin: 14px 0; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #f8fbfb; }
  .mobile-guide .guide-card { grid-template-columns: 160px 1fr; }
  .mobile-guide .guide-image { grid-row: 1/5; }
  .context-panel .guide-card { display: none; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sidebar.open { display: flex; position: fixed; z-index: 60; width: 250px; left: 0; }
  .mobile-menu { display: block; }
  .topbar { padding: 16px 18px; min-height: 80px; }
  .topbar > div:first-of-type { margin-right: auto; margin-left: 10px; }
  .top-actions .save-status { display: none; }
  h1 { font-size: 1.1rem; }
  .stepper-wrap { padding: 15px 18px 4px; }
  .stepper { display: flex; overflow-x: auto; gap: 18px; padding-bottom: 8px; }
  .step-label { min-width: max-content; }
  .workspace { padding: 20px 14px; }
  .form-card { padding: 20px; min-height: 0; }
  .fields, .choice-grid, .result-grid, .status-grid, .composition-masses, .fold-checks, .factor-grid, .energy-result, .report-status-grid, .source-grid, .source-fields, .body-composition-legend, .exercise-fields, .clinical-audit-grid { grid-template-columns: 1fr; }
  .basic-guide-grid { grid-template-columns: 1fr; }
  .activity-builder, .activity-picker-row, .custom-activity-fields { grid-template-columns: 1fr; }
  .energy-ledger, .energy-path-grid.simple-path, .manual-adjustment-body { grid-template-columns: 1fr; }
  .energy-path-head, .manual-adjustment-head { align-items: stretch; flex-direction: column; }
  .energy-path-head > small { max-width: none; text-align: left; }
  .path-operator { min-height: 24px; }
  .direction-toggle { align-self: flex-start; }
  .mode-switch, .validation-card, .muscle-pending, .recommended-equation, .overview-head, .protocol-hero, .clinical-review { align-items: stretch; flex-direction: column; }
  .body-composition-head, .exercise-card-head { align-items: flex-start; flex-direction: column; }
  .body-composition-head small { text-align: left; }
  .recommended-equation > div:last-child { text-align: left; }
  .overview-counts { justify-content: flex-start; }
  .exercise-row { grid-template-columns: 1fr; }
  .weekday-picker { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .exercise-estimate { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .exercise-estimate small { grid-column: 1/-1; text-align: left; }
  .measure-grid { grid-template-columns: 1fr; gap: 10px; }
  .measure-grid > .measure-grid.header { display: none; }
  .measure-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fbfdfd; }
  .measure-name { grid-column: 1/-1; padding: 0; }
  .computed { grid-column: 1/-1; }
  .mobile-guide .guide-card { grid-template-columns: 110px 1fr; }
  .mobile-guide .guide-card dl, .mobile-guide .guide-card > small { grid-column: 1/-1; }
  .exercise-card > summary { align-items: flex-start; }
  .exercise-card > summary > div:nth-child(2) { text-align: left; }
  .report-actions { align-items: stretch; flex-direction: column; }
  .actions-bar { left: 0; padding: 12px 14px; }
  .actions-bar > span { display: none; }
  .toast { left: 14px; right: 14px; bottom: 88px; }
  .session-modal { padding: 10px; }
  .session-modal-card { padding: 18px; max-height: calc(100vh - 20px); }
  .session-record { grid-template-columns: 1fr; }
  .session-record dl { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media print {
  .sidebar, .topbar, .stepper-wrap, .actions-bar, .context-panel, .report-actions, .toast { display: none !important; }
  .app-shell, main, .workspace { display: block; width: 100%; max-width: none; margin: 0; padding: 0; }
  .form-card { min-height: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  body { background: white; }
  .technical-details { break-inside: avoid; }
  .technical-details[open] { display: block; }
}
