/* ============ GYM NEST — design tokens ============ */
:root {
  --brand: #B37563;
  --brand-strong: #9A5E4D;
  --brand-soft: #F4E6E1;
  --brand-softer: #FAF2EF;
  --teal: #6FA5A2;
  --bg: #FBF8F6;
  --surface: #FFFFFF;
  --surface-2: #F6F1EE;
  --ink: #2C2624;
  --ink-2: #5E5452;
  --muted: #988C88;
  --line: #ECE3DF;
  --good: #3E8E6E;
  --good-soft: #E3F2EB;
  --warn: #C08A2E;
  --warn-soft: #FBF0DC;
  --bad: #C2554B;
  --bad-soft: #FBE6E3;
  --shadow: 0 1px 2px rgba(60, 35, 28, .04), 0 6px 24px rgba(60, 35, 28, .06);
  --shadow-lg: 0 12px 40px rgba(60, 35, 28, .14);
  --r: 18px;
  --r-sm: 12px;
  --font: 'Assistant', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #D08F7C; --brand-strong: #E3A592; --brand-soft: #3A2A25; --brand-softer: #2B211E;
    --bg: #161312; --surface: #201B1A; --surface-2: #2A2321; --ink: #F3ECE9; --ink-2: #CFC3BF;
    --muted: #9A8E8A; --line: #352D2A; --good-soft: #1D3229; --warn-soft: #3A2F1A; --bad-soft: #3B221F;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #D08F7C; --brand-strong: #E3A592; --brand-soft: #3A2A25; --brand-softer: #2B211E;
  --bg: #161312; --surface: #201B1A; --surface-2: #2A2321; --ink: #F3ECE9; --ink-2: #CFC3BF;
  --muted: #9A8E8A; --line: #352D2A; --good-soft: #1D3229; --warn-soft: #3A2F1A; --bad-soft: #3B221F;
  color-scheme: dark;
}

/* ============ base ============ */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); background: var(--bg); color: var(--ink);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  min-height: 100vh; overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-strong); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hide { display: none !important; }

/* ============ layout ============ */
.shell { max-width: 1080px; margin: 0 auto; padding: 0 16px 110px; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1080px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.logo-mark { width: 36px; height: 36px; flex: none; }
.logo-text { font-weight: 800; letter-spacing: .14em; font-size: 17px; direction: ltr; }
.logo-sub { font-size: 12px; color: var(--muted); margin-top: -3px; letter-spacing: 0; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav a {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  color: var(--ink-2); font-weight: 600; font-size: 15px; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--brand-soft); color: var(--brand-strong); }
.nav svg { width: 19px; height: 19px; }
.user-btn {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 4px 4px 4px 12px; font-weight: 600; font-size: 14px;
}
@media (max-width: 760px) {
  .nav {
    position: fixed; bottom: 0; left: 0; right: 0; margin: 0; justify-content: space-around;
    background: var(--surface); border-top: 1px solid var(--line); padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    z-index: 30; box-shadow: 0 -4px 20px rgba(0,0,0,.04);
  }
  .nav a { flex-direction: column; gap: 2px; font-size: 12px; padding: 6px 10px; border-radius: 14px; flex: 1; }
  .nav a svg { width: 22px; height: 22px; }
  .user-btn .user-name { display: none; }
  .user-btn { margin-inline-start: auto; padding: 4px; }
}

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 28px 0 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .split, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-2 { grid-template-columns: minmax(0, 1fr); } .grid-4.keep, .grid-2.keep { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* ============ cards ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h3 { font-size: 18px; }
.card.flat { box-shadow: none; }
.section-title { font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--muted); margin: 26px 0 10px; }

.stat { padding: 16px 18px; }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 28px; font-weight: 800; margin-top: 2px; }
.stat .value small { font-size: 14px; font-weight: 600; color: var(--muted); margin-inline-start: 2px; }
.stat .sub { font-size: 13px; margin-top: 2px; }

.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; font-size: 13px; padding: 1px 8px; border-radius: 999px; }
.delta.up { color: var(--good); background: var(--good-soft); }
.delta.down { color: var(--bad); background: var(--bad-soft); }
.delta.flat { color: var(--muted); background: var(--surface-2); }

/* ============ hero greeting ============ */
.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 28px 26px; margin-top: 24px;
  background: linear-gradient(135deg, #C98B79 0%, var(--brand) 45%, #9A5E4D 100%); color: #fff;
  box-shadow: 0 14px 40px rgba(154, 94, 77, .28);
}
.hero::after {
  content: ''; position: absolute; inset: auto -60px -90px auto; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.18), transparent 70%);
}
.hero .greet-icon { font-size: 15px; opacity: .9; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.hero h1 { font-size: 34px; margin-top: 6px; }
.hero p { margin: 6px 0 0; opacity: .92; }
.hero-row { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; position: relative; z-index: 1; }
.pill-light { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.28); color: #fff; border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 600; }

/* ============ buttons / inputs ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent;
  border-radius: 999px; padding: 10px 20px; font-weight: 700; font-size: 15px; transition: transform .08s, background .15s, box-shadow .15s;
  background: var(--surface-2); color: var(--ink); white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(179, 117, 99, .3); }
.btn-primary:hover { background: var(--brand-strong); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-white { background: #fff; color: var(--brand-strong); }
.btn-sm { padding: 6px 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 50%; }
.btn-danger { color: var(--bad); }
.btn svg { width: 18px; height: 18px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-sm);
  padding: 11px 14px; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
.input.input-sm { padding: 6px 10px; font-size: 14px; width: auto; max-width: 100%; }
.input.ltr { direction: ltr; text-align: right; }
.hint { font-size: 13px; color: var(--muted); }
.err { font-size: 13px; color: var(--bad); min-height: 18px; }

.search { position: relative; }
.search svg { position: absolute; top: 50%; transform: translateY(-50%); right: 14px; width: 18px; color: var(--muted); }
.search .input { padding-right: 42px; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--brand-strong); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
  background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--ink-2);
}
.chip.brand { background: var(--brand-soft); color: var(--brand-strong); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }

/* ============ avatar ============ */
.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 15px; overflow: hidden; background: var(--brand);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.xs { width: 26px; height: 26px; font-size: 11px; box-shadow: 0 0 0 2px var(--surface); }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.xl { width: 96px; height: 96px; font-size: 32px; }
.trainer-tag { display: flex; align-items: center; gap: 10px; }
.trainer-tag .t-name { font-weight: 700; line-height: 1.15; }
.trainer-tag .t-role { font-size: 12px; color: var(--muted); }

/* ============ login ============ */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art {
  position: relative; overflow: hidden; color: #fff; padding: 48px;
  background: radial-gradient(circle at 80% 10%, #D9A796 0, transparent 45%), linear-gradient(160deg, #B37563, #7E4A3D);
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-art h2 { font-size: 44px; line-height: 1.1; max-width: 420px; }
.login-art p { opacity: .9; max-width: 380px; font-size: 18px; }
.login-art .rings { position: absolute; left: -120px; bottom: -120px; width: 420px; opacity: .14; }
.login-art .addr { display: flex; align-items: center; gap: 8px; opacity: .85; font-size: 15px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.login-box { width: 100%; max-width: 400px; }
.login-box h1 { font-size: 30px; margin: 18px 0 6px; }
.login-box .stack { display: flex; flex-direction: column; gap: 16px; margin-top: 22px; }
.trainer-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.trainer-pick button {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px; border-radius: var(--r);
  border: 1.5px solid var(--line); background: var(--surface); text-align: center; transition: border-color .15s, transform .1s;
}
.trainer-pick button:hover { border-color: var(--brand); transform: translateY(-2px); }
.trainer-pick .t-role { font-size: 12px; color: var(--muted); }
.soon { display: flex; gap: 10px; align-items: flex-start; background: var(--brand-softer); border: 1px dashed color-mix(in srgb, var(--brand) 40%, transparent); padding: 12px 14px; border-radius: var(--r-sm); font-size: 14px; color: var(--ink-2); }
@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { padding: 28px 20px; min-height: 0; }
  .login-art h2 { font-size: 30px; }
  .login-art p { font-size: 16px; }
  .login-art .art-body { margin: 22px 0 10px; }
}

/* ============ next workout / lists ============ */
.next-card { display: flex; flex-direction: column; gap: 14px; }
.ex-preview { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ex-preview li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.ex-preview li:last-child { border-bottom: 0; }
.ex-preview .ex-name { font-weight: 700; }

.row-list { display: flex; flex-direction: column; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); color: var(--ink); }
.row-item:last-child { border-bottom: 0; }
.row-item:hover { background: var(--brand-softer); border-radius: 10px; }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .title { font-weight: 700; }
.row-item .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .em-icon { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.empty .em-icon svg { width: 26px; height: 26px; }
.empty h4 { color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* ============ journal ============ */
.date-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: thin; scroll-snap-type: x proximity; }
.date-chip {
  flex: none; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; min-width: 62px;
  padding: 8px 6px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2);
}
.date-chip .d { font-size: 20px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.date-chip .m { font-size: 12px; }
.date-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--good); margin-top: 4px; }
.date-chip .dot.planned { background: var(--warn); }
.date-chip.on { border-color: var(--brand); background: var(--brand-soft); }
.date-chip.on .d { color: var(--brand-strong); }

.journal-page {
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  overflow: hidden;
}
.jp-head { padding: 22px 22px 18px; background: linear-gradient(180deg, var(--brand-softer), var(--surface)); border-bottom: 1px solid var(--line); }
.jp-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.jp-nav { display: flex; gap: 6px; }
.jp-date { font-size: 26px; font-weight: 800; margin-top: 10px; }
.jp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 14px; }
.jp-body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 14px; }

