:root {
  color-scheme: dark;
  --bg: #212121; --ink: #ffffff; --muted: #bdbdbd;
  --card: #292929; --top: #262626; --surface-raised: #323232; --line: #454545;
  --orange: #ff9000; --orange-d: var(--orange); --on-accent: #212121;
  --orange-l: rgb(127 127 127 / 12%); --orange-ll: rgb(127 127 127 / 7%); --orange-m: rgb(127 127 127 / 28%);
  --green: #75d9a6; --red: #ff8585; --teal: #76daca; --pink: #f2a2b7; --sky: #9ecaff; --violet: #cbb5fb;
  --green-bg: #26382e; --teal-bg: #253733; --blue-bg: #283443;
  --violet-bg: #352c43; --pink-bg: #3c2831; --red-bg: #3a2828;
  --green-line: #415b4b; --blue-line: #46566e; --red-line: #8d5050;
  --r: 20px; --font: Inter, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; }
h2 { font-size: 14px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.o { color: var(--orange-d); }
.grow { flex: 1; min-width: 0; }

/* buttons & fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--orange); background: var(--orange); color: var(--on-accent); font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, transform .1s; }
@media (hover: hover) { .btn:hover { background: var(--orange); border-color: var(--halo-line); box-shadow: var(--halo); } }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-raised); }
.btn.dark { background: var(--surface-raised); border-color: var(--line); color: var(--ink); }
.btn.danger, .btn.danger:hover { background: var(--card); color: var(--red); border-color: var(--red-line); }
.btn.sm { height: 28px; padding: 0 12px; font-size: 12px; }
.btn.lg { height: 44px; font-size: 14px; }
.btn.block { width: 100%; }
.iconbtn { background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 10px; color: var(--muted); font-size: 14px; line-height: 1; }
.iconbtn:hover { background: var(--surface-raised); color: var(--ink); }
.roundbtn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.del { width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--red); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 12px; }
input[type=text], input[type=number], input[type=email], input[type=tel], input[type=date], input[type=time], input[type=search], input[type=password], select, textarea {
  width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--card); outline: none;
}
textarea { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--halo-line); box-shadow: var(--halo); }
label.f { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.toggle { position: relative; width: 44px; height: 24px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: var(--surface-raised); border-radius: 22px; cursor: pointer; transition: .2s; }
.toggle span::before { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; background: var(--card); border-radius: 50%; transition: .2s; }
.toggle input:checked + span { background: var(--orange); }
.toggle input:checked + span::before { transform: translateX(20px); }

/* chips & avatars */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 22px; border: 1px solid var(--line); background: var(--card); font-size: 12px; color: var(--muted); white-space: nowrap; }
.chip.green { color: var(--green); border-color: var(--green-line); background: var(--green-bg); }
.chip.teal { color: var(--teal); border-color: var(--green-line); background: var(--teal-bg); }
.chip.blue { color: var(--sky); border-color: var(--blue-line); background: var(--blue-bg); }
.chip.orange { color: var(--orange-d); border-color: var(--orange); background: var(--orange-l); }
.chip.red { color: var(--red); border-color: var(--red-line); background: var(--red-bg); }
.chip.dark { background: var(--bg); color: var(--ink); border-color: var(--line); }
.pct { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border: 1px solid var(--line); border-radius: 22px; font-size: 12px; }
.pct.down { color: var(--red); } .pct.up { color: var(--green); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--orange); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; flex: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 17px; }
.avatar.xs { width: 22px; height: 22px; font-size: 12px; }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); }
.login-art {
  background: linear-gradient(105deg, rgb(33 33 33 / 95%), rgb(33 33 33 / 82%) 52%, rgb(33 33 33 / 64%)),
    url("/fantefit-login.webp") 55% 32% / cover no-repeat var(--bg);
  color: var(--ink);
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-art footer { color: var(--muted); }
.login-art h1 { font-size: 40px; line-height: 1.05; font-weight: 700; max-width: 480px; margin-top: 60px; }
.login-art h1 b { color: var(--orange-text); font-weight: 700; }
.login-art ul { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 12px; color: var(--muted); position: relative; z-index: 1; }
.login-art li::before { content: "●"; color: var(--orange); margin-right: 10px; font-size: 12px; vertical-align: 2px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.brand img { width: 34px; height: 36px; }
.brand span b { color: var(--orange-text); }
.login-box { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-mark, .login-foot { display: none; }
.login-card { width: 380px; max-width: 100%; }
.login-card h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.login-card [data-form="login"] { margin-top: 16px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-raised); border-radius: 22px; padding: 4px; margin: 22px 0; }
.seg button { border: 0; background: none; height: 34px; border-radius: 22px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.1); }

.err { color: var(--red); font-size: 13px; margin-top: 8px; min-height: 18px; }

/* coach shell */
.top { position: sticky; top: 0; z-index: 40; height: 56px; background: var(--top); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 20px; gap: 12px; }
.top .logo img { width: 26px; height: 28px; display: block; }
.topnav { display: flex; align-items: center; gap: 4px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.topnav a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 22px; color: var(--muted); white-space: nowrap; }
.topnav a svg { width: 17px; height: 17px; }
.topnav a:hover { background: var(--surface-raised); }
.topnav a.on { background: var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.08); font-weight: 600; }
.me { display: flex; align-items: center; gap: 10px; }
.me .avatar { background: var(--surface-raised); color: var(--ink); }
.page { padding: 24px 28px 80px; max-width: 1600px; margin: 0 auto; }
.card { background: var(--card); border-radius: var(--r); box-shadow: 0 1px 3px rgba(0,0,0,.05); padding: 18px 20px; }
.card-h { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-h h2 { display: flex; align-items: center; gap: 8px; }
.count { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 22px; font-size: 12px; font-weight: 500; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .btn { margin-top: 12px; }

/* dashboard */
.dash { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 20px; }
.dash .card { min-height: 360px; }
.act { display: flex; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.act:last-child { border-bottom: 0; }
.act .t { color: var(--ink); font-weight: 600; }
.act .meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.scroll { max-height: 330px; overflow-y: auto; }
.evt { display: flex; align-items: center; gap: 12px; padding: 10px; margin-bottom: 8px; border: 1px solid var(--box-line); border-radius: 16px; background: var(--card); font-size: 12px; color: var(--muted); }
.evt b { display: block; color: var(--ink); font-size: 14px; font-weight: 600; }
.evt-day { display: grid; place-content: center; flex: none; width: 48px; height: 48px; border-radius: 16px; background: var(--surface-raised); text-align: center; font-size: 12px; line-height: 1.15; }
.evt-day strong { color: var(--ink); font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.evt.is-next .evt-day, .evt.is-next .evt-day strong { color: var(--on-accent); }
.evt.is-next .evt-day { background: var(--orange); }
.evt em { flex: none; padding: 4px 10px; border-radius: 999px; background: var(--surface-raised); color: var(--ink); font-style: normal; font-weight: 600; white-space: nowrap; }
.comp { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.welcome { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--card); border-radius: var(--r); padding: 14px 18px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.kpi b { display: block; font-size: 24px; font-weight: 600; margin-top: 2px; }

/* clients list */
.crumbs { display: flex; align-items: center; gap: 10px; color: var(--muted); margin-bottom: 14px; flex-wrap: wrap; }
.crumbs a.on { background: var(--card); color: var(--ink); font-weight: 600; padding: 4px 12px; border-radius: 22px; border: 1px solid var(--line); }
.tabs-line { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin: 22px 0 18px; overflow-x: auto; scrollbar-width: none; }
.tabs-line a { padding: 8px 0 10px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs-line a.on { color: var(--orange-d); border-color: var(--orange); }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-weight: 600; font-size: 13px; padding: 12px 10px; background: var(--surface-raised); }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--orange-ll); }
.cname { color: var(--orange-d); text-transform: none; font-weight: 500; }
.tbl-wrap { overflow-x: auto; background: var(--card); border-radius: 16px; }

/* client page */
.chead { display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.cpage { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 110px); }
.cside { background: var(--surface-raised); border-right: 1px solid var(--line); padding: 10px 0; }
.cside a { display: flex; gap: 10px; padding: 12px 16px 12px 18px; border-right: 2px solid transparent; }
.cside a svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--muted); }
.cside a b { display: block; font-weight: 500; }
.cside a span { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.cside a.on { background: var(--card); border-color: var(--halo-line); box-shadow: var(--halo); }
.cside a.on b, .cside a.on svg { color: var(--orange-d); }
.cmain { padding: 20px 24px 80px; min-width: 0; }
.subtabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.subtabs :is(a, button) { padding: 6px 0 10px; border-bottom: 2px solid transparent; white-space: nowrap; }
.subtabs :is(a, button).on { color: var(--orange-d); border-color: var(--orange); font-weight: 500; }

/* calendar */
.coach-desktop-plan { --cal-line: var(--line); --cal-accent: var(--orange); }
.cal-bar, .cal-nav, .cal-stats, .legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cal-bar { margin-bottom: 10px; }
.cal-bar .title { font-size: 24px; font-weight: 750; }
.cal-nav { gap: 5px; }
.cal-bar .cal-add { margin-inline-start: auto; background: var(--orange); color: var(--on-accent); border-color: var(--orange); font-weight: 700; }
.cal-bar .cal-add:hover { background: var(--orange); filter: brightness(1.06); }
.cal-bar .roundbtn, .cal-bar .btn.ghost { border-color: var(--cal-line); background: var(--card); }
.cal-bar .roundbtn:hover, .cal-bar .btn.ghost:hover { background: var(--orange-l); }
.cal-stats { margin-bottom: 12px; font-size: 12px; color: var(--muted); }
.cal-stats > span { padding: 4px 8px; border: 1px solid var(--cal-line); border-radius: 10px; background: var(--card); }
.cal-stats b { color: var(--ink); }
.legend { margin-inline-start: auto; }
.legend i { display: inline-block; width: 7px; height: 7px; margin-inline-end: 4px; border-radius: 50%; background: var(--cal-dot); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--cal-line); border-radius: 16px; overflow: hidden; background: var(--card); }
.cal .dow { padding: 8px 0; font-size: 12px; font-weight: 700; text-align: center; color: var(--muted); background: var(--surface-raised); }
.cal .day { min-width: 0; min-height: 116px; padding: 6px 5px; border-block-start: 1px solid var(--cal-line); border-inline-end: 1px solid var(--cal-line); transition: background-color 150ms ease, box-shadow 150ms ease; }
.cal .day:nth-child(7n) { border-inline-end: 0; }
.cal .day.out { background: var(--card); }
.cal .day.out .n { color: var(--muted); }
.cal .day.today { background: var(--orange-ll); }
.cal .n { display: flex; justify-content: end; padding-bottom: 5px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.cal .n time { display: grid; place-items: center; min-width: 22px; height: 22px; border-radius: 16px; }
.cal .n [aria-current] { color: var(--on-accent); background: var(--orange); font-weight: 800; }
/* Colour is only a marker (bar + dot). The entreno is the one filled block; daily repeats stay quiet. */
.coach-desktop-plan :is(.k-nut, .k-wk, .k-steps, .k-ci, .k-task) { --cal-text: var(--ink); }
.coach-desktop-plan .k-nut { --cal-tint: color-mix(in srgb, var(--green) 18%, transparent); --cal-dot: var(--green); }
.coach-desktop-plan .k-wk { --cal-tint: var(--orange-m); --cal-dot: var(--orange); }
.coach-desktop-plan .k-steps { --cal-tint: color-mix(in srgb, var(--violet) 18%, transparent); --cal-dot: var(--violet); }
.coach-desktop-plan .k-ci { --cal-tint: var(--blue-bg); --cal-dot: var(--sky); }
.coach-desktop-plan .k-task { --cal-tint: var(--surface-raised); --cal-dot: var(--muted); }
.ev { display: block; width: 100%; margin-bottom: 4px; padding: 4px 7px; border: 0; border-radius: 10px; font-size: 12px; font-weight: 600; line-height: 1.3; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--cal-text); background: var(--cal-tint); cursor: pointer; }
.coach-desktop-plan .k-wk { font-weight: 700; }
.ev.done { opacity: .6; }
.ev-check { margin-inline-end: 4px; color: var(--green); font-weight: 800; }
.cal-note { margin-top: 9px; }
.cal-note a { color: var(--ink); text-decoration: underline var(--orange); text-underline-offset: 3px; }

/* info */
.info-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.info-head .section-title { padding: 0; margin: 0; border: 0; }
.info-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.info-actions select { width: auto; }
.info-group { padding: 16px 0 4px; }
.info-group + .info-group { border-top: 1px solid var(--line); }
.info-group .eyebrow { margin-bottom: 10px; }
.info-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 20px; }
.info-fields .field { margin-bottom: 12px; }
.info-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.info-stat { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--box-line); border-radius: 16px; background: var(--surface-raised); }
.info-stat b { font-size: 17px; font-variant-numeric: tabular-nums; }
.info-stat.hi { border-color: var(--orange); background: var(--orange-ll); }
.info-stat.hi b { color: var(--orange-d); }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 20px; letter-spacing: .25em; font-weight: 700; background: var(--orange-l); color: var(--orange-d); padding: 6px 14px; border-radius: 16px; }

/* nutrition */
.plan-title { color: var(--orange-d); font-size: 17px; font-weight: 600; border: 0; padding: 0; height: 32px; background: none; }
.macros { display: grid; grid-template-columns: repeat(5, 1fr); text-align: center; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 8px 0 18px; }
.macros i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.opts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.opt { border: 1px solid #555; background: var(--card); border-radius: 22px; height: 34px; padding: 0 16px; cursor: pointer; font-weight: 600; }
.opt.on { background: var(--orange-d); color: var(--on-accent); border-color: var(--orange-d); }
.opt.add { border-style: dashed; color: var(--muted); border-color: var(--line); }
.food-t { width: 100%; border-collapse: collapse; text-align: center; }
.food-t th { font-weight: 500; padding: 6px; font-size: 13px; }
.food-t td { padding: 4px 6px; }
.food-t input { width: 70px; height: 28px; text-align: center; }
.food-t tfoot td { border-top: 1px solid var(--line); padding-top: 10px; font-weight: 600; }

/* training editor */

.ex-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.ex-table thead th { background: var(--bg); color: var(--ink); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: none; padding: 10px 6px; text-align: left; }
.ex-table tbody td { background: var(--card); padding: 6px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: middle; }
.ex-table tbody td:first-child { border-left: 1px solid var(--line); border-radius: 10px 0 0 10px; }
.ex-table tbody td:last-child { border-right: 1px solid var(--line); border-radius: 0 10px 10px 0; }
.ex-table tr.block td { background: var(--blue-bg); }
.ex-table input { height: 30px; padding: 0 6px; font-size: 13px; }
.ex-table .num input { width: 54px; text-align: center; }
.ex-thumb { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #3a3a3a, #111); color: var(--orange-text); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; flex: none; }
.lib { background: var(--card); border-radius: 16px; padding: 12px; position: sticky; top: 70px; max-height: calc(100vh - 90px); display: flex; flex-direction: column; }
.lib-list { overflow-y: auto; margin-top: 10px; display: grid; gap: 8px; }
.lib-item { display: flex; gap: 10px; align-items: center; border: 1px solid var(--box-line); border-radius: 16px; padding: 8px; cursor: pointer; background: var(--card); text-align: left; width: 100%; }
@media (hover: hover) { .lib-item:hover { border-color: var(--halo-line); background: var(--orange-ll); box-shadow: var(--halo); } }

/* evolution */
.chartbox { width: 100%; min-width: 0; position: relative; }
.chart { display: block; overflow: visible; }
.chart text { font-size: 12px; font-family: var(--font); font-weight: 500; letter-spacing: .01em; }
.chart .bar path { transition: opacity .15s ease, transform .15s ease; }
.chart .bar .tip { opacity: 0; font-weight: 700; font-size: 12px; transition: opacity .15s ease; pointer-events: none; }
.chart .bar:hover .tip { opacity: 1; }
.chart .bar:hover path { opacity: .82; }
.chart .dot { transition: r .15s ease; }
.chart .dot:hover { r: 5; }
.evo { display: grid; grid-template-columns: 1fr 260px; gap: 24px; align-items: start; }
.metric-nav { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 0; margin-bottom: 14px; }
.metric-nav select { width: auto; border: 0; font-weight: 500; }
.reg-wrap { overflow-x: auto; }
.reg { border-collapse: collapse; min-width: 100%; }
.reg th, .reg td { border: 1px solid var(--line); padding: 8px 12px; text-align: center; white-space: nowrap; font-size: 13px; }
.reg th { font-weight: 500; }
.reg td:first-child, .reg th:first-child { text-align: left; position: sticky; left: 0; background: var(--card); }
.ph-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ph-card { border: 1px solid var(--box-line); border-radius: 16px; background: var(--card); }
.ph-card header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ph-card .imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 14px; }
.ph { aspect-ratio: 3/4; background: var(--surface-raised); border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; position: relative; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.info-bar { background: var(--blue-bg); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }

/* chat */
.chat { display: flex; flex-direction: column; height: 520px; background: var(--card); border-radius: 16px; }

.msg { max-width: 75%; padding: 8px 12px; border-radius: 16px; background: var(--surface-raised); align-self: flex-start; }
.msg.me { align-self: flex-end; background: var(--orange); color: var(--on-accent); }
.msg small { display: block; font-size: 12px; opacity: .7; margin-top: 2px; }

/* modal + toast */
.modal { position: fixed; inset: 0; background: rgba(20,20,20,.45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 14px; overflow-y: auto; }
#modal { overscroll-behavior: contain; }
html.modal-open { scrollbar-gutter: stable; }
html.modal-open, html.modal-open body { overflow: hidden; overscroll-behavior: none; }
html.modal-open #root { position: fixed; inset: 0; overflow: hidden; }
.modal-card { margin: auto; background: var(--card); border-radius: 22px; width: 580px; max-width: 100%; padding: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal-card.wide { width: 900px; }
.modal-card h2 { font-size: 17px; margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; align-items: center; }
.modal-card:has(> #nc) {
  --nc-gutter: 24px;
  width: 640px;
  padding: 0;
  border: 1px solid var(--line);
  overflow: hidden;
}
#nc { display: flex; flex-direction: column; max-height: 88dvh; }
.nc-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px var(--nc-gutter); border-bottom: 1px solid var(--line); }
.nc-icon { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 16px; background: var(--orange-l); color: var(--orange-d); }
.nc-head h2 { margin: 0 0 2px; font-size: 20px; line-height: 1.2; font-weight: 750; letter-spacing: -.025em; }
.nc-head p { color: var(--muted); font-size: 13px; }
.nc-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px var(--nc-gutter) 18px; }
.nc-body fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.nc-body fieldset + fieldset { margin-top: 16px; }
.nc-body legend { width: 100%; padding: 0 0 7px; margin-bottom: 9px; border-bottom: 1px solid var(--line); font-weight: 700; }
.nc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.nc-full { grid-column: 1 / -1; }
.nc-grid label { min-width: 0; font-size: 13px; font-weight: 600; }
.nc-required { color: var(--orange-d); }
.nc-grid :is(input, select) { display: block; min-width: 0; height: 44px; margin-top: 4px; border-radius: 16px; background: var(--top); font-size: 14px; font-weight: 400; }
.nc-footer { padding: 12px var(--nc-gutter); border-top: 1px solid var(--line); }
.nc-footer .err { margin: 0 0 8px; }
.nc-footer .err:empty { display: none; }
.nc-footer .modal-actions { margin: 0; }
.nc-options { display: grid; gap: 8px; }
.nc-options button { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; min-height: 56px; padding: 8px 12px; border: 1px solid var(--box-line); border-radius: 16px; color: var(--ink); background: var(--top); text-align: start; cursor: pointer; }
@media (hover: hover) { .nc-options button:hover { border-color: var(--halo-line); box-shadow: var(--halo); } }
.nc-options button > span { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; background: var(--orange-l); color: var(--orange-d); }
.modal-card:has(.invite-result) .modal-actions { flex-wrap: wrap; }
.invite-result:not(:empty) { margin-top: 16px; }
.invite-result p { margin-top: 8px; }
.registration { min-height: 100dvh; display: grid; justify-items: center; align-content: start; padding: 60px 14px 28px; }
.registration-theme { position: absolute; top: 12px; right: 14px; display: flex; gap: 8px; align-items: center; }
.registration-card { width: min(100%, 510px); padding: clamp(18px, 5vw, 34px); border: 1px solid var(--box-line); border-radius: 22px; background: var(--card); }
.registration-card > .logo-img { display: block; width: 38px; height: 40px; margin: 0 auto 16px; object-fit: contain; }
.registration-card h1 { text-align: center; font-size: clamp(23px, 6vw, 30px); font-weight: 750; line-height: 1.15; }
.registration-intro { max-width: 36ch; margin: 8px auto 22px; text-align: center; color: var(--muted); }
.registration-form { display: grid; gap: 13px; }
.registration-form label { font-weight: 600; }
.registration-form :is(input, select, textarea) { display: block; min-width: 0; min-height: 44px; margin-top: 4px; font-size: 16px; font-weight: 400; background: var(--top); }
.registration-form textarea { min-height: 76px; }
.registration-form :is(.field, .err) { margin: 0; }
.registration-form .err:empty { display: none; }
.registration-questions { display: grid; gap: 14px; min-width: 0; padding: 0; margin: 0; border: 0; }
.registration-questions legend { margin-bottom: 10px; padding: 0; color: var(--muted); font-weight: 650; }
.registration-actions { display: flex; gap: 8px; }
.registration-actions > :last-child, .registration-actions > [data-step="1"] { flex: 1; }
.registration-form [hidden] { display: none; }
.registration-select { position: relative; min-width: 0; }
.registration-select-label { display: block; font-weight: 600; }
.registration-select-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  min-height: 44px; margin-top: 4px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--top); font-size: 16px; text-align: start; cursor: pointer;
}
.registration-select-trigger svg { flex: none; }
.registration-select-options, .bounded-field-popup {
  overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); box-shadow: 0 6px 18px rgb(0 0 0 / 16%);
}
.registration-select-options { position: absolute; z-index: 2; inset-inline: 0; inset-block-start: calc(100% + 4px); }
.registration-select-options.opens-up { inset-block: auto calc(44px + 4px); }
:is(.registration-select-options, .bounded-field-popup) button {
  display: block; width: 100%; min-height: 44px; padding: 8px 10px; border: 0;
  background: transparent; text-align: start; cursor: pointer;
}
:is(.registration-select-options, .bounded-field-popup) button:is(:hover, :focus-visible, [aria-pressed="true"]) { background: var(--orange-l); }
.bounded-field {
  display: inline-grid; grid-template-columns: minmax(0, 1fr); width: 100%; min-width: 0;
  vertical-align: middle;
}
.bounded-field > * { grid-area: 1 / 1; }
.bounded-field-native { opacity: 0; pointer-events: none; min-width: 0; }
.bounded-field-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0;
  padding: 0 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  color: var(--ink); text-align: start; cursor: pointer;
}
.bounded-field-trigger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bounded-field-trigger svg { flex: none; }
.bounded-field-trigger:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.bounded-field-trigger:disabled { opacity: .5; cursor: default; }
.bounded-field-popup { position: fixed; z-index: 500; }

