/* Elric Fit — iOS-style layer (approved mockup 2026-11-29): grouped inset cards, large titles, Inter, orange accent */
:root, :root[data-theme] { --e-bg:#F2F2F7; --e-surface:#FFFFFF; --e-input:#E9E9EE; --e-line:rgba(60,60,67,.18); --e-muted:#6C6C70; --e-tab:#8E8E93; --e-r-card:18px; --e-r-btn:14px; --e-shadow:none; --e-pad:16px; }
:root[data-theme="dark"] { --e-bg:#000000; --e-surface:#1C1C1E; --e-input:#2C2C2E; --e-line:#38383A; --e-muted:#8E8E93; --e-tab:#8E8E93; --e-glass:rgba(22,22,24,.92); --e-outline:rgba(255,255,255,.14); }
body { font-family:"Inter",-apple-system,system-ui,sans-serif; letter-spacing:-.01em; }
h1, h2, h3, .x-head h1, .x-card h2, .x-mealhead h2, .p-brand { font-family:"Inter",-apple-system,system-ui,sans-serif !important; text-transform:none !important; letter-spacing:-.02em !important; }
/* large title */
.x-head { padding:10px 0 6px; }
.x-head h1 { font:800 34px/1.1 "Inter",system-ui,sans-serif !important; }
.x-head h1 small { display:block; margin-top:4px; font:500 14px/1.3 "Inter",system-ui,sans-serif !important; letter-spacing:0 !important; text-transform:none !important; color:var(--e-muted); }
.x-quote { font-size:14px; color:var(--e-muted); }
.x-top { -webkit-backdrop-filter:saturate(180%) blur(20px); backdrop-filter:saturate(180%) blur(20px); border-bottom:.5px solid var(--e-line); }
/* grouped cards */
.x-card { border:0 !important; box-shadow:none !important; border-radius:18px; padding:16px; gap:12px; }
.x-card h2, .x-label, .p-h { font:600 13px/1.3 "Inter",system-ui,sans-serif !important; letter-spacing:.03em !important; text-transform:uppercase !important; color:var(--e-muted) !important; }
.x-card h2 span { text-transform:none; letter-spacing:0; color:var(--e-muted); font-weight:500; }
p.x-label { margin:18px 4px 6px; }
.x-row { min-height:52px; padding:10px 0; border-top:.5px solid var(--e-line); }
.x-row strong { font:600 16px/1.3 "Inter",system-ui,sans-serif; }
.x-row small { font-size:13px; color:var(--e-muted); }
.p-group { border:0 !important; border-radius:14px !important; }
.p-hero { border:0 !important; border-radius:18px !important; }
/* buttons */
.x-big { border-radius:14px; font-weight:700; letter-spacing:0; text-transform:none; }
.x-big:not(.is-ghost):not(.is-text):not(.is-danger):not(.is-red) { background:var(--e-hot); border:0; box-shadow:0 8px 22px rgba(255,77,46,.25); }
.x-big.is-ghost { background:var(--e-input); border:0; color:var(--e-text); }
.x-big.is-ghost[aria-pressed="true"] { background:rgba(255,106,26,.18); color:#FF6A1A; box-shadow:inset 0 0 0 1.5px #FF6A1A; }
/* segmented controls */
.x-seg { background:var(--e-input); border-radius:11px; padding:2px; gap:2px; }
.x-seg .x-big.is-ghost { background:transparent; box-shadow:none; color:var(--e-text); border-radius:9px; min-height:36px; font-size:14px; }
.x-seg .x-big.is-ghost[aria-pressed="true"] { background:var(--e-surface); color:var(--e-text); box-shadow:0 2px 6px rgba(0,0,0,.18); }
:root[data-theme="dark"] .x-seg .x-big.is-ghost[aria-pressed="true"] { background:#636366; }
/* week strip */
.x-days { display:flex; justify-content:space-between; gap:4px; }
.x-days .x-chip { flex:1; min-width:0; border:0; border-radius:12px; background:transparent; padding:9px 0; font-weight:700; color:var(--e-muted); position:relative; }
.x-days .x-chip.has-ex::after { content:""; position:absolute; bottom:4px; left:50%; width:5px; height:5px; margin-left:-2.5px; border-radius:50%; background:#FF8A00; }
.x-days .x-chip[aria-pressed="true"] { background:var(--e-hot); color:#fff; }
.x-days .x-chip[aria-pressed="true"]::after { background:#fff; }
/* exercise thumbnails */
.x-th { width:46px; height:46px; border-radius:10px; object-fit:cover; flex:none; background:var(--e-input); }
.x-thi { width:46px; height:46px; border-radius:10px; flex:none; display:grid; place-items:center; background:rgba(255,106,26,.15); font-size:20px; }
/* tab bar */
.x-tabs { border-top:.5px solid var(--e-line); -webkit-backdrop-filter:saturate(180%) blur(20px); backdrop-filter:saturate(180%) blur(20px); }
.x-tabs button { font:500 11px/1 "Inter",system-ui,sans-serif; letter-spacing:0; text-transform:none; min-height:58px; }
.x-tabs button[aria-selected="true"] { color:#FF6A1A; }
.x-tabs button::before, .x-tabs button::after { display:none !important; }
/* sheet */
.x-sheet { border-radius:22px 22px 0 0; }
.x-input { border-radius:12px; border:0; background:var(--e-input); }
/* demo: start photo with finish inset, crossfading */
.x-demo { border-radius:20px; aspect-ratio:4/3; }
.x-coach-card, .x-coachcta { background:linear-gradient(135deg,rgba(255,106,26,.16),transparent 70%),var(--e-surface) !important; }
.x-big, .x-big * { text-transform:none !important; letter-spacing:0 !important; font-family:"Inter",system-ui,sans-serif !important; }
.x-row .x-mini, .x-coachtip .x-mini { width:auto; height:auto; min-width:0; min-height:0; margin-left:auto; border:0; border-radius:99px; padding:7px 16px; font:700 14px/1 "Inter",system-ui,sans-serif; color:#fff !important; background:var(--e-hot) !important; flex:none; }
/* v2: layout matches approved mockup */
.x-top { display:none !important; }
.x-app { padding-top:calc(var(--e-safe-t) + 8px) !important; }
.x-quote { display:none !important; }
.x-head__row { display:flex; align-items:center; gap:8px; }
.x-head__row h1 { flex:1; min-width:0; }
.x-head__row #acct { order:3; width:44px; height:44px; border-radius:50%; flex:none; background:var(--e-hot); color:#fff; border:0; overflow:hidden; padding:0; }
.x-head__row #acct img, .x-head__row #acct svg { width:100%; height:100%; object-fit:cover; }
.x-daynav .x-icon { width:36px; height:36px; border:0 !important; background:var(--e-input) !important; }
/* summary card */
.x-sum { display:flex !important; align-items:center; gap:18px; }
.x-sumring { position:relative; width:124px; height:124px; flex:none; border:0; background:none; padding:0; color:var(--e-text); }
.x-sumring svg { width:100%; height:100%; transform:rotate(-90deg); }
.x-sumring .bg { fill:none; stroke:rgba(255,106,26,.16); stroke-width:13; }
.x-sumring .fg { fill:none; stroke:url(#x-g2); stroke-width:13; stroke-linecap:round; transition:stroke-dashoffset .6s var(--e-ease); }
.x-sumring.is-over .fg { stroke:#FF453A; }
.x-sumring span { position:absolute; inset:0; display:grid; place-content:center; text-align:center; }
.x-sumring b { font:800 26px/1 "Inter",system-ui,sans-serif; letter-spacing:-.02em; }
.x-sumring small { font-size:12px; color:var(--e-muted); margin-top:3px; }
.x-mbs { flex:1; min-width:0; display:grid; gap:12px; }
.x-mb > div { display:flex; justify-content:space-between; font-size:14px; }
.x-mb b { font-weight:700; } .x-mb span { color:var(--e-muted); }
.x-mb i { display:block; height:7px; border-radius:9px; background:var(--e-input); margin-top:6px; overflow:hidden; }
.x-mb em { display:block; height:100%; border-radius:9px; }
/* coach list */
.x-coach-card { padding:4px 16px !important; }
.x-coach-card .x-check, .x-v-today .x-check { flex:none; }
.x-coachtip { margin:0 0 14px; }
.x-row .x-check { width:26px; height:26px; border-radius:50%; border:2px solid var(--e-line); display:grid; place-items:center; flex:none; background:transparent; }
.x-row.is-done .x-check { background:#30D158; border-color:#30D158; color:#000; }
.x-row.is-done strong { text-decoration:none; opacity:.75; }
/* workout hero */
.x-whero { background:linear-gradient(135deg,rgba(255,77,46,.32),rgba(255,138,0,.06) 70%),var(--e-surface) !important; gap:6px !important; }
.x-whero small { color:#FF8A00; font:700 13px "Inter",system-ui,sans-serif; text-transform:uppercase; letter-spacing:.04em; }
.x-whero strong { font:800 26px/1.15 "Inter",system-ui,sans-serif; letter-spacing:-.02em; }
.x-whero p { color:var(--e-muted); font-size:14px; margin:0 0 8px; }
.x-days { margin:4px 0 14px; }
.x-head h1 { display:flex !important; flex-direction:column !important; }
.x-head h1 small { order:2; }
.x-row .x-mini.is-undo { background:var(--e-input) !important; color:var(--e-text) !important; }

/* ---- v3 upgrades (2026-11-29) ---- */
.x-fic { flex:none; width:40px; height:40px; border-radius:12px; display:grid; place-items:center; font-size:22px; background:rgba(255,255,255,.06); margin-right:2px; }
.x-row { transition: transform .18s ease; }
.x-row.is-swipe { transition:none; }
.x-water2 { display:flex; gap:18px; align-items:center; }
.x-bottle { flex:none; width:58px; height:110px; border:2.5px solid #0A84FF; border-radius:14px 14px 18px 18px; position:relative; overflow:hidden; background:rgba(10,132,255,.08); }
.x-bottle::before { content:""; position:absolute; top:-10px; left:16px; width:22px; height:10px; border:2.5px solid #0A84FF; border-bottom:0; border-radius:4px 4px 0 0; }
.x-bottle i { position:absolute; left:0; right:0; bottom:0; background:linear-gradient(180deg,#4DB2FF,#0A84FF); transition:height .6s cubic-bezier(.2,.8,.2,1); }
.x-wtx { flex:1; min-width:0; }
.x-wtx b { font-size:30px; font-weight:700; display:block; line-height:1.1; }
.x-wtx b small { font-size:15px; color:var(--e-dim, #8e8e93); font-weight:500; }
.x-wtx .x-btns { margin-top:10px; display:flex; gap:8px; }
.x-wtx .x-btns .x-big { flex:1; min-height:42px; }
.x-whero.has-ph { background:linear-gradient(180deg,rgba(0,0,0,.25),rgba(0,0,0,.88)), var(--ph) center/cover no-repeat, #1c1c1e; min-height:210px; display:flex; flex-direction:column; justify-content:flex-end; }
.x-whero.has-ph strong, .x-whero.has-ph p, .x-whero.has-ph small { color:#fff; text-shadow:0 1px 6px rgba(0,0,0,.6); }
.x-arings { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.x-aring { display:grid; justify-items:center; gap:6px; text-align:center; }
.x-aring svg { width:84px; height:84px; transform:rotate(-90deg); }
.x-aring circle { fill:none; stroke-width:8; }
.x-aring .bg { stroke:rgba(255,255,255,.08); }
.x-aring .fg { stroke:#FF6A1A; stroke-linecap:round; transition:stroke-dashoffset .6s; }
.x-aring .fg.is-b { stroke:#BF5AF2; }
.x-aring .x-input { text-align:center; width:100%; }
.x-aring small { color:var(--e-dim, #8e8e93); font-size:12px; }
.x-cols { position:relative; display:flex; align-items:flex-end; gap:8px; height:150px; padding-top:18px; }
.x-col { flex:1; height:100%; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; gap:4px; }
.x-col i { width:100%; max-width:30px; border-radius:8px 8px 4px 4px; background:linear-gradient(180deg,#FF8A00,#FF4D2E); animation:colUp .6s cubic-bezier(.2,.8,.2,1) both; transform-origin:bottom; max-height:calc(100% - 34px); }
.x-col.is-over i { background:#FF453A; }
.x-col span { font-size:11px; color:var(--e-dim, #8e8e93); min-height:14px; }
.x-col b { font-size:12px; color:var(--e-dim, #8e8e93); font-weight:600; }
.x-wr { margin:6px 0 10px; }
@keyframes colUp { from { transform:scaleY(0); } }
@keyframes popIn { 0% { transform:scale(.6); } 60% { transform:scale(1.25); } 100% { transform:scale(1); } }
.is-pop { animation:popIn .35s ease; }
@keyframes ringIn { from { stroke-dashoffset:339.29; } }
.is-boot .x-sumring .fg { animation:ringIn .9s cubic-bezier(.2,.8,.2,1); transition:stroke-dashoffset .5s; }
.x-foot { display:none; }
body[data-tab="prof"] .x-foot { display:block; }
@media (prefers-reduced-motion: reduce) { .x-col i, .x-sumring .fg, .is-pop { animation:none; } }
.x-addb { flex:none; display:inline-flex; align-items:center; gap:4px; min-height:36px; padding:0 12px; border-radius:18px; border:0; background:linear-gradient(135deg,#FF4D2E,#FF8A00); color:#fff; font-weight:700; font-size:14px; }
.x-addb svg { width:16px; height:16px; }
.x-addb.is-on { background:rgba(48,209,88,.16); color:#30D158; }
.x-list .x-row button.x-addb { width:auto !important; height:auto !important; min-width:0; flex-direction:row !important; white-space:nowrap; padding:0 12px; margin-left:auto; background:linear-gradient(135deg,#FF4D2E,#FF8A00); color:#fff; }
.x-list .x-row button.x-addb.is-on { background:rgba(48,209,88,.16); color:#30D158; }
.x-list .x-row button.x-addb { display:inline-flex !important; align-items:center; justify-content:center; gap:4px; min-height:36px; }
.x-list .x-row button.x-addb svg { width:15px !important; height:15px !important; flex:none; display:inline-block; }
/* ---- v4 polish ---- */
.x-fic { background:#2c2c2e url(food.jpg) no-repeat; background-size:600% 300%; font-size:0; width:44px; height:44px; border-radius:12px; }
.x-card h2, .x-label, .x-mealhead h3, .x-mealhead .x-label { text-transform:none !important; letter-spacing:-.01em !important; font-size:17px; color:#fff; font-weight:700; }
.x-card h2 span, .x-mealhead span { font-size:13px; font-weight:500; text-transform:none; }
p.x-label { font-size:15px; color:var(--e-dim,#8e8e93); }
.x-water .x-three .x-big { white-space:nowrap; font-size:15px; padding:0 6px; }
.x-macros b { font-size:24px; } .x-macros span { white-space:nowrap; font-size:12px; text-transform:none; letter-spacing:0; }
.x-aring { position:relative; }
.x-aring .x-av { position:absolute; top:0; left:50%; transform:translateX(-50%); width:84px; height:84px; display:grid; place-items:center; font-size:18px; font-weight:700; }
.x-aring .bg { stroke:rgba(255,106,26,.18); }
.x-onb { position:fixed; inset:0; z-index:9999; background:radial-gradient(120% 80% at 50% 0%,#3a1608 0%,#0b0b0c 60%); display:grid; place-items:center; padding:24px; animation:onbIn .3s ease; }
.x-onb-in { width:100%; max-width:380px; text-align:center; position:relative; padding-top:40px; }
.x-onb-skip { position:fixed; top:calc(env(safe-area-inset-top) + 14px); right:18px; background:none; border:0; color:#8e8e93; font-size:16px; }
.x-onb-ic { font-size:84px; width:150px; height:150px; margin:0 auto 26px; border-radius:40px; display:grid; place-items:center; background:linear-gradient(135deg,rgba(255,77,46,.25),rgba(255,138,0,.12)); box-shadow:0 20px 60px rgba(255,77,46,.25); }
.x-onb h2 { font-size:28px; font-weight:800; margin:0 0 12px; color:#fff; }
.x-onb p { color:#c7c7cc; font-size:16px; line-height:1.5; margin:0 0 28px; }
.x-onb-dots { display:flex; gap:8px; justify-content:center; margin-bottom:24px; }
.x-onb-dots i { width:8px; height:8px; border-radius:4px; background:#3a3a3c; transition:width .25s; }
.x-onb-dots i.on { width:24px; background:#FF6A1A; }
@keyframes onbIn { from { opacity:0; } }
.x-form { margin:8px 0 4px; background:rgba(255,255,255,.04); border-radius:12px; padding:10px 12px; }
.x-form summary { font-weight:600; color:#FF8A00; cursor:pointer; list-style:none; }
.x-form summary::before { content:"💡 "; }
.x-form ul { margin:8px 0 6px; padding-left:18px; color:#d1d1d6; font-size:14px; line-height:1.5; }
.x-chips { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.x-chips .x-chip[aria-pressed="true"] { background:linear-gradient(135deg,#FF4D2E,#FF8A00); color:#fff; border-color:transparent; }

/* Elric AI */
.x-ask{position:fixed;right:16px;bottom:calc(env(safe-area-inset-bottom,0px) + 92px);z-index:35;display:flex;align-items:center;gap:8px;padding:11px 16px 11px 12px;border-radius:999px;border:1px solid var(--e-outline,rgba(255,255,255,.14));background:var(--e-glass,rgba(28,28,30,.92));color:inherit;font:600 15px/1 Inter,system-ui,sans-serif;box-shadow:0 6px 20px rgba(0,0,0,.35);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}
.x-ask__dot{width:20px;height:20px;border-radius:50%;background:conic-gradient(#FF4D2E,#FF8A00,#FF4D2E);animation:xaskspin 4s linear infinite}
@keyframes xaskspin{to{transform:rotate(360deg)}}
body[data-tab="prof"] .x-ask,body.is-live .x-ask{display:none}
.x-ask__sub{margin:0 0 8px}
.x-ask__log{display:flex;flex-direction:column;gap:8px;max-height:46vh;min-height:120px;overflow-y:auto;padding:4px 0}
.x-ab{align-self:flex-start;max-width:88%;padding:10px 13px;border-radius:16px;background:var(--e-input);font-size:15px;line-height:1.4;word-wrap:break-word}
.x-ab.is-u{align-self:flex-end;background:linear-gradient(135deg,#FF4D2E,#FF8A00);color:#fff}
.x-ab.is-wait{opacity:.6}
.x-ab__add{display:block;margin-top:8px;padding:0;border:0;background:none;color:#FF8A00;font-weight:600;font-size:14px}
.x-ab__add.is-on{color:#34C759}
.x-ask__chips{display:flex;gap:6px;overflow-x:auto;padding:8px 0;scrollbar-width:none}
.x-ask__chips .x-chip{white-space:nowrap;flex:none}
.x-ask__f{display:flex;gap:8px;align-items:center}
.x-ask__f input{flex:1;min-width:0;padding:12px 14px;border-radius:999px;border:0;background:var(--e-input);color:inherit;font-size:16px}
.x-ask__f .x-big{width:auto;padding:0 18px;margin:0;min-height:44px}