.ex-card { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; background: var(--surface); }
.ex-card.done { border-color: color-mix(in srgb, var(--good) 35%, var(--line)); }
.ex-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ex-head h3 { font-size: 19px; }
.ex-note { font-size: 14px; color: var(--ink-2); background: var(--surface-2); padding: 6px 10px; border-radius: 10px; margin-top: 8px; display: inline-block; }
.ex-by { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.ex-by b { color: var(--ink-2); font-weight: 700; }
.ex-last { font-size: 13px; color: var(--muted); margin-top: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.sets { width: 100%; border-collapse: separate; border-spacing: 0 6px; margin-top: 10px; }
.sets th { font-size: 12px; color: var(--muted); font-weight: 700; text-align: center; padding: 0 4px; }
.sets td { text-align: center; padding: 0 4px; }
.sets .set-n { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); display: inline-grid; place-items: center; font-weight: 800; font-size: 14px; }
.sets .w { font-weight: 800; font-size: 17px; }
.sets .w small { font-weight: 600; color: var(--muted); font-size: 12px; }
.reps-input {
  width: 74px; text-align: center; font-weight: 800; font-size: 18px; padding: 8px 4px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface-2); direction: ltr; -moz-appearance: textfield;
}
.reps-input::-webkit-outer-spin-button, .reps-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.reps-input:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.reps-input.hit { border-color: color-mix(in srgb, var(--good) 50%, transparent); background: var(--good-soft); color: var(--good); }
.reps-input.miss { border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: var(--warn-soft); color: var(--warn); }
.reps-input.over { border-color: color-mix(in srgb, var(--teal) 60%, transparent); background: color-mix(in srgb, var(--teal) 14%, transparent); }

.feel { display: flex; gap: 8px; flex-wrap: wrap; }
.feel button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 14px; padding: 8px 12px; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.feel button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.jp-foot { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 16px 22px; border-top: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }

/* ============ progress ============ */
.ex-picker { position: relative; }
.ex-dropdown {
  position: absolute; z-index: 15; top: calc(100% + 6px); right: 0; left: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-lg); max-height: 320px; overflow: auto; padding: 6px;
}
.ex-dropdown button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: right; border: 0; background: transparent; padding: 10px 12px; border-radius: 10px; }
.ex-dropdown button:hover, .ex-dropdown button.kb { background: var(--brand-softer); }
.ex-dropdown mark { background: var(--brand-soft); color: var(--brand-strong); border-radius: 4px; padding: 0 2px; }

.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 220px; }

.ex-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ex-tile { text-align: right; border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, transform .1s; }
.ex-tile:hover { border-color: var(--brand); transform: translateY(-2px); }
.ex-tile.on { border-color: var(--brand); background: var(--brand-softer); }
.ex-tile .t-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ex-tile .t-name { font-weight: 800; }
.ex-tile svg.spark { width: 100%; height: 34px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: right; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; }
.pr { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }

.compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; text-align: center; }
.compare .cbox { background: var(--surface-2); border-radius: var(--r-sm); padding: 12px 8px; }
.compare .cbox .lbl { font-size: 12px; color: var(--muted); font-weight: 700; }
.compare .cbox .big { font-size: 22px; font-weight: 800; }
.compare .cbox .det { font-size: 13px; color: var(--ink-2); }

/* ============ body ============ */
.bmi-bar { position: relative; height: 12px; border-radius: 999px; margin: 18px 0 8px; direction: ltr;
  background: linear-gradient(90deg, #8DB5D6 0 14%, #6DB38F 14% 40%, #E2B65C 40% 60%, #D9776A 60% 100%); }
.bmi-marker { position: absolute; top: 50%; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 4px solid var(--ink); transform: translate(-50%, -50%); box-shadow: var(--shadow); transition: left .5s; }
.bmi-scale { position: relative; height: 18px; font-size: 12px; color: var(--muted); direction: ltr; }
.bmi-scale span { position: absolute; transform: translateX(-50%); }
.goal-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.goal-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), #D9A796); }

/* ============ trainer builder ============ */
.builder-row { display: grid; grid-template-columns: 28px minmax(0, 2.2fr) repeat(3, minmax(64px, .7fr)) minmax(0, 1.6fr) auto; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.builder-row .idx { font-weight: 800; color: var(--muted); text-align: center; }
.builder-row .input { padding: 9px 10px; font-size: 15px; }
.builder-row .prev { grid-column: 2 / -1; font-size: 12px; color: var(--muted); margin-top: -2px; }
.builder-head { display: grid; grid-template-columns: 28px minmax(0, 2.2fr) repeat(3, minmax(64px, .7fr)) minmax(0, 1.6fr) auto; gap: 8px; font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 10px; }
.row-actions { display: flex; gap: 2px; }
.row-actions button { border: 0; background: transparent; width: 30px; height: 30px; border-radius: 8px; color: var(--muted); display: grid; place-items: center; }
.row-actions button:hover { background: var(--surface-2); color: var(--ink); }
.row-actions svg { width: 16px; height: 16px; }
@media (max-width: 760px) {
  .builder-head { display: none; }
  .builder-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .builder-row .idx { display: none; }
  .builder-row .ex-in, .builder-row .note-in { grid-column: 1 / -1; }
  .builder-row .row-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .builder-row .prev { grid-column: 1 / -1; }
  .builder-row .mlabel { display: block !important; font-size: 11px; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
}
.mlabel { display: none; }
.pick-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-chips button { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; font-size: 14px; }
.pick-chips button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 4px; overflow-x: auto; }
.tabs a { padding: 10px 16px; font-weight: 700; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--brand-strong); border-color: var(--brand); }

/* ============ toast / modal ============ */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-weight: 700; z-index: 100;
  transition: opacity .2s, transform .2s; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
/* שמירה שנכשלה: פס קבוע למעלה, נשאר עד שהשמירה הבאה מצליחה (צבע קבוע, קריא בשני המצבים) */
#save-alert {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200; background: #9F2F26; color: #FFFFFF;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px; text-align: center; font-weight: 700; font-size: 15px; line-height: 1.4;
}
@media (max-width: 760px) { #toast { bottom: 96px; } }

.modal-bg { position: fixed; inset: 0; background: rgba(30, 20, 18, .42); z-index: 50; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); width: 100%; max-width: 440px; padding: 22px; animation: pop .18s; max-height: 90vh; overflow: auto; }
.modal h3 { font-size: 20px; margin-bottom: 6px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-start; margin-top: 18px; }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(6px) } }

