:root {
  --bg: #12100c;
  --bg2: #1a1712;
  --line: #3a3428;
  --txt: #f7f1e6;
  --muted: #b5a791;
  --accent: #e8a54b;
  --work: #7dcf8a;
  --rest: #e8a54b;
  --danger: #e07474;
  --card: #17140f;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --font: "Vazirmatn", Tahoma, sans-serif;
  --display: "Space Grotesk", "Vazirmatn", sans-serif;
}
* { box-sizing: border-box; }
html, /* v168 anti-zoom */
html, body {
  touch-action: manipulation;
  -ms-touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
}
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(900px 480px at 90% -10%, #3a2a14 0%, transparent 55%),
    radial-gradient(700px 420px at -10% 110%, #1e2a22 0%, transparent 50%),
    var(--bg);
  color: var(--txt);
  font: 500 16px/1.7 var(--font);
  -webkit-tap-highlight-color: transparent;
}
#app {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(12px + var(--safe-top)) 14px calc(28px + var(--safe-bot));
  min-height: 100dvh;
}
.top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.brand {
  font-family: var(--display);
  font-size: clamp(32px, 8vw, 44px);
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1;
}
.brand span { color: var(--accent); }
.app-ver {
  margin-inline-start: auto;
  font: 800 12px var(--display);
  color: var(--muted);
  opacity: .85;
  letter-spacing: .04em;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.mute-btn {
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--txt);
  border-radius: 12px;
  padding: 0;
  width: 44px;
  height: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.mute-btn .mute-ico { display: grid; place-items: center; line-height: 0; }
.mute-btn .ico-off { display: none; }
.mute-btn.is-muted .ico-on { display: none; }
.mute-btn.is-muted .ico-off { display: block; }
.mute-btn.is-muted {
  color: #1a1208;
  background: var(--accent);
  border-color: var(--accent);
}
.mute-btn:active { transform: scale(0.98); }
/* tabs below */
/* tabs replaced */
.view { display: none; }
.view.on { display: block; }
.home-head {
  display: flex;
  justify-content: center;
  padding: 10px 0 16px;
}
.btn-hero {
  width: min(86vw, 300px);
  min-height: 84px;
  border: 0;
  border-radius: 22px;
  background: linear-gradient(155deg, #f0b75a 0%, #d4892e 55%, #b56a18 100%);
  color: #1a1208;
  font: 900 clamp(28px, 8vw, 40px) var(--font);
  box-shadow: 0 0 0 4px rgba(232, 165, 75, .18), 0 14px 28px rgba(0, 0, 0, .35);
  cursor: pointer;
}
.btn-hero:active { transform: scale(.98); }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  display: grid;
  gap: 10px;
}
.set-panel {
  gap: 12px;
  padding: 16px;
  border-color: rgba(232, 165, 75, 0.28);
}
.set-panel .panel-title {
  font: 900 clamp(18px, 4.6vw, 22px) var(--font);
  color: var(--text, #f3ebe0);
  margin: 0;
}
.panel-hint {
  margin: -4px 0 0;
  font: 700 13px/1.45 var(--font);
  color: var(--muted);
}
.set-summary { display: none !important; /* v168 removed */

  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(232, 165, 75, 0.18), rgba(232, 165, 75, 0.06));
  border: 1px solid rgba(232, 165, 75, 0.35);
  font: 900 clamp(15px, 3.8vw, 18px)/1.4 var(--font);
  color: #f6d7a4;
  letter-spacing: -0.01em;
}
.set-field {
  display: grid;
  gap: 6px;
  margin: 0;
}
.set-field .field-k {
  font-size: clamp(14px, 3.6vw, 16px);
  font-weight: 900;
  color: var(--text, #f3ebe0);
  line-height: 1.35;
}
.set-field .field-sub {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  opacity: 0.9;
}
.set-field.rest-lbl {
  margin-top: 2px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 420px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}
.empty {
  margin: 12px 0 0;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.empty[hidden] { display: none; }
.row-form {
  display: grid;
  grid-template-columns: 1fr minmax(132px, 150px) auto;
  gap: 8px;
  margin-bottom: 12px;
  align-items: stretch;
}
#addToSetForm #btnAddToSet {
  width: 100%;
}
.add-set-form {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.field-block {
  display: grid;
  gap: 6px;
  margin: 0;
}
.field-k {
  font-size: 13px;
  font-weight: 900;
  color: var(--muted);
}
/* تمام‌عرض + تپل؛ فونت ۱۶ تا گوشی زوم نکند */
.add-set-form .field-block:has(#pickFromLib),
.add-set-form .field-block:has(#pickMoveName) {
  justify-items: stretch;
  width: 100%;
  max-width: none;
  margin-inline: 0;
  text-align: start;
}
.add-set-form .select-wrap {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}
.add-set-form select,
.add-set-form input[type="text"] {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  display: block;
  min-height: 54px;
  height: 54px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg2, #17130e);
  color: inherit;
  font: inherit;
  font-size: 16px; /* کمتر از ۱۶ = زوم آی‌او‌اس/اندروید */
  font-weight: 700;
  padding: 12px 14px;
  box-sizing: border-box;
  line-height: 1.25;
  touch-action: manipulation;
}
.add-set-form input[type="text"]::placeholder {
  font-size: 16px;
  opacity: 0.5;
}
.num-step.with-unit {
  grid-template-columns: 44px 1fr 44px auto;
  align-items: center;
}
.unit-lbl {
  font-size: 14px;
  font-weight: 900;
  color: var(--accent);
  padding-inline: 6px 2px;
  white-space: nowrap;
}
.num-step {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 4px;
  align-items: stretch;
  min-width: 0;
  direction: ltr; /* فیزیکی: چپ − ، راست + */
}
.num-step input[type="number"] {
  text-align: center;
  padding-inline: 6px;
  min-width: 0;
  /* hide native spinners — we use +/- buttons */
  -moz-appearance: textfield;
  appearance: textfield;
}
.num-step input[type="number"]::-webkit-outer-spin-button,
.num-step input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.num-btn {
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--txt);
  border-radius: 12px;
  font: 900 22px/1 var(--display);
  min-height: 48px;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.num-btn:focus,
.num-btn:focus-visible {
  outline: none;
  background: var(--bg2);
  color: var(--txt);
  border-color: var(--line);
}
.num-btn.is-press {
  background: var(--accent);
  color: #1a1208;
  border-color: var(--accent);
}
@media (hover: hover) and (pointer: fine) {
  .num-btn:active {
    background: var(--accent);
    color: #1a1208;
    border-color: var(--accent);
  }
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.grid2 label, .rest-lbl {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
input[type="text"], input[type="number"] {
  width: 100%;
  background: #100e0a;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--txt);
  font: 700 16px var(--font);
  padding: 12px;
}
.btn {
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--txt);
  border-radius: 12px;
  padding: 10px 14px;
  font: 800 14px var(--font);
  cursor: pointer;
}
.btn.block { width: 100%; margin: 6px 0; }
.btn.primary { background: var(--accent); color: #1a1208; border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { background: #2a1414; color: var(--danger); border-color: #5a2a2a; }
.btn.sm { padding: 8px 12px; font-size: 13px; min-height: 44px; }
.btn.big { flex: 1; min-height: 52px; font-size: 15px; }
.btn:active { transform: scale(.98); }
.actions { margin-top: 8px; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.list:empty { display: none; }
.list li {
  background: #100e0a;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px 12px;
  display: grid;
  gap: 10px;
}
.list .row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.list .title { font-weight: 900; font-size: clamp(18px, 4.6vw, 21px); line-height: 1.35; }
.list .meta { color: var(--muted); font-size: clamp(14px, 3.6vw, 16px); font-weight: 700; line-height: 1.45; }
.seq { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; counter-reset: ex; }
.seq li {
  background: #100e0a;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  counter-increment: ex;
}
.seq .nm::before {
  content: counter(ex) ". ";
  color: var(--accent);
  font-weight: 900;
}
.seq .nm { font-weight: 800; font-size: clamp(16px, 4.2vw, 18px); line-height: 1.4; }
.seq .mt { color: var(--muted); font-size: clamp(13px, 3.4vw, 15px); font-weight: 700; }

#view-run {
  position: fixed;
  inset: 0;
  z-index: 40;
  background:
    radial-gradient(800px 500px at 50% 0%, #2a2114 0%, transparent 60%),
    var(--bg);
  display: none;
  flex-direction: column;
  padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bot));
}
#view-run.on { display: flex; }
.run-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  gap: 0;
  overflow: hidden;
  padding-top: 6px;
  padding-bottom: 2px;
  padding-inline: 10px;
  /* فونت‌ها نسبت به ارتفاع صفحه بزرگ می‌مانند ولی اسکرول نمی‌خورند */
  --run-name: clamp(34px, 7dvh, 56px);
  --run-timer: clamp(88px, 18dvh, 152px);
  --run-frac: clamp(34px, 7.5dvh, 52px);
  --run-next: clamp(26px, 5.2dvh, 42px);
  --run-phase: clamp(16px, 3.2dvh, 22px);
}
.run-stage.work { --glow: var(--work); }
.run-stage.rest { --glow: var(--rest); }
.run-stage.rest .frac {
  font-size: clamp(28px, 8vw, 44px);
  opacity: .85;
}
.run-stage.rest .frac-lbl {
  font-size: 12px;
  margin-bottom: 0;
}
.progress-box {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  width: calc(100% - 16px);
  max-width: 380px;
  margin: 6px auto 8px;
  padding: 0;
  flex-shrink: 0;
  overflow: visible;
  box-sizing: border-box;
}
.progress-item {
  background: #17130e;
  border: 2px solid rgba(232, 165, 75, 0.48);
  border-radius: 14px;
  padding: 10px 6px 12px;
  min-height: 4.8rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  overflow: hidden;
}
.progress-k {
  font-size: 13px;
  font-weight: 900;
  color: var(--muted);
  margin-bottom: 4px;
  line-height: 1.1;
}
.progress-v {
  font-family: var(--display);
  font-size: clamp(30px, 7.5dvh, 42px);
  font-weight: 800;
  line-height: 1;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: center;
  width: 100%;
}
.progress-v span { color: var(--muted); margin: 0 .06em; }
.progress-item[hidden] { display: none !important; }
.run-stage.rest .phase {
  font-size: var(--run-phase);
  margin-bottom: 0;
}
.run-stage.rest .timer-big {
  /* v168-rest-timer */
  font-size: clamp(84px, 18dvh, 148px);
  margin: 2px 0 4px;
}
.run-stage.rest .move-big {
  display: block;
  font-size: var(--run-name);
  color: #f0b75a;
}
.run-stage.rest .sub {
  display: block;
  font-size: var(--run-phase);
  color: #f0b75a;
  font-weight: 900;
}
.frac {
  font-family: var(--display);
  font-size: var(--run-frac);
  font-weight: 700;
  line-height: .95;
  letter-spacing: .02em;
  color: var(--txt);
  direction: ltr;
  unicode-bidi: isolate;
}
.frac span { color: var(--muted); margin: 0 .08em; }
.frac-lbl {
  font-size: 13px;
  font-weight: 900;
  color: var(--muted);
  margin-bottom: 2px;
}
.phase {
  font-size: var(--run-phase);
  font-weight: 900;
  color: var(--glow, var(--accent));
  letter-spacing: .04em;
  flex-shrink: 0;
}
.move-count {
  font-family: var(--display);
  font-size: var(--run-frac);
  font-weight: 700;
  color: var(--txt);
  margin: 0;
  letter-spacing: .02em;
  line-height: 1.05;
}
.move-count[hidden] { display: none !important; }
.move-big {
  font-size: var(--run-name);
  font-weight: 900;
  margin: 2px 0 4px;
  max-width: 94vw;
  line-height: 1.15;
  word-break: break-word;
  flex-shrink: 1;
  min-height: 0;
}
.timer-big {
  font-family: var(--display);
  font-size: var(--run-timer);
  font-weight: 600;
  line-height: .88;
  letter-spacing: -0.04em;
  color: var(--glow, var(--accent));
  direction: ltr;
  unicode-bidi: isolate;
  text-shadow: 0 0 22px color-mix(in srgb, var(--glow, var(--accent)) 32%, transparent);
  margin: 0 0 4px;
  flex-shrink: 0;
}
.sub {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}
.next-card {
  margin-top: 4px;
  margin-left: auto;
  margin-right: auto;
  width: min(94vw, 400px);
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
  position: relative;
  flex-shrink: 1;
  min-height: 0;
  align-self: center;
  background: #1a1510;
  border: 2px solid var(--accent);
  border-radius: 14px;
  padding: 10px 12px 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .3);
}
.next-card[hidden] { display: none !important; }
.run-stage.rest .next-card {
  margin-top: 4px;
  border-color: #f0b75a;
  background: linear-gradient(180deg, #2a2114 0%, #17130e 100%);
}
.flow {
  display: grid;
  gap: 4px;
  justify-items: stretch;
}
.flow-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  align-items: center;
  text-align: right;
  padding: 8px 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 0;
}
.flow-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 900 16px var(--display);
  color: #1a1208;
  background: var(--accent);
  direction: ltr;
}
#flowRow2 .flow-num {
  background: var(--work);
}
.flow-txt {
  font-size: var(--run-next);
  font-weight: 900;
  line-height: 1.2;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
}
.flow-arrow {
  font-size: var(--run-phase);
  font-weight: 900;
  color: #f0b75a;
  line-height: 1.15;
  direction: rtl;
  text-align: center;
  width: 100%;
  padding: 2px 0;
}
.flow-arrow-lead {
  font-size: clamp(22px, 4.5dvh, 34px);
  margin-bottom: 2px;
  color: #f0b75a;
  animation: nextPulse 1.2s ease-in-out infinite;
}
.next-label {
  font-size: var(--run-phase);
  font-weight: 900;
  color: #f0b75a;
  letter-spacing: .04em;
  margin-bottom: 2px;
}
.next-label[hidden] {
  display: none !important;
}
.next-card.is-rest-next .flow-arrow-lead {
  display: block !important;
}
.next-card.is-next-only .flow-row:first-of-type .flow-txt,
.next-card.is-rest-next #flowRow2 .flow-txt {
  color: #f0b75a;
  font-weight: 900;
}
.next-card.is-rest-next .flow-row:first-of-type .flow-txt {
  color: #f0b75a;
  font-weight: 800;
}
@keyframes nextPulse {
  0%, 100% { opacity: 1; transform: translateY(0); }
  50% { opacity: .55; transform: translateY(4px); }
}
.flow-arrow[hidden],
.flow-row[hidden] {
  display: none !important;
}
.run-bar {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-shrink: 0;
}
.run-bar .btn.big {
  min-height: 48px;
  font-size: 15px;
  padding: 10px 8px;
}
#btnAddToSet {
  white-space: nowrap;
  min-width: max-content;
}
@media (max-width: 420px) {
  .row-form #btnAddToSet,
  .add-set-form #btnAddToSet { width: 100%; }
}
.done-card {
  text-align: center;
  padding: 28px 14px 36px;
  max-width: 520px;
  margin: 0 auto;
}
.done-kicker {
  font: 800 13px var(--font);
  color: var(--accent);
  margin-bottom: 6px;
}
.done-frac { margin-bottom: 10px; }
.done-msg {
  margin: 0 0 16px;
  font-size: clamp(16px, 4.4vw, 22px);
  font-weight: 900;
  color: var(--txt);
  line-height: 1.45;
}
.done-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
  text-align: start;
}
.done-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 12px 10px;
}
.done-tile-v {
  font: 900 clamp(18px, 4.5vw, 22px)/1.2 var(--font);
  color: #f6d7a4;
}
.done-tile-k {
  margin-top: 4px;
  font: 800 12px var(--font);
  color: var(--muted);
}
.done-chart-wrap {
  text-align: start;
  margin: 0 0 14px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(232, 165, 75, 0.28);
  background: rgba(232, 165, 75, 0.06);
}
.done-chart-title {
  font: 900 14px var(--font);
  margin-bottom: 10px;
  color: var(--txt);
}
.done-chart {
  display: grid;
  gap: 10px;
}
.done-bar-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: stretch;
}
.done-bar-name {
  font: 800 15px/1.35 var(--font);
  color: var(--txt);
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  word-break: break-word;
}
.done-bar-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.done-bar-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.done-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e8a54b, #f0c27a);
  min-width: 8px;
}
.done-bar-sec {
  font: 800 12px/1.35 var(--font);
  color: var(--muted);
  white-space: normal;
  text-align: start;
  max-width: 46vw;
}
.done-moves {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  text-align: start;
  display: grid;
  gap: 6px;
}
.done-moves li {
  font: 700 13px/1.4 var(--font);
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}
.done-card .btn {
  margin-top: 4px;
}
@media (max-width: 420px) {
  .row-form { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
}

.row-form select {
  flex: 1 1 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line, #3a342c);
  background: var(--panel, #1a1612);
  color: inherit;
  font: inherit;
  padding: 8px 12px;
}

/* v25 units + center */
.num-step.with-unit {
  grid-template-columns: 44px minmax(0, 1fr) 44px auto !important;
  align-items: center;
}
.unit-lbl {
  font-size: 15px !important;
  font-weight: 900 !important;
  color: var(--accent) !important;
  white-space: nowrap;
  min-width: 2.8em;
}
.grid2 .num-step.with-unit .unit-lbl {
  font-size: 14px !important;
}
.run-stage .next-card {
  align-self: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: min(92vw, 360px) !important;
  max-width: 100% !important;
}
.run-stage .next-card .flow {
  justify-items: center;
  width: 100%;
}
.run-stage .next-card .flow-row {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  grid-template-columns: 36px 1fr;
  justify-content: center;
}
.run-stage .next-card .flow-txt {
  text-align: center;
}

/* v28 select: هم‌سبک بقیه؛ فلش واضح برای انتخاب */
.select-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.pick-select,
#pickFromLib.pick-select {
  width: 100% !important;
  max-width: none !important;
  min-height: 54px !important;
  height: 54px !important;
  border-radius: 14px !important;
  border: 1px solid var(--line) !important;
  background: var(--bg2, #17130e) !important;
  color: inherit !important;
  font: inherit !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  padding: 12px 40px 12px 14px !important;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  line-height: 1.25;
  touch-action: manipulation;
}
#pickMoveName {
  font-size: 16px !important;
  font-weight: 700 !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 54px !important;
  height: 54px !important;
  padding: 12px 14px !important;
  border-radius: 14px !important;
  touch-action: manipulation;
}
#pickMoveName::placeholder {
  font-size: 16px !important;
  opacity: 0.5;
}
/* صفحه حرکت‌ها هم بدون زوم */
#moveName {
  font-size: 16px !important;
  min-height: 48px;
  touch-action: manipulation;
}
.pick-select:focus {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(232, 165, 75, .25);
}
.select-chev {
  position: absolute;
  inset-inline-end: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  line-height: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
  opacity: 0.95;
}
.select-chev svg {
  display: block;
  width: 16px;
  height: 16px;
  color: #fff;
  stroke: #fff;
}
.next-card.is-rest-next,
.next-card.is-next-only {
  border-color: #f0b75a !important;
  box-shadow: 0 0 0 1px rgba(240, 183, 90, .35), 0 12px 28px rgba(0, 0, 0, .4);
}
.next-card.is-rest-next .flow-arrow-lead,
.next-card.is-next-only .flow-arrow-lead {
  display: block !important;
  font-size: clamp(40px, 12vw, 56px);
  color: #f0b75a;
  margin-bottom: 6px;
}