.cmenu-btn { display: inline-grid; place-items: center; min-width: 36px; min-height: 36px; }
.cmenu { position: fixed; z-index: 500; min-width: 220px; max-width: calc(100vw - 16px); padding: 4px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: 0 10px 28px rgb(0 0 0 / 22%); }
.cmenu button { display: block; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.cmenu button:is(:hover, :focus-visible) { background: var(--orange-l); outline: 0; }
.cmenu button.danger { color: var(--red); }
.cmenu button.danger:is(:hover, :focus-visible) { background: var(--red-bg); }
.cmenu-sep { height: 1px; margin: 4px 6px; background: var(--line); }
:is(.metric-nav, .dt-foot, .filter) .bounded-field { width: auto; }
.dt-foot .bounded-field-trigger { margin-left: 6px; }
:is(.nc-grid, .registration-form) .bounded-field-trigger { margin-top: 4px; background: var(--top); }
.bounded-field-popup .birth-year input { width: 90px; }
.birth-calendar { padding: 8px; }
.birth-nav { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; text-align: center; }
.birth-nav button, .birth-days button { display: grid; place-items: center; padding: 0; border-radius: 10px; }
.birth-year { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 4px; }
.birth-year input { width: 90px; }
.birth-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.birth-days span { padding: 3px 0; color: var(--muted); font-size: 12px; text-align: center; }
.birth-nav button:disabled, .birth-days button:disabled { opacity: .4; cursor: default; background: transparent; }
.birth-days button[aria-pressed="true"] { font-weight: 700; }
.birth-calendar .birth-clear { color: var(--orange-d); }
.phone-field { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; margin-top: 4px; }
.phone-field #onboarding-phone { margin-top: 0; }
.phone-prefix.btn { min-width: 82px; height: 44px; padding: 0 8px; border-radius: 10px; background: var(--top); }
.phone-flag { display: inline-block; width: 20px; height: 15px; flex: none; border-radius: 2px; background: url("/phone-flags.png") no-repeat; background-size: 320px auto; }
.phone-dialog { width: min(390px, calc(100% - 24px)); padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); }
.phone-dialog::backdrop { background: rgb(0 0 0 / 55%); }
.phone-dialog input { margin: 10px 0 5px; }
.phone-list { max-height: min(47dvh, 330px); overflow: auto; overscroll-behavior: contain; }
.phone-list button { display: grid; width: 100%; grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px; align-items: center; min-height: 44px; padding: 7px; color: var(--ink); background: var(--card); border: 0; border-bottom: 1px solid var(--line); text-align: start; cursor: pointer; }
.phone-list button:is(:hover, :focus-visible, [aria-pressed="true"]) { background: var(--orange-l); }
.phone-list strong { color: var(--orange-d); }

@media (max-width: 600px) {
  .modal:has(.modal-card > #nc) { align-items: center; padding: 10px; }
  .modal-card:has(> #nc) { --nc-gutter: 15px; }
  #nc { max-height: calc(100dvh - 22px); }
  .nc-grid { grid-template-columns: minmax(0, 1fr); }
  .nc-grid :is(input, select) { font-size: 16px; }
  .nc-footer { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .nc-footer .modal-actions > [type=submit] { flex: 1; }
}
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--bg); color: var(--ink); padding: 10px 18px; border-radius: 22px; z-index: 200; }
.pick { max-height: 340px; overflow-y: auto; border: 1px solid var(--box-line); border-radius: 16px; margin-top: 10px; }
.pick button { display: flex; width: 100%; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line); background: var(--card); text-align: left; cursor: pointer; }
.pick button:hover { background: var(--orange-ll); }

/* client app */
.progress { height: 8px; border-radius: 10px; background: var(--surface-raised); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--orange); }
.photo-in { aspect-ratio: 3/4; border: 1px dashed var(--line); border-radius: 16px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; color: var(--muted); font-size: 12px; text-align: center; background: var(--surface-raised); cursor: pointer; }
.photo-in img { width: 100%; height: 100%; object-fit: cover; }
.photo-in input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-in .lbl { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.6); color: var(--ink); border-radius: 22px; padding: 1px 8px; font-size: 12px; }