.menu { position: absolute; top: calc(100% + 8px); left: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-lg); min-width: 200px; padding: 6px; z-index: 40; }
.menu button, .menu a { width: 100%; display: flex; gap: 10px; align-items: center; text-align: right; padding: 10px 12px; border: 0; background: transparent; border-radius: 8px; color: var(--ink); font-weight: 600; }
.menu button:hover, .menu a:hover { background: var(--surface-2); }

.fade-in { animation: fadeUp .25s ease-out; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px) } }

.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.soon .ic { width: 20px; height: 20px; color: var(--brand); margin-top: 1px; }
.addr .ic { width: 18px; height: 18px; }
.chip .ic, .pr .ic { width: 14px; height: 14px; }
td.num, th.num { display: table-cell; text-align: right; }
.sets { max-width: 560px; }
.jp-nav .small { white-space: nowrap; }
@media (max-width: 760px) {
  /* backdrop-filter יוצר containing block ושובר את הניווט הקבוע בתחתית */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .jp-nav .small { display: none; }
  .jp-head, .jp-body { padding-inline: 16px; }
  .jp-date { font-size: 22px; }
  .hero h1 { font-size: 28px; }
  .page-head h1 { font-size: 26px; }
  .card { padding: 16px; }
  .stat .value { font-size: 24px; }
  .ex-card { padding: 14px 12px; }
  .reps-input { width: 64px; }
}

/* ריבועים לחיצים */
.grid-4 { align-items: start; }
.stat.tap { position: relative; display: block; color: inherit; cursor: pointer; transition: border-color .15s, transform .1s, box-shadow .15s; }
.stat.tap:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); transform: translateY(-2px); }
a.stat.tap:focus-visible, .stat.tap summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 10px; }
.stat.tap summary { list-style: none; cursor: pointer; outline: none; }
.stat.tap summary::-webkit-details-marker { display: none; }
.tap-ic { position: absolute; top: 12px; left: 12px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); transition: transform .2s, background .15s, color .15s; }
.tap-ic .ic { width: 15px; height: 15px; vertical-align: 0; }
.stat.tap:hover .tap-ic, details.stat[open] .tap-ic { background: var(--brand-soft); color: var(--brand-strong); }
details.stat[open] .tap-ic { transform: rotate(180deg); }
details.stat[open] { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); transform: none; }
.more { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 14px; color: var(--ink-2); display: flex; flex-direction: column; gap: 2px; animation: fadeUp .2s ease-out; }
.more p { margin: 0 0 6px; }
.mrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0; color: var(--ink-2); }
a.mrow:hover { color: var(--brand-strong); }
.mrow b { color: var(--ink); font-weight: 700; text-align: left; }
.more .go { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-weight: 700; color: var(--brand-strong); }
.linkish { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; }
.hero.compact { padding: 22px 24px; margin-bottom: 18px; }
.hero.compact h1 { font-size: 30px; }
@media (max-width: 760px) { .hero.compact { padding: 18px; } .hero.compact h1 { font-size: 25px; } }
.gender-seg { display: grid; grid-template-columns: repeat(3, 1fr); }
.gender-seg button { padding: 9px 6px; }
.steps { display: flex; gap: 6px; margin: 18px 0 0; }
.steps span { height: 4px; flex: 1; border-radius: 4px; background: var(--line); }
.steps span.on { background: var(--brand); }

.bmi-legend { display: grid; grid-template-columns: 14fr 26fr 20fr 40fr; text-align: center; margin-top: 4px; direction: ltr; }
.bmi-legend span { direction: rtl; }

/* הוספה למסך הבית */
.install-banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-top: 16px; border-radius: var(--r); background: var(--brand-softer); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); }
.install-banner img { border-radius: 12px; flex: none; }
.install-banner .grow { flex: 1; min-width: 0; line-height: 1.35; }
.ib-x { border: 0; background: transparent; color: var(--muted); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; cursor: pointer; }
.ib-x:hover { background: var(--surface-2); color: var(--ink); }
.steps-h { display: flex; align-items: center; gap: 6px; font-size: 15px; margin: 18px 0 8px; }
.steps-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.steps-list li { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; font-size: 15px; }
.st-n { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; flex: none; }
.st-ic { color: var(--brand-strong); display: grid; place-items: center; flex: none; }
.st-ic .ic { width: 20px; height: 20px; }

/* הלוגו של GYM NEST */
.logo-mark { width: 44px; height: auto; display: block; }
.login-logo { width: 112px; height: auto; display: block; }
@media (max-width: 860px) { .login-logo { width: 84px; } }

