/* Strobl Fitness Coach Alpha 8.1 — presentation-only refresh.
   Keeps all Alpha 8 JavaScript, local storage, data formats, and workflows. */
:root {
  color-scheme:dark;
  --bg:#0c0f16;
  --surface:#161b26;
  --surface-2:#1e2432;
  --border:#2a3242;
  --border-strong:#3a4557;
  --text:#eef4ff;
  --muted:#9aa5b5;
  /* Audi Misano Red, adapted for dark UI surfaces. */
  --accent:#bd2436;
  --accent-rgb:189,36,54;
  --accent-outline:#e8616f;
  --accent-bright:#ff8994;
  --accent-text-soft:#ffb2ba;
  --accent-text-pale:#ffd7db;
  --accent-on-solid:#fff7f8;
  --accent-border:#663441;
  --accent-surface:#321f2a;
  --accent-soft:rgba(var(--accent-rgb),.16);
  --ok:#2ee06f;
  --warning:#ffc53d;
  font-family:system-ui,-apple-system,'Segoe UI',sans-serif;
  background:var(--bg);
  color:var(--text);
}
html { -webkit-text-size-adjust:100%; background:var(--bg); }
body { margin:0; background:var(--bg); color:var(--text); padding-bottom:calc(94px + env(safe-area-inset-bottom)); line-height:1.48; -webkit-font-smoothing:antialiased; -webkit-tap-highlight-color:transparent; }
header { position:relative; background:linear-gradient(130deg,#1b202c 0%,#11151e 70%,#0c0f16 100%); padding:max(26px,calc(env(safe-area-inset-top) + 16px)) 20px 20px; border-bottom:1px solid var(--border); }
header:before { content:""; position:absolute; top:0; left:0; right:0; height:3px; background:linear-gradient(90deg,var(--accent),var(--accent-text-soft) 72%,transparent); }
header h1 { font-size:clamp(20px,4.5vw,24px); letter-spacing:.075em; font-weight:850; line-height:1.2; }
header h1 span { color:var(--accent-bright) !important; }
header p { color:var(--muted); font-size:13px; margin:8px 0 13px; }
header #dateLabel { border-color:#573440; background:rgba(var(--accent-rgb),.12); color:var(--accent-text-soft); }
main { max-width:820px; margin:auto; padding:18px 14px; }
main section { animation:sf-enter .16s ease-out; }
@keyframes sf-enter { from { opacity:.87; transform:translateY(3px) } to {opacity:1;transform:none} }
.card { background:var(--surface); border:1px solid var(--border); border-radius:17px; padding:19px 17px; margin-bottom:14px; box-shadow:0 6px 22px rgba(0,0,0,.11); }
h2 { color:#f6f7fc; font-size:19px; font-weight:750; line-height:1.28; letter-spacing:-.015em; margin:0 0 13px; }
h3 { color:#dce2ef; font-size:15px; margin:17px 0 9px; }
label { color:#b6c0d1; font-size:13px; font-weight:550; margin:13px 0 6px; }
.muted { color:var(--muted); font-size:13px; line-height:1.55; }
.small { color:#c6cfdd; }
.pill { border:1px solid var(--border-strong); color:#c4ccda; border-radius:999px; padding:5px 11px; }
input,select,textarea { background:#0e1219; color:var(--text); border:1px solid var(--border-strong); border-radius:10px; padding:12px; min-height:44px; font-size:16px; max-width:100%; }
textarea { min-height:72px; }
input:focus-visible,select:focus-visible,textarea:focus-visible,button:focus-visible,a:focus-visible,summary:focus-visible { outline:2px solid var(--accent-outline); outline-offset:2px; }
input::placeholder, textarea::placeholder { color:#808a99; }
button { background:var(--accent); color:var(--accent-on-solid); border:0; border-radius:10px; min-height:45px; padding:11px 15px; font-size:14px; font-weight:750; touch-action:manipulation; transition:filter .1s ease,transform .08s ease; }
button:hover { filter:brightness(1.08); }
button:active { transform:scale(.985); }
button.secondary { background:#272e3e; color:#edf1fa; border:1px solid #343e50; }
button.danger { background:#52252f; color:#ffe4e4; border:1px solid #753644; }
button:disabled { opacity:.52; }
a { color:var(--accent-bright); }
a:hover { color:var(--accent-text-soft); }
.grid { gap:10px; }
.metric { background:#1e2532; border:1px solid #2d3748; border-radius:13px; padding:14px 13px; }
.metric .small { color:#a5afc1; font-size:12px; }
.metric b { color:var(--accent-bright); font-size:clamp(17px,4.3vw,22px); }
.notice { background:rgba(var(--accent-rgb),.12); border-left:3px solid var(--accent); color:var(--accent-text-pale); border-radius:7px; }
.focus, .coachbox { background:#241e24; border:1px solid var(--accent-border); border-radius:13px; }
.coachbox { padding:13px; }
.coachbox b { color:var(--accent-bright); }
.nutri-track { background:#303647; height:10px; }
.nutri-track>div { background:linear-gradient(90deg,var(--accent),var(--accent-outline)); }
.nutri-line span { color:#bbc5d5; }
.preview { border-color:#343d50; background:#111722; }
.preview-item { border-color:#2c3445; }
.preview-item.current { color:var(--accent-bright); }
.preview-item.done { color:#98a4b5; }
.history, .history-workout, .comparison-table th,.comparison-table td { border-color:var(--border); }
.comparison-table thead th { color:#b4becc; }
.comparison-table td strong { color:var(--accent-text-soft); }
/* Four primary destinations, with legacy check-ins and Review still accessible from Today. */
.nav { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; align-items:stretch; background:rgba(18,22,31,.98); border-top:1px solid #313b4d; padding:8px max(8px,env(safe-area-inset-left)) max(9px,env(safe-area-inset-bottom)); box-shadow:0 -6px 24px rgba(0,0,0,.25); z-index:90; }
.nav button { min-height:55px; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:5px; font-size:11.5px; letter-spacing:.02em; color:#a6b0bf; background:transparent; border:1px solid transparent; border-radius:11px; padding:6px 2px; font-weight:700; }
.nav button:before { content:""; width:21px; height:21px; display:block; background:currentColor; mask-repeat:no-repeat; mask-position:center; mask-size:contain; -webkit-mask-repeat:no-repeat; -webkit-mask-position:center; -webkit-mask-size:contain; }
.nav button[data-nav="today"]:before { -webkit-mask-image:url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpath d="m3 10 9-7 9 7v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1z"/%3E%3Cpath d="M9 21v-8h6v8"/%3E%3C/svg%3E'); mask-image:url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpath d="m3 10 9-7 9 7v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1z"/%3E%3Cpath d="M9 21v-8h6v8"/%3E%3C/svg%3E'); }
.nav button[data-nav="workout"]:before { -webkit-mask-image:url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round"%3E%3Cpath d="M2 10v4M5 8v8M8 7v10M8 12h8M16 7v10M19 8v8M22 10v4"/%3E%3C/svg%3E'); mask-image:url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round"%3E%3Cpath d="M2 10v4M5 8v8M8 7v10M8 12h8M16 7v10M19 8v8M22 10v4"/%3E%3C/svg%3E'); }
.nav button[data-nav="progress"]:before { -webkit-mask-image:url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round"%3E%3Cpath d="M4 20V11M10 20V5M16 20v-9M22 20V3"/%3E%3C/svg%3E'); mask-image:url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round"%3E%3Cpath d="M4 20V11M10 20V5M16 20v-9M22 20V3"/%3E%3C/svg%3E'); }
.nav button[data-nav="history"]:before { -webkit-mask-image:url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Ccircle cx="12" cy="12" r="9"/%3E%3Cpath d="M12 7v5l4 2"/%3E%3C/svg%3E'); mask-image:url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Ccircle cx="12" cy="12" r="9"/%3E%3Cpath d="M12 7v5l4 2"/%3E%3C/svg%3E'); }
.nav button.active { background:var(--accent-soft); color:var(--accent-bright); border-color:var(--accent-border); }
.nav button:active { transform:none; }
/* Keep the exact third-child workflow hook required by Alpha 8's JavaScript.
   CSS ordering puts the workout flow ahead of nutrition without moving DOM nodes. */
#today:not(.hidden) { display:flex; flex-direction:column; }
#today>.card:nth-child(1) { order:0; }
#today>.card:nth-child(3) { order:1; }
#today>.card:nth-child(2) { order:2; }
#today>.card:nth-child(4) { order:3; }
#today>.card:nth-child(1) { background:linear-gradient(160deg,#1d2330,#171b26); border-color:#394052; }
#today>.card:nth-child(1) h2 { font-size:21px; }
#todayWorkout { color:var(--accent-text-soft); padding-left:11px; border-left:3px solid var(--accent); margin:5px 0 15px; font-size:13px; }
#statusGrid { grid-template-columns:repeat(2,minmax(0,1fr)); }
#today>.card:nth-child(3) { border-color:#4a303b; }
#today>.card:nth-child(3) h2 { display:flex; gap:10px; align-items:center; }
#today>.card:nth-child(3) h2:before { content:""; background:var(--accent); width:5px; height:23px; border-radius:99px; }
.a6workflow { gap:11px; align-items:stretch; }
.a6workflow>button,.a6workflow>select { max-width:none; width:100%; }
.a6workflow>label { margin:8px 0 0; }
.a6workflow #a6morning { background:var(--accent); min-height:54px; }
.a6workflow #a6evening { background:#272e3e; color:#edf1fa; border:1px solid #343e50; }
#a6workoutActions>button { width:100%; min-height:54px; background:var(--accent); color:var(--accent-on-solid); border:none; }
.a6active { background:#231f27; border:1px solid #74404e; border-radius:12px; width:100%; }
.a6active>b { color:var(--accent-text-soft); }
.a6actions { gap:8px; }
.home-quick-links { display:flex; gap:8px; flex-wrap:wrap; margin-top:14px; }
.home-quick-links button { flex:1; min-width:120px; padding:10px 11px; }
#today>.card:nth-child(2) button { margin-top:5px; margin-right:6px; }
.sf-about summary { cursor:pointer; color:#acb6c7; font-size:13px; font-weight:700; }
.sf-about summary:hover { color:var(--accent-text-soft); }
.sf-about p { margin:12px 0 0; }
/* Workout logger: bright target cues, restrained borders and more legible touch fields. */
#workout>.card>h2 { margin-bottom:16px; }
#workout .v42card,#workout .a7card { background:#1c222e !important; border-color:#313a4a !important; border-radius:13px !important; box-shadow:0 3px 13px rgba(0,0,0,.11); }
#workout .v42card .v42head, #workout .a7row { border-color:#343c4c !important; }
#workout .a7row.a8suggested { outline-color:var(--accent-outline); background:rgba(var(--accent-rgb),.08); }
#workout .a7row.a8suggested input { background:var(--accent-surface); border-color:#864652; }
#workout .a7row button { border-radius:8px; }
#workout .v42done { background:rgba(46,224,111,.09); }
#workout .v42direct input { background:#10151f; }
#workout .v42direct th,#workout .v42direct td { border-color:#343e50; }
/* Touch sliders: maintain Alpha 8's 52px interaction area and 36px handle. */
input[type="range"] { --slider-track:linear-gradient(to right,var(--accent-outline) 0%,var(--accent-outline) var(--slider-progress),#465064 var(--slider-progress),#465064 100%); }
input[type="range"]:focus-visible { outline-color:var(--accent-outline); }
input[type="range"]::-webkit-slider-thumb { border-color:var(--accent); background:var(--accent-on-solid); }
input[type="range"]::-moz-range-thumb { border-color:var(--accent); background:var(--accent-on-solid); }
/* Version-specific panels and dynamic overlays */
.a6panel,.a5dialog { background:#1b202c !important; border-color:#5a3b48 !important; color:var(--text); }
.a6modalHead,.a6modalFoot { border-color:#343c4a; }
.a6overlay { background:rgba(5,8,13,.83); }
#a6toast { background:#294435; border-color:#50bc78; }
.prep-history { border-color:#4a4546; background:#211f29; }
#bodyComposition .site-card { background:#1c222e; border-color:#344052; }
#bodyComposition .site-average,#bodyComposition .sum-preview { color:var(--accent-text-soft); }
#bodyComposition .result { background:#2d2028; border-color:#753846; }
#bodyComposition .reading-warning,#bodyComposition .message { color:var(--accent-text-pale); }
#bodyComposition .history-item { border-color:#343c4b; }
@media (min-width:640px) { #today #statusGrid { grid-template-columns:repeat(4,minmax(0,1fr)); } main {padding:22px;} }
@media (max-width:520px) {
  main { padding:12px 10px; }
  .card { padding:16px 14px; border-radius:15px; }
  header { padding-left:16px; padding-right:16px; }
  #workout>.card { padding:12px 8px !important; }
  #workout .v42card { padding:11px 7px !important; }
  #today #statusGrid { gap:8px; }
  #today .metric { padding:13px 11px; }
  #today>.card:nth-child(2)>button { margin:6px 5px 0 0; }
}
@media (prefers-reduced-motion:reduce) { main section,button { animation:none; transition:none; } }