.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  width: 100%;
  flex: 1 1 100%;
  margin-top: 6px;
}
.tabs button {
  flex: 1 1 0;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--muted);
  border-radius: 14px;
  padding: 12px 10px;
  font: 800 15px var(--font);
  min-height: 48px;
}
.tabs button.on {
  color: #1a1208;
  background: var(--accent);
  border-color: var(--accent);
}
.list .row.actions-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 8px;
  width: 100%;
}
.list .row.actions-row .btn {
  width: 100%;
  margin: 0;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}
.list .row.actions-row .btn.primary {
  font-weight: 900;
}

/* v168 move memory chips + done polish */
.move-suggest-wrap {
  display: grid;
  gap: 8px;
  margin: 2px 0 4px;
}
.move-suggest-k {
  font: 800 12px var(--font);
  color: var(--muted);
}
.move-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.move-suggest[hidden] { display: none !important; }
.move-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid rgba(232, 165, 75, 0.35);
  background: rgba(232, 165, 75, 0.1);
  color: #f6d7a4;
  border-radius: 999px;
  padding: 0;
  max-width: 100%;
  overflow: hidden;
}
.move-chip-pick {
  border: 0;
  background: transparent;
  color: inherit;
  font: 800 13px var(--font);
  padding: 8px 10px 8px 12px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.move-chip-x {
  border: 0;
  background: rgba(0, 0, 0, 0.22);
  color: #f0e6d8;
  font: 900 16px/1 var(--font);
  width: 34px;
  height: 34px;
  margin: 2px 2px 2px 0;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.move-chip-pick:active {
  color: #1a1208;
}
.move-chip:has(.move-chip-pick:active) {
  background: var(--accent);
  border-color: var(--accent);
}
.move-chip-x:active {
  background: #b33;
  color: #fff;
}
.done-card {
  background: #14110d;
  border: 1px solid rgba(232, 165, 75, 0.22);
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.done-tiles {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 420px) {
  .done-tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.done-tile-k {
  letter-spacing: 0;
}
.flow-txt {
  font-weight: 900;
}

/* v169 done dashboard */
.done-card {
  padding: 22px 14px 28px;
  text-align: stretch;
}
.done-kicker {
  font: 900 clamp(14px, 3.8vw, 18px) var(--font);
  color: var(--accent);
}
.done-frac {
  font-size: clamp(42px, 11vw, 64px) !important;
  font-weight: 900;
  margin: 8px 0 10px;
}
.done-msg {
  font-size: clamp(20px, 5.5vw, 28px) !important;
  margin-bottom: 18px;
}
.done-tiles {
  gap: 10px;
  margin-bottom: 18px;
}
.done-tile {
  padding: 14px 12px 12px;
  border-radius: 16px;
}
.done-tile-v {
  font: 900 clamp(22px, 6vw, 30px)/1.15 var(--font) !important;
}
.done-tile-k {
  font: 800 clamp(13px, 3.4vw, 15px) var(--font) !important;
  margin-top: 6px;
}
.done-anatomy-wrap {
  text-align: start;
  margin: 0 0 16px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(232, 165, 75, 0.3);
  background: linear-gradient(160deg, rgba(232,165,75,.12), rgba(20,17,13,.9));
}
.done-anatomy {
  display: flex;
  justify-content: center;
  margin: 8px 0 12px;
}
.anatomy-svg {
  width: min(100%, 220px);
  height: auto;
  display: block;
}
.done-insight {
  margin: 0 0 12px;
  font: 800 clamp(15px, 4vw, 18px)/1.55 var(--font);
  color: #f3ebe0;
}
.done-muscles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.done-muscles li {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,.25);
  border: 1px solid var(--line);
}
.mus-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.mus-name {
  font: 900 clamp(15px, 4vw, 18px) var(--font);
  color: #f6d7a4;
}
.mus-pct {
  font: 800 12px var(--font);
  color: var(--muted);
}
.mus-track {
  margin-top: 8px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.mus-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e8a54b, #f0c27a);
}
.mus-tip {
  margin-top: 8px;
  font: 700 13px/1.45 var(--font);
  color: var(--muted);
}
.done-chart-title {
  font: 900 clamp(16px, 4.2vw, 20px) var(--font) !important;
}
.done-bar-name {
  font: 800 clamp(15px, 4vw, 18px)/1.35 var(--font) !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
}
.done-bar-sec {
  font: 800 clamp(12px, 3.2vw, 14px)/1.35 var(--font) !important;
  white-space: normal !important;
  max-width: none;
}
.done-moves li {
  font: 800 clamp(14px, 3.6vw, 16px)/1.45 var(--font) !important;
}

/* v171 progress sub */
#runSub {
  min-height: 1.2em;
  font: 900 clamp(18px, 4.5vw, 26px) var(--font);
  color: #f6d7a4;
}

/* v172 finale */
.done-emoji {
  font-size: clamp(48px, 14vw, 72px);
  line-height: 1;
  margin: 4px 0 8px;
  filter: drop-shadow(0 8px 18px rgba(232, 165, 75, 0.35));
}
.next-card.is-finale {
  border-color: rgba(232, 165, 75, 0.55);
  background: linear-gradient(160deg, rgba(232,165,75,.2), rgba(20,17,13,.92));
}
.next-card.is-finale .next-label {
  color: var(--accent);
  font-weight: 900;
}
.next-card.is-finale #flow1 {
  font-size: clamp(22px, 5.5vw, 32px);
}

/* v175 equal cards + clear frame */
.progress-item.overall {
  border-color: rgba(232, 165, 75, 0.55);
  background: linear-gradient(160deg, rgba(232,165,75,.14), #17130e);
}
.progress-item.overall .progress-k {
  color: var(--accent);
}
.progress-item.overall {
  border-color: rgba(232, 165, 75, 0.7);
}
.progress-item.overall .overall-v,
.progress-v.overall-v {
  font-family: var(--display) !important;
  font-size: clamp(30px, 7.5dvh, 42px) !important;
  font-weight: 800 !important;
  color: #f6d7a4 !important;
  letter-spacing: 0;
  direction: ltr !important;
  unicode-bidi: isolate;
  text-align: center;
}
#runSub {
  color: #f0c27a;
  font-size: clamp(28px, 6.5vw, 40px) !important;
  font-weight: 900 !important;
  min-height: 0;
  flex-shrink: 0;
}
.run-stage .next-card {
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  margin-top: 4px !important;
  min-height: 4.5rem;
  z-index: 2;
}
.run-stage .timer-big {
  flex-shrink: 1;
  min-height: 0;
}
.run-stage .move-big {
  flex-shrink: 1;
  min-height: 0;
}

/* v177 done */
.done-back {
  margin: 0 0 12px !important;
  font-weight: 900 !important;
}
.done-tiles {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
@media (min-width: 420px) {
  .done-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* v178 compact done */
.done-card {
  padding: 14px 10px 20px !important;
}
.done-emoji {
  font-size: clamp(36px, 10vw, 52px) !important;
  margin: 2px 0 4px !important;
}
.done-frac {
  font-size: clamp(28px, 8vw, 40px) !important;
  margin: 4px 0 6px !important;
}
.done-msg {
  font-size: clamp(16px, 4vw, 20px) !important;
  margin-bottom: 10px !important;
}
.done-tile {
  padding: 10px 8px 8px !important;
}
.done-tile-v {
  font-size: clamp(16px, 4.2vw, 20px) !important;
}
.done-tile-k {
  font-size: 11px !important;
}
.done-anatomy-wrap {
  padding: 8px !important;
  margin-bottom: 10px !important;
}
.anatomy-svg {
  width: min(100%, 160px) !important;
}
.done-muscles li {
  padding: 6px 8px !important;
}
.mus-name {
  font-size: 14px !important;
}
.done-chart-wrap[hidden] {
  display: none !important;
}

/* v180 sticky back — فقط وقتی صفحه پایان روشن است */
#view-done.on {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.done-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
  padding: 10px 12px 8px;
  background: linear-gradient(180deg, #12100c 85%, rgba(18,16,12,0));
}
.done-topbar .done-back {
  margin: 0 !important;
}
#view-done.on .done-card {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
  padding-top: 8px !important;
}

/* v181 home dash */
.home-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.btn-dash {
  border: 1px solid rgba(232, 165, 75, 0.45);
  background: transparent;
  color: #f6d7a4;
  border-radius: 999px;
  padding: 6px 14px;
  font: 800 13px var(--font);
  cursor: pointer;
  touch-action: manipulation;
}
.btn-dash:active {
  background: rgba(232, 165, 75, 0.2);
}
.done-insight:not([hidden]) {
  display: block;
  margin: 8px 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(232, 165, 75, 0.28);
  background: rgba(232, 165, 75, 0.08);
  font: 700 13px/1.5 var(--font);
  color: #f3ebe0;
  text-align: start;
}


/* v182 readable cards + dash nav + sticky sets */
.btn-top-dash {
  border: 1px solid rgba(232, 165, 75, 0.55);
  background: rgba(232, 165, 75, 0.12);
  color: #f6d7a4;
  border-radius: 999px;
  padding: 5px 10px;
  font: 800 12px var(--font);
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
  flex: 0 0 auto;
  margin-inline-start: auto;
}
.app-ver {
  margin-inline-start: 0;
}
.btn-top-dash:active {
  background: rgba(232, 165, 75, 0.28);
}
.home-head {
  display: flex;
  justify-content: center;
  padding: 10px 0 16px;
}
.done-when {
  margin: 0 0 8px;
  font: 800 clamp(14px, 3.8vw, 17px)/1.45 var(--font);
  color: #f0c27a;
  text-align: center;
}
.done-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  flex-shrink: 0;
  padding: 10px 12px 10px;
  background: #12100c;
  border-bottom: 1px solid rgba(232, 165, 75, 0.22);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}
.done-topbar .done-back {
  margin: 0 !important;
  min-height: 48px !important;
  font-size: clamp(17px, 4.5vw, 20px) !important;
  font-weight: 900 !important;
  border-radius: 14px !important;
  box-shadow: 0 0 0 2px rgba(232, 165, 75, 0.28);
}
.done-insight,
.done-insight:not([hidden]) {
  display: none !important;
}
.mus-tip {
  margin-top: 6px;
  font: 700 clamp(12px, 3.2vw, 14px)/1.4 var(--font);
  color: #cbb89a;
}


/* v189 move chart tips */
.done-bar {
  margin: 0 0 12px;
  text-align: start;
}
.done-bar-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
}
.done-bar-tip {
  margin-top: 6px !important;
  font: 700 clamp(12px, 3.2vw, 14px)/1.4 var(--font) !important;
  color: #cbb89a !important;
}
.done-chart-wrap[hidden] { display: none !important; }
.done-chart-wrap:not([hidden]) { display: block; margin-top: 12px; }