/* כניסה מאובטחת */
.pin-input { text-align: center; font-size: 26px; letter-spacing: 14px; font-weight: 800; padding: 10px; }
.pin-input::placeholder { letter-spacing: 10px; color: var(--line); }
.demo-box { margin-top: 22px; padding: 14px; border-radius: var(--r-sm); background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.consent input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.privacy-list { margin: 10px 0 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; color: var(--ink-2); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* מיילים */
.modal.modal-wide { max-width: 680px; }
.em-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.em-nav { display: flex; align-items: center; gap: 6px; }
.em-frame { margin-top: 8px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; max-height: 60vh; overflow-y: auto; background: #FBF8F6; color: #2C2624; }
.mail-card { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.mail-card .mc-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; flex: none; }
.mail-card .mc-ic .ic { width: 22px; height: 22px; }
.mail-card .grow { flex: 1; min-width: 180px; }
.check-row { display: flex; gap: 10px; align-items: center; font-size: 15px; color: var(--ink-2); }
.check-row input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }

.btn-danger-solid { background: var(--bad); color: #fff; }
.btn-danger-solid:hover { filter: brightness(.92); }
/* ניהול מתאמנים */
.mg-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin-top: 14px; }
.mg-card { display: flex; flex-direction: column; gap: 12px; }
.mg-top { display: flex; gap: 12px; align-items: center; }
.mg-top .grow { flex: 1; min-width: 0; }
.mg-top .title { font-weight: 800; font-size: 17px; }
.mg-info { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.mg-info dt { color: var(--muted); }
.mg-info dd { margin: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.mg-actions .btn { flex: 1; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }

/* תוכנית לכל מתאמן באימון קבוצתי */
.plan-tabs { background: var(--brand-softer); border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line)); border-radius: var(--r-sm); padding: 12px; margin-bottom: 14px; }
.plan-n { font-size: 12px; font-weight: 700; color: var(--muted); }
.plan-n.empty { color: var(--bad); }
.pick-chips button.on .plan-n { color: var(--brand-strong); }

.back-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 16px; padding: 6px 10px 6px 4px; border: 0; background: none; color: var(--ink-2); font-weight: 700; font-size: 15px; border-radius: 999px; cursor: pointer; }
.back-link:hover { background: var(--surface-2); color: var(--ink); }

/* האימון הבא בכרטיס מתאמן */
.mg-next { background: var(--surface-2); border-radius: var(--r-sm); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.mg-next-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.mg-next-top b { font-size: 16px; }
.mg-next-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mg-next-actions .btn { flex: 1; }
.mg-next.big { background: none; padding: 0; }

/* ===== הרשמה לאימונים (בהשראת ארבוקס) ===== */
.one-col { max-width: 640px; margin-inline: auto; }
.mem-card { display: flex; flex-direction: column; gap: 12px; }
.mem-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.mem-top h3 { font-size: 20px; margin-top: 2px; }
.mem-bar { display: flex; gap: 4px; direction: rtl; }
.mem-bar span { flex: 1; height: 10px; border-radius: 4px; background: var(--surface-2); }
.mem-bar span.on { background: var(--brand); }
.mem-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.mem-nums div { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 6px; display: flex; flex-direction: column; }
.mem-nums b { font-size: 20px; font-weight: 800; }
.mem-nums span { font-size: 12px; color: var(--muted); }
.plan-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.plan-pick .btn { flex-direction: column; gap: 0; padding: 12px 6px; border-radius: var(--r-sm); white-space: normal; font-size: 13px; }
.plan-pick .btn b { font-size: 24px; }
.my-list { display: flex; flex-direction: column; gap: 8px; }
.my-booking { display: flex; align-items: center; gap: 12px; width: 100%; text-align: right; background: var(--surface-2); border: 0; border-radius: var(--r-sm); padding: 10px 12px; color: var(--ink); }
.my-booking:hover { background: var(--brand-soft); }
.my-booking .grow { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mb-date { width: 44px; height: 48px; border-radius: 12px; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; }
.mb-date b { font-size: 18px; line-height: 1; color: var(--brand-strong); }
.mb-date span { font-size: 11px; color: var(--muted); }
.day-strip { margin-top: 2px; }
.date-chip.closed { opacity: .45; }
.day-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 2px 10px; flex-wrap: wrap; }
.slots { display: flex; flex-direction: column; gap: 10px; }
.slot { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s; }
.slot:hover, .slot:focus-visible { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.slot.mine { border-color: var(--good); background: color-mix(in srgb, var(--good-soft) 50%, var(--surface)); }
.slot.past, .t-slot.past { opacity: .55; }
.slot-time { display: flex; flex-direction: column; align-items: center; min-width: 54px; flex: none; }
.slot-time b { font-size: 20px; font-weight: 800; }
.slot-time span { font-size: 12px; color: var(--muted); }
.slot-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.slot-tr { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.slot-regs { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.slot-act { flex: none; }
.av-stack { display: inline-flex; }
.av-stack .avatar { margin-inline-start: -6px; }
.av-stack .avatar:first-child { margin-inline-start: 0; }
.avatar.more { background: var(--surface-2); color: var(--ink-2); }
.cap { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.cap-bar { width: 56px; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; direction: rtl; }
.cap-bar span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.cm-cap { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; background: var(--surface-2); padding: 10px 12px; border-radius: var(--r-sm); }
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.people li { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.people li:last-child { border-bottom: 0; }
.people .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.people.compact { margin: 10px 0; }
.people.compact a { display: flex; align-items: center; gap: 8px; width: 100%; color: var(--ink); }
.people.compact .grow { flex-direction: row; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.t-slot { padding: 14px; }
.t-slot.mine { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.t-slot-head { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.t-slot-head .grow { flex: 1; min-width: 0; }
@media (max-width: 760px) { .nav a { padding: 6px 4px; font-size: 11px; } }

/* תוכנית אימונים */
.prog-bar:empty { display: none; }
.prog-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--brand-softer); border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line)); border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 12px; }
.pb-text { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.prog-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.prog-type { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.prog-type.next { background: var(--brand-soft); }
.prog-type .chip { align-self: flex-start; }
.mem-bar span.now { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand); }
.chip.tiny { font-size: 11px; padding: 1px 8px; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }

/* ===== מסך אימון בטלפון: + / −, טיימר מנוחה ===== */
.ex-card.current { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.ex-head h3 { display: flex; align-items: center; gap: 8px; }
.ex-num { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: inline-grid; place-items: center; font-size: 13px; font-weight: 800; flex: none; }
.ex-card.current .ex-num { background: var(--brand); color: #fff; }
.ex-ok { display: none; color: var(--good); }
.ex-card.done .ex-ok { display: inline-flex; }
.ex-card.done .ex-num { background: var(--good); color: #fff; }
.ex-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.set-grid { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; max-width: 560px; }
.sg-head, .set-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; }
.sg-head span { font-size: 12px; color: var(--muted); font-weight: 700; text-align: center; }
.set-prev { grid-column: 2 / -1; font-size: 12px; color: var(--muted); text-align: center; margin-top: -4px; }
.stepper { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface-2); direction: ltr; }
.st-btn { width: 44px; height: 50px; border: 0; background: transparent; font-size: 24px; font-weight: 700; color: var(--brand-strong); flex: none; touch-action: manipulation; }
.st-btn:active { background: var(--brand-soft); }
.st-input, .stepper .reps-input { flex: 1; min-width: 0; width: 100%; height: 50px; border: 0; border-radius: 0; background: transparent; text-align: center; font-size: 20px; font-weight: 800; padding: 0; direction: ltr; -moz-appearance: textfield; }
.st-input::-webkit-outer-spin-button, .st-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.st-input:focus { outline: none; }
.stepper:focus-within { border-color: var(--brand); }
.stepper:has(.reps-input.hit) { border-color: color-mix(in srgb, var(--good) 55%, transparent); background: var(--good-soft); }
.stepper:has(.reps-input.miss) { border-color: color-mix(in srgb, var(--warn) 55%, transparent); background: var(--warn-soft); }
.stepper:has(.reps-input.over) { border-color: color-mix(in srgb, var(--teal) 60%, transparent); background: color-mix(in srgb, var(--teal) 14%, transparent); }
.jp-progress { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.pbar { flex: 1; height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; direction: rtl; }
.pbar span { display: block; height: 100%; background: var(--good); border-radius: 999px; transition: width .3s; }
.jp-foot { position: sticky; bottom: 0; z-index: 6; }
.rest { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--brand-strong); font-size: 16px; }
.rest b { font-size: 22px; min-width: 52px; text-align: center; }
.rest .btn { padding: 4px 10px; }
@media (max-width: 760px) {
  .jp-foot { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); padding: 10px 14px; box-shadow: 0 -6px 18px rgba(0,0,0,.06); }
  .st-btn { width: 40px; }
}
/* ===== עורך תוכנית ל-8 שבועות ===== */
.pe-ex { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.pe-ex .mlabel { display: block; font-size: 11px; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.pe-row1 { display: grid; grid-template-columns: 24px minmax(0, 2.4fr) repeat(3, minmax(70px, .8fr)) auto; gap: 8px; align-items: end; }
.pe-row1 .idx { font-weight: 800; color: var(--muted); text-align: center; padding-bottom: 10px; }
.pe-row1 .input, .pe-row2 .input { padding: 9px 10px; font-size: 15px; }
.pe-row2 { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pe-row2 .input { flex: 1; min-width: 200px; }
.pe-weeks-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }
.pe-weeks { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(68px, 1fr); gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.pe-week { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); text-align: center; font-weight: 700; }
.pe-week small { display: block; font-size: 11px; font-weight: 500; }
.pe-week.now span { color: var(--brand-strong); }
.pe-week.now .input { border-color: var(--brand); }
.pe-week .input { padding: 8px 4px; text-align: center; font-weight: 700; }
.plan-pick .btn span { font-size: 12px; color: var(--muted); font-weight: 600; }
.plan-pick .btn b { font-size: 16px; }
@media (max-width: 760px) {
  .pe-row1 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pe-row1 .idx { display: none; }
  .pe-row1 .pe-name { grid-column: 1 / -1; }
  .pe-row1 .row-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

/* ===== "אני מאחר/ת" ===== */
.mb-wrap { display: flex; flex-direction: column; gap: 6px; }
.late-btn { background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); align-self: flex-start; }
.late-btn.on { background: var(--warn); color: #fff; }
.late-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.late-pick button { border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 10px 4px; font-size: 20px; font-weight: 800; display: flex; flex-direction: column; align-items: center; }
.late-pick button small { font-size: 12px; font-weight: 600; color: var(--muted); }
.late-pick button.on { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.late-banner { margin-top: 16px; border-radius: var(--r); border: 1.5px solid color-mix(in srgb, var(--warn) 45%, var(--line)); background: var(--warn-soft); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; animation: fadeUp .25s; }
.lb-head { font-size: 15px; color: var(--warn); }
.lb-row { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: var(--r-sm); padding: 8px 10px; }
.lb-row .grow { flex: 1; min-width: 0; }
/* overflow:hidden מבטל sticky; clip שומר על הפינות המעוגלות בלי לשבור את הכפתור הצמוד למטה */
.journal-page { overflow: clip; }
@media (max-width: 760px) {
  .ex-card { padding: 14px 10px; }
  .sg-head, .set-row { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
  .st-btn { width: 32px; font-size: 22px; }
  .st-input, .stepper .reps-input { font-size: 18px; }
}

/* ===== מילוי תוכניות ===== */
.pe-ex .input.missing, .pe-week .input.missing { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); background: color-mix(in srgb, var(--warn-soft) 70%, var(--surface)); }
.pe-sum { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; padding: 12px; border-radius: var(--r-sm); background: var(--surface-2); }
.pe-sum-txt { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 15px; }
.pg-list { display: flex; flex-direction: column; gap: 10px; }
.pg-row { padding: 14px; }
.pg-row summary { list-style: none; cursor: pointer; }
.pg-row summary::-webkit-details-marker { display: none; }
.pg-sum { display: flex; align-items: center; gap: 12px; position: relative; padding-inline-start: 0; }
.pg-sum .grow { flex: 1; min-width: 0; }
.pg-bar { display: flex; align-items: center; gap: 8px; margin-top: 6px; max-width: 320px; }
.pg-chips { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.pg-row .tap-ic { position: static; flex: none; }
.pg-row[open] .tap-ic { transform: rotate(180deg); background: var(--brand-soft); color: var(--brand-strong); }
.pg-grid { border-collapse: separate; border-spacing: 3px; font-size: 13px; min-width: 520px; }
.pg-grid th { font-size: 11px; color: var(--muted); font-weight: 700; padding: 2px 4px; }
.pg-grid th.now { color: var(--brand-strong); }
.pg-grid td { text-align: center; padding: 6px 4px; border-radius: 6px; font-weight: 700; direction: ltr; }
.pg-grid td.ex { text-align: right; font-weight: 700; color: var(--ink); white-space: nowrap; direction: rtl; padding-inline-end: 8px; }
.pg-grid td.ok { background: var(--good-soft); color: var(--good); }
.pg-grid td.miss { background: var(--warn-soft); color: var(--warn); }
.pg-grid td.now { box-shadow: inset 0 0 0 2px var(--brand); }
a.chip { text-decoration: none; }

/* המשקל שונה ממה שנכתב: רואים גם את המקורי */
.set-prev { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.set-prev .was:empty { display: none; }
.set-row.changed .stepper:not(.reps) { border-color: color-mix(in srgb, var(--warn) 55%, transparent); background: var(--warn-soft); }
.set-row.changed .was { color: var(--warn); font-weight: 700; }

/* ===== "סיימתי את התרגיל" ===== */
.ex-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 14px; max-width: 560px; }
.ex-done-btn { background: var(--surface-2); color: var(--ink-2); box-shadow: none; }
.ex-done-btn.ready { background: var(--good); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--good) 35%, transparent); animation: nudge 1.6s ease-in-out 2; }
@keyframes nudge { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .ex-done-btn.ready { animation: none; } }
.ex-sumrow { display: none; width: 100%; align-items: center; gap: 10px; border: 0; background: none; padding: 0; text-align: right; color: var(--ink); cursor: pointer; }
.ex-sumrow .ex-num { background: var(--good); color: #fff; }
.ex-sumrow .ex-num .ic { width: 14px; height: 14px; }
.ex-sumrow .grow { flex: 1; min-width: 0; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-card.collapsed { padding: 12px 14px; background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 35%, var(--line)); box-shadow: none; }
.ex-card.collapsed .ex-sumrow { display: flex; }
.ex-card.collapsed > .ex-head, .ex-card.collapsed > .set-grid, .ex-card.collapsed > .ex-foot { display: none; }

/* ===== טבלת סטים "כמו פעם": סט · משקל · חזרות רצוי · כמה עשית ===== */
.sets td.w { vertical-align: top; }
.sets .w-input { width: 76px; text-align: center; font-weight: 800; font-size: 17px; padding: 8px 4px; border-radius: 12px; border: 1.5px solid transparent; background: transparent; direction: ltr; color: var(--ink); -moz-appearance: textfield; }
.sets .w-input::-webkit-outer-spin-button, .sets .w-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.sets .w-input:hover { border-color: var(--line); }
.sets .w-input:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.sets tr.set-tr.changed .w-input { border-color: color-mix(in srgb, var(--warn) 55%, transparent); background: var(--warn-soft); color: var(--warn); }
.sets .was { display: block; font-size: 11px; color: var(--warn); font-weight: 700; line-height: 1.2; }
.sets .was:empty { display: none; }
.sets td.tgt { font-weight: 800; font-size: 17px; color: var(--ink-2); }
.sets .reps-input { width: 78px; height: 48px; font-size: 20px; }
@media (max-width: 760px) {
  .sets th { font-size: 11px; }
  .sets .w-input { width: 64px; font-size: 16px; }
  .sets .reps-input { width: 66px; }
}

.plan-chip { background: color-mix(in srgb, var(--teal) 16%, var(--surface)); color: color-mix(in srgb, var(--teal) 70%, var(--ink)); }
.pe-ex .input:disabled { background: var(--surface-2); color: var(--ink); border-color: transparent; opacity: 1; cursor: default; -webkit-text-fill-color: var(--ink); }
.pe-ex input[type=checkbox]:disabled + * , .pe-ex .check-row:has(input:disabled) { opacity: .7; }
.warn-t { color: var(--warn); font-weight: 700; font-size: 14px; }
.good-t { color: var(--good); font-weight: 700; }

/* ===== לוח בקרה: אימונים קרובים ===== */
.up-list { display: flex; flex-direction: column; gap: 10px; }
.up-day { font-weight: 800; font-size: 15px; color: var(--ink-2); margin: 8px 2px 0; }
.up-cls { padding: 12px 14px; }
.up-cls.mine { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.up-cls summary { list-style: none; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.up-cls summary::-webkit-details-marker { display: none; }
.up-cls summary .grow { flex: 1; min-width: 0; }
.up-cls .tap-ic { position: static; flex: none; }
.up-cls[open] .tap-ic { transform: rotate(180deg); background: var(--brand-soft); color: var(--brand-strong); }
.up-flags { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.up-people { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.up-person { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.up-p-top { display: flex; align-items: center; gap: 10px; }
.up-p-top .grow { flex: 1; min-width: 0; }
.up-p-top a { color: var(--ink); }
.up-chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.up-exs { display: flex; gap: 6px; flex-wrap: wrap; }
.up-ex { background: var(--surface); border-radius: 8px; padding: 3px 8px; font-size: 13px; }
.up-ex b { color: var(--brand-strong); }
.cm-plan { margin-top: 14px; background: var(--brand-softer); border-radius: var(--r-sm); padding: 4px 12px 8px; }
.cm-plan .steps-h { margin-top: 10px; }

/* ===== מי צריך תוכנית ל-8 השבועות הבאים ===== */
.need-card { margin-top: 16px; padding: 12px 14px; border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.need-card summary { list-style: none; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.need-card summary::-webkit-details-marker { display: none; }
.need-card summary .grow { flex: 1; min-width: 0; }
.need-card .mc-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); display: grid; place-items: center; flex: none; }
.need-card .tap-ic { position: static; flex: none; }
.need-card[open] .tap-ic { transform: rotate(180deg); }
.need-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.card.need-list { margin-top: 0; padding: 10px; }
.need-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); background: var(--surface-2); }
.need-row .grow { flex: 1; min-width: 0; }
.need-row a { color: var(--ink); }
.need-row .btn { color: inherit; }
.need-row .btn-primary { color: #fff; }

/* ===== הצעות משקל ===== */
.sug-card { margin-bottom: 14px; padding: 12px; border-radius: var(--r-sm); border: 1.5px solid color-mix(in srgb, var(--brand) 35%, var(--line)); background: var(--brand-softer); }
.sug-card summary { list-style: none; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.sug-card summary::-webkit-details-marker { display: none; }
.sug-card summary .grow { flex: 1; min-width: 0; }
.sug-card .mc-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; flex: none; }
.sug-card .tap-ic { position: static; flex: none; }
.sug-card[open] .tap-ic { transform: rotate(180deg); }
.sug-card .tbl-wrap { margin-top: 10px; background: var(--surface); border-radius: var(--r-sm); }
.sug-tbl td { vertical-align: top; }
.sug-tbl .sug-w { font-size: 18px; color: var(--brand-strong); }
.sug-tbl input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); }

/* ===== התוכנית המלאה, כמו הגיליון ===== */
.sheet { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sheet-wrap { border: 1px solid var(--line); border-radius: var(--r-sm); }
.sheet-tbl { border-collapse: collapse; font-size: 13px; min-width: 760px; width: 100%; font-variant-numeric: tabular-nums; }
.sheet-tbl th, .sheet-tbl td { border-bottom: 1px solid var(--line); border-inline-start: 1px solid var(--line); padding: 6px; text-align: center; vertical-align: middle; }
.sheet-tbl th { background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.sheet-tbl th small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.sheet-tbl th.now, .sheet-tbl td.now { background: var(--brand-softer); box-shadow: inset 0 0 0 1.5px var(--brand); }
.sheet-tbl .ex { text-align: right; min-width: 150px; position: sticky; right: 0; background: var(--surface); z-index: 1; }
.sheet-tbl th.ex { background: var(--surface-2); }
.sheet-tbl td.done { background: var(--good-soft); }
.sheet-tbl td.carry b { color: var(--muted); font-weight: 600; }
.sh-done { font-size: 11px; color: var(--good); font-weight: 700; direction: ltr; }
.sh-w { width: 60px; padding: 5px 4px; border: 1.5px solid var(--line); border-radius: 8px; text-align: center; font-weight: 700; background: var(--surface); color: inherit; }
.sh-w:focus { outline: none; border-color: var(--brand); }
.sheet-legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.lg { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid var(--line); }
.lg.now { background: var(--brand-softer); border-color: var(--brand); }
.lg.done { background: var(--good-soft); }
.lg.carry { background: var(--surface-2); }
/* "התחלת האימון" */
.start-next { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.start-next .grow { flex: 1; min-width: 200px; }
/* משקלים לפני אימון */
.pre-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.pre-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--surface-2); padding: 8px 10px; border-radius: var(--r-sm); }
.pre-in { display: flex; align-items: center; gap: 6px; flex: none; }
.pre-in .input { width: 84px; padding: 8px; text-align: center; font-weight: 800; }
.sheet-tbl .ex-meta { display: none; color: var(--ink-2); font-weight: 600; }
@media (max-width: 640px) {
  .sheet-tbl { min-width: 0; width: max-content; }
  .sheet-tbl .mt { display: none; }
  .sheet-tbl .ex-meta { display: block; }
  .sheet-tbl .ex { min-width: 128px; max-width: 150px; }
  .sheet-tbl th:not(.ex), .sheet-tbl td:not(.ex) { min-width: 64px; }
}

/* מספר טלפון שפותח שיחת וואטסאפ */
.wa-link { display: inline-flex; align-items: center; gap: 4px; color: var(--good); font-weight: 700; text-decoration: none; border-bottom: 1px dashed currentColor; }
.wa-link:hover { opacity: .85; }
.wa-link:focus-visible { outline: 2px solid var(--good); outline-offset: 2px; border-radius: 4px; }
.wa-link .ic { width: 15px; height: 15px; flex: none; }
/* מילוי תוכניות בטלפון: השם והפרטים מקבלים את כל השורה, והתגיות יורדות לשורה מתחת */
@media (max-width: 640px) {
  details.pg-row > .pg-sum { flex-wrap: wrap; }
  details.pg-row > .pg-sum > .tap-ic { order: 2; }
  details.pg-row > .pg-sum > .pg-chips { order: 3; flex-basis: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; padding-inline-start: 52px; }
}
.sug-tbl .sug-why-m { display: none; margin-top: 4px; }
@media (max-width: 640px) {
  .sug-tbl .sug-why { display: none; }
  .sug-tbl .sug-why-m { display: block; }
}
.nowrap { white-space: nowrap; }
@media (max-width: 640px) {
  .m-hide { display: none; }
  /* לוח בקרה: הכפתורים יורדים מתחת לשם, כדי שהשם והתגיות לא יידחסו */
  .up-p-top { flex-wrap: wrap; }
  .up-p-top > .grow { flex: 1 1 calc(100% - 52px); }
  .up-p-top > .btn { margin-inline-start: 42px; }
  .up-p-top > .btn ~ .btn { margin-inline-start: 0; }
  .sug-tbl.has-checks .sug-last { display: none; }
}

/* ===== סרטון הסבר לתרגיל ===== */
.vid-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--brand-strong); padding: 2px 10px 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.vid-link.own { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.vid-link:hover { border-color: var(--brand); }
.vid-link .ic { width: 15px; height: 15px; flex: none; }
.sh-vid { margin-top: 4px; }
.sh-vid .vid-link { font-size: 11px; padding: 1px 8px 1px 6px; }
.ltr-inline { direction: ltr; unicode-bidi: isolate; }

/* ===== בחירה מהספרייה ===== */
.in-lib { display: flex; gap: 6px; align-items: center; min-width: 0; }
.in-lib .input { flex: 1; min-width: 0; }
.lib-btn { flex: none; width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--brand-strong); display: grid; place-items: center; cursor: pointer; }
.lib-btn:hover { border-color: var(--brand); background: var(--brand-softer); }
.lib-btn .ic { width: 17px; height: 17px; }
.add-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.add-row .btn { flex: 1 1 200px; border-style: dashed; }
.xp { display: flex; flex-direction: column; gap: 10px; }
.xp-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.xp-cats button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-weight: 700; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.xp-cats button .num { color: var(--muted); font-weight: 600; font-size: 12px; }
.xp-cats button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.xp-list { max-height: min(46vh, 380px); overflow: auto; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.xp-gh { font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .03em; padding: 8px 8px 4px; }
.xp-item { width: 100%; display: flex; align-items: center; gap: 10px; text-align: right; border: 0; background: transparent; padding: 9px 10px; border-radius: 10px; cursor: pointer; color: inherit; font: inherit; }
.xp-item .grow { flex: 1; min-width: 0; }
.xp-item:hover { background: var(--brand-softer); }
.xp-item > .ic { width: 18px; height: 18px; color: var(--brand-strong); flex: none; }
.xp-tick { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line); display: grid; place-items: center; flex: none; color: transparent; }
.xp-tick .ic { width: 14px; height: 14px; }
.xp-item.on { background: var(--brand-soft); }
.xp-item.on .xp-tick { background: var(--brand); border-color: var(--brand); color: #fff; }
.xp-none { padding: 8px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.pre-pick { margin-top: 10px; }

/* ===== מסך "תרגילים" ===== */
.lib-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.lib-gh { font-size: 17px; margin-bottom: 4px; }
.lib-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.lib-row:first-of-type { border-top: 0; }
.lib-row .grow { flex: 1; min-width: 0; }
.lib-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }

/* ===== באימון: סט נוסף / תרגיל נוסף (מאמנים) ===== */
.set-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.set-tools .btn { border-style: dashed; }

/* ===== לוח בקרה: היום בסטודיו ===== */
.today-card { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.today-card.now { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.today-card.done { border-color: color-mix(in srgb, var(--good) 35%, var(--line)); }
.today-card .up-ex { background: var(--surface-2); }
.up-ex.ok { color: var(--good); }
.sp-list { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; max-height: min(50vh, 420px); overflow: auto; }
.sp-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: right; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 8px 10px; cursor: pointer; color: inherit; font: inherit; }
.sp-item .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sp-item:hover { border-color: var(--brand); background: var(--brand-softer); }
.sp-item > .ic { width: 18px; height: 18px; color: var(--muted); flex: none; }

/* ===== סטים ומשקלים לאימון ===== */
.pre-row .grow { flex: 1; }
.pre-sets { display: flex; align-items: center; gap: 4px; flex: none; }
.pre-sets button { width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 800; font-size: 17px; color: var(--brand-strong); cursor: pointer; line-height: 1; }
.pre-sets button:disabled { opacity: .35; cursor: default; }
.pre-sets b { min-width: 18px; text-align: center; }
.pre-sets small { color: var(--muted); font-size: 12px; }
@media (max-width: 640px) {
  .pre-row { flex-wrap: wrap; }
  .pre-row > .grow { flex-basis: 100%; }
  .pre-row.nw-row { flex-wrap: nowrap; align-items: flex-start; }
  .nw-row > .grow { flex: 1 1 0; }
  .nw-row .pre-in .input { width: 72px; }
}

/* ===== מה המתאמן/ת עשה/תה עד עכשיו (בבניית תוכנית) ===== */
.pe-hist { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-radius: 10px; background: var(--brand-softer); line-height: 1.6; }
.pe-hist:empty { display: none; }
.pe-hist .linkish { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; color: var(--brand-strong); }
.pe-hist .linkish .ic { width: 14px; height: 14px; }
.hist-card { margin-top: 16px; padding: 12px 14px; }
.hist-card summary { list-style: none; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.hist-card summary::-webkit-details-marker { display: none; }
.hist-card summary .grow { flex: 1; min-width: 0; }
.hist-card .mc-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; flex: none; }
.hist-card .tap-ic { position: static; flex: none; }
.hist-card[open] > summary .tap-ic { transform: rotate(180deg); }
.hist-exs { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow: auto; }
.hx-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--surface-2); }
.hx-name { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; text-align: right; border: 0; background: transparent; padding: 2px 0; cursor: pointer; color: inherit; font: inherit; }
.hx-name:hover b { color: var(--brand-strong); }
.past-list { display: flex; flex-direction: column; gap: 8px; }
.past-prog { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; }
.past-prog > summary { list-style: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer; }
.past-prog > summary::-webkit-details-marker { display: none; }
.past-prog > summary .tap-ic { position: static; margin-inline-start: auto; }
.past-prog[open] > summary .tap-ic { transform: rotate(180deg); }
.past-tbl td { vertical-align: top; }
.hist-spark { margin: 6px 0 10px; }
.hist-spark .spark { width: 100%; height: 44px; }
.hist-spark .small { display: flex; justify-content: space-between; }
.hist-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.hist-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.hist-w { display: flex; flex-direction: column; align-items: center; flex: none; min-width: 54px; }
.hist-w b { font-size: 18px; color: var(--brand-strong); }
.hist-w small { color: var(--muted); font-size: 11px; }

/* ===== בנק התרגילים: סינון לפי קבוצת שרירים ותבנית תנועה ===== */
.xp-filters { display: flex; flex-direction: column; gap: 8px; }
.xp-frow { display: flex; gap: 8px; align-items: flex-start; }
.xp-fl { flex: none; width: 88px; font-size: 12px; font-weight: 800; color: var(--muted); padding-top: 7px; }
.xp-frow .xp-cats { flex: 1; min-width: 0; }
.xp-meta { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.xp-hist { color: var(--good); font-weight: 700; }
.xp-hist .ic { width: 12px; height: 12px; vertical-align: -2px; }
.mu-pick button small { font-size: 10px; font-weight: 800; color: var(--brand-strong); background: var(--surface); border-radius: 6px; padding: 0 4px; }
@media (max-width: 640px) {
  .xp-frow { flex-direction: column; gap: 4px; }
  .xp-fl { width: auto; padding-top: 0; }
}

/* ===== ביצועי עבר: תקופות, הערות הצוות, גרף ===== */
.pe-vid { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hl-periods { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.periods { display: flex; flex-direction: column; gap: 6px; }
.period { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid transparent; }
.period.now { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); background: var(--brand-softer); }
.snotes { display: flex; flex-direction: column; gap: 6px; }
.snote { padding: 6px 10px; border-radius: 10px; background: var(--surface-2); }
.chart-box.xs { height: 160px; }
.perf-panel { margin-top: 8px; padding: 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }

/* ===== מעבר על האימון לפני שמגיעים ===== */
.pre-ex { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.pre-ex .pre-row { background: transparent; padding: 0; }
.pre-fields { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1.6fr); gap: 8px; }
.pre-fields label { display: flex; flex-direction: column; min-width: 0; }
.pre-fields .mlabel { font-size: 11px; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.pre-fields .input { padding: 7px 10px; font-size: 14px; background: var(--surface); }
.pre-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pre-tools .linkish { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--brand-strong); }
.pre-tools .linkish .ic { width: 15px; height: 15px; }
@media (max-width: 640px) {
  .pre-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pre-fields .pre-note { grid-column: 1 / -1; }
}

/* ===== סיכום הסייקל: תבניות תנועה וקבוצות שרירים ===== */
.mix-card { margin-bottom: 14px; padding: 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); }
.mix-card > summary { list-style: none; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.mix-card > summary::-webkit-details-marker { display: none; }
.mix-card > summary .grow { flex: 1; min-width: 0; }
.mix-card .mc-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; flex: none; }
.mix-card .tap-ic { position: static; flex: none; }
.mix-card[open] > summary .tap-ic { transform: rotate(180deg); }
.mix-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.mix-pats { display: flex; gap: 6px; flex-wrap: wrap; }
.mix-pat { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-strong); font-size: 13px; font-weight: 700; }
.mix-pat b { font-weight: 800; }
.mix-pat.zero { background: var(--surface-2); color: var(--muted); font-weight: 600; }
.mix-per { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; }
.mix-mus { display: flex; flex-direction: column; gap: 5px; }
.mix-row { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 13px; }
.mix-row.zero { color: var(--muted); }
.mix-name { font-weight: 700; }
.mix-bar { display: flex; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.mix-bar .p { background: var(--brand); }
.mix-bar .s { background: color-mix(in srgb, var(--brand) 35%, transparent); }
.mix-n { white-space: nowrap; }
.lg.mix-lg-p { background: var(--brand); border-color: var(--brand); }
.lg.mix-lg-s { background: color-mix(in srgb, var(--brand) 35%, transparent); }
.mix-empty { margin-bottom: 14px; padding: 10px 12px; border-radius: var(--r-sm); border: 1px dashed var(--line); display: flex; align-items: center; gap: 6px; }
@media (max-width: 760px) { .mix-grid { grid-template-columns: minmax(0, 1fr); } }

/* ===== אימון נוסף: בחירת תרגילים מהסייקל ===== */
.cp-list { display: flex; flex-direction: column; gap: 12px; max-height: 55vh; overflow: auto; }
.cp-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.cp-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); margin-top: 4px; cursor: pointer; }
.cp-item input { width: 18px; height: 18px; accent-color: var(--brand); margin-top: 2px; flex: none; }
.cp-item .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ===== באימון ===== */
.ex-note.tnote { background: var(--brand-softer); color: var(--ink); display: block; width: fit-content; max-width: 100%; }
.sets .set-n.opt { background: transparent; border: 1.5px dashed var(--line); color: var(--muted); }
.opt-l { display: block; font-size: 10px; color: var(--muted); font-weight: 700; margin-top: 1px; }
.ex-last .linkish { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: var(--brand-strong); }
.ex-last .linkish .ic { width: 14px; height: 14px; }
.miss-list { margin: 0 0 8px; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 4px; }

/* ===== מבט כללי: נפח שבועי ושיאים אישיים ===== */
.ov-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.vol-now { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.vol-now > b { font-size: 34px; font-weight: 800; color: var(--brand-strong); line-height: 1.1; }
.vol-bars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; align-items: end; height: 150px; margin-top: 14px; direction: ltr; }   /* הזמן מתקדם משמאל לימין, כמו בשאר הגרפים */
.vol-wrap { position: relative; }
.vol-col { display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; min-width: 0; padding: 0; margin: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; border-radius: 8px; -webkit-tap-highlight-color: transparent; }
.vol-col:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.vol-col.sel .vol-bar > span { background: var(--brand-strong); }
.vol-col.sel .vol-v, .vol-col.sel .vol-d { color: var(--brand-strong); font-weight: 800; }
.vol-tip { position: absolute; z-index: 2; direction: rtl; display: grid; gap: 1px; min-width: 108px; max-width: 170px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; line-height: 1.35; pointer-events: none; }
.vol-tip[hidden] { display: none; }
.vol-tip .vt-kg { font-size: 18px; font-weight: 800; color: var(--brand-strong); }
.vol-v { font-size: 11px; font-weight: 700; color: var(--muted); }
.vol-bar { flex: 1; width: 100%; max-width: 34px; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.vol-bar > span { display: block; width: 100%; background: color-mix(in srgb, var(--brand) 45%, var(--surface-2)); border-radius: 8px 8px 0 0; }
.vol-col.now .vol-bar > span { background: var(--brand); }
.vol-col.now .vol-v { color: var(--brand-strong); }
.vol-d { font-size: 10px; color: var(--muted); }
.pr-tbl td, .pr-tbl th { padding: 8px 6px; }
.pr-manual { margin-top: 10px; }
.pr-manual > summary { cursor: pointer; font-weight: 700; color: var(--brand-strong); }
.pr-m-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.pr-m-row .grow { flex: 1; min-width: 0; }
@media (max-width: 900px) { .ov-split { grid-template-columns: minmax(0, 1fr); } }

/* ===== השלמה אוטומטית בשם התרגיל ===== */
.in-lib { position: relative; }
.ex-sugg { position: absolute; top: calc(100% + 4px); inset-inline: 0; z-index: 40; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-lg); padding: 4px; max-height: 320px; overflow: auto; display: flex; flex-direction: column; gap: 1px; min-width: 220px; }
.ex-sugg button { width: 100%; display: flex; align-items: center; gap: 8px; text-align: right; border: 0; background: transparent; padding: 8px 10px; border-radius: 9px; cursor: pointer; color: inherit; font: inherit; font-size: 14px; }
.ex-sugg button .grow { flex: 1; min-width: 0; }
.ex-sugg button:hover, .ex-sugg button.kb { background: var(--brand-softer); }
.ex-sugg .sg-new { padding: 8px 10px; border-top: 1px dashed var(--line); }
/* בחיפוש, הכי מתאים למעלה (גם בתוך כל קבוצה) */
.xp-group { display: flex; flex-direction: column; }
.xp-group > .xp-gh { order: -1000; }
.lib-group { display: flex; flex-direction: column; }
.lib-group > .lib-gh { order: -1000; }

/* ===== הערה לכל תרגיל באימון ===== */
.ex-notes { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.exn { display: flex; flex-direction: column; }
.exn .mlabel { font-size: 11px; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.exn .input { padding: 8px 10px; font-size: 14px; }
.exn-ro { background: var(--surface-2); padding: 6px 10px; border-radius: 10px; }

/* ===== בבחירת תרגיל: מתי המתאמן/ת עשה/תה אותו ובאיזה משקל ===== */
.xp-perf { display: block; font-size: 12px; margin-top: 2px; }
.xp-perf .xp-hist { font-weight: 600; }
.xp-perf .xp-hist b { font-weight: 800; }
.xp-never { color: var(--muted); }
.xp-never::before { content: '○ '; }
.xp-item.never b { font-weight: 700; }
.xp-frow .xp-cats [data-h] .ic { width: 13px; height: 13px; vertical-align: -2px; }

/* ===== סיום אימון כשחסר משהו: הכפתור "לסיים בכל זאת" והתרגילים החסרים ===== */
.btn.armed { background: var(--warn); box-shadow: none; }
.btn.armed:hover { background: color-mix(in srgb, var(--warn) 85%, #000); }
.ex-card.missing { border-color: color-mix(in srgb, var(--warn) 65%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 16%, transparent); }
.ex-card.missing .ex-sumtxt::after { content: ' · חסר'; color: var(--warn); font-weight: 800; }

/* ===== ייבוא נתונים קיימים: רשימת מתאמנים ותוכניות מהגיליונות ===== */
.im-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.im-steps { margin: 0 0 4px; padding-inline-start: 20px; display: grid; gap: 4px; color: var(--ink-2); line-height: 1.55; }
.im-paste { margin-top: 12px; }
.im-paste summary { cursor: pointer; color: var(--brand); font-weight: 700; width: fit-content; }
.im-paste-body { display: grid; gap: 8px; margin-top: 8px; }
.im-sum { margin: 12px 0 8px; }
.im-tbl td { padding: 8px 10px; font-size: 14px; }
.im-list { display: grid; gap: 10px; margin-top: 12px; }
.im-card { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; display: grid; gap: 6px; background: var(--surface); min-width: 0; }
.im-card.bad { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.im-card.off { opacity: .55; }
.im-name { overflow-wrap: anywhere; }
.im-row { display: flex; gap: 10px; flex-wrap: wrap; }
.im-field { display: grid; gap: 4px; flex: 1 1 200px; min-width: 0; }
.im-field select.need { border-color: var(--warn); }
.im-res { display: grid; gap: 6px; margin-top: 12px; }
.im-done { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-sm); background: var(--good-soft); color: var(--ink); font-size: 14px; margin-top: 10px; }
.im-res .im-done { margin-top: 0; }
.im-done > .ic { color: var(--good); flex: none; margin-top: 2px; }
.im-done.bad { background: var(--bad-soft); }
.im-done.bad > .ic { color: var(--bad); }