@media (max-width: 1100px) {
  .dash { grid-template-columns: 1fr 1fr; }

  .lib { position: static; max-height: 420px; }
  .evo { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .login { grid-template-columns: minmax(0, 1fr); min-height: 100dvh; }
  .login-box { min-width: 0; flex-direction: column; gap: 28px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .login-card { width: 100%; }
  .login-art { display: none; }
  .login-mark { display: block; margin-top: auto; }
  .login-mark .logo-img { width: 80px; height: 84px; object-fit: contain; }
  .login-foot { display: block; margin: auto 0 0; color: var(--muted); }
  .top { padding: 0 12px; }
  .me .name { display: none; }
  .topnav a span { display: none; }
  .page { padding: 16px 14px 80px; }
  .dash, .grid2, .grid3, .ph-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .cpage { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .cside { display: flex; overflow-x: auto; padding: 0; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .cside a { flex: none; border-right: 0; border-bottom: 2px solid transparent; padding: 10px 14px; }
  .cside a span { display: none; }
  .cside a.on { border-color: var(--halo-line); box-shadow: var(--halo); }
  .cmain { padding: 16px 12px 80px; }
  .cal .day { min-height: 70px; }
  .ev { font-size: 0; height: 6px; padding: 0; }
  .macros { grid-template-columns: repeat(3, 1fr); row-gap: 10px; }
  h1 { font-size: 24px; }
}

/* v2: logo, library, drag & drop, media, premium evolution */
.logo-img { display: block; width: 28px; height: 30px; }
.top .logo-img { width: 26px; height: 28px; }
.login-art .logo-img { width: 64px; height: 68px; }

.auth-nav { display: flex; gap: 16px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.auth-nav a { color: var(--orange-d); }
/* top nav dropdown */
.dd-wrap { position: relative; }
.dd-wrap > a svg:last-child { width: 14px; height: 14px; opacity: .6; }
.dd { display: none; position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--card); border-radius: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.14); padding: 8px; min-width: 260px; z-index: 50; }
.dd::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.dd-wrap:hover .dd, .dd-wrap:focus-within .dd { display: block; }
.dd a { display: block !important; padding: 10px 12px !important; border-radius: 16px !important; box-shadow: none !important; }
.dd a:hover { background: var(--orange-ll) !important; }
.dd a b { display: block; font-weight: 600; }
.dd a span { display: block !important; font-size: 12px; color: var(--muted); }

/* drag & drop */
.ev.drag { cursor: grab; }
.dragging { opacity: .45; }
.coach-desktop-plan :is(.pal, .ev, .trash) { transition: opacity 140ms ease, box-shadow 140ms ease, background-color 140ms ease, transform 140ms ease; }
.coach-desktop-plan :is(button, a):focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.coach-desktop-plan :is(.pal, .ev):hover { box-shadow: inset 0 0 0 1px var(--cal-dot); }
.coach-desktop-plan .dragging { opacity: .32; transform: scale(.97); }
.cal .day.over { background: var(--orange-l); box-shadow: inset 0 0 0 2px var(--orange); }
.cal .day.did-drop { animation: calendar-confirm 330ms ease-out; }
.cal .ev.did-drop { animation: calendar-settle 260ms cubic-bezier(.2,.75,.3,1); }
@keyframes calendar-confirm { from { box-shadow: inset 0 0 0 2px var(--orange); background: var(--orange-l); } }
@keyframes calendar-settle { from { opacity: .72; transform: translateY(-5px) scale(.97); } }
.palette { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; padding: 8px; border: 1px solid var(--cal-line); border-radius: 16px; background: var(--card); }
.cal-palette-label { color: var(--muted); font-size: 12px; font-weight: 650; }
.pal { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 4px 8px; border-radius: 10px; color: var(--cal-text); background: var(--cal-tint); font-size: 12px; font-weight: 650; overflow-wrap: anywhere; cursor: grab; user-select: none; }
.pal svg, .trash svg { width: 14px; height: 14px; flex: none; }
.trash { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border: 1px dashed var(--cal-line); border-radius: 10px; color: var(--muted); font-size: 12px; }
.drag-ev .coach-desktop-plan .trash { border-color: var(--red-line); color: var(--red); }
.drag-ev .coach-desktop-plan .trash.over { background: var(--red-bg); border-style: solid; box-shadow: 0 0 0 2px var(--red-line); }
@media (prefers-reduced-motion: reduce) {
  .coach-desktop-plan :is(.pal, .ev, .trash, .day) { transition: none; animation: none; }
}
body:not(.drag-ev) .trash { opacity: .55; }
.ex-table td.grip { cursor: grab; color: var(--muted); width: 24px; padding: 6px 2px 6px 8px; }
.ex-table td.grip:hover { color: var(--orange-d); }
.ex-table tr.over td { box-shadow: inset 0 3px 0 var(--orange); }
.ex-table tr.drop-end td { background: transparent; border: 1px dashed var(--line); border-radius: 10px; text-align: center; color: var(--muted); font-size: 12px; padding: 12px; }
.ex-table tr.drop-end.over td { border-color: var(--orange); color: var(--orange-d); background: var(--orange-ll); }
.lib-item { cursor: grab; }
.lib-item .col { display: flex; flex-direction: column; gap: 2px; }

/* exercise media */
.ex-thumb { position: relative; overflow: hidden; }
.ex-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ex-thumb .play { position: absolute; right: 2px; bottom: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--orange); color: var(--on-accent); font-size: 12px; font-style: normal; display: flex; align-items: center; justify-content: center; }
.ex-thumb.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 14px; }
.ex-thumb.xl { width: 100%; height: 150px; border-radius: 16px 16px 0 0; font-size: 28px; }
.thumb-btn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 10px; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.ex-card { border: 1px solid var(--box-line); background: var(--card); border-radius: 16px; padding: 0; text-align: left; cursor: pointer; display: flex; flex-direction: column; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.ex-card:hover { transform: translateY(-2px); box-shadow: none; }

.ex-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ex-modal { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.media-box { background: #111; border-radius: 16px; overflow: hidden; min-height: 200px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.media-box img, .media-box video { width: 100%; max-height: 420px; object-fit: contain; display: block; }
.media-box iframe { width: 100%; aspect-ratio: 16/9; border: 0; display: block; }
.linkbtn { border: 0; background: none; color: var(--orange-d); font-weight: 600; padding: 4px 0 0; cursor: pointer; font-size: 13px; }

/* library templates */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.tpl { background: var(--card); border-radius: 16px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.05); display: flex; flex-direction: column; gap: 8px; min-height: 210px; }
.tpl b { font-size: 16px; }
.tpl-ic { width: 40px; height: 40px; border-radius: 16px; background: var(--orange-l); color: var(--orange-d); display: flex; align-items: center; justify-content: center; }
.tpl .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.invite-box { background: var(--surface-raised); border: 1px solid var(--box-line); border-radius: 16px; padding: 12px 14px; margin: 14px 0 10px; }
.invite-box pre { white-space: pre-wrap; font: 13px/1.5 var(--font); margin: 8px 0 0; color: var(--muted); }

/* premium evolution */
.evo-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 18px; padding-bottom: 6px; }
.evo-hero { display: grid; grid-template-columns: 300px 1fr; gap: 0; background: radial-gradient(120% 140% at 100% 0%, var(--orange-l) 0%, #212121 45%, #161616 100%); color: var(--ink); border-radius: 22px; overflow: hidden; box-shadow: none; }
.evo-hero-l { padding: 26px 24px; border-right: 1px solid rgba(255,255,255,.07); display: flex; flex-direction: column; gap: 8px; }
.evo-hero-r { padding: 18px 20px 10px; min-width: 0; }
.eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: none; color: var(--muted); }
.big { font-size: 52px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.big small { font-size: 17px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.delta { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 22px; font-size: 12px; font-weight: 600; background: rgba(150,150,150,.15); color: var(--muted); width: max-content; }
.delta.good { background: rgba(31,163,122,.15); color: var(--green); } .delta.bad { background: rgba(239,68,68,.12); color: var(--red); } .delta.neutral { background: color-mix(in srgb, var(--orange) 15%, transparent); color: var(--orange-d); }
.evo-hero .delta.good { color: #3ee0a8; } .evo-hero .delta.bad { color: #ff7a7a; } .evo-hero .delta.neutral { color: var(--orange-text); }

.goal { margin-top: 14px; display: grid; gap: 6px; }
.goal-bar { height: 8px; border-radius: 10px; background: rgba(255,255,255,.1); overflow: hidden; }
.goal-bar i { display: block; height: 100%; border-radius: 10px; background: var(--orange); }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: auto; padding-top: 18px; }
.hero-stats div { background: rgba(255,255,255,.05); border-radius: 16px; padding: 10px; }
.hero-stats span { display: block; font-size: 12px; color: var(--muted); }
.hero-stats b { font-size: 17px; }
.pills { display: inline-flex; flex-wrap: wrap; gap: 4px; background: rgba(127,127,127,.12); padding: 4px; border-radius: 22px; }
.pills button { border: 0; background: none; color: inherit; opacity: .75; padding: 5px 12px; border-radius: 22px; cursor: pointer; font-size: 12px; font-weight: 600; }
.pills button.on { background: var(--orange); color: var(--on-accent); opacity: 1; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 18px; }
.mcard { background: var(--card); border: 1px solid var(--box-line); border-radius: 16px; padding: 14px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: box-shadow .15s, border-color .15s; }
.mcard:hover { box-shadow: none; }
.mcard.on { border-color: var(--halo-line); box-shadow: var(--halo); }
.mcard b { font-size: 20px; font-weight: 700; } .mcard b small { font-size: 12px; color: var(--muted); font-weight: 500; }
.spark { width: 100%; height: 30px; }
.ba { position: relative; aspect-ratio: 3/4; border-radius: 16px; overflow: hidden; background: #111; user-select: none; }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-line { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: var(--card); box-shadow: 0 0 10px rgba(0,0,0,.4); pointer-events: none; }
.ba-line span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 36px; height: 36px; border-radius: 50%; background: var(--orange); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-weight: 700; box-shadow: none; }
.ba-l, .ba-r { position: absolute; bottom: 12px; background: rgba(0,0,0,.6); color: var(--ink); font-size: 12px; padding: 3px 10px; border-radius: 22px; pointer-events: none; }
.ba-l { left: 12px; } .ba-r { right: 12px; }
.ba input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.ba-stats { display: flex; gap: 16px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.ba-stats div { text-align: center; } .ba-stats span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }

@media (max-width: 1100px) { .evo-hero { grid-template-columns: 1fr; } .evo-hero-l { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.07); } }
@media (max-width: 800px) {
  .ex-modal { grid-template-columns: 1fr; }
  .dd { left: auto; right: -40px; transform: none; }
  .palette .trash { margin-left: 0; }
  .big { font-size: 40px; }
}

/* premium chart extras */
.chart-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0 6px; }
.chart-stats > div { background: var(--surface-raised); border: 1px solid var(--box-line); border-radius: 16px; padding: 12px 14px; position: relative; overflow: hidden; }
.chart-stats span { display: block; font-size: 12px; color: var(--muted); text-transform: none; letter-spacing: .06em; font-weight: 600; }
.chart-stats b { display: block; font-size: 20px; font-weight: 800; color: var(--ink); margin-top: 4px; letter-spacing: -.02em; }
.chart-stats b small { font-size: 13px; color: var(--muted); font-weight: 600; }
.chart-stats i { position: absolute; left: 0; bottom: 0; height: 3px; width: var(--p); background: var(--orange); border-radius: 0 3px 3px 0; }
.chart-legend { display: flex; gap: 18px; justify-content: flex-end; font-size: 12px; color: var(--muted); margin-top: 4px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-legend .lg-on { background: var(--orange); }
.chart-legend .lg-off { background: var(--orange-l); }
@media (max-width: 640px) { .chart-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .chart-stats b { font-size: 17px; } }

/* evolution — minimal premium (v3) */
.evo-hero { background: #212121; border: 1px solid #2c2c2c; border-radius: 22px; box-shadow: none; position: relative; }
.evo-hero::before { content: ""; position: absolute; inset: 0 0 auto auto; width: 45%; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--orange) 55%, transparent)); pointer-events: none; }
.evo-hero-l { padding: 28px 26px; gap: 10px; border-right: 1px solid rgba(255,255,255,.06); }
.evo-hero-r { padding: 20px 22px 12px; }
.evo-hero .eyebrow { color: var(--muted); letter-spacing: .14em; font-size: 12px; }
.big { font-weight: 600; letter-spacing: -0.035em; }
.big small { color: var(--muted); font-weight: 400; }

.delta { background: var(--surface-raised); color: var(--muted); font-weight: 600; padding: 3px 9px; font-size: 12px; letter-spacing: .01em; }
.delta.good { background: var(--orange-l); color: var(--orange-d); }
.delta.bad, .delta.neutral { background: var(--surface-raised); color: var(--muted); }
.evo-hero .delta { background: rgba(255,255,255,.07); color: var(--muted); }
.evo-hero .delta.good { background: color-mix(in srgb, var(--orange) 14%, transparent); color: var(--orange-text); }
.evo-hero .delta.bad, .evo-hero .delta.neutral { background: rgba(255,255,255,.07); color: var(--muted); }
.goal-bar { height: 4px; background: rgba(255,255,255,.08); }
.goal-bar i { background: var(--orange); }
.hero-stats { gap: 0; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.06); }
.hero-stats div { background: none; border-radius: 0; padding: 2px 0 0 14px; border-left: 1px solid rgba(255,255,255,.06); }
.hero-stats div:first-child { padding-left: 0; border-left: 0; }
.hero-stats span { color: var(--muted); font-size: 12px; text-transform: none; letter-spacing: .08em; }
.hero-stats b { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.evo-hero .pills { background: rgba(255,255,255,.05); }
.evo-hero .pills button { color: var(--muted); opacity: 1; font-weight: 500; }
.evo-hero .pills button:hover { color: var(--ink); }
.evo-hero .pills button.on { background: var(--card); color: var(--ink); font-weight: 600; }
.mgrid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.mcard { border: 1px solid var(--box-line); border-radius: 16px; padding: 14px 14px 10px; gap: 4px; box-shadow: none; }
.mcard:hover { box-shadow: none; border-color: var(--line); }
.mcard.on { border-color: #212121; box-shadow: none; }
.mcard > span.muted { font-size: 12px; text-transform: none; letter-spacing: .07em; color: var(--muted); }
.mcard b { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.mcard .delta { margin-top: 2px; }
.mcard .spark { height: 26px; margin-top: 4px; }
.mcard .spark polyline { stroke: #cfcfcf; }
.mcard.on .spark polyline, .mcard:hover .spark polyline { stroke: var(--orange); }
.mgrid { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px; }
.mcard { padding: 12px 12px 8px; }
.mcard b { font-size: 20px; }
.mcard b small { font-size: 12px; }
@media (max-width: 640px) { .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mcard > span.muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .05em; font-size: 12px; }

/* v3: collapsible sidebar, data tables, library grid, agenda, activity, equivalences, PWA */
.cside { position: relative; }
.side-h { display: flex; align-items: center; justify-content: space-between; padding: 4px 12px 8px 18px; font-size: 12px; color: var(--muted); }
.side-t { border: 0; background: none; cursor: pointer; width: 28px; height: 28px; border-radius: 10px; color: var(--orange-d); display: inline-flex; align-items: center; justify-content: center; }
.side-t:hover { background: var(--surface-raised); }
.cpage { transition: grid-template-columns .2s ease; }
.cpage.collapsed { grid-template-columns: 64px 1fr; }
.cpage.collapsed .side-h { justify-content: center; padding: 4px 0 8px; }
.cpage.collapsed .side-t svg { transform: rotate(180deg); }
.cpage.collapsed .cside a { justify-content: center; padding: 14px 0; }
.cpage.collapsed .cside a div { display: none; }
.cpage.collapsed .cside a svg { width: 19px; height: 19px; margin-top: 0; }

.pg-h { margin-bottom: 14px; }
.pg-h h1 { font-weight: 500; letter-spacing: -.01em; }
.cnt { font-size: 13px; color: var(--muted); font-weight: 500; vertical-align: super; margin-left: 2px; }

@media (hover: hover) { .btn.dark:hover { background: var(--bg); border-color: var(--halo-line); box-shadow: var(--halo); } }
.who { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 460px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.chip.blue-soft { background: var(--blue-bg); border-color: var(--blue-line); color: var(--sky); font-weight: 600; padding: 4px 12px; font-size: 13px; }
.iconbtn.rnd { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: var(--card); display: inline-flex; align-items: center; justify-content: center; color: var(--orange-d); font-size: 16px; }
@media (hover: hover) { .iconbtn.rnd:hover:not(:disabled) { border-color: var(--halo-line); box-shadow: var(--halo); } }
.iconbtn:disabled { opacity: .35; cursor: default; }
.row-actions { display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end; }

.dt-bar { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; flex-wrap: wrap; }
.dt-search { position: relative; display: flex; align-items: center; min-width: 260px; flex: 0 1 380px; }
.dt-search svg { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.dt-search input { width: 100%; height: 38px; padding-left: 36px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); }
.dt-wrap { background: var(--card); border: 1px solid var(--box-line); border-radius: 16px; overflow-x: auto; }
.dt { width: 100%; border-collapse: collapse; font-size: 13px; }
.dt th { text-align: left; padding: 12px 16px; background: var(--surface-raised); font-weight: 600; font-size: 13px; color: var(--muted); white-space: nowrap; border-bottom: 1px solid var(--line); }
.dt td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dt tbody tr:last-child td { border-bottom: 0; }
.dt tbody tr:hover td { background: var(--orange-l); }
.dt .r { text-align: right; }
.dt a.o, .linkbtn { color: var(--orange-d); font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; text-align: left; }
.dt a.o:hover, .linkbtn:hover { text-decoration: underline; }
.th-s { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.th-s i { font-style: normal; color: var(--muted); font-size: 12px; }
.th-s.on i { color: var(--orange-d); }
.dt-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 4px; flex-wrap: wrap; }
.dt-foot select { width: auto; min-width: 64px; height: 32px; margin-left: 6px; border-radius: 10px; padding: 0 8px; }
.filter select { width: auto; }
.x-empty { font-size: 20px; }
.dt-pager { display: flex; align-items: center; gap: 8px; }
.files-intro { margin: 0 0 14px; color: var(--muted); }

.lib-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 18px; }

.filter { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 0 8px 0 12px; height: 38px; color: var(--muted); }
.filter select { border: 0; background: none; height: 34px; padding: 0 4px; max-width: 140px; }
.x-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.xcard { position: relative; border-radius: 16px; overflow: hidden; background: #151515; aspect-ratio: 16 / 10; box-shadow: 0 1px 3px rgba(0,0,0,.08); transition: transform .15s, box-shadow .15s; }
.xcard:hover { transform: translateY(-2px); box-shadow: none; }
.xcard.none { background: var(--surface-raised); }
.xmain { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; color: var(--ink); }
.xmain img { width: 100%; height: 100%; object-fit: cover; display: block; }
.x-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 16px 36px; font-weight: 700; font-size: 20px; line-height: 1.15; color: var(--muted); }
.xmain .play { position: absolute; left: 12px; top: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--orange); color: var(--on-accent); font-size: 12px; font-style: normal; display: flex; align-items: center; justify-content: center; }
.x-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 12px; background: linear-gradient(transparent, rgba(0,0,0,.78)); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.xcard.none .x-cap { background: linear-gradient(transparent, rgba(60,60,60,.55)); }
.x-cap b { font-size: 13px; font-weight: 600; line-height: 1.25; }
.x-cap em { font-style: normal; background: var(--orange); color: var(--on-accent); border-radius: 22px; font-size: 12px; font-weight: 600; padding: 1px 9px; }
.x-heart { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(33,33,33,.88); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.x-heart.on { color: var(--brand-lift, var(--orange)); box-shadow: inset 0 0 0 1px currentColor, 0 2px 8px rgba(0,0,0,.18); }
.x-heart:hover { color: var(--brand-lift, var(--orange)); }

.agenda { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.ag-day { background: var(--card); border: 1px solid var(--box-line); border-radius: 16px; padding: 10px; min-height: 220px; display: flex; flex-direction: column; gap: 6px; }
.ag-day.today { border-color: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 12%, transparent); }
.ag-day header { display: flex; align-items: baseline; justify-content: space-between; font-size: 12px; color: var(--muted); text-transform: none; letter-spacing: .05em; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.ag-day header b { font-size: 17px; color: var(--ink); letter-spacing: 0; }
.ag-item { display: flex; flex-direction: column; border-radius: 16px; padding: 6px 9px; font-size: 12px; border: 1px solid transparent; }
.ag-item b { font-weight: 600; }
.ag-item span { color: var(--muted); font-size: 12px; }
.ag-item.k-wk { background: var(--orange-l); }
.ag-item.k-ci { background: var(--blue-bg); }
.ag-item.k-task { background: var(--surface-raised); }
.ag-item.done { opacity: .5; text-decoration: line-through; }
.ag-item:hover { border-color: var(--line); }

.act-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 16px; }
.act-head h2 { font-size: 20px; font-weight: 500; margin-right: 6px; }
.pills.light { background: transparent; padding: 0; gap: 6px; }
.pills.light button { border: 1px solid var(--line); background: var(--card); color: var(--muted); opacity: 1; padding: 6px 14px; }
.pills.light button.on { background: var(--card); border-color: var(--halo-line); color: var(--orange-d); box-shadow: var(--halo); }
.act-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.act-card { background: var(--surface-raised); border: 1px solid var(--box-line); border-radius: 16px; padding: 16px 16px 8px; min-width: 0; }
.act-card.full { grid-column: 1 / -1; }
.act-h { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 13px; }
.act-h > span { display: inline-flex; align-items: center; gap: 8px; }
.act-h svg { color: var(--muted); }
.act-nums { display: flex; justify-content: space-between; gap: 10px; margin: 14px 0 6px; text-align: center; }
.act-card.full .act-nums { padding: 0 2%; }
.act-nums div { display: flex; flex-direction: column; flex: 1; align-items: center; }
.act-nums b { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.act-nums span { font-size: 12px; color: var(--muted); }
.trend { font-style: normal; font-size: 16px; margin-right: 4px; }
.trend.dn { color: var(--red); } .trend.up { color: var(--orange-d); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.ach { background: var(--card); border: 1px solid var(--box-line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 6px; opacity: .9; }
.ach.ok { border-color: var(--orange); background: linear-gradient(180deg, var(--orange-l), var(--card)); opacity: 1; }
.ach-ic { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-raised); color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.ach.ok .ach-ic { background: var(--orange); color: var(--on-accent); font-size: 17px; }
.ach .goal-bar { height: 4px; background: var(--surface-raised); margin-top: 4px; }
.ach .goal-bar i { background: var(--orange); }

.eq-edit .r { text-align: right; }
.eq-edit input { min-width: 70px; }
.eq-edit td:first-child input { min-width: 180px; }
.eq-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.eq-chip { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--orange); background: var(--orange-l); border-radius: 22px; padding: 3px 4px 3px 12px; font-size: 13px; }
button.eq-chip { padding: 5px 14px; cursor: pointer; }
.eq-clients { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 12px; }
.eq-c { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.eq-c input { width: auto; height: auto; }

.install { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); width: min(440px, calc(100vw - 24px)); background: #212121; color: var(--ink); border-radius: 16px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; box-shadow: none; }
.install img { width: 40px; height: 40px; border-radius: 16px; flex: none; }
.install div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.install b { font-size: 14px; }
.install span { font-size: 12px; color: var(--muted); line-height: 1.35; }
.install .iconbtn { color: var(--muted); }
.install .btn.ghost { background: transparent; color: var(--ink); border-color: #666; }
.inst-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 8px 0 4px; }
.inst-steps ol { margin: 8px 0 0; padding-left: 18px; color: var(--muted); line-height: 1.6; }

@media (max-width: 1100px) { .act-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .agenda { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .side-h { display: none; }
  .cpage.collapsed { grid-template-columns: 1fr; }
  .cpage.collapsed .cside a { padding: 10px 14px; }
  .cpage.collapsed .cside a div { display: block; }
  .act-grid { grid-template-columns: 1fr; }
  .agenda { grid-template-columns: 1fr 1fr; }
  .ag-day { min-height: 120px; }
  .inst-steps { grid-template-columns: 1fr; }
  .x-grid { grid-template-columns: 1fr; }
  .dt-search { flex: 1 1 100%; min-width: 0; }
  .dt-bar .btn { flex: 1 1 auto; }
}

/* evolution — light, clear (v4) */
.evo-hero { background: var(--card); color: var(--ink); border: 1px solid var(--box-line); border-radius: 22px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.evo-hero::before { display: none; }
.evo-hero-l { border-right: 1px solid var(--line); padding: 26px 26px 22px; gap: 14px; }
.evo-hero-r { padding: 20px 22px 14px; }
.evo-hero .eyebrow { color: var(--muted); }
.evo-hero .big { font-size: 52px; margin-top: -4px; }
.evo-hero .big small { color: var(--muted); }
.evo-change { display: flex; flex-direction: column; gap: 6px; }
.evo-change p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.evo-change p b { color: var(--ink); }
.evo-hero .delta { background: var(--surface-raised); color: var(--muted); }
.evo-hero .delta.good { background: var(--orange-l); color: var(--orange-d); }
.evo-hero .delta.bad, .evo-hero .delta.neutral { background: var(--surface-raised); color: var(--muted); }
.evo-hero .goal { background: var(--surface-raised); border: 1px solid var(--box-line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.goal-k { font-size: 13px; color: var(--muted); }
.evo-hero .goal b { font-size: 14px; }
.evo-hero .goal-bar { height: 6px; background: var(--surface-raised); }
.goal-sub { font-size: 12px; color: var(--muted); }
.goal-sub b { color: var(--ink); font-size: 12px !important; }
.evo-hero .hero-stats { border-top: 0; padding-top: 0; margin-top: auto; }
.evo-hero .hero-stats div { border-left: 1px solid var(--line); }
.evo-hero .hero-stats div:first-child { border-left: 0; }
.evo-hero .hero-stats span { color: var(--muted); }
.evo-hero .hero-stats b { display: block; color: var(--ink); margin-top: 2px; }
.evo-hero .hero-stats em { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 1px; }
.evo-hero-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.evo-hero .pills { background: var(--surface-raised); }
.evo-hero .pills button { color: var(--muted); font-weight: 500; }
.evo-hero .pills button:hover { color: var(--ink); }
.evo-hero .pills button.on { background: #212121; color: var(--ink); font-weight: 600; }
.evo-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin: 14px 0 2px; }
.evo-legend span { display: inline-flex; align-items: center; gap: 6px; }
.evo-legend i { display: inline-block; width: 16px; height: 0; border-top: 2.5px solid var(--orange); border-radius: 2px; }
.evo-legend i.lg-goal { border-top: 1.5px dashed #212121; }
.mc-sub { font-style: normal; font-size: 12px; color: var(--muted); margin-top: -1px; }
@media (max-width: 1100px) { .evo-hero-l { border-right: 0; border-bottom: 1px solid var(--line); } }
.evo-change p { font-size: 13px; }
.evo-change p.good b { color: var(--orange-d); }
.evo-hero .hero-stats span { white-space: nowrap; letter-spacing: .05em; font-size: 12px; }
.mcard > span.muted { text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--muted); font-weight: 500; }

/* FanteFit client management and mobile contact. */
.tabs-line .linkbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 8px 0 10px;
  color: var(--ink);
  border-bottom: 2px solid transparent;
}
.tabs-line .linkbtn.on { border-color: var(--orange); }
.configured-logo { object-fit: contain; }
#online-error[hidden] { display: none; }

/* Training editor inside a client's trainer profile. */
.te {
  --te-line: var(--line);
  --te-text: var(--ink);
  --te-muted: var(--muted);
  --te-accent: var(--orange);
  --te-warm: var(--orange-l);
  display: grid; gap: 15px; max-width: 1380px; min-width: 0; margin-inline: auto; color: var(--te-text);
}
.te :is(button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.te .btn { min-height: 42px; height: auto; justify-content: center; padding: 7px 12px; border-radius: 16px; }
.te .btn.ghost { color: var(--te-text); border-color: var(--te-line); }
.te .te-primary { background: var(--orange); color: var(--on-accent); border-color: var(--orange); }
.te .te-primary:hover { background: var(--orange); }
.te-heading, .te-plan-head, .te-library header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.te-heading h2 { font-size: clamp(23px, 4.8vw, 34px); line-height: 1.12; letter-spacing: -.05em; font-weight: 800; }
.te-bar { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.te-bar .te-session-select { flex: 1 1 220px; }
.te-tools { display: flex; flex-wrap: wrap; gap: 7px; }
.te-tools > button, .te-menu summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 39px; padding: 5px 10px;
  border: 1px solid var(--te-line); border-radius: 10px; background: var(--card); cursor: pointer; font-size: 12px; font-weight: 650;
}
.te-menu { position: relative; justify-self: start; }
.te-menu summary { list-style: none; }
.te-menu summary::-webkit-details-marker { display: none; }
.te-menu > div {
  display: grid; position: absolute; z-index: 8; top: calc(100% + 5px); left: 0; min-width: max-content;
  padding: 4px; border-radius: 16px; border: 1px solid var(--te-line); background: var(--card); box-shadow: 0 6px 16px #32241415;
}
.te-menu > div button { border: 0; border-radius: 10px; background: var(--card); padding: 10px; text-align: start; cursor: pointer; }
.te-menu > div button:hover { background: var(--te-warm); }
.te-menu .te-danger, .te-remove { color: var(--red); }
.te-day-menu { flex: none; }
.te-day-menu > div { left: auto; right: 0; }
.te-layout { display: grid; align-items: start; gap: 15px; grid-template-columns: minmax(0, 1fr); }
.te-main, .te-plan, .te-items { display: grid; min-width: 0; gap: 11px; }
.te-card, .te-item { border: 1px solid var(--te-line); border-radius: 16px; background: var(--card); min-width: 0; }
.te-card { padding: 15px; }
.te-empty { color: var(--te-muted); }
.te-empty h2 { color: var(--te-text); margin-bottom: 3px; }
.te-session-select { display: grid; gap: 4px; max-width: 380px; }
.te-session-select > span, .te-field > span, .te-session legend { color: var(--te-muted); font-size: 12px; font-weight: 650; }
.te-session-select select, .te input:not([type=checkbox]), .te textarea {
  box-sizing: border-box; width: 100%; min-width: 0; min-height: 41px;
  border: 1px solid var(--te-line); border-radius: 10px; background-color: var(--card);
}
.te input:not([type=checkbox]), .te textarea { padding: 7px 9px; }
.te-session-head, .te-row-main { display: flex; justify-content: space-between; align-items: end; gap: 8px; }
.te-field { display: grid; gap: 4px; min-width: 0; }
.te-session-head .te-field, .te-row-main .te-field { flex: 1; }
.te .te-session-name { font-size: 20px; font-weight: 780; letter-spacing: -.03em; }
.te-session-settings { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 20px; margin-top: 13px; }
.te-session fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.te-session legend { margin-bottom: 5px; }
.te-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.te-week button {
  width: 37px; min-height: 37px; padding: 3px; background: var(--surface-raised); border: 1px solid var(--te-line);
  border-radius: 10px; cursor: pointer; color: var(--te-muted); font-size: 12px; font-weight: 700;
}
.te-week button[aria-pressed="true"] { background: var(--te-warm); color: var(--te-accent); border-color: var(--halo-line); box-shadow: var(--halo); }
.te-visibility { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; font-size: 13px; font-weight: 650; cursor: pointer; }
.te-plan-head { padding-top: 6px; }
.te-plan-head h2, .te-library h2 { font-size: 17px; font-weight: 800; letter-spacing: -.035em; }
.te-plan-head p { color: var(--te-muted); font-size: 12px; }
.te-plan-head > div:last-child { display: flex; gap: 6px; }
.te-item.is-block { border-inline-start: 0; background: var(--orange-l); }
.te-item.over, .te-drop-end.over { box-shadow: inset 0 3px 0 var(--orange); }
.te-row-toggle { display: none; }
.te-row-edit { padding: 12px; display: grid; gap: 9px; }
.te-row-main input { font-weight: 730; }
.te-row-actions { display: flex; flex: none; flex-wrap: wrap; gap: 4px; }
.te-row-actions button, .te-library-item button {
  display: inline-grid; place-items: center; min-width: 34px; height: 41px; padding: 4px;
  border: 1px solid var(--te-line); border-radius: 10px; background: var(--card); cursor: pointer;
}
.te-row-actions button:disabled { opacity: .35; cursor: default; }
.te-row-actions button:not(:disabled):hover, .te-library-item button:hover { background: var(--te-warm); }
.te-grip { display: grid; place-items: center; width: 24px; color: var(--te-muted); cursor: grab; }
.te-prescription { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.te-notes textarea { min-height: 41px; resize: vertical; }
.te-drop-end { border: 1px dashed var(--line); border-radius: 16px; min-height: 42px; display: none; place-items: center; color: var(--te-muted); font-size: 12px; }
.drag-row .te-drop-end, .te-drop-end.over { display: grid; }
.te-history summary { font-weight: 750; cursor: pointer; }
.te-history .grid2 { margin-block-start: 13px; }
.te-library { display: none; padding: 12px; }
.te-library header { margin-bottom: 8px; }
.te-library header button { display: flex; align-items: center; gap: 3px; min-height: 38px; border: 0; background: transparent; color: var(--te-accent); font-size: 12px; font-weight: 750; cursor: pointer; }
.te-library-list { display: grid; gap: 6px; max-height: 510px; overflow: auto; margin-top: 10px; }
.te-library-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 7px; border-bottom: 1px solid var(--te-line); padding: 4px 2px 7px; }
.te-library-item > span { display: grid; min-width: 0; gap: 2px; overflow-wrap: anywhere; }
.te-library-item strong { font-size: 12px; line-height: 1.2; }
.te-library-item small { color: var(--te-muted); font-size: 12px; }
.te-library-item .ex-thumb { width: 33px; height: 30px; }
.te-library-item button:last-child { color: var(--te-accent); }
.te-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Editor de entrenamiento: tira de días, bloques agrupados, animaciones */
.te-days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.te-day {
  flex: 0 0 auto; display: grid; gap: 2px; min-width: 128px; padding: 10px 14px; text-align: start; cursor: grab;
  border: 1px solid var(--te-line); border-radius: 16px; background: var(--card); color: var(--te-text);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease, opacity .18s ease;
}
.te-day strong { font-size: 14px; font-weight: 750; letter-spacing: -.02em; }
.te-day small { color: var(--te-muted); font-size: 12px; font-weight: 600; }
.te-day:hover { transform: translateY(-1px); box-shadow: none; }
.te-day.on { border-color: var(--halo-line); background: var(--orange-l); box-shadow: var(--halo); }
.te-day.dragging { opacity: .45; transform: scale(.96); }
.te-day.over { border-color: var(--orange); box-shadow: -5px 0 0 var(--orange); }
.te-day-add { min-width: 0; grid-auto-flow: column; align-content: center; justify-content: center; gap: 4px; border-style: dashed; color: var(--te-accent); font-size: 13px; font-weight: 700; cursor: pointer; }
.te-item { transition: box-shadow .18s ease, border-color .18s ease, opacity .18s ease, transform .18s ease; }
.te-item:hover { box-shadow: none; }
.te-item.dragging { opacity: .4; transform: scale(.99); }
.te-item.in-block { position: relative; margin-inline-start: 16px; }
.te-item.in-block::before { content: ""; position: absolute; inset-block: -7px; inset-inline-start: -11px; width: 2px; border-radius: 2px; background: var(--orange-m); }
.te-item.is-block .te-row-main input { font-size: 14px; font-weight: 800; }
.te .te-row-actions button { border-color: transparent; background: transparent; color: var(--te-muted); }
.te .te-row-actions button:not(:disabled):hover { background: var(--te-warm); color: var(--te-accent); }
.te .te-row-actions .te-remove:hover { color: var(--red); }
.te-muscles { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.te-muscles button { min-height: 28px; padding: 2px 10px; border: 1px solid var(--te-line); border-radius: 999px; background: var(--card); color: var(--te-muted); font-size: 12px; font-weight: 650; cursor: pointer; }
.te-muscles button[aria-pressed="true"] { border-color: var(--halo-line); background: var(--orange-l); color: var(--te-text); box-shadow: var(--halo); }
@keyframes te-pop { from { opacity: 0; transform: translateY(-8px) scale(.985); } to { opacity: 1; transform: none; } }
.te-item.did-drop, .te-day.did-drop { animation: te-pop .34s cubic-bezier(.2, .8, .2, 1); }
@media (prefers-reduced-motion: reduce) { .te-item.did-drop, .te-day.did-drop { animation: none; } .te-day, .te-item { transition: none; } }
@media (min-width: 681px) {
  .te-bar .te-session-select { display: none; }
  .te-bar { align-items: center; flex-wrap: nowrap; }
  .te-bar .te-days { flex: 1 1 0; min-width: 0; padding-bottom: 2px; }
  .te-bar .te-tools { flex: none; }
  .te { gap: 10px; }
}
@media (max-width: 680px) { .te-days { display: none; } }
@media (min-width: 900px) {
  .te-row-edit { grid-template-columns: minmax(150px, 1fr) repeat(4, 76px) auto; align-items: end; }
  .te-row-main, .te-prescription { display: contents; }
  .te-row-main > .te-field { grid-area: 1 / 1; }
  .te-prescription > .te-field { grid-row: 1; }
  .te-row-actions { grid-area: 1 / 6; flex-wrap: nowrap; }
  .te-notes { grid-row: 2; grid-column: 1 / -1; }
  .te-item.is-block .te-row-edit { grid-template-columns: minmax(0, 1fr) auto; }
  .te-item.is-block .te-row-actions { grid-column: 2; }
}

@media (min-width: 1050px) {
  .te-layout { grid-template-columns: minmax(0, 1fr) minmax(225px, 27%); }
  .te-library { display: block; position: sticky; top: 65px; }
}
@media (max-width: 680px) {
  .te { gap: 13px; }
  main:has(.te) .chead { flex-wrap: wrap; min-width: 0; gap: 6px 8px; }
  main:has(.te) .chead .grow { display: none; }
  main:has(.te) .chead > b { overflow-wrap: anywhere; }
  .te-bar .te-session-select { flex-basis: 100%; }
  .te-heading .btn { padding-inline: 8px; }
  .te-card { padding: 12px; }
  .te-week button { width: clamp(31px, 10vw, 43px); min-height: 42px; }
  .te-visibility { width: 100%; }
  .te-session-settings { gap: 7px; }
  .te-plan-head { flex-wrap: wrap; }
  .te-plan-head p { font-size: 12px; }
  .te-row-toggle {
    width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
    gap: 8px; min-height: 60px; padding: 9px; background: transparent; border: 0; text-align: start; cursor: pointer;
  }
  .te-row-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; color: var(--te-accent); background: var(--te-warm); }
  .te-row-toggle strong, .te-row-toggle small { display: block; overflow-wrap: anywhere; }
  .te-row-toggle small { color: var(--te-muted); font-size: 12px; }
  .te-row-toggle[aria-expanded=true] > svg:last-child { transform: rotate(180deg); }
  .te-item:not(.is-open) .te-row-edit { display: none; }
  .te-item.is-open { border-color: var(--halo-line); box-shadow: var(--halo); }
  .te-row-edit { border-top: 1px solid var(--te-line); padding: 10px; }
  .te-row-main { flex-direction: column; align-items: stretch; }
  .te-row-actions { order: 2; }
  .te-row-actions button { width: 44px; height: 44px; }
  .te-grip { display: none; }
  .te-prescription { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .te input:not([type=checkbox]), .te textarea, .te select { font-size: 16px; min-height: 44px; }
}

.ex-thumb .ex-thumb-fallback { position: relative; }
.ex-thumb :is(img, video) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.workout-media-button {
  display: grid; place-items: center; padding: 0; min-width: 46px; min-height: 46px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--card); cursor: pointer;
}
@media (hover: hover) { .workout-media-button:hover { border-color: var(--halo-line); box-shadow: var(--halo); } }
.workout-media-button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.workout-media-button .ex-thumb { width: 44px; height: 44px; border-radius: 10px; }
.workout-media-button .play { color: var(--on-accent); width: 16px; height: 16px; }
.te-item.has-workout-media { display: grid; grid-template-columns: 59px minmax(0, 1fr); }
.te-item > .workout-media-button { grid-column: 1; grid-row: 1; align-self: start; justify-self: end; margin-top: 13px; }
.te-item.has-workout-media .te-row-edit { grid-column: 2; }
.workout-technique-player:has(img) { min-height: 0; }
.workout-technique-photo { margin-top: 12px; }
.workout-technique-photo summary { padding: 8px 0; cursor: pointer; font-weight: 650; }
.workout-technique-photo img { display: block; width: 100%; max-height: 380px; margin-top: 6px; object-fit: contain; border-radius: 16px; }
@media (max-width: 680px) {
  .te-item.has-workout-media { grid-template-columns: 54px minmax(0, 1fr); }
  .te-item.has-workout-media .te-row-toggle { grid-column: 2; grid-row: 1; grid-template-columns: minmax(0, 1fr) auto; }
  .te-item.has-workout-media .te-row-edit { grid-column: 1 / -1; }
  .te-item > .workout-media-button { align-self: center; margin-top: 0; }
}

.te-item.has-media-editor { display: grid; grid-template-columns: minmax(0, 1fr) 49px; }
.te-item.has-media-editor.has-workout-media { grid-template-columns: 59px minmax(0, 1fr) 49px; }
.te-media-eye {
  grid-column: 2; grid-row: 1; place-self: start center; display: grid; place-items: center;
  width: 41px; height: 41px; margin-top: 29px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--te-line); background: var(--card); color: var(--te-accent);
}
.te-media-eye:hover { background: var(--te-warm); }
.has-workout-media > .te-media-eye { grid-column: 3; }
.te-media-cover { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.te-media-cover input { flex: 1 1 180px; width: auto; min-width: 0; }
.te-media-cover button:disabled { opacity: .55; cursor: default; }
@media (max-width: 680px) {
  .te-item.has-media-editor.has-workout-media { grid-template-columns: 54px minmax(0, 1fr) 52px; }
  .te-item.has-media-editor .te-row-toggle { grid-row: 1; }
  .te-item.has-media-editor .te-row-edit { grid-column: 1 / -1; }
  .te-media-eye { align-self: center; width: 44px; height: 44px; margin: 0; }
}

/* Nutrition editor for coaches and library templates. */
.diet-editor { display: grid; gap: 14px; --diet-line: var(--line); --diet-soft: var(--bg); --diet-accent: var(--orange); }
.diet-editor :is(.diet-plan, .diet-summary, .diet-meal) { min-width: 0; border: 1px solid var(--diet-line); border-radius: 16px; box-shadow: none; }
.diet-plan, .diet-meal { display: grid; gap: 12px; }
.diet-plan { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
.diet-plan > .field, .diet-plan > .diet-field:last-child { grid-column: 1 / -1; }
.diet-plan > .field { margin: 0; }
.diet-field { display: block; min-width: 0; }
.diet-field .f { font-weight: 650; }
.diet-plan .plan-title { height: 44px; padding-inline: 10px; font-size: clamp(17px, 2.2vw, 22px); font-weight: 750; color: var(--ink); border: 1px solid var(--diet-line); }
.diet-field textarea { display: block; min-height: 55px; }
.diet-plan-settings, .diet-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.diet-plan-settings { align-items: flex-end; }
.diet-visibility { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; cursor: pointer; font-size: 13px; }
.diet-visibility .toggle:focus-within { outline: 2px solid var(--diet-accent); outline-offset: 3px; border-radius: 22px; }
.diet-plan-settings .diet-field input { display: block; width: auto; max-width: 100%; }
.diet-editor :is(.btn, .opt) { min-height: 38px; height: auto; padding: 7px 11px; border-radius: 16px; white-space: normal; }
.diet-editor :is(.btn.ghost, .opt) { border-color: var(--diet-line); }
.diet-editor :is(.opt.on, .btn:not(.ghost)) { color: var(--diet-accent); border-color: var(--orange); background: var(--orange-l); }
.diet-editor :is(.opt.on, .btn:not(.ghost)):hover { background: var(--orange-l); }
.diet-editor .iconbtn { display: inline-grid; place-items: center; min-width: 36px; min-height: 36px; border: 1px solid var(--diet-line); background: var(--card); }
.diet-editor .iconbtn:hover:not(:disabled) { background: var(--diet-soft); color: var(--diet-accent); }
.diet-editor .iconbtn:disabled { opacity: .35; cursor: default; }
.diet-editor :is(button, input, select, textarea):focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.diet-editor h2 { font-size: 17px; font-weight: 750; }
.diet-summary .macros { gap: 6px; margin: 10px 0 0; padding: 0; border: 0; font-size: 12px; }
.diet-summary .macros > div { padding: 8px 3px; border-radius: 16px; background: var(--surface-raised); }
.diet-summary .macros > div:first-child { background: var(--orange-l); color: var(--diet-accent); }
.diet-summary .macros b { font-size: 14px; }
.diet-meals { display: grid; gap: 10px; }
.diet-meals-heading, .diet-meal-heading, .diet-option-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.diet-meals-heading { align-items: center; }
.diet-meal-heading > label, .diet-option-heading > label { flex: 1; max-width: 410px; }
.diet-meal-heading input { font-weight: 750; }
.diet-options { gap: 6px; margin: 0; }
.diet-options .opt { overflow-wrap: anywhere; }
.diet-option { display: grid; gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--diet-line); border-radius: 16px; background: var(--diet-soft); }
.diet-food { background: var(--card); border-radius: 16px; }
.diet-food th { font-size: 12px; }
.diet-food tbody td, .diet-food tbody th { border-top: 1px solid var(--diet-line); border-bottom: 0; }
.diet-food .diet-food-name { text-align: start; padding-inline: 9px; font-weight: 700; overflow-wrap: anywhere; }
.diet-food-amount input { width: 68px; }
.diet-food .diet-nutrient-label, .diet-food .diet-food-amount > span { display: none; }
.diet-food tfoot { background: var(--orange-l); }
.diet-food tfoot :is(th, td) { font-weight: 750; border-top: 1px solid var(--diet-line); padding-block: 8px; }
.diet-recipe { display: grid; grid-template-columns: minmax(0, 1fr) 90px; gap: 8px; }

/* Escritorio: editor más estrecho y denso */
@media (min-width: 921px) {
  .diet-editor { max-width: 1160px; margin-inline: auto; gap: 14px; }
  .diet-editor :is(.diet-plan, .diet-summary, .diet-meal) { padding: 18px 20px; gap: 12px; }
  .diet-plan { grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; }
  .diet-plan .plan-title { height: 42px; }
  .diet-option { padding: 14px; gap: 10px; }
  .diet-meal-heading > label, .diet-option-heading > label { max-width: 380px; }
  .diet-food :is(th, td) { padding-block: 6px; }
  .diet-food-amount input { width: 64px; }
}

@media (max-width: 920px) {
  .diet-plan { grid-template-columns: minmax(0, 1fr); }
  .diet-editor :is(.btn, .opt, .iconbtn) { min-height: 44px; }
  .diet-editor .iconbtn { min-width: 36px; }
  .diet-food { display: block; position: relative; background: transparent; }
  .diet-food thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .diet-food :is(tbody, tfoot) { display: grid; gap: 6px; }
  .diet-food tr { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; gap: 3px; padding: 6px; background: var(--card); border: 1px solid var(--diet-line); border-radius: 16px; }
  .diet-food :is(tbody, tfoot) :is(th, td) { border: 0; padding: 3px 0; }
  .diet-food tbody .diet-food-name { grid-column: 1 / 3; grid-row: 1; }
  .diet-food tfoot { margin-top: 6px; }
  .diet-food tfoot tr { background: var(--orange-l); }
  .diet-food tfoot .diet-food-name { grid-column: 1 / -1; }
  .diet-food tbody .diet-food-amount { grid-column: 3 / 5; grid-row: 1; display: flex; align-items: center; justify-content: end; gap: 3px; }
  .diet-food-amount input { width: min(100%, 66px); min-width: 0; min-height: 44px; padding-inline: 4px; }
  .diet-food .diet-food-amount > span { display: inline; font-size: 12px; }
  .diet-food tbody .diet-food-remove { grid-column: 5; grid-row: 1; justify-self: end; }
  .diet-food tfoot .diet-food-remove { display: none; }
  .diet-food :is(tbody, tfoot) .diet-nutrient { padding: 4px 0; font-size: 12px; border-radius: 10px; background: var(--surface-raised); }
  .diet-food .diet-nutrient-label { display: block; color: var(--muted); font-size: 12px; }
}
@media (max-width: 440px) {
  .diet-summary .macros { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diet-summary .macros > div:first-child { grid-column: 1 / -1; }
  .diet-option { padding: 7px; }
  .diet-option-heading { display: grid; }
  .diet-recipe { grid-template-columns: minmax(0, 1fr); }
  .diet-recipe input { max-width: 90px; }
}

input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff; --ink: #212121; --muted: #65615a;
  --card: #ffffff; --top: #fffaf4; --surface-raised: #f6f4f0; --line: #e8e3dc;
  --orange-d: color-mix(in srgb, var(--orange) 58%, #000);
  --green: #20613f; --red: #a82f36; --teal: #155e50; --pink: #872943; --sky: #244e7d; --violet: #634c88;
  --green-bg: #e8f4e9; --teal-bg: #e6f5ef; --blue-bg: #e9f2ff; --violet-bg: #f0eafa;
  --pink-bg: #fcecf1; --red-bg: #fff0f0; --green-line: #d3e6d5; --blue-line: #d4e3ff; --red-line: #f6c4c4;
}
:root[data-theme="light"] :is(.login-art, .install) {
  --ink: #ffffff; --muted: #dedede; --bg: #212121;
}
:root[data-theme="light"] .evo-hero .pills button.on { background: var(--surface-raised); }
:root[data-theme="light"] :is(.capp, .coach-tabbar, .cpage, .coach-page-home, .coach-page-clients, .coach-profile-head) { --client-accent-ink: color-mix(in srgb, var(--orange) 47%, #000); }
:root[data-theme="light"] .te { --te-accent: color-mix(in srgb, var(--orange) 47%, #000); }
:root[data-theme="light"] .diet-editor { --diet-accent: color-mix(in srgb, var(--orange) 47%, #000); }
:root[data-theme="light"] .coach-desktop-plan { --cal-accent: #783c00; }
.theme-switch {
  display: inline-grid;
  min-width: 38px;
  min-height: 38px;
  place-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.theme-switch > span { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; font-weight: 650; }
.theme-switch svg { color: var(--orange-d); flex: none; }
.theme-switch:hover { background: var(--surface-raised); }
.theme-switch:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
:root[data-theme="light"] .theme-night, :root:not([data-theme="light"]) .theme-day { display: none; }
.login-box { position: relative; padding-block-start: max(56px, calc(12px + env(safe-area-inset-top))); }
.login-theme { position: absolute; inset-block-start: calc(10px + env(safe-area-inset-top)); inset-inline-end: 12px; }
/* A pantalla completa (app o PWA), la barra superior baja por debajo del notch. */
.top { height: calc(56px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
@media (max-width: 800px) {
  .theme-switch { min-width: 44px; min-height: 44px; }
}

/* Editor de entrenamiento: tarjetas compactas y miniatura grande (escritorio) */
@media (min-width: 681px) {
  .te-items, .te-plan { gap: 8px; }
  .te-item .te-row-edit { padding: 8px 12px 10px; gap: 5px; }
  .te-item :is(input:not([type=checkbox]), textarea) { min-height: 34px; padding: 4px 9px; }
  .te-item .te-field { gap: 2px; }
  .te-item .te-field > span { font-size: 12px; }
  .te-item .te-notes textarea { min-height: 34px; }
  .te .te-item .te-row-actions button { height: 34px; min-width: 30px; }
  .te-item.has-media-editor.has-workout-media { grid-template-columns: 104px minmax(0, 1fr) 46px; }
  .te-item > .workout-media-button { margin: 10px 0 0; justify-self: center; min-width: 88px; min-height: 88px; }
  .te-item > .workout-media-button .ex-thumb { width: 88px; height: 88px; border-radius: 10px; }
  .te-media-eye { width: 34px; height: 34px; margin-top: 24px; }
  .te-card.te-session { padding: 11px 14px; }
}
@media (min-width: 900px) {
  .te-item.is-block .te-row-edit { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto; }
  .te-item.is-block .te-row-main > .te-field { grid-area: 1 / 1; }
  .te-item.is-block .te-notes { grid-area: 1 / 2; }
  .te-item.is-block .te-row-actions { grid-area: 1 / 3; }
}

/* Modal de ejercicio: dos columnas limpias */
.modal-card:has(.ex-modal) { padding: 26px 28px 22px; }
.modal-card:has(.ex-modal) h2 { margin-bottom: 2px; font-size: 20px; font-weight: 800; letter-spacing: -.04em; }
.ex-sub { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.ex-modal { gap: 28px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.ex-col { display: grid; align-content: start; gap: 12px; min-width: 0; }
.ex-col h3 { margin: 0; color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: none; }
.ex-modal .media-box { aspect-ratio: 16 / 9; min-height: 0; border-radius: 16px; font-size: 13px; }
.ex-modal .media-box :is(img, video, iframe) { height: 100%; max-height: none; }
.ex-modal :is(input:not([type=file]), textarea) {
  box-sizing: border-box; width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--card); color: var(--ink); font: inherit; font-size: 14px;
}
.ex-modal textarea#md { min-height: 170px; resize: vertical; }
.ex-modal :is(input, textarea):focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; border-color: transparent; }
.ex-modal .field { margin: 0; }
.ex-modal .f { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; font-weight: 650; }
.ex-link { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-link input { flex: 1 1 100%; }
.ex-file { position: relative; overflow: hidden; }
.ex-file input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ex-thumbrow { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--box-line); border-radius: 16px; }
.ex-thumbtext { display: grid; flex: 1; min-width: 0; }
.ex-thumbtext strong { font-size: 13px; }
.ex-thumbtext small { color: var(--muted); font-size: 12px; }
.ex-thumbrow .btn:disabled { opacity: .5; }
.modal-actions .ex-del { background: transparent; border-color: transparent; color: var(--red); font-weight: 650; }
.modal-actions .ex-del:hover { background: color-mix(in srgb, var(--red) 10%, transparent); }
@media (max-width: 760px) { .ex-modal { grid-template-columns: 1fr; gap: 20px; } }
.te-day { max-width: 230px; }
.te-day small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-plan-head .te-block-menu summary { min-height: 42px; padding: 7px 12px; border-radius: 16px; font-size: 14px; font-weight: 650; }
.te-block-menu > div { left: 0; right: auto; }

/* Inicio: minimalista con movimiento  */
@keyframes home-rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes home-ring { from { stroke-dasharray: 0 100; } }
.welcome { position: relative; margin-bottom: 26px; padding: 6px 0; isolation: isolate; }
.welcome h1 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 650; letter-spacing: -.025em; animation: home-rise .6s both; }
.welcome p { animation: home-rise .6s .08s both; }
.welcome .welcome-date { margin: 0 0 2px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: none; color: var(--orange-text); animation-delay: 0s; }
.kpis { gap: 14px; margin-bottom: 18px; }
.kpi { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--box-line); box-shadow: none; overflow: hidden; transition: transform .2s, border-color .2s; }
.kpi:hover { transform: translateY(-2px); border-color: var(--orange-m); }
.kpi::after { content: ""; position: absolute; left: 18px; bottom: 0; width: 28px; height: 3px; border-radius: 3px 3px 0 0; background: var(--orange); transition: width .3s; }
.kpi:hover::after { width: calc(100% - 36px); }
.kpi.warn::after { background: var(--red); }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi b { font-size: 28px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; margin: 0; }
.home-note { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 10px 14px; border-radius: 16px; font-size: 13px; background: color-mix(in srgb, var(--muted) 9%, transparent); border: 1px solid var(--orange-m); animation: home-rise .5s .4s both; }
.home-note svg { color: var(--orange); flex: none; }
.dash { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dash .card { min-height: 0; border: 1px solid var(--box-line); box-shadow: none; animation: home-rise .6s .3s both; }
.dash-main { min-height: 420px; }
.dash-side { display: grid; gap: 16px; min-width: 0; }
.dash-side .card:nth-child(2) { animation-delay: .4s; }
.ring-key { margin-left: auto; }
.timeline { max-height: 480px; position: relative; }
.act { position: relative; padding: 11px 8px; border-radius: 16px; border-bottom: 0; transition: background .2s; }
/* sin desplazamiento: dentro de la lista con scroll, mover la fila hacía aparecer la barra horizontal */
.act:hover { background: var(--surface-raised); }
.comp, .evt { transition: background .2s, transform .2s; }
.comp { padding: 9px 8px; border-radius: 16px; border-bottom: 0; }
a.comp:hover { background: var(--surface-raised); }
@media (hover: hover) and (pointer: fine) { @media (hover: hover) { .evt:hover { border-color: var(--halo-line); box-shadow: var(--halo); } } }
.sub-h { margin: 18px 0 8px; font-size: 14px; font-weight: 650; }
.ring { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.4; stroke-linecap: round; }
.ring .bg { stroke: var(--line); }
.ring .fg { animation: home-ring 1.1s .6s cubic-bezier(.2, .7, .2, 1) both; }
.ring.up .fg { stroke: var(--green); } .ring.down .fg { stroke: var(--red); }
.ring b { font-size: 12px; font-weight: 650; }
@media (max-width: 960px) { .dash { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) {
  .welcome :is(h1, p), .kpi, .home-note, .dash .card, .act, .comp, .evt, .ring .fg { animation: none; }
}

/* Menú superior: centrado real, más grande y con movimiento al pasar el ratón */
@media (min-width: 901px) {
  .top { display: grid; grid-template-columns: 1fr auto 1fr; }
  .top .me { justify-self: end; }
  .topnav { margin: 0; gap: 6px; }
  .topnav a { position: relative; padding: 9px 16px; font-size: 14px; transition: background .2s, color .2s, transform .2s; }
  .topnav a svg { width: 19px; height: 19px; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
  .topnav a:hover { color: var(--ink); transform: translateY(-1px); }
  .topnav a:hover svg { transform: scale(1.18) rotate(-6deg); }
  .topnav a:active { transform: scale(.96); }
  .topnav a::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 0; height: 2px; border-radius: 2px; background: var(--orange); transform: translateX(-50%); transition: width .25s; }
  .topnav a:hover::after { width: 38%; }
  .topnav a.on::after { display: none; }
}
@media (prefers-reduced-motion: reduce) { .topnav a, .topnav a svg, .topnav a::after { transition: none; } }

/* Botón de tema: animación al pasar el ratón */
@keyframes theme-spin { to { transform: rotate(360deg) scale(1.15); } }
@keyframes theme-sway { 0%, 100% { transform: rotate(0); } 35% { transform: rotate(-22deg) scale(1.15); } 70% { transform: rotate(12deg) scale(1.15); } }
.theme-switch { transition: background .2s, transform .2s, box-shadow .25s; }
.theme-switch:hover { transform: translateY(-1px); box-shadow: 0 0 0 4px color-mix(in srgb, var(--muted) 16%, transparent); }
.theme-switch:active { transform: scale(.92); }
.theme-switch .theme-day svg { transition: transform .3s; }
.theme-switch:hover .theme-day svg { animation: theme-spin .9s ease-in-out; }
.theme-switch:hover .theme-night svg { animation: theme-sway .8s ease-in-out; }
@media (prefers-reduced-motion: reduce) { .theme-switch, .theme-switch svg { transition: none; animation: none !important; } }

/* Marca de agua del logo en Inicio */
.coach-page-home { position: relative; isolation: isolate; }

/* Ajustes: una columna, tarjetas limpias */
@keyframes set-rise { from { opacity: 0; transform: translateY(14px); } }
.set-page { max-width: 760px; margin: 0 auto; display: grid; gap: 14px; }
.set-head { margin-bottom: 6px; animation: set-rise .5s both; }
.set-head h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 650; letter-spacing: -.025em; }
.set-card { padding: 20px 22px; border: 1px solid var(--box-line); border-radius: 22px; background: var(--card); display: grid; gap: 16px; transition: border-color .25s, transform .25s; }
.set-card:hover { border-color: var(--orange-m); transform: translateY(-2px); }
.set-card > header { display: flex; align-items: flex-start; gap: 14px; }
.set-card h2 { font-size: 16px; font-weight: 650; }
.set-card header p { margin: 3px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.set-ico { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 16px; color: var(--orange); background: color-mix(in srgb, var(--muted) 12%, transparent); transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.set-ico svg { width: 19px; height: 19px; }
.set-card:hover .set-ico { transform: scale(1.1) rotate(-6deg); }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.set-field { display: grid; gap: 6px; min-width: 0; }
.set-field.wide { grid-column: 1 / -1; }
.set-field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.set-field input { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.set-field input:hover { border-color: var(--orange-m); }
.set-field input:focus { outline: 0; border-color: var(--halo-line); box-shadow: var(--halo); }
.set-pass { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.set-pass .grow { flex: 1; min-width: 200px; }
.set-pass .btn { min-height: 42px; }
.set-pass .err { flex-basis: 100%; margin: 0; }
.set-brand { display: flex; align-items: flex-end; gap: 16px; }
.set-logo { display: grid; place-items: center; width: 64px; height: 64px; flex: none; border: 1px dashed var(--line); border-radius: 16px; background: var(--bg); transition: transform .3s; }
.set-logo .logo-img { width: 32px; height: 34px; object-fit: contain; }
.set-card:hover .set-logo { transform: rotate(-4deg) scale(1.04); }
.set-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.set-actions .btn { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; transition: transform .2s, box-shadow .2s, background .2s; }
.set-actions .btn:hover { transform: translateY(-2px); }
.set-file { position: relative; overflow: hidden; cursor: pointer; }
.set-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.set-note { font-size: 13px; line-height: 1.55; color: var(--muted); }
.set-card .chip { vertical-align: middle; }
.set-card.danger-zone { border-color: color-mix(in srgb, var(--red) 28%, var(--line)); }
.set-card.danger-zone:hover { border-color: color-mix(in srgb, var(--red) 55%, var(--line)); }
.danger-zone .set-ico { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.set-danger-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--red) 6%, transparent); font-size: 13px; }
@media (max-width: 640px) { .set-grid { grid-template-columns: 1fr; } .set-card { padding: 16px; } }
@media (prefers-reduced-motion: reduce) { .set-head, .set-card, .set-ico, .set-logo, .set-actions .btn { animation: none; transition: none; } }

/* Agenda: minimalista con movimiento */
@keyframes ag-rise { from { opacity: 0; transform: translateY(14px); } }
.ag-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.ag-head .pg-h { margin: 0; animation: ag-rise .5s both; }
.ag-head h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 650; letter-spacing: -.025em; }
.ag-nav { display: flex; align-items: center; gap: 10px; animation: ag-rise .5s .08s both; }
.ag-nav b { min-width: 150px; text-align: center; font-size: 14px; font-weight: 650; }
.ag-nav .iconbtn { transition: transform .2s, background .2s, border-color .2s; }
@media (hover: hover) { .ag-nav .iconbtn:hover { transform: scale(1.12); border-color: var(--halo-line); box-shadow: var(--halo); } }
.ag-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; animation: ag-rise .5s .14s both; }
.ag-legend span { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 22px; font-size: 13px; color: var(--muted); }
.ag-legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.ag-legend .k-ci i { background: var(--sky); }
.ag-legend .k-task i { background: var(--muted); }
.agenda { gap: 12px; }
.ag-day { min-height: 280px; padding: 12px; border-radius: 22px; gap: 8px; transition: border-color .25s, transform .25s, opacity .25s; }
.ag-day:hover { transform: translateY(-3px); border-color: var(--orange-m); }
.ag-day.past { opacity: .62; }
.ag-day.past:hover { opacity: 1; }
.ag-day.today { box-shadow: 0 0 0 4px color-mix(in srgb, var(--muted) 14%, transparent); }
.ag-day.today header b { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 50%; background: var(--orange); color: var(--on-accent); }
.ag-day header { padding-bottom: 8px; border-bottom: 0; }
.ag-day header b { font-size: 17px; }
.ag-item { position: relative; padding: 8px 10px 8px 13px; border-radius: 16px; transition: transform .2s, border-color .2s, background .2s; }
.ag-item::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--orange); }
.ag-item.k-ci::before { background: var(--sky); }
.ag-item.k-task::before { background: var(--muted); }
.ag-item:hover { transform: translateX(3px); }
.ag-empty { margin: auto; font-size: 12px; color: var(--muted); opacity: .55; }
@media (prefers-reduced-motion: reduce) { .ag-head .pg-h, .ag-nav, .ag-legend, .ag-day { animation: none; } .ag-day, .ag-item, .ag-nav .iconbtn { transition: none; } }

/* Librería > Entrenamientos */
@keyframes lw-rise { from { opacity: 0; transform: translateY(14px); } }
.lw-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; animation: lw-rise .5s both; }
.lw-head h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 650; letter-spacing: -.025em; }
.lw-tools { display: flex; align-items: center; gap: 10px; }
.lw-tools .dt-search { min-width: 220px; }
.tpl-grid { gap: 14px; }
.tpl { position: relative; min-height: 200px; padding: 18px; gap: 6px; border: 1px solid var(--box-line); border-radius: 22px; box-shadow: none; transition: transform .25s, border-color .25s; }
.tpl:hover { transform: translateY(-3px); border-color: var(--orange-m); }
.tpl-grid.still .tpl { animation: none; }
.tpl-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.tpl-ic { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.tpl:hover .tpl-ic { transform: scale(1.1) rotate(-8deg); }
.tpl-icons { display: flex; gap: 4px; }
@media (hover: hover) { .tpl-icons { opacity: 0; transform: translateY(-3px); transition: opacity .2s, transform .2s; } .tpl:hover .tpl-icons, .tpl:focus-within .tpl-icons { opacity: 1; transform: none; } }
.tpl .chips { flex-wrap: nowrap; overflow: hidden; margin-top: 4px; }
.tpl .chip { white-space: nowrap; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tpl .chip.more { flex: none; color: var(--orange-text); border-color: var(--orange-m); }
.tpl-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 12px; }
.tpl-new { display: grid; place-content: center; justify-items: center; gap: 8px; min-height: 200px; border: 1.5px dashed var(--line); border-radius: 22px; background: transparent; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; animation: lw-rise .55s .3s both; transition: color .2s, border-color .2s, background .2s, transform .25s; }
.tpl-new svg { width: 22px; height: 22px; transition: transform .3s; }
@media (hover: hover) { .tpl-new:hover { color: var(--orange-text); border-color: var(--halo-line); background: color-mix(in srgb, var(--muted) 6%, transparent); transform: translateY(-3px); box-shadow: var(--halo); } }
.tpl-new:hover svg { transform: rotate(90deg) scale(1.15); }
.tpl-grid.still .tpl-new { animation: none; }
@media (prefers-reduced-motion: reduce) { .lw-head, .tpl, .tpl-new { animation: none; } .tpl, .tpl-ic, .tpl-icons, .tpl-new, .tpl-new svg { transition: none; } }

/* Librería > Ejercicios: tarjetas limpias */
@keyframes lx-rise { from { opacity: 0; transform: translateY(14px); } }
.lx-fav { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; transition: color .2s, border-color .2s, background .2s; }
.lx-fav svg { width: 15px; height: 15px; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.lx-fav:hover { border-color: var(--orange-m); color: var(--ink); }
.lx-fav:hover svg { transform: scale(1.2); }
.lx-fav.on { color: var(--orange-text); border-color: var(--halo-line); background: var(--orange-l); box-shadow: var(--halo); }
.lx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 18px; }
.lx-chips button { min-height: 30px; padding: 2px 13px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: color .2s, border-color .2s, background .2s, transform .2s; }
.lx-chips button:hover { color: var(--ink); border-color: var(--orange-m); transform: translateY(-1px); }
.lx-chips button[aria-pressed="true"] { color: var(--orange-text); border-color: var(--halo-line); background: var(--orange-l); box-shadow: var(--halo); }
.x-grid { gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.xcard { aspect-ratio: auto; display: flex; flex-direction: column; border: 1px solid var(--box-line); border-radius: 22px; background: var(--card); box-shadow: none; transition: transform .25s, border-color .25s; }
.xcard:hover { transform: translateY(-3px); border-color: var(--orange-m); box-shadow: none; }
.x-grid.still .xcard { animation: none; }
.xmain { position: static; display: flex; flex-direction: column; height: auto; }
.x-media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #151515; }
.xcard.none .x-media { background: var(--surface-raised); }
.xmain img { height: 100%; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.xcard:hover .xmain img { transform: scale(1.06); }
.x-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 0; color: var(--muted); opacity: .35; transition: opacity .25s, transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.x-empty svg { width: 34px; height: 34px; }
.xcard:hover .x-empty { opacity: .7; transform: scale(1.1) rotate(-6deg); }
.x-cap { position: static; padding: 12px 14px 14px; background: none; gap: 7px; }
.xcard.none .x-cap { background: none; }
.x-cap b { font-size: 14px; font-weight: 650; }
.x-cap em { background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--orange-text); }
.x-heart { top: 10px; right: 10px; opacity: 0; transform: scale(.85); transition: opacity .2s, transform .25s cubic-bezier(.3, 1.6, .5, 1), color .2s; }
.xcard:hover .x-heart, .x-heart.on, .x-heart:focus-visible { opacity: 1; transform: none; }
@media (hover: none) { .x-heart { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .xcard { animation: none; } .xcard, .xmain img, .x-empty, .x-heart, .lx-fav svg { transition: none; } }

/* Formularios personalizados */
@keyframes fb-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.tpl .clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fb { display: grid; gap: 14px; }
.fb .field { margin: 0; }
.fb input:not([type=radio]):not([type=checkbox]), .fb select { width: 100%; }
.fb-top { display: grid; grid-template-columns: 1fr 200px; gap: 12px; }
.fb-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.fb-add { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-add button, .fb-types button { min-height: 30px; padding: 2px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: color .2s, border-color .2s, background .2s, transform .2s; }
.fb-add button:hover, .fb-types button:hover { color: var(--ink); border-color: var(--orange-m); transform: translateY(-1px); }
.fb-add button { color: var(--orange-text); border-color: var(--orange-m); }
.fb-types button[aria-pressed="true"] { color: var(--orange-text); border-color: var(--halo-line); background: var(--orange-l); box-shadow: var(--halo); }
.fb-list { display: grid; gap: 10px; max-height: min(40vh, 420px); overflow-y: auto; padding: 2px; }
.fb-q { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--box-line); border-radius: 16px; background: var(--bg); transition: border-color .2s; }
.fb-q:focus-within, .fb-q:hover { border-color: var(--orange-m); }
.fb-q.new { animation: fb-pop .35s both; }
.fb-n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--orange-text); font-size: 12px; font-weight: 700; }
.fb-body { display: grid; gap: 8px; min-width: 0; }
.fb-types { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-act { display: flex; gap: 4px; }
.fb-act .iconbtn:disabled { opacity: .3; cursor: default; }
.fb-empty { margin: 0; padding: 26px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line); border-radius: 16px; }
.fs-list { display: grid; gap: 6px; max-height: 320px; overflow-y: auto; margin: 12px 0; }
.fs-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--box-line); border-radius: 16px; cursor: pointer; transition: border-color .2s, background .2s; }
.fs-item span { flex: 1; }
.fs-item:hover { border-color: var(--orange-m); }
.fs-item:has(input:checked) { border-color: var(--halo-line); background: var(--orange-l); box-shadow: var(--halo); }
.fq-set { border: 0; padding: 0; min-width: 0; }
.fq-set legend { padding: 0; margin-bottom: 8px; }
.fq-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.fq-opts.scale { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 5px; }
.fq-opts label { position: relative; display: block; cursor: pointer; }
.fq-opts input { position: absolute; opacity: 0; inset: 0; }
.fq-opts span { display: grid; place-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 16px; font-weight: 600; font-size: 14px; transition: border-color .2s, background .2s, color .2s, transform .15s; }
.fq-opts.scale span { padding: 0; }
.fq-opts label:hover span { border-color: var(--orange-m); transform: translateY(-1px); }
.fq-opts input:checked + span { border-color: var(--orange); background: var(--orange); color: var(--on-accent); }
.fq-opts input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }
.fq-ends { display: flex; justify-content: space-between; margin-top: 4px; font-size: 12px; color: var(--muted); }
@media (max-width: 640px) { .fb-top { grid-template-columns: 1fr; } .fb-q { grid-template-columns: 24px minmax(0, 1fr); } .fb-act { grid-column: 2; } }
@media (prefers-reduced-motion: reduce) { .fb-q.new { animation: none; } .fb-add button, .fb-types button, .fq-opts span { transition: none; } }

/* Clientes: filas limpias con movimiento */
@keyframes cl-rise { from { opacity: 0; transform: translateY(10px); } }
.cl-head { margin: 2px 0 6px; animation: cl-rise .5s both; }
.cl-head h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 650; letter-spacing: -.025em; }
.cl-head p { margin-top: 2px; font-size: 14px; }
.coach-client-status.tabs-line { gap: 6px; border-bottom: 0; margin: 14px 0 12px; }
.coach-client-status .linkbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border: 1px solid transparent; border-radius: 999px; color: var(--muted); font-weight: 600; transition: color .2s, background .2s, border-color .2s, transform .2s; }
.coach-client-status .linkbtn:hover { color: var(--ink); text-decoration: none; transform: translateY(-1px); }
.coach-client-status .linkbtn.on { color: var(--orange-text); border-color: var(--halo-line); background: var(--orange-l); box-shadow: var(--halo); }
.coach-client-table { border-radius: 22px; }
.coach-client-table .dt { border-collapse: separate; border-spacing: 0 6px; padding: 0 8px; }
.coach-client-table .dt th { background: transparent; border-bottom: 0; padding: 12px 14px 4px; }
.coach-client-table .dt td { border-bottom: 0; padding: 12px 14px; background: transparent; transition: background .2s; }
.coach-client-table .dt tbody td:first-child { border-radius: 16px 0 0 16px; }
.coach-client-table .dt tbody td:last-child { border-radius: 0 16px 16px 0; }
.coach-client-table .dt tbody tr { }
.coach-client-table .dt tbody tr:nth-child(1) { --r: 0; } .coach-client-table .dt tbody tr:nth-child(2) { --r: 1; } .coach-client-table .dt tbody tr:nth-child(3) { --r: 2; }
.coach-client-table .dt tbody tr:nth-child(4) { --r: 3; } .coach-client-table .dt tbody tr:nth-child(5) { --r: 4; } .coach-client-table .dt tbody tr:nth-child(n+6) { --r: 5; }
.coach-client-table.dt-still .dt tbody tr { animation: none; }
.coach-client-table .dt tbody tr:hover td { background: var(--surface-raised); }
.coach-client-table .cname-row .avatar { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.cl-rings { display: inline-flex; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .cl-head, .coach-client-table .dt tbody tr { animation: none; } .coach-client-status .linkbtn, .coach-client-table .dt td, .coach-client-table .cname-row .avatar { transition: none; } }

/* Menú lateral de la ficha del cliente */
@keyframes cs-in { from { opacity: 0; transform: translateX(-10px); } }
@media (min-width: 801px) {
  .cside { padding: 12px 10px; }
  .side-h { padding: 2px 4px 12px 8px; }
  .side-who { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
  .side-who b { font-size: 14px; font-weight: 650; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cside a { position: relative; align-items: center; margin: 2px 0; padding: 10px 12px; border-right: 0; border-radius: 16px; transition: background .2s, transform .2s; }
  .cside a::before { content: ""; position: absolute; left: -10px; top: 50%; width: 3px; height: 0; border-radius: 0 3px 3px 0; background: var(--orange); transform: translateY(-50%); transition: height .25s; }
  .cside a.on::before { height: 60%; }
  .cside a:hover { background: var(--card); }
  .cside a.on { background: var(--card); border-color: transparent; }
  .cside a svg { margin-top: 0; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), color .2s; }
  .cside a:hover svg { transform: scale(1.18) rotate(-6deg); color: var(--orange); }
  .cside a div { transition: transform .2s; }
  .cside a:hover div { transform: translateX(2px); }
  .cside a b { font-size: 14px; font-weight: 600; }
  .cside a div > span { max-height: 0; margin-top: 0; opacity: 0; overflow: hidden; transition: max-height .3s ease, opacity .25s, margin .25s; }
  .cside a.on div > span, .cside a:hover div > span, .cside a:focus-visible div > span { max-height: 64px; margin-top: 3px; opacity: 1; }
  .cpage.collapsed .cside a::before { left: -10px; }
  .cpage.collapsed .cside a { padding: 12px 0; }
}
@media (prefers-reduced-motion: reduce) { .cside a { animation: none; } .cside a, .cside a svg, .cside a div, .cside a div > span, .cside a::before { transition: none; } }

/* Editor de entrenamiento: más ligero (escritorio) */
@media (min-width: 900px) {
  .te-item { border-color: transparent; background: transparent; border-radius: 16px; }
  .te-item:hover, .te-item:focus-within { background: var(--card); border-color: var(--te-line); box-shadow: none; }
  .te-item.is-block { background: transparent; border-color: transparent; border-inline-start: 0; border-radius: 10px; margin-top: 10px; }
  .te-item.is-block:hover, .te-item.is-block:focus-within { background: var(--card); border-color: var(--te-line); border-inline-start-color: var(--orange); }
  .te-item.is-block .te-row-main input { background: transparent; border-color: transparent; font-size: 16px; }
  .te-item.is-block:hover .te-row-main input, .te-item.is-block .te-row-main input:focus { background: var(--bg); border-color: var(--te-line); }
  .te-item.is-block .te-notes textarea { background: transparent; }
  .te-item .te-field > span { color: var(--te-muted); opacity: .75; font-weight: 600; }
  .te-item .te-notes textarea { min-height: 30px; padding: 4px 9px; border-color: transparent; background: transparent; font-size: 13px; color: var(--te-muted); resize: none; transition: border-color .2s, background .2s, color .2s; }
  .te-item .te-notes textarea:hover { border-color: var(--te-line); }
  .te-item .te-notes textarea:focus { border-color: var(--halo-line); background: var(--bg); color: var(--ink); box-shadow: var(--halo); }
  .te-item .te-notes > span { display: none; }
  .te-row-actions > :not(.te-grip), .te-media-eye { opacity: 0; transition: opacity .2s, background .2s, color .2s; }
  .te-item:hover .te-row-actions > :not(.te-grip), .te-item:focus-within .te-row-actions > :not(.te-grip), .te-item:hover .te-media-eye, .te-item:focus-within .te-media-eye { opacity: 1; }
  .te-grip { opacity: .35; transition: opacity .2s, color .2s; cursor: grab; }
  .te-item:hover .te-grip { opacity: 1; color: var(--orange-text); }
  .te-plan-head .btn.ghost, .te-plan-head .te-menu summary { border-color: transparent; background: transparent; color: var(--te-muted); transition: background .2s, color .2s, transform .2s; }
  .te-plan-head .btn.ghost:hover, .te-plan-head .te-menu summary:hover, .te-plan-head .te-menu[open] summary { background: var(--card); color: var(--ink); transform: translateY(-1px); }
  .te-library { border-color: transparent; background: transparent; padding: 0 0 0 4px; }
  .te-muscles { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .te-muscles button { flex: none; white-space: nowrap; transition: color .2s, border-color .2s, background .2s, transform .2s; }
  .te-muscles button:hover { color: var(--ink); border-color: var(--orange-m); transform: translateY(-1px); }
  .te-library-item { border-bottom: 0; border-radius: 16px; padding: 6px; transition: background .2s, transform .2s; }
  .te-library-item:hover { background: var(--card); transform: translateX(2px); }
  .te-library-item > button:last-child { opacity: .45; transition: opacity .2s, transform .25s cubic-bezier(.3, 1.6, .5, 1); }
  .te-library-item:hover > button:last-child { opacity: 1; transform: scale(1.1) rotate(90deg); }
}
@media (hover: none) { .te-row-actions > :not(.te-grip), .te-media-eye { opacity: 1 !important; } }
@media (prefers-reduced-motion: reduce) { .te-row-actions > *, .te-grip, .te-library-item, .te-muscles button, .te-item .te-notes textarea { transition: none !important; } }

/* Bloques destacados con sutileza */
@media (min-width: 900px) {
  .te-item.is-block, .te-item.is-block:hover, .te-item.is-block:focus-within { background: color-mix(in srgb, var(--muted) 7%, transparent); border-color: transparent; border-inline-start: 0; border-radius: 10px 16px 16px 10px; margin-top: 14px; }
  .te-item.is-block:hover, .te-item.is-block:focus-within { background: color-mix(in srgb, var(--muted) 11%, transparent); }
  .te-item.is-block .te-row-main .te-field > span { color: var(--orange-text); opacity: 1; font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: none; }
  .te-item.is-block .te-row-main input { font-size: 17px; font-weight: 750; letter-spacing: -.02em; }
  .te-item.is-block .te-notes textarea { color: var(--te-muted); }
  .te-item.is-block + .te-item.in-block { margin-top: 6px; }
}

/* Plan nutricional: ligero y con movimiento sutil */
@keyframes diet-bar { from { transform: scaleX(0); } }
.mbar { display: block; position: relative; height: 4px; margin: 8px auto 0; width: 70%; border-radius: 10px; overflow: hidden; background: color-mix(in srgb, var(--muted) 22%, transparent); }
.mbar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); max-width: 100%; border-radius: 10px; background: var(--c, var(--orange)); transform-origin: left; animation: diet-bar .9s .15s cubic-bezier(.2, .7, .2, 1) both; }
@media (min-width: 921px) {
  .diet-editor :is(.diet-plan, .diet-summary, .diet-meal) { border-color: transparent; background: color-mix(in srgb, var(--card) 70%, transparent); transition: border-color .25s; }
  .diet-editor :is(.diet-plan, .diet-meal):hover, .diet-editor :is(.diet-plan, .diet-meal):focus-within { border-color: var(--diet-line); }
  .diet-plan .plan-title { border-color: transparent; background: transparent; font-size: clamp(20px, 2.4vw, 26px); letter-spacing: -.025em; transition: border-color .2s, background .2s; }
  .diet-plan .plan-title:hover { border-color: var(--diet-line); }
  .diet-plan .plan-title:focus { border-color: var(--halo-line); background: var(--bg); box-shadow: var(--halo); }
  .diet-field > .f { color: var(--muted); font-size: 12px; font-weight: 600; }
  .diet-field textarea, .diet-meal-heading input { transition: border-color .2s, background .2s; }
  .diet-plan .diet-field textarea { border-color: transparent; background: transparent; color: var(--muted); }
  .diet-plan .diet-field textarea:hover { border-color: var(--diet-line); }
  .diet-plan .diet-field textarea:focus { border-color: var(--halo-line); background: var(--bg); color: var(--ink); box-shadow: var(--halo); }
  .diet-meal-heading input { border-color: transparent; background: transparent; font-size: 17px; }
  .diet-meal-heading input:hover { border-color: var(--diet-line); }
  .diet-meal-heading input:focus { border-color: var(--halo-line); background: var(--bg); box-shadow: var(--halo); }
  .diet-summary { padding: 6px 4px; background: transparent; }
  .diet-summary .macros > div { background: color-mix(in srgb, var(--surface-raised) 60%, transparent); transition: transform .2s, background .2s; }
  .diet-summary .macros > div:hover { transform: translateY(-2px); background: var(--surface-raised); }
  .diet-summary .macros > div:first-child { background: color-mix(in srgb, var(--muted) 12%, transparent); }
  .diet-option { background: transparent; border-color: var(--diet-line); }
  .diet-food { background: transparent; }
  .diet-food tbody tr { transition: background .2s; }
  .diet-food tbody tr:hover { background: color-mix(in srgb, var(--muted) 5%, transparent); }
  .diet-food .diet-food-remove .iconbtn { opacity: 0; transition: opacity .2s, background .2s, color .2s; }
  .diet-food tbody tr:hover .diet-food-remove .iconbtn, .diet-food .diet-food-remove .iconbtn:focus-visible { opacity: 1; }
  .diet-options .opt { transition: color .2s, border-color .2s, background .2s, transform .2s; }
  .diet-options .opt:hover { transform: translateY(-1px); }
  .diet-add-food .btn { border-color: transparent; color: var(--muted); transition: background .2s, color .2s, transform .2s; }
  .diet-add-food .btn:hover { background: var(--surface-raised); color: var(--ink); transform: translateY(-1px); }
}
@media (hover: none) { .diet-food .diet-food-remove .iconbtn { opacity: 1 !important; } }
@media (prefers-reduced-motion: reduce) { .mbar::after { animation: none; } .diet-editor * { transition: none !important; } }

/* Comidas y opciones: tabla limpia */
.diet-meal-heading { flex-wrap: wrap; }
@media (min-width: 921px) {
  .diet-options { gap: 4px; padding: 3px; width: max-content; max-width: 100%; border-radius: 999px; background: color-mix(in srgb, var(--muted) 10%, transparent); }
  .diet-options .opt { border-color: transparent; border-radius: 999px; background: transparent; min-height: 32px; padding: 3px 14px; }
  .diet-options .opt.on { background: var(--card); border-color: var(--orange); color: var(--orange-text); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
  .diet-options .opt.add { border: 1px dashed var(--diet-line); }
  .diet-food th { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
  .diet-food thead th:first-child, .diet-food tbody .diet-food-name { text-align: start; }
  .diet-food tbody td { color: var(--ink); }
  .diet-food-amount input { border-color: transparent; background: color-mix(in srgb, var(--muted) 10%, transparent); text-align: center; transition: border-color .2s, background .2s, box-shadow .2s; }
  .diet-food-amount input:hover { border-color: var(--diet-line); }
  .diet-food-amount input:focus { border-color: var(--halo-line); background: var(--bg); box-shadow: var(--halo); }
  .diet-food tfoot { background: color-mix(in srgb, var(--muted) 10%, transparent); }
  .diet-food tfoot .diet-nutrient { color: var(--orange-text); }
  .diet-food tfoot .diet-food-name { color: var(--muted); font-weight: 600; }
  .diet-option-heading .btn.ghost { border-color: transparent; color: var(--muted); }
  .diet-option-heading .btn.ghost:hover { background: var(--surface-raised); color: var(--ink); }
  .diet-recipe textarea { border-color: transparent; background: color-mix(in srgb, var(--muted) 8%, transparent); transition: border-color .2s, background .2s; }
  .diet-recipe textarea:hover { border-color: var(--diet-line); }
  .diet-recipe textarea:focus { border-color: var(--halo-line); background: var(--bg); box-shadow: var(--halo); }
}

/* Total calorías: tarjeta destacada */
@keyframes mk-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes mk-flame { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18) rotate(-6deg); } }
.macros .mk { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: linear-gradient(135deg, color-mix(in srgb, var(--muted) 16%, transparent), color-mix(in srgb, var(--muted) 6%, transparent)); border: 1px solid var(--orange-m); }
.macros .mk-l { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: none; color: var(--orange-text); }
.macros .mk-l svg { width: 14px; height: 14px; }
.macros .mk b { font-size: 24px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; color: var(--ink); animation: mk-rise .5s .1s both; }
.macros .mk b small { font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .macros .mk-l svg, .macros .mk b { animation: none; } }

/* Botón "Añadir comida" */
.diet-editor .diet-meals-heading .btn { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 16px; border: 1px solid var(--diet-line); border-radius: 999px; background: transparent; color: var(--ink); font-weight: 600; transition: color .2s, border-color .2s, background .2s, transform .2s, box-shadow .25s; }
.diet-editor .diet-meals-heading .btn svg { width: 15px; height: 15px; color: var(--orange); transition: transform .3s cubic-bezier(.3, 1.6, .5, 1), color .2s; }
@media (hover: hover) { .diet-editor .diet-meals-heading .btn:hover { color: var(--on-accent); border-color: var(--halo-line); background: var(--orange); transform: translateY(-2px); box-shadow: var(--halo); } }
.diet-editor .diet-meals-heading .btn:hover svg { color: var(--on-accent); transform: rotate(90deg) scale(1.15); }
.diet-editor .diet-meals-heading .btn:active { transform: scale(.96); }
@media (prefers-reduced-motion: reduce) { .diet-editor .diet-meals-heading .btn, .diet-editor .diet-meals-heading .btn svg { transition: none; } }

/* Fila "Total de la opción": minimalista */
@keyframes tot-rise { from { opacity: 0; transform: translateY(6px); } }
@media (min-width: 921px) {
  .diet-food tfoot, .diet-food tfoot tr { background: transparent; }
  .diet-food tfoot :is(th, td) { border-top: 1.5px solid var(--orange-m); padding-block: 12px; background: transparent; }
  .diet-food tfoot .diet-food-name { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: none; }
  .diet-food tfoot .diet-nutrient { color: var(--ink); font-size: 14px; font-weight: 700; animation: tot-rise .45s both; }
  .diet-food tfoot .diet-nutrient.kcal { color: var(--orange-text); font-size: 17px; animation-delay: .05s; }
  .diet-food tfoot .diet-nutrient.p { animation-delay: .1s; } .diet-food tfoot .diet-nutrient.c { animation-delay: .15s; }
  .diet-food tfoot .diet-nutrient.f { animation-delay: .2s; } .diet-food tfoot .diet-nutrient.fi { animation-delay: .25s; }
}
@media (prefers-reduced-motion: reduce) { .diet-food tfoot .diet-nutrient { animation: none !important; } }

/* Entrenamiento: días y cabecera, minimalista */
@keyframes te-ind { from { transform: scaleX(0); } }
.te-day { border-color: transparent; background: transparent; box-shadow: none; transition: background .2s, color .2s, transform .2s; }
.te-day:hover { background: var(--card); box-shadow: none; transform: translateY(-2px); }
.te-day.on { position: relative; border-color: transparent; background: var(--card); box-shadow: none; }
.te-day.on::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 5px; height: 3px; border-radius: 3px; background: var(--orange); transform-origin: center; animation: te-ind .35s cubic-bezier(.2, .8, .2, 1) both; }
.te-day.on strong { color: var(--orange-text); }
.te-day-add { border: 1px dashed var(--te-line); background: transparent; color: var(--muted); transition: color .2s, border-color .2s, background .2s, transform .2s; }
@media (hover: hover) { .te-day-add:hover { color: var(--orange-text); border-color: var(--halo-line); background: color-mix(in srgb, var(--muted) 6%, transparent); box-shadow: var(--halo); } }
.te-session.te-card { border-color: transparent; background: color-mix(in srgb, var(--card) 70%, transparent); transition: border-color .25s; }
.te-session.te-card:hover, .te-session.te-card:focus-within { border-color: var(--te-line); }
.te .te-session-name { border-color: transparent; background: transparent; transition: border-color .2s, background .2s; }
.te .te-session-name:hover { border-color: var(--te-line); }
.te .te-session-name:focus { border-color: var(--halo-line); background: var(--bg); box-shadow: var(--halo); }
.te-week button { width: 34px; min-height: 34px; border-radius: 50%; border-color: transparent; background: color-mix(in srgb, var(--muted) 12%, transparent); transition: background .2s, color .2s, transform .2s, border-color .2s; }
.te-week button:hover { transform: translateY(-2px); color: var(--ink); }
.te-week button[aria-pressed="true"] { background: var(--orange); color: var(--on-accent); border-color: var(--halo-line); box-shadow: var(--halo); }
.te-plan-head h2 { font-size: 20px; }
.te-plan-head .te-primary { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; transition: transform .2s, box-shadow .25s; }
.te-plan-head .te-primary svg { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.te-plan-head .te-primary:hover { transform: translateY(-2px); box-shadow: none; }
.te-plan-head .te-primary:hover svg { transform: rotate(90deg) scale(1.15); }
.te-plan-head .btn.ghost svg, .te-plan-head .te-menu summary svg { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.te-plan-head .btn.ghost:hover svg, .te-plan-head .te-menu summary:hover svg { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .te-day, .te-day-add, .te-week button, .te-plan-head * { transition: none !important; } .te-day.on::after { animation: none; } }

/* Biblioteca de ejercicios del editor: minimalista */
@keyframes lib-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--muted) 22%, transparent); } }
.te-library.te-card { border-color: transparent; background: transparent; }
.te-library header button { padding: 0 12px; border-radius: 999px; transition: background .2s, transform .2s; }
.te-library header button:hover { background: color-mix(in srgb, var(--muted) 12%, transparent); transform: translateY(-1px); }
.te-library header button svg { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.te-library header button:hover svg { transform: rotate(90deg) scale(1.15); }
.te .te-library input[type=search] { min-height: 40px; padding-left: 38px; border-color: transparent; border-radius: 999px; background: color-mix(in srgb, var(--muted) 12%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center; transition: background-color .2s, border-color .2s, box-shadow .2s; }
.te .te-library input[type=search]:focus { background-color: var(--bg); border-color: var(--halo-line); box-shadow: var(--halo); }
.te-library .te-muscles { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); padding-right: 24px; }
.te-library-list { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 40%, transparent) transparent; gap: 2px; }
.te-library-item { cursor: grab; }
.te-library-item:active { cursor: grabbing; }
.te-library-item .ex-thumb { border-color: transparent; border-radius: 16px; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.te-library-item:hover .ex-thumb { transform: scale(1.08) rotate(-3deg); }
.te-library-item > button:first-child { border: 0; background: transparent; padding: 0; }
.te-library-item > button:last-child { width: 30px; height: 30px; min-height: 0; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); transition: opacity .2s, transform .25s cubic-bezier(.3, 1.6, .5, 1), background .2s, color .2s; }
.te-library-item:hover > button:last-child { background: var(--orange); color: var(--on-accent); }
.te-library-item > button:last-child:active { transform: scale(.85); animation: lib-pulse .4s; }
.te-library-item.dragging { opacity: .45; }
@media (prefers-reduced-motion: reduce) { .te-library * { transition: none !important; animation: none !important; } }

/* Archivos del cliente: minimalista */
@keyframes fl-rise { from { opacity: 0; transform: translateY(10px); } }
.card.sd { border-color: transparent; background: color-mix(in srgb, var(--card) 70%, transparent); animation: fl-rise .5s both; }
.sd-head { margin-bottom: 4px; }
.sd-head h2 { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; }
.sd-actions { display: inline-flex; gap: 6px; }
.sd-actions .btn.ghost { border-color: transparent; color: var(--muted); transition: background .2s, color .2s, transform .2s; }
.sd-actions .btn.ghost:hover { background: var(--surface-raised); color: var(--ink); transform: translateY(-1px); }
.sd-actions .btn svg { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.sd-actions .btn:hover svg { transform: rotate(90deg) scale(1.15); }
.sd-empty { display: flex; align-items: center; gap: 10px; margin: 8px 0 2px; padding: 14px 16px; border: 1.5px dashed var(--line); border-radius: 16px; color: var(--muted); }
.sd-empty svg { width: 18px; height: 18px; color: var(--orange); opacity: .8; }
.sd-row { padding: 10px 8px; border-radius: 16px; transition: background .2s; }
.sd-row:hover { background: var(--surface-raised); }
.files-tbl { margin-top: 16px; }
.files-tbl .dt-wrap { border-color: transparent; background: transparent; }
.files-tbl .dt { border-collapse: separate; border-spacing: 0 4px; }
.files-tbl .dt th { background: transparent; border-bottom: 0; padding: 8px 14px; font-size: 12px; letter-spacing: .02em; }
.files-tbl .dt td { border-bottom: 0; padding: 12px 14px; transition: background .2s; }
.files-tbl .dt tbody td:first-child { border-radius: 16px 0 0 16px; } .files-tbl .dt tbody td:last-child { border-radius: 0 16px 16px 0; }
.files-tbl .dt tbody tr { animation: fl-rise .45s calc(var(--r, 0) * 50ms + 150ms) both; }
.files-tbl .dt tbody tr:nth-child(1) { --r: 0; } .files-tbl .dt tbody tr:nth-child(2) { --r: 1; } .files-tbl .dt tbody tr:nth-child(3) { --r: 2; } .files-tbl .dt tbody tr:nth-child(4) { --r: 3; } .files-tbl .dt tbody tr:nth-child(n+5) { --r: 4; }
.files-tbl .dt tbody tr:hover td { background: var(--surface-raised); }
.files-tbl .linkbtn { color: var(--ink); font-weight: 600; transition: color .2s; }
.files-tbl .dt tbody tr:hover .linkbtn { color: var(--orange-text); text-decoration: none; }
.files-tbl .dt td .clamp2 { color: var(--muted); font-size: 13px; }
.files-tbl .row-actions { opacity: 0; transform: translateX(6px); transition: opacity .2s, transform .2s; }
.files-tbl tr:hover .row-actions, .files-tbl .row-actions:focus-within { opacity: 1; transform: none; }
@media (hover: none) { .files-tbl .row-actions { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .card.sd, .files-tbl .dt tbody tr { animation: none; } .sd-row, .files-tbl * { transition: none !important; } }

/* Calculadora de equivalencias: minimalista */
/* Calculadora de equivalencias: una cantidad grande, un alimento y una lista de nombres con sus gramos. */
.eq-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal-card:has(.eq-amount, .mg-list) .eq-head h2 { margin: 0; font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.eq-close, .eq-amount button { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; transition: transform .15s cubic-bezier(.23, 1, .32, 1); }
.eq-close { margin-inline-end: -6px; background: transparent; color: #232323; }
.eq-close > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--orange); }
.eq-close:active, .eq-amount button:active { transform: scale(.93); }
.eq-amount { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 12px; }
.eq-amount label { display: flex; align-items: baseline; justify-content: center; gap: 4px; min-width: 0; color: var(--muted); font-size: 18px; }
.eq-amount label::before { content: 'g'; visibility: hidden; }
.eq-value { position: relative; display: inline-block; min-width: 0; color: var(--ink); font-size: clamp(32px, 12vw, 52px); font-weight: 750; letter-spacing: -.045em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.eq-value::before { content: attr(data-value); visibility: hidden; white-space: pre; padding-inline: 4px; }
.eq-amount .eq-value input { position: absolute; inset: 0; width: 100%; min-width: 0; height: 100%; padding: 0; border: 0; border-radius: 12px; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; font-variant-numeric: inherit; text-align: center; appearance: textfield; }
.eq-amount input::-webkit-inner-spin-button, .eq-amount input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.eq-amount input:focus { outline: 0; box-shadow: var(--halo); }
.eq-from select, .eq-from .bounded-field-trigger { width: 100%; min-height: 46px; justify-content: center; border-color: transparent; border-radius: 18px; background-color: color-mix(in srgb, var(--muted) 12%, transparent); text-align: center; font-weight: 600; }
.eq-from .bounded-field-trigger { position: relative; padding-inline: 34px; }
.eq-from .bounded-field-trigger svg { position: absolute; inset-inline-end: 12px; }
.eq-sum { margin: 18px 0 4px; color: var(--muted); font-size: 13px; }
.eq-sum b { color: var(--orange-text); font-weight: 750; }
.eq-list { flex: 1 1 auto; min-height: 0; margin: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; list-style: none; }
.eq-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 8%, transparent); }
.eq-list li:last-child { border-bottom: 0; }
.eq-list span { min-width: 0; font-size: 15px; line-height: 1.25; }
.eq-list b { flex: none; font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; }
.eq-list.enter li { animation: eq-in .35s cubic-bezier(.23, 1, .32, 1) both; animation-delay: calc(var(--i) * 30ms); }
@keyframes eq-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .eq-list.enter li { animation: none; } .eq-close, .eq-amount button { transition: none; } }

/* Movimiento diario: minimalista */
@keyframes mv-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes mv-grow { from { transform: scaleY(0); } }
@keyframes mv-fill { from { transform: scaleX(0); } }
.card.mv, .card.mv-log { border-color: transparent; background: color-mix(in srgb, var(--card) 70%, transparent); }
.mv h2, .mv-log h2 { font-size: 17px; letter-spacing: -.02em; }
.mv input[data-bind="movement.stepsGoal"] { border-color: transparent; background: color-mix(in srgb, var(--muted) 12%, transparent); border-radius: 16px; text-align: center; transition: background .2s, border-color .2s, box-shadow .2s; }
.mv input[data-bind="movement.stepsGoal"]:focus { background: var(--bg); border-color: var(--halo-line); box-shadow: var(--halo); outline: 0; }
.mv .chart-stats { gap: 12px; }
.mv .chart-stats > div { border-color: transparent; background: color-mix(in srgb, var(--surface-raised) 60%, transparent); border-radius: 16px; animation: mv-rise .5s both; transition: transform .2s, background .2s; }
.mv .chart-stats > div:nth-child(2) { animation-delay: .07s; } .mv .chart-stats > div:nth-child(3) { animation-delay: .14s; } .mv .chart-stats > div:nth-child(4) { animation-delay: .21s; }
.mv .chart-stats > div:hover { transform: translateY(-2px); background: var(--surface-raised); }
.mv .chart-stats span { font-size: 12px; letter-spacing: .08em; }
.mv .chart-stats b { font-size: 24px; font-weight: 650; letter-spacing: -.03em; }
.mv .chart-stats i { transform-origin: left; animation: mv-fill .9s .3s cubic-bezier(.2, .7, .2, 1) both; }
.mv .chart .bar path { transform-box: fill-box; transform-origin: bottom; animation: mv-grow .7s cubic-bezier(.2, .7, .2, 1) both; transition: opacity .15s, filter .15s; }
.mv .chart .bar:hover path { opacity: 1; filter: brightness(1.12); }
.mv-log .btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; transition: transform .2s, box-shadow .25s; }
.mv-log .btn svg { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.mv-log .btn:hover { transform: translateY(-2px); box-shadow: none; }
.mv-log .btn:hover svg { transform: rotate(90deg) scale(1.15); }
.mv-log .tbl-wrap { border: 0; }
.mv-log .t { border-collapse: separate; border-spacing: 0 3px; }
.mv-log .t th { background: transparent; border-bottom: 0; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.mv-log .t td { border-bottom: 0; padding: 4px 6px; transition: background .2s; }
.mv-log .t tbody td:first-child { border-radius: 16px 0 0 16px; } .mv-log .t tbody td:last-child { border-radius: 0 16px 16px 0; }
.mv-log .t tbody tr:hover td { background: var(--surface-raised); }
.mv-log .t input { border-color: transparent; background: transparent; border-radius: 16px; transition: border-color .2s, background .2s, box-shadow .2s; }
.mv-log .t tbody tr:hover input { border-color: var(--line); }
.mv-log .t input:focus { background: var(--bg); border-color: var(--halo-line); box-shadow: var(--halo); outline: 0; }
.mv-log .t td:last-child .iconbtn { opacity: 0; transition: opacity .2s, background .2s, color .2s; }
.mv-log .t tbody tr:hover td:last-child .iconbtn, .mv-log .t td:last-child .iconbtn:focus-visible { opacity: 1; }
@media (hover: none) { .mv-log .t td:last-child .iconbtn { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mv .chart-stats > div, .mv .chart-stats i, .mv .chart .bar path { animation: none; } .mv *, .mv-log * { transition: none !important; } }
.mv-log .t td:first-child input[type=date] { min-width: 150px; }

/* Evolución > Actividad: minimalista (panel del entrenador) */
@keyframes ev-rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes ev-grow { from { transform: scaleY(0); } }
.cmain .evo-top { border-bottom: 0; margin-bottom: 8px; }
.cmain .evo-top .subtabs { gap: 4px; padding: 3px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 10%, transparent); }
.cmain .evo-top .subtabs :is(a, button) { padding: 7px 14px; border-bottom: 0; border-radius: 999px; color: var(--muted); font-size: 13px; transition: color .2s, background .2s, transform .2s, box-shadow .2s; }
.cmain .evo-top .subtabs :is(a, button):hover { color: var(--ink); transform: translateY(-1px); }
.cmain .evo-top .subtabs :is(a, button).on { background: var(--card); color: var(--orange-text); font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .14); }
.cmain .evo-top > .btn.ghost { border-color: transparent; color: var(--muted); transition: background .2s, color .2s, transform .2s; }
.cmain .evo-top > .btn.ghost:hover { background: var(--surface-raised); color: var(--ink); transform: translateY(-1px); }
.cmain .evo-top > .btn:not(.ghost) { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; transition: transform .2s, box-shadow .25s; }
.cmain .evo-top > .btn:not(.ghost) svg { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.cmain .evo-top > .btn:not(.ghost):hover { transform: translateY(-2px); box-shadow: none; }
.cmain .evo-top > .btn:not(.ghost):hover svg { transform: rotate(90deg) scale(1.15); }
.cmain .act-head h2 { font-size: 20px; letter-spacing: -.025em; font-weight: 650; }
.cmain .act-head .pills.light { padding: 3px; gap: 2px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 10%, transparent); }
.cmain .act-head .pills.light button { border-color: transparent; background: transparent; transition: color .2s, background .2s, box-shadow .2s; }
.cmain .act-head .pills.light button:hover { color: var(--ink); }
.cmain .act-head .pills.light button.on { background: var(--card); color: var(--orange-text); box-shadow: 0 1px 4px rgba(0, 0, 0, .14); }
.cmain .act-card { border-color: transparent; background: color-mix(in srgb, var(--surface-raised) 55%, transparent); border-radius: 22px; animation: ev-rise .55s both; transition: transform .25s, background .25s; }
.cmain .act-card:nth-child(2) { animation-delay: .06s; } .cmain .act-card:nth-child(3) { animation-delay: .12s; } .cmain .act-card:nth-child(4) { animation-delay: .18s; } .cmain .act-card:nth-child(5) { animation-delay: .24s; }
.cmain .act-card:hover { transform: translateY(-3px); background: var(--surface-raised); }
.cmain .act-h { font-size: 13px; color: var(--muted); font-weight: 600; }
.cmain .act-h .iconbtn { opacity: 0; transition: opacity .2s, background .2s; }
.cmain .act-card:hover .act-h .iconbtn, .cmain .act-h .iconbtn:focus-visible { opacity: 1; }
.cmain .act-nums b { font-size: 28px; font-weight: 650; letter-spacing: -.03em; }
.cmain .act-nums > div:last-child b { color: var(--muted); font-size: 24px; }
.cmain .trend.up { color: var(--green); } .cmain .trend.dn { color: var(--red); }
.cmain .act-card .chart .bar path { transform-box: fill-box; transform-origin: bottom; animation: ev-grow .7s .15s cubic-bezier(.2, .7, .2, 1) both; }
.act-none { display: grid; place-items: center; align-content: center; gap: 8px; min-height: 120px; margin: 6px 0 10px; border: 1.5px dashed var(--line); border-radius: 16px; color: var(--muted); font-size: 13px; }
.act-none svg { width: 22px; height: 22px; color: var(--orange); opacity: .7; }
@media (hover: none) { .cmain .act-h .iconbtn { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cmain .act-card, .cmain .act-card .chart .bar path { animation: none; } .cmain .evo-top *, .cmain .act-card, .cmain .act-head * { transition: none !important; } }

/* Evolución > Panel de progreso: minimalista */
@keyframes pp-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes pp-reveal { from { clip-path: inset(-40px 100% -40px -40px); } to { clip-path: inset(-40px -200px -40px -40px); } }
@keyframes pp-fill { from { transform: scaleX(0); } }
@keyframes pp-draw { from { stroke-dashoffset: 400; } }
.cmain .evo-hero { border-color: transparent; background: color-mix(in srgb, var(--card) 70%, transparent); border-radius: 22px; box-shadow: none; animation: pp-rise .5s both; }
.cmain .evo-hero-l { border-right-color: color-mix(in srgb, var(--line) 60%, transparent); }
.cmain .evo-hero .eyebrow { font-size: 12px; letter-spacing: .12em; }
.cmain .evo-hero .big { font-size: 52px; letter-spacing: -.045em; animation: pp-rise .6s .1s both; }
.cmain .evo-hero .big small { font-size: 17px; letter-spacing: 0; color: var(--muted); }
.cmain .evo-change p { margin: 0; color: var(--muted); }
.cmain .evo-change p.good b { color: var(--green); }
.cmain .evo-hero .goal { padding: 14px 16px; border-radius: 16px; background: color-mix(in srgb, var(--surface-raised) 60%, transparent); border: 0; }
.cmain .goal-bar { height: 6px; border-radius: 10px; background: color-mix(in srgb, var(--muted) 22%, transparent); }
.cmain .goal-bar i { transform-origin: left; animation: pp-fill 1s .3s cubic-bezier(.2, .7, .2, 1) both; }
.cmain .hero-stats > div { transition: transform .2s; }
.cmain .hero-stats > div:hover { transform: translateY(-2px); }
.cmain .evo-hero .pills { padding: 3px; gap: 2px; background: color-mix(in srgb, var(--muted) 10%, transparent); }
.cmain .evo-hero .pills button { transition: color .2s, background .2s, box-shadow .2s; }
.cmain .evo-hero .pills button.on { background: var(--card); color: var(--orange-text); box-shadow: 0 1px 4px rgba(0, 0, 0, .14); }
.cmain .evo-hero .chart { animation: pp-reveal 1.1s .15s cubic-bezier(.3, .6, .2, 1) backwards; }
.cmain .evo-hero .chart circle.dot { transition: r .15s; }
.cmain .mgrid .mcard { border-color: transparent; background: color-mix(in srgb, var(--card) 70%, transparent); border-radius: 22px; position: relative; overflow: hidden; animation: pp-rise .5s both; transition: transform .25s, background .25s; }
.cmain .mgrid .mcard:nth-child(2) { animation-delay: .05s; } .cmain .mgrid .mcard:nth-child(3) { animation-delay: .1s; } .cmain .mgrid .mcard:nth-child(4) { animation-delay: .15s; } .cmain .mgrid .mcard:nth-child(5) { animation-delay: .2s; }
.cmain .mgrid .mcard:nth-child(6) { animation-delay: .25s; } .cmain .mgrid .mcard:nth-child(7) { animation-delay: .3s; } .cmain .mgrid .mcard:nth-child(8) { animation-delay: .35s; } .cmain .mgrid .mcard:nth-child(9) { animation-delay: .4s; }
.cmain .mgrid .mcard:hover { transform: translateY(-3px); background: var(--surface-raised); border-color: transparent; }
.cmain .mgrid .mcard.on { border-color: transparent; background: var(--surface-raised); }
.cmain .mgrid .mcard::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--orange); transform: scaleX(0); transform-origin: left; transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
.cmain .mgrid .mcard.on::after { transform: scaleX(1); }
.cmain .mcard .spark polyline { stroke-dasharray: 400; animation: pp-draw 1.1s .3s ease-out both; }
@media (prefers-reduced-motion: reduce) { .cmain .evo-hero, .cmain .evo-hero .big, .cmain .goal-bar i, .cmain .evo-hero .chart, .cmain .mgrid .mcard, .cmain .mcard .spark polyline { animation: none; } .cmain .evo-hero *, .cmain .mgrid .mcard { transition: none !important; } }

/* Evolución corporal: tabla minimalista */
@keyframes rg-rise { from { opacity: 0; transform: translateY(10px); } }
.cmain .card:has(.reg-wrap) { border-color: transparent; background: color-mix(in srgb, var(--card) 70%, transparent); border-radius: 22px; padding: 10px 6px; animation: rg-rise .5s both; }
.cmain .reg-wrap { border: 0; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 40%, transparent) transparent; }
.cmain .reg { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.cmain .reg th, .cmain .reg td { border: 0; padding: 12px 18px; text-align: center; white-space: nowrap; transition: background .2s, color .2s; }
.cmain .reg thead th { position: relative; font-size: 12px; font-weight: 600; letter-spacing: .03em; color: var(--muted); background: transparent; }
.cmain .reg thead th:first-child, .cmain .reg tbody td:first-child { position: sticky; left: 0; z-index: 1; text-align: left; background: color-mix(in srgb, var(--card) 92%, var(--bg)); padding-left: 20px; }
.cmain .reg tbody td:first-child { color: var(--muted); font-weight: 600; }
.cmain .reg tbody tr { animation: rg-rise .45s calc(var(--r, 0) * 45ms + 120ms) both; }
.cmain .reg tbody tr:nth-child(1) { --r: 0; } .cmain .reg tbody tr:nth-child(2) { --r: 1; } .cmain .reg tbody tr:nth-child(3) { --r: 2; } .cmain .reg tbody tr:nth-child(4) { --r: 3; } .cmain .reg tbody tr:nth-child(5) { --r: 4; }
.cmain .reg tbody tr:nth-child(6) { --r: 5; } .cmain .reg tbody tr:nth-child(7) { --r: 6; } .cmain .reg tbody tr:nth-child(8) { --r: 7; } .cmain .reg tbody tr:nth-child(n+9) { --r: 8; }
.cmain .reg tbody tr:hover td { background: var(--surface-raised); }
.cmain .reg tbody tr:hover td:first-child { background: var(--surface-raised); color: var(--ink); }
.cmain .reg tbody td:nth-child(2), .cmain .reg thead th:nth-child(2) { color: var(--orange-text); font-weight: 700; }
.cmain .reg tbody tr:hover td:first-child { border-radius: 16px 0 0 16px; } .cmain .reg tbody tr:hover td:last-child { border-radius: 0 16px 16px 0; }
.cmain .reg .del { width: 22px; height: 22px; margin-left: 4px; padding: 0; vertical-align: middle; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; transform: scale(.7); transition: opacity .2s, transform .25s cubic-bezier(.3, 1.6, .5, 1), background .2s, color .2s; }
.cmain .reg .del svg { width: 12px; height: 12px; }
.cmain .reg thead th:hover .del, .cmain .reg .del:focus-visible { opacity: 1; transform: none; }
.cmain .reg .del:hover { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
@media (hover: none) { .cmain .reg .del { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cmain .card:has(.reg-wrap), .cmain .reg tbody tr { animation: none; } .cmain .reg * { transition: none !important; } }

/* Modal de check-in: minimalista */
@keyframes ci-pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-card:has([data-ci]) { animation: ci-pop .35s cubic-bezier(.2, .8, .2, 1) both; }
.modal-card:has([data-ci]) h2 { font-size: 20px; letter-spacing: -.02em; }
.modal-card:has([data-ci]) .field > .f { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.modal-card:has([data-ci]) :is(input, textarea) { border-color: transparent; background-color: color-mix(in srgb, var(--muted) 12%, transparent); border-radius: 16px; transition: background-color .2s, border-color .2s, box-shadow .2s; }
.modal-card:has([data-ci]) :is(input, textarea):hover { border-color: var(--line); }
.modal-card:has([data-ci]) :is(input, textarea):focus { background-color: var(--bg); border-color: var(--halo-line); box-shadow: var(--halo); outline: 0; }
.modal-card:has([data-ci]) .photo-in { border: 1.5px dashed var(--line); border-radius: 16px; background: color-mix(in srgb, var(--muted) 8%, transparent); transition: border-color .2s, background .2s, transform .25s; }
@media (hover: hover) { .modal-card:has([data-ci]) .photo-in:hover { border-color: var(--halo-line); background: color-mix(in srgb, var(--muted) 7%, transparent); color: var(--orange-text); transform: translateY(-3px); box-shadow: var(--halo); } }
.modal-card:has([data-ci]) .photo-in img { transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.modal-card:has([data-ci]) .photo-in:hover img { transform: scale(1.05); }
.ci-sec { margin: 4px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: none; color: var(--orange-text); }
.modal-card:has([data-ci]) .modal-actions .btn.danger { background: transparent; border-color: transparent; color: var(--red); transition: background .2s; }
.modal-card:has([data-ci]) .modal-actions .btn.danger:hover { background: color-mix(in srgb, var(--red) 12%, transparent); }
.modal-card:has([data-ci]) .modal-actions .btn:not(.ghost):not(.danger) { transition: transform .2s, box-shadow .25s; }
.modal-card:has([data-ci]) .modal-actions .btn:not(.ghost):not(.danger):hover { transform: translateY(-2px); box-shadow: 0 6px 16px color-mix(in srgb, var(--orange) 30%, transparent); }
@media (prefers-reduced-motion: reduce) { .modal-card:has([data-ci]) { animation: none; } .modal-card:has([data-ci]) * { transition: none !important; } }

/* Planes nutricionales: resumen de kcal en la tarjeta */
.tpl-kcal { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; font-size: 13px; color: var(--muted); }
.tpl-kcal b { font-size: 20px; font-weight: 700; letter-spacing: -.03em; color: var(--orange-text); }
.tpl-kcal i { font-style: normal; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 14%, transparent); font-size: 12px; font-weight: 600; }

/* Librería > Alimentos: tabla editable minimalista */
.lw-tools .btn.ghost { display: inline-flex; align-items: center; gap: 6px; border-color: transparent; color: var(--muted); transition: background .2s, color .2s, transform .2s; }
.lw-tools .btn.ghost:hover { background: var(--surface-raised); color: var(--ink); transform: translateY(-1px); }
.lw-head h1 .count { vertical-align: middle; margin-left: 6px; }
.food-tbl { border: 0; background: transparent; overflow: visible; }
.food-tbl .t { border-collapse: separate; border-spacing: 0 2px; }
.food-tbl .t th { position: sticky; top: calc(56px + env(safe-area-inset-top));z-index: 2; background: var(--bg); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; letter-spacing: .03em; color: var(--muted); }
.food-tbl .t td { border-bottom: 0; padding: 3px 10px; transition: background .2s; }
.food-tbl .t tbody td:first-child { border-radius: 16px 0 0 16px; } .food-tbl .t tbody td:last-child { border-radius: 0 16px 16px 0; }
.food-tbl .t tbody tr:hover td { background: var(--surface-raised); }
@media (prefers-reduced-motion: reduce) { .food-tbl * { transition: none !important; } }

/* Alimentos: edición con pista suave en lugar de aro duro */
@keyframes fd-new { 0%, 60% { background: color-mix(in srgb, var(--muted) 22%, transparent); } 100% { background: transparent; } }
.food-tbl .t tr.is-new td { animation: fd-new 2.4s ease-out both; }
.fm { display: grid; gap: 12px; }
.fm .field { margin: 0; }
.fm input { width: 100%; border-color: transparent; background-color: color-mix(in srgb, var(--muted) 12%, transparent); border-radius: 16px; transition: background-color .2s, border-color .2s, box-shadow .2s; }
.fm input:focus { background-color: var(--bg); border-color: var(--halo-line); box-shadow: var(--halo); outline: 0; }
.fm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 520px) { .fm-grid { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { .food-tbl .t tr.is-new td { animation: none; background: color-mix(in srgb, var(--muted) 14%, transparent); } }

/* Campos de los modales: hover más claro y con transición */
.fm input:not(:focus):hover,
.modal-card:has([data-ci]) :is(input, textarea):not(:focus):hover { border-color: color-mix(in srgb, var(--orange) 45%, transparent); background-color: color-mix(in srgb, var(--muted) 7%, color-mix(in srgb, var(--muted) 12%, transparent)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--muted) 8%, transparent); cursor: text; }
.fm .field:hover > .f, .modal-card:has([data-ci]) .field:hover > .f { color: var(--ink); }
.fm .field > .f, .modal-card:has([data-ci]) .field > .f { transition: color .2s; }
.fm input::placeholder { transition: opacity .2s, transform .2s; }
.fm input:hover::placeholder { opacity: .65; }
.fm input:focus::placeholder { opacity: .35; transform: translateX(4px); }

/* Alimentos: filas de solo lectura con botones editar / eliminar */
.food-tbl .t td { padding: 12px 14px; font-size: 13px; }
.food-tbl .food-name { font-weight: 600; }
.food-tbl .food-actions { white-space: nowrap; text-align: right; }
.food-tbl .food-actions .iconbtn { opacity: 0; transition: opacity .2s, background .2s, color .2s, transform .2s; }
.food-tbl tbody tr:hover .food-actions .iconbtn, .food-tbl .food-actions .iconbtn:focus-visible { opacity: 1; }
.food-tbl .food-actions .iconbtn:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--orange); }
.food-tbl .food-actions .food-del:hover { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
@media (hover: none) { .food-tbl .food-actions .iconbtn { opacity: 1; } }

/* Evitar recortes al elevar elementos dentro de contenedores con scroll */
.coach-client-status.tabs-line { padding: 4px 3px; margin: 10px 0 8px; }
.te-muscles { padding-top: 3px; padding-inline: 2px; }
.cmain .evo-top .subtabs { padding: 4px; }

/* Nueva tarea: selector de tipo */
@keyframes tk-in { from { opacity: 0; transform: translateY(8px); } }
.tk { display: grid; gap: 14px; }
.tk .field { margin: 0; }
.tk [hidden] { display: none !important; }
.tk-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tk-type { position: relative; display: grid; justify-items: start; gap: 2px; padding: 12px; border: 1.5px solid var(--box-line); border-radius: 16px; cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.tk-type input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tk-ico { display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 6px; border-radius: 16px; color: var(--muted); background: color-mix(in srgb, var(--muted) 14%, transparent); transition: color .2s, background .2s, transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.tk-ico svg { width: 16px; height: 16px; }
.tk-type b { font-size: 13px; font-weight: 650; }
.tk-type small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.tk-type:hover:not(.off) { transform: translateY(-2px); border-color: var(--orange-m); }
.tk-type:hover:not(.off) .tk-ico { transform: scale(1.1) rotate(-6deg); }
.tk-type:has(input:checked) { border-color: var(--halo-line); background: color-mix(in srgb, var(--muted) 9%, transparent); box-shadow: var(--halo); }
.tk-type:has(input:checked) .tk-ico { color: var(--on-accent); background: var(--orange); }
.tk-type:has(input:focus-visible) { outline: 2px solid var(--orange); outline-offset: 2px; }
.tk-type.off { opacity: .45; cursor: not-allowed; }
.tk-type.off input { cursor: not-allowed; }
.tk-f:not([hidden]) { animation: tk-in .3s both; }
.tk-note { margin: 0; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--muted) 10%, transparent); color: var(--muted); font-size: 13px; }
.tk :is(input[type=text], input[type=date], select) { width: 100%; border-color: transparent; background-color: color-mix(in srgb, var(--muted) 12%, transparent); border-radius: 16px; transition: background-color .2s, border-color .2s, box-shadow .2s; }
.tk :is(input[type=text], input[type=date], select):not(:focus):hover { border-color: color-mix(in srgb, var(--orange) 45%, transparent); background-color: color-mix(in srgb, var(--muted) 7%, color-mix(in srgb, var(--muted) 12%, transparent)); }
.tk :is(input[type=text], input[type=date], select):focus { background-color: var(--bg); border-color: var(--halo-line); box-shadow: var(--halo); outline: 0; }
.tk .field > .f { font-size: 12px; font-weight: 600; color: var(--muted); }
@media (max-width: 420px) { .tk-types { grid-template-columns: 1fr; } .tk-type { grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; } .tk-ico { grid-row: 1 / 3; margin: 0; } }
@media (prefers-reduced-motion: reduce) { .tk-type, .tk-f:not([hidden]) { animation: none; } .tk * { transition: none !important; } }

/* Información > General: minimalista */
@keyframes in-rise { from { opacity: 0; transform: translateY(10px); } }
.cmain > .subtabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 16px; border-bottom: 0; border-radius: 999px; background: color-mix(in srgb, var(--muted) 10%, transparent); max-width: 100%; }
.cmain > .subtabs :is(a, button) { padding: 7px 14px; border-bottom: 0; border-radius: 999px; color: var(--muted); font-size: 13px; transition: color .2s, background .2s, transform .2s, box-shadow .2s; }
.cmain > .subtabs :is(a, button):hover { color: var(--ink); transform: translateY(-1px); }
.cmain > .subtabs :is(a, button).on { background: var(--card); color: var(--orange-text); font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .14); }
.cmain .card:has(> .section-title), .cmain .card:has(> .info-head) { border-color: transparent; background: color-mix(in srgb, var(--card) 70%, transparent); border-radius: 22px; }
.cmain .card > .section-title { font-size: 16px; font-weight: 650; letter-spacing: -.01em; border-bottom: 0; padding-bottom: 4px; }
.cmain .section-title svg { color: var(--orange); }
.info-head { border-bottom: 0; }
.info-group + .info-group { border-top: 0; }
.info-group { padding: 14px 0 2px; }
.info-group .eyebrow { color: var(--orange-text); font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.cmain .card:has(> .section-title) .field > .f, .cmain .card:has(> .info-head) .field > .f { font-size: 12px; font-weight: 600; color: var(--muted); transition: color .2s; }
.cmain .card:has(> .section-title) .field:hover > .f, .cmain .card:has(> .info-head) .field:hover > .f { color: var(--ink); }
.cmain .card:has(> .section-title) :is(input:not([type=checkbox]), select, textarea), .cmain .card:has(> .info-head) :is(input:not([type=checkbox]), select, textarea) { border-color: transparent; background-color: color-mix(in srgb, var(--muted) 12%, transparent); border-radius: 16px; transition: background-color .2s, border-color .2s, box-shadow .2s; }
.cmain .card:has(> .section-title) :is(input:not([type=checkbox]), select, textarea):not(:focus):hover, .cmain .card:has(> .info-head) :is(input:not([type=checkbox]), select, textarea):not(:focus):hover { border-color: color-mix(in srgb, var(--orange) 45%, transparent); background-color: color-mix(in srgb, var(--muted) 7%, color-mix(in srgb, var(--muted) 12%, transparent)); }
.cmain .card:has(> .section-title) :is(input:not([type=checkbox]), select, textarea):focus, .cmain .card:has(> .info-head) :is(input:not([type=checkbox]), select, textarea):focus { background-color: var(--bg); border-color: var(--halo-line); box-shadow: var(--halo); outline: 0; }
.info-actions .btn { transition: background .2s, color .2s, transform .2s; }
.info-actions .btn:hover { transform: translateY(-1px); }
.info-actions .btn.danger { background: transparent; border-color: transparent; color: var(--red); }
.info-actions .btn.danger:hover { background: color-mix(in srgb, var(--red) 12%, transparent); }
.info-stats { gap: 10px; }
.info-stat { border-color: transparent; background: color-mix(in srgb, var(--surface-raised) 60%, transparent); border-radius: 16px; padding: 12px 14px; transition: transform .2s, background .2s; }
.info-stat:hover { transform: translateY(-2px); background: var(--surface-raised); }
.info-stat > span { font-size: 12px; letter-spacing: .06em; text-transform: none; }
.info-stat b { font-size: 20px; letter-spacing: -.02em; animation: in-rise .5s .15s both; }
.info-stat.hi { border: 1px solid var(--orange-m); background: linear-gradient(135deg, color-mix(in srgb, var(--muted) 15%, transparent), color-mix(in srgb, var(--muted) 5%, transparent)); }
.info-stat.hi > span { color: var(--orange-text); }
.info-stat.hi b { color: var(--ink); font-size: 20px; }
@media (prefers-reduced-motion: reduce) { .info-stat b { animation: none; } .cmain * { transition: none !important; } }

/* Plan nutricional a todo el ancho: comidas a la izquierda, plan y totales a la derecha */
.diet-side { display: grid; gap: 14px; min-width: 0; align-content: start; }
@media (min-width: 921px) { .diet-editor { max-width: none; } }
/* Dos columnas solo si la tabla de alimentos (unos 520 px) cabe en su caja. */
@media (min-width: 1320px) {
  .diet-editor { grid-template-columns: minmax(0, 1fr) clamp(340px, 30vw, 440px); grid-template-areas: "meals side"; gap: 20px; align-items: start; }
  .diet-editor > .diet-meals { grid-area: meals; }
  .diet-editor > .diet-side { grid-area: side; position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto; scrollbar-width: thin; padding: 2px; }
  .diet-side .diet-plan { grid-template-columns: minmax(0, 1fr); }
  .diet-side .diet-plan-settings { justify-content: space-between; }
  .diet-side .diet-actions { gap: 6px; }
  .diet-side .diet-summary .macros { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diet-side .diet-summary .macros > .mk { grid-column: 1 / -1; }
}

/* Editor de entrenamiento: sin tope de ancho */
.te { max-width: none; margin-inline: 0; width: 100%; }

/* Entrenamiento: días bajo el título; sesión y biblioteca a la derecha */
.te-side { display: grid; gap: 14px; min-width: 0; align-content: start; }
@media (min-width: 1050px) {
  .te-layout { grid-template-columns: minmax(0, 1fr) clamp(340px, 26vw, 520px); column-gap: 22px; }
  .te-main { gap: 14px; }
  .te-main > .te-bar { align-items: center; flex-wrap: nowrap; }
  .te-main > .te-bar .te-days { flex: 1 1 0; min-width: 0; }
  .te-side .te-library { position: static; display: block; }
}
@media (max-width: 1049px) {
  .te-layout { display: flex; flex-direction: column; }
  .te-main, .te-side { display: contents; }
  .te-main > .te-bar { order: 1; }
  .te-side > .te-session { order: 2; }
  .te-main > .te-plan { order: 3; }
  .te-main > .te-history { order: 4; }
  .te-side > .te-library { order: 5; }
}

/* Columna lateral del entrenamiento fija al hacer scroll */
@media (min-width: 1050px) {
  .te-side { position: sticky; top: 72px; align-self: start; display: grid; gap: 14px; }
  .te-side > .te-library { display: grid; align-content: start; gap: 10px; }
  .te-side .te-library > * { min-width: 0; }
  .te-side .te-muscles { margin-top: 0; padding: 3px 2px 5px; min-height: 40px; }
  .te-side .te-muscles button { flex: none; min-height: 30px; line-height: 1.2; }
  .te-side .te-library-list { margin-top: 0; max-height: clamp(220px, calc(100vh - 500px), 560px); overscroll-behavior: contain; }
}

/* Logros: anillos de progreso */
@property --p { syntax: '<number>'; inherits: false; initial-value: 0; }
@keyframes ach-ring { from { --p: 0; } }
@keyframes ach-rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes ach-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.ach-total { width: 160px; height: 6px; margin-top: 8px; border-radius: 10px; overflow: hidden; background: color-mix(in srgb, var(--muted) 20%, transparent); }
.ach-total i { display: block; height: 100%; border-radius: 10px; background: var(--orange); transform-origin: left; animation: pp-fill 1s .2s cubic-bezier(.2, .7, .2, 1) both; }
.ach-grid { gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.ach { position: relative; gap: 4px; padding: 18px; border-color: transparent; border-radius: 22px; background: color-mix(in srgb, var(--card) 70%, transparent); opacity: 1; transition: transform .25s, background .25s, box-shadow .25s; }
.ach:hover { transform: translateY(-3px); background: var(--card); }
.ach .ach-ic { position: relative; width: 52px; height: 52px; margin-bottom: 8px; border-radius: 50%; background: conic-gradient(var(--orange) calc(var(--p) * 1%), color-mix(in srgb, var(--muted) 20%, transparent) 0); color: var(--ink); animation: ach-ring 1.1s .2s cubic-bezier(.2, .7, .2, 1) both; }
.ach .ach-ic::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--bg); }
.ach .ach-ic em { position: relative; font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); }
.ach.ok { background: linear-gradient(160deg, color-mix(in srgb, var(--muted) 16%, transparent), color-mix(in srgb, var(--muted) 4%, transparent)); border-color: var(--orange-m); }
.ach.ok .ach-ic { background: var(--orange); box-shadow: none; }
.ach.ok .ach-ic::before { display: none; }
.ach.ok .ach-ic em { font-size: 20px; color: var(--on-accent); }
.ach:hover .ach-ic { transform: rotate(-6deg) scale(1.05); }
.ach:not(.ok) { opacity: .92; }
.ach b { font-size: 14px; letter-spacing: -.01em; }
.ach-n { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.ach.ok .ach-n { color: var(--orange-text); }
@media (prefers-reduced-motion: reduce) { .ach, .ach .ach-ic, .ach-total i { animation: none !important; } .ach, .ach * { transition: none !important; } }

/* Check-ins: línea de tiempo */
@keyframes ci-rise { from { opacity: 0; transform: translateY(12px); } }
.ci-list { position: relative; display: grid; gap: 4px; padding: 6px 0; }
.ci-item { position: relative; display: grid; grid-template-columns: 92px 22px minmax(0, 1fr); gap: 0 14px; align-items: start; }
.ci-date { padding-top: 14px; text-align: right; line-height: 1.15; }
.ci-date b { display: block; font-size: 14px; font-weight: 650; text-transform: capitalize; }
.ci-date span { font-size: 12px; color: var(--muted); }
.ci-dot { position: relative; justify-self: center; align-self: stretch; width: 2px; background: color-mix(in srgb, var(--muted) 25%, transparent); }
.ci-dot::before { content: ""; position: absolute; top: 18px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--bg); border: 2.5px solid var(--orange); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), background .2s; }
.ci-item:first-child .ci-dot { background: linear-gradient(transparent 18px, color-mix(in srgb, var(--muted) 25%, transparent) 18px); }
.ci-item:last-child .ci-dot { background: linear-gradient(color-mix(in srgb, var(--muted) 25%, transparent) 24px, transparent 24px); }
.ci-item:first-child:last-child .ci-dot { background: none; }
.ci-item:hover .ci-dot::before { background: var(--orange); transform: scale(1.3); }
.ci-body { margin: 4px 0; padding: 12px 16px; border-radius: 16px; transition: background .2s, transform .2s; }
.ci-item:hover .ci-body { background: color-mix(in srgb, var(--card) 80%, transparent); transform: translateX(3px); }
.ci-top { display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; }
.ci-w { display: inline-flex; align-items: baseline; gap: 4px; min-width: 150px; }
.ci-w b { font-size: 24px; font-weight: 650; letter-spacing: -.03em; }
.ci-w small { font-size: 13px; color: var(--muted); }
.ci-d { margin-left: 8px; padding: 2px 8px; border-radius: 999px; font-style: normal; font-size: 12px; font-weight: 600; background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--muted); }
.ci-d.good { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.ci-d.bad { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.ci-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1 1 auto; }
.ci-chips .chip { border-color: transparent; background: color-mix(in srgb, var(--muted) 12%, transparent); color: var(--muted); }
.ci-chips .chip b { color: var(--ink); font-weight: 650; }
.ci-top .btn { margin-left: auto; border-color: transparent; color: var(--muted); opacity: 0; transition: opacity .2s, background .2s, color .2s; }
.ci-item:hover .ci-top .btn, .ci-top .btn:focus-visible { opacity: 1; color: var(--ink); background: var(--surface-raised); }
.ci-note { margin: 8px 0 0; font-size: 13px; color: var(--ink); }
.ci-fb { color: var(--muted); font-size: 13px; }
.ci-fb span { margin-right: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: none; color: var(--orange-text); }
@media (hover: none) { .ci-top .btn { opacity: 1; } }
@media (max-width: 640px) { .ci-item { grid-template-columns: 56px 18px minmax(0, 1fr); gap: 0 8px; } .ci-w { min-width: 0; } .ci-top .btn { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ci-item { animation: none; } .ci-item *, .ci-body { transition: none !important; } }

/* Imágenes de progreso */
@keyframes ph-rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes ph-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.ph-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; margin: 6px 0 14px; animation: ph-rise .45s both; }
.ph-head h2 { font-size: 20px; letter-spacing: -.025em; font-weight: 650; }
.ph-head .btn.ghost { border-color: transparent; color: var(--muted); transition: background .2s, color .2s, transform .2s; }
.ph-head .btn.ghost:not(:disabled):hover { background: var(--surface-raised); color: var(--ink); transform: translateY(-1px); }
.ph-head .btn:disabled { opacity: .4; cursor: not-allowed; }
.ph-head .btn:not(.ghost) { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; transition: transform .2s, box-shadow .25s; }
.ph-head .btn:not(.ghost):hover { transform: translateY(-2px); box-shadow: none; }
.ph-tip { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 10px 14px; border-radius: 16px; font-size: 13px; color: var(--muted); background: color-mix(in srgb, var(--muted) 9%, transparent); animation: ph-rise .45s .08s both; }
.ph-tip svg { flex: none; color: var(--orange); }
.ph-tip b { color: var(--ink); font-weight: 650; }
.ph-empty { display: grid; justify-items: center; gap: 6px; max-width: 480px; margin: 36px auto; padding: 36px 24px; text-align: center; border: 1.5px dashed var(--line); border-radius: 22px; animation: ph-rise .5s .1s both; transition: border-color .25s, background .25s; }
.ph-empty:hover { border-color: var(--orange-m); background: color-mix(in srgb, var(--muted) 4%, transparent); }
.ph-empty-ic { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 8px; border-radius: 22px; color: var(--orange-text); background: color-mix(in srgb, var(--muted) 12%, transparent); }
.ph-empty-ic svg { width: 28px; height: 28px; }
.ph-empty b { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.ph-empty p { margin: 0 0 12px; max-width: 360px; font-size: 13px; color: var(--muted); }
.ph-empty .btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; transition: transform .2s, box-shadow .25s; }
.ph-empty .btn:hover { transform: translateY(-2px); box-shadow: none; }
.ph-card { border-color: transparent; background: color-mix(in srgb, var(--card) 70%, transparent); border-radius: 22px; animation: ph-rise .5s both; transition: transform .25s, border-color .25s, background .25s; }
.ph-card:hover { transform: translateY(-3px); background: var(--card); }
.ph-card header { border-bottom: 0; }
.ph-card .ph { border-radius: 16px; overflow: hidden; transition: transform .3s; }
.ph-card .ph:hover { transform: scale(1.02); }
.ph-card .del { opacity: 0; transition: opacity .2s; }
.ph-card:hover .del, .ph-card .del:focus-visible { opacity: 1; }
@media (hover: none) { .ph-card .del { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ph-head, .ph-tip, .ph-empty, .ph-card { animation: none; } .ph-empty-ic { animation: none; } .ph-card, .ph-card *, .ph-head * { transition: none !important; } }

/* Etiquetas sobre fotos: fondo oscuro fijo, texto claro en ambos temas */
.photo-in .lbl, .ba-l, .ba-r { color: #fff; background: rgba(20, 20, 20, .72); backdrop-filter: blur(4px); font-weight: 600; }
.photo-in .lbl { padding: 2px 9px; }

/* Ajustes: ancho completo, tarjetas en cuadrícula */
.coach-page-settings { max-width: none; }
.set-page { max-width: none; margin: 0; grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); align-items: start; gap: 16px; }
.set-page > .set-head { grid-column: 1 / -1; }
.set-page > .danger-zone { grid-column: 1 / -1; }

/* Esqueleto breve al cambiar de página */
.sk-host { position: relative; }
.sk-layer { position: absolute; inset: 0; z-index: 8; overflow: hidden; background: var(--bg); pointer-events: none; transition: opacity .25s ease; }
.sk-layer.is-out { opacity: 0; }
.sk-layer i { position: absolute; display: block; box-sizing: border-box; }
.sk-card { border: 1px solid var(--box-line); background: var(--card); }
.sk-fill { background: linear-gradient(100deg, color-mix(in srgb, var(--muted) 13%, transparent) 35%, color-mix(in srgb, var(--muted) 30%, transparent) 50%, color-mix(in srgb, var(--muted) 13%, transparent) 65%) 100% 0 / 300% 100%; animation: sk-shine .9s linear infinite; }
@keyframes sk-shine { to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sk-fill { animation: none; } .sk-layer { transition: none; } }

/* Equivalencias y guías de menús: ventana compacta, con la lista desplazándose dentro */
.modal:has(.eq-amount, .mg-scroll) { overflow: hidden; align-items: center; padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)); }
.modal-card:has(.eq-amount, .mg-list) { display: flex; flex-direction: column; width: 490px; max-height: 100%; padding: 16px; border-radius: 22px; font-family: system-ui, sans-serif; }
.modal-card:has(.eq-amount, .mg-list) > * { flex: none; }
/* Guía de restaurante: altura estable al cambiar de categoría y solo la lista se desplaza. */
.eq-head + .eq-from { margin-top: 14px; }
.modal-card:has(.mg-list) { height: min(640px, 100%); }
.modal-card:has(.mg-list) > .mg-scroll { flex: 1 1 auto; min-height: 96px; margin-top: 8px; overflow-y: auto; overscroll-behavior: contain; }
.mg-list { margin: 0; padding: 0; list-style: none; }
.mg-list li { border-bottom: 1px solid color-mix(in srgb, var(--ink) 8%, transparent); animation: eq-in .3s cubic-bezier(.23, 1, .32, 1) both; animation-delay: calc(var(--i) * 25ms); }
.mg-list li:last-child { border-bottom: 0; }
.mg-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 8px 0; font-size: 15px; line-height: 1.25; list-style: none; }
summary.mg-row { cursor: pointer; }
.mg-row::-webkit-details-marker, .mg-foot summary::-webkit-details-marker { display: none; }
.mg-row > span { min-width: 0; }
.mg-row svg { width: 14px; height: 14px; margin-left: 6px; vertical-align: -2px; color: var(--muted); transition: rotate .2s; }
.mg-list details[open] .mg-row svg { rotate: 180deg; }
.mg-row b { max-width: 55%; font-size: 15px; font-weight: 750; text-align: right; font-variant-numeric: tabular-nums; }
.mg-row b.short { flex: none; max-width: none; white-space: nowrap; }
.mg-list details p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.mg-foot { margin-top: 8px; color: var(--muted); font-size: 11px; text-align: center; }
.mg-foot summary { display: flex; min-height: 32px; align-items: center; justify-content: center; list-style: none; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.mg-foot p { max-height: 22vh; margin: 4px 0 0; overflow-y: auto; font-size: 11px; line-height: 1.45; text-align: left; }
@media (prefers-reduced-motion: reduce) { .mg-list li { animation: none; } .mg-row svg { transition: none; } }

/* Sin barras laterales curvas: el color va en rellenos y etiquetas */
.coach-desktop-plan .ev.k-wk:not(.done) { background: var(--orange); color: var(--on-accent); }
.te .te-item.is-block .te-row-main .te-field > span { justify-self: start; display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--orange); color: var(--on-accent); font-weight: 700; }
.cside a::before { display: none; }

.avatar { overflow: hidden; flex: none; }
.avatar img.face, .client-avatar img.face { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* Base accesible (auditoría anti-slop) */
:root { --orange-text: var(--orange); --focus: var(--orange); }
:root[data-theme="light"] { --orange-text: var(--ink); --focus: var(--ink); }
:root[data-theme="light"] :is(.login-art, .install) { --orange: var(--brand-lift, #ff9000); --orange-text: var(--orange); --focus: #ffffff; }
/* Paleta: naranja de acento, verde y rojo para estado, el resto neutro */
:root, :root[data-theme="light"] { --teal: var(--green); --teal-bg: var(--green-bg); --pink: var(--red); --pink-bg: var(--red-bg); --violet: var(--muted); --violet-bg: var(--surface-raised); --sky: var(--ink); --blue-bg: var(--surface-raised); --blue-line: var(--line); }
.macros .mk-l, .eyebrow, .welcome .welcome-date { color: var(--orange-text); }
:root[data-theme="light"] :is(.macros .mk-l, .eyebrow, .welcome .welcome-date, .tpl-kcal b, .chip.orange, .x-cap em, .lx-chips button[aria-pressed="true"], .info-stat .small, .tabs-line a.on, .pills button.on) { color: var(--ink); }
.ex-thumb { --orange-d: var(--orange); }
:root[data-theme="light"] .ex-thumb-fallback { color: var(--orange); }
/* Foco de teclado siempre visible */
:is(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--focus) !important; outline-offset: 2px; }
/* Agenda legible */
.ag-day.past { opacity: 1; }
.ag-day.past header b { color: var(--muted); }
.ag-item.done { opacity: .9; }
.ag-empty { opacity: 1; }
.linkbtn[data-act="forgot"] { min-height: 32px; }
/* Táctil: 44 px como mínimo en móvil */
@media (max-width: 800px) {
  .btn, .btn.sm, .iconbtn, .x-heart, .lx-fav, .lx-chips button, .library-crumbs a, .tabs-line a, .subtabs :is(a, button), .pills button, .te-week button, .te-danger, .te-primary, .logo, .comp, summary, .linkbtn[data-act="forgot"], .auth-nav a, main .btn { min-height: 44px !important; }
  .iconbtn, .x-heart, .te-week button, .logo, summary { min-width: 44px !important; }
  .te-session-settings .btn, .te-plan-head button { min-height: 44px !important; }
  .library-crumbs a, .tabs-line a, .logo, summary, .linkbtn[data-act="forgot"] { display: inline-flex; align-items: center; }
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, .bounded-field-trigger { min-height: 44px; }
  .te-week { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; } }
:root[data-theme="light"] .x-cap em { background: var(--surface-raised); color: var(--ink); }
.chead .chead-h { margin: 0; font: inherit; font-weight: 600; letter-spacing: 0; text-transform: none; line-height: inherit; }
.login-card form[data-form] { margin-top: 16px; }
.login-card .check { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-bottom: 8px; cursor: pointer; }
.login-card .auth-nav:empty { display: none; }
.btn { border-radius: 16px; }
.ci-date b, .client-week-month, .coach-day-heading h3 { text-transform: none !important; }
.ci-date b::first-letter, .client-week-month::first-letter, .coach-day-heading h3::first-letter { text-transform: uppercase; }

/* Check-in en azul claro y pasos en rojo claro */
:root { --ci-bg: rgb(96 165 250 / 24%); --ci-dot: #7cb4ff; --steps-bg: rgb(248 113 113 / 22%); --steps-dot: #ff8f8f; }
:root[data-theme="light"] { --ci-bg: #dbeafe; --ci-dot: #3b82f6; --steps-bg: #fde3e3; --steps-dot: #e5484d; }
.coach-desktop-plan .k-ci { --cal-tint: var(--ci-bg); --cal-dot: var(--ci-dot); }
.coach-desktop-plan .k-steps { --cal-tint: var(--steps-bg); --cal-dot: var(--steps-dot); }
.ag-item.k-ci { background: var(--ci-bg); }
.ag-item.k-ci::before, .ag-legend .k-ci i { background: var(--ci-dot); }
.ag-item.k-steps { background: var(--steps-bg); }
.ag-item.k-steps::before, .ag-legend .k-steps i { background: var(--steps-dot); }

/* Pestañas que son botones: sin el marco del navegador */
:where(.subtabs) :where(button) { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }

/* Cambio de modo instantáneo */
.theme-switching, .theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }

/* Librería en móvil: buscador y botón a todo el ancho */
@media (max-width: 800px) {
  .lw-head > * { min-width: 0; max-width: 100%; }
  .lw-tools { flex-wrap: wrap; width: 100%; }
  .lw-tools .dt-search, .lib-bar .dt-search { flex: 1 1 100%; width: 100%; min-width: 0; }
  .lw-tools .btn { flex: 1 1 100%; justify-content: center; }
}

/* Cabecera de bloque */
.te-block-ico, .te-block-count { display: none; }
@media (min-width: 900px) {
  .te .te-item.is-block { padding: 14px 16px !important; border: 1px solid var(--box-line) !important; border-radius: 22px !important; background: var(--card) !important; }
  .te .te-item.is-block .te-row-edit { display: grid !important; grid-template-columns: 48px minmax(0, 1fr) auto; grid-template-areas: "ico main main" "ico notes count"; align-items: center; column-gap: 14px; row-gap: 2px; padding: 0; }
  .te .te-item.is-block .te-block-ico { grid-area: ico; display: grid; width: 48px; height: 48px; place-items: center; border-radius: 16px; background: var(--orange); color: var(--on-accent); }
  .te .te-item.is-block .te-row-main { grid-area: main; display: flex; align-items: center; gap: 12px; min-width: 0; }
  .te .te-item.is-block .te-row-main .te-field { flex: 1; min-width: 0; margin: 0; }
  .te .te-item.is-block .te-row-main .te-field > span, .te .te-item.is-block .te-notes > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .te .te-item.is-block .te-row-main input { width: 100%; height: 32px; min-height: 32px; padding: 0 6px; border-color: transparent; background: transparent; color: var(--ink); font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
  .te .te-item.is-block .te-notes { grid-area: notes; margin: 0; min-width: 0; }
  .te .te-item.is-block .te-notes textarea { width: 100%; padding: 2px 6px; border-color: transparent; background: transparent; color: var(--muted); font-size: 13px; field-sizing: content; overflow: hidden; resize: none; }
  .te .te-item.is-block :is(.te-row-main input, .te-notes textarea):hover { background: var(--surface-raised); }
  .te .te-item.is-block .te-block-count { grid-area: count; display: inline-block; justify-self: end; padding: 3px 12px; border-radius: 999px; background: var(--surface-raised); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
}

/* Acceso */
.login-card { max-width: 420px; padding: 28px; border: 1px solid var(--box-line); border-radius: 22px; background: var(--card); }
.login-card h2 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.login-card form[data-form] { display: grid; gap: 14px; margin-top: 20px; }
.login-card .field { margin: 0; }
.auth-input { position: relative; display: flex; align-items: center; margin-top: 6px; }
.auth-input > svg { position: absolute; left: 14px; color: var(--muted); pointer-events: none; transition: color .2s ease; }
.auth-input:focus-within > svg { color: var(--orange); }
.login-card .auth-input input { width: 100%; height: 48px; padding: 0 48px 0 44px; border-radius: 16px; }
.auth-input > svg, .auth-eye > svg { width: 18px; height: 18px; }
.auth-eye { position: absolute; right: 2px; display: grid; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 16px; background: transparent; color: var(--muted); cursor: pointer; }
.auth-eye[aria-pressed="true"] { color: var(--orange); }
.auth-eye:active { scale: .92; }
.login-card .btn.lg.block { position: relative; height: 48px; margin: 4px 0 0; transition: scale .16s cubic-bezier(0.23, 1, 0.32, 1); }
.login-card .btn.is-loading { color: transparent; pointer-events: none; }
.login-card .btn.is-loading::after { content: ""; position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border: 2px solid var(--on-accent); border-right-color: transparent; border-radius: 50%; animation: auth-spin .7s linear infinite; }
.login-card .err:empty { display: none; }
.login-card .err.shake { animation: auth-shake .35s cubic-bezier(0.23, 1, 0.32, 1); }
.login-card .auth-nav { margin-top: 18px; padding: 0; border: 0; justify-content: center; }
.login-card > * { animation: auth-in .4s cubic-bezier(0.23, 1, 0.32, 1) both; }
.login-card > form { animation-delay: .07s; }
.login-card > .auth-nav { animation-delay: .14s; }
@keyframes auth-in { from { opacity: 0; translate: 0 10px; } }
@keyframes auth-spin { to { rotate: 360deg; } }
@keyframes auth-shake { 20% { translate: -7px 0; } 45% { translate: 6px 0; } 70% { translate: -3px 0; } }
@media (max-width: 800px) { .login-card { padding: 20px 16px; } }
@media (prefers-reduced-motion: reduce) { .login-card > *, .login-card .err.shake { animation: none !important; } }
/* Iniciales sobre miniatura oscura: naranja en los dos modos */
.ex-thumb, :root[data-theme="light"] .ex-thumb, :root[data-theme="light"] .ex-thumb .ex-thumb-fallback { color: var(--orange); }
/* Tabla de alimentos en móvil: se desplaza dentro de su caja, sin ensanchar la página */
@media (max-width: 800px) { .tbl-wrap.food-tbl { max-width: 100%; overflow-x: auto; } .food-tbl .t th { position: static; } }

/* Entrenos registrados por el cliente */
.te-log { margin-block-start: 14px; padding-block-start: 12px; border-top: 1px solid var(--line); }
.te-log h3 { margin: 0 0 6px; font-size: 14px; }
.te-log p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
.te-log p strong { flex: 1 1 100%; font-size: 13px; }

/* Color de la app */
.set-color { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
.wheel { position: relative; flex: none; width: 168px; height: 168px; border-radius: 50%; cursor: crosshair; touch-action: none; background: radial-gradient(closest-side, #fff, transparent), conic-gradient(from 90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.wheel-shade { position: absolute; inset: 0; border-radius: 50%; background: #000; pointer-events: none; }
.wheel-knob { position: absolute; width: 18px; height: 18px; margin: -9px; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #000; background: var(--brand-pick, var(--orange)); pointer-events: none; }
.set-color-side { display: grid; flex: 1 1 220px; gap: 12px; min-width: 0; }
.set-color-side input[type=range] { width: 100%; padding: 0; accent-color: var(--orange); }
.set-color-side input[type=text] { font-family: ui-monospace, monospace; text-transform: lowercase; }
.set-swatch { width: 42px; height: 42px; flex: none; border: 1px solid var(--line); border-radius: 16px; background: var(--brand-pick, var(--orange)); }
.set-logo .configured-logo { width: 52px; height: 52px; object-fit: contain; }
.logo-img.configured-logo { object-fit: contain; }

/* Foto del entrenador */
.set-photo { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.set-photo-pick { position: relative; flex: none; border-radius: 50%; cursor: pointer; }
.set-photo-pick input { position: absolute; inset: 0; z-index: 1; opacity: 0; cursor: pointer; }
.set-photo-pick .avatar, .client-coach .avatar { display: grid; width: 72px; height: 72px; place-items: center; overflow: hidden; border-radius: 50%; background: var(--surface-raised); color: var(--ink); font-size: 22px; font-weight: 700; }
.set-photo-pick:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.me .avatar, .who .avatar { overflow: hidden; }
:is(.set-photo-pick, .client-coach, .me, .who) .avatar .face { width: 100%; height: 100%; object-fit: cover; }
.client-coach { display: flex; align-items: center; gap: 14px; }
.client-coach .avatar { width: 56px; height: 56px; flex: none; }
.client-coach small { display: block; color: var(--muted); }

/* Guía de postura en las casillas de foto vacías: solo la sombra */
.modal-card:has([data-ci]) .photo-in:has(.pose-slot) { border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(180deg, color-mix(in srgb, var(--muted) 13%, transparent), color-mix(in srgb, var(--muted) 3%, transparent)); }
.modal-card:has([data-ci]) .photo-in:has(.pose-slot):hover { border-color: color-mix(in srgb, var(--orange) 55%, var(--line)); color: var(--muted); }
.pose-slot { position: absolute; inset: 0; display: flex; justify-content: center; padding: 16px 4px 38px; }
.pose { position: relative; width: 100%; height: 100%; min-height: 0; fill: color-mix(in srgb, var(--muted) 52%, var(--surface-raised)); -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent); transition: fill .25s; }
.photo-in:hover .pose { fill: color-mix(in srgb, var(--muted) 72%, var(--surface-raised)); }
.pose .pose-arm { fill: color-mix(in srgb, var(--muted) 70%, var(--surface-raised)); stroke: var(--surface-raised); stroke-width: .9; }
.pose .pose-detail { fill: none; stroke: color-mix(in srgb, var(--surface-raised) 75%, var(--muted)); stroke-width: 1.1; stroke-linecap: round; }
.photo-in:has(.pose-slot) .lbl { left: 50%; bottom: 11px; translate: -50% 0; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 4px; white-space: nowrap; }
.photo-in:has(.pose-slot) .lbl::before { content: "+"; display: grid; width: 17px; height: 17px; place-items: center; border-radius: 50%; background: var(--orange); color: var(--on-accent); font: 700 13px/1 system-ui, sans-serif; }
@media (max-width: 800px) { .modal-card:has([data-ci]) .photo-in { aspect-ratio: 10 / 19; } }


/* Editor de entrenamiento en escritorio estrecho: se mide la columna del plan (no la ventana),
   y si las filas no caben en una línea, se reparten en varias en vez de meterse bajo el panel lateral. */
@media (min-width: 801px) {
  .te, .te-main { grid-template-columns: minmax(0, 1fr); } /* la fila de días hace scroll; no ensancha la columna */
  .cmain .te-plan { container: workout-plan / inline-size; }
  @container workout-plan (width < 840px) {
    .te-plan-head, .te-plan-head > div:last-child { flex-wrap: wrap; }
    .te-item.has-media-editor .te-row-edit { grid-template-columns: minmax(0, 1fr); }
    .te-item.has-media-editor .te-row-main { display: flex; flex-wrap: wrap; }
    .te-item.has-media-editor .te-row-main > .te-field { flex: 1 1 150px; }
    .te-item.has-media-editor .te-prescription { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); flex: 1 1 100%; min-width: 0; }
    .te-item.has-media-editor :is(.te-row-main > .te-field, .te-prescription > .te-field, .te-row-actions, .te-notes) { grid-area: auto; }
    .te-item.has-media-editor .te-row-actions { flex-wrap: wrap; }
  }
}
/* En columna única, cada bloque ocupa todo el ancho (el plan es un contenedor y sin esto mide 0). */
@media (min-width: 801px) and (max-width: 1049px) { .cmain .te-layout { align-items: stretch; } }

/* Campana de avisos del entrenador */
.notice-btn { position: relative; }
.notice-btn b { position: absolute; top: 3px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--orange); color: var(--on-accent); font-size: 10px; font-weight: 800; line-height: 16px; text-align: center; }
.notice-list { display: grid; gap: 6px; margin-top: 12px; max-height: 60vh; overflow-y: auto; }
.notice-list .comp { gap: 10px; padding: 10px 12px; border-radius: 16px; font-size: 14px; }
.notice-list .comp.is-new { background: var(--surface-raised); }
.notice-list .comp:not(.is-new) { opacity: .6; }