/* v192 muscle motion + bar grow */
.anatomy-live .mus-hot {
  transform-origin: center;
  animation: musPulse 1.35s ease-in-out infinite;
}
@keyframes musPulse {
  0%, 100% { filter: brightness(1); opacity: 1; }
  50% { filter: brightness(1.35); opacity: 0.82; }
}
.mus-fill {
  transition: width 0.85s cubic-bezier(.22,.9,.3,1);
}

/* v201 done tiles */
.done-tiles {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 420px) {
  .done-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.done-tile {
  min-height: 78px;
}

/* v206 anatomy engage — opacity only (SVG-safe on mobile) */
.anatomy-live .mus-zone {
  transform-box: fill-box;
  transform-origin: center;
}
.anatomy-live .mus-idle {
  opacity: 0.45;
}
.anatomy-live .mus-hot,
.anatomy-live .mus-pop {
  animation: musPopIn 0.7s ease-out both, musGlow 1.2s ease-in-out 0.7s infinite;
  animation-delay: var(--d, 0s), calc(var(--d, 0s) + 0.7s);
}
.anatomy-live .mus-lvl-1 { stroke: rgba(232,165,75,.35); stroke-width: 1; }
.anatomy-live .mus-lvl-2 { stroke: rgba(255,200,120,.55); stroke-width: 1.5; }
.anatomy-live .mus-lvl-3 { stroke: rgba(255,230,160,.9); stroke-width: 2; }
@keyframes musPopIn {
  0% { opacity: 0.15; }
  100% { opacity: 1; }
}
@keyframes musGlow {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}
.done-move-science {
  list-style: none;
  margin: 0 0 10px;
  padding: 12px 12px 10px;
  border-radius: 14px;
  border: 1px solid rgba(232,165,75,.22);
  background: rgba(0,0,0,.28);
  text-align: start;
}
.done-move-science-name {
  font: 900 clamp(14px, 3.6vw, 17px) var(--font);
  color: #f6d7a4;
  margin-bottom: 6px;
}
.done-move-science-tip {
  font: 700 clamp(12px, 3.2vw, 14px)/1.55 var(--font);
  color: #d7c4a4;
}
#doneMoves:not([hidden]) {
  display: grid;
  gap: 0;
  margin-top: 12px;
  padding: 0;
}

/* v207 add compact */
.add-set-compact { gap: 10px; }
.add-inline {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: stretch;
}
.add-inline #pickMoveName {
  width: 100%;
  min-height: 58px;
  height: 58px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg2, #17130e);
  color: inherit;
  font: 800 18px var(--font);
  padding: 12px 14px;
  box-sizing: border-box;
}
.add-inline #pickMoveName::placeholder {
  color: color-mix(in srgb, var(--muted, #9a8b75) 92%, transparent);
  font: 700 17px var(--font);
  opacity: 1;
}
.add-sec {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: stretch;
  gap: 0;
  min-height: 44px;
  min-width: 128px;
  max-width: 148px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg2, #17130e);
  overflow: hidden;
}
.add-sec-mid {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 6px;
}
.sec-show {
  font: 900 16px/1 var(--font);
  color: inherit;
  min-width: 2ch;
  text-align: center;
}
.add-sec-lbl {
  font: 900 11px var(--font);
  color: var(--accent);
  white-space: nowrap;
}
.sec-step {
  border: 0;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font: 900 22px/1 var(--font);
  min-width: 40px;
  min-height: 44px;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}
.sec-step:active {
  background: color-mix(in srgb, var(--accent) 38%, transparent);
}
.add-plus {
  display: inline-flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 72px;
  width: auto;
  min-height: 56px;
  height: 56px;
  border-radius: 16px !important;
  font-size: inherit !important;
  line-height: 1 !important;
  padding: 6px 12px !important;
}
.add-plus-ico { font: 900 24px/1 var(--font); }
.add-plus-txt { font: 900 12px/1.1 var(--font); white-space: nowrap; }

.auto-save-hint {
  margin: 0 0 8px;
  text-align: center;
  font: 800 13px var(--font);
  color: var(--muted);
}
.auto-save-hint.on { color: var(--accent); }
@media (max-width: 380px) {
  .add-inline { grid-template-columns: 1fr auto; }
  .add-plus { grid-column: 2; grid-row: 1; min-width: 68px; }
  .add-sec { grid-column: 1 / -1; min-width: 0; }
}

/* v209 edit actions */
.edit-actions {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}
.edit-actions #btnStartFromEdit {
  min-height: 52px;
  font-weight: 900;
}
.auto-save-hint { display: none !important; }
