/* ═══════════════════════════════════════════════════════════════════════════
   JUICED — Hevy-Grade Dark Mobile-First Stylesheet
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #0b0e14;
  --surface: #141923;
  --elevated: #1c2333;
  --elevated-2: #242d40;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-soft: rgba(59, 130, 246, 0.15);

  --brand: #fb923c;
  --brand-soft: rgba(251, 146, 60, 0.15);

  --gold: #f59e0b;
  --gold-soft: rgba(245, 158, 11, 0.15);
  --gold-border: rgba(245, 158, 11, 0.35);

  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.16);
  --green-row: rgba(16, 185, 129, 0.12);

  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.15);

  --deload: #a855f7;
  --deload-soft: rgba(168, 85, 247, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --header-h: 56px;
  --nav-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.55);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.4;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

body.modal-open {
  overflow: hidden;
}

.hidden { display: none !important; }
.tabular { font-variant-numeric: tabular-nums; }
.text-muted { color: var(--text-secondary); }
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-danger { color: var(--danger); }
.text-brand { color: var(--brand); }
.text-primary { color: var(--primary); }

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

input, select, textarea {
  background: var(--elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 12px;
  font-size: 15px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

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

/* ─── Top App Header ─────────────────────────────────────────────────────── */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: calc(var(--header-h) + var(--safe-top));
  padding: var(--safe-top) 14px 0;
  background: rgba(11, 14, 20, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.hub-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 6px 10px 6px 6px;
  min-height: 36px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}

.hub-back-btn:active {
  background: var(--elevated);
  color: var(--text);
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--gold));
  color: #0b0e14;
  font-size: 16px;
  box-shadow: 0 2px 10px rgba(251, 146, 60, 0.35);
}

.brand-name {
  background: linear-gradient(90deg, #fff 40%, var(--brand));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-tab-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.offline-pill, .pending-sync-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.offline-pill {
  background: var(--danger-soft);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.pending-sync-pill {
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid var(--gold-border);
  cursor: pointer;
}

/* ─── Main Content Area ──────────────────────────────────────────────────── */
.app-main {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(var(--header-h) + var(--safe-top) + 14px) 14px calc(var(--nav-h) + var(--safe-bottom) + 84px);
  min-height: 100dvh;
}

.tab-view {
  display: none;
  animation: fadeIn 0.16s ease;
}

.tab-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Bottom Navigation ──────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(16, 21, 31, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 54px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  transition: color 0.15s;
  position: relative;
}

.nav-btn svg {
  transition: transform 0.15s ease;
}

.nav-btn.active {
  color: var(--primary);
}

.nav-btn.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24%;
  right: 24%;
  height: 2.5px;
  border-radius: 0 0 3px 3px;
  background: var(--primary);
}

.nav-btn:active svg {
  transform: scale(0.92);
}

/* ─── Minimized Active Workout Bar ───────────────────────────────────────── */
.minimized-workout-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 10px);
  z-index: 46;
  max-width: 616px;
  margin: 0 auto;
  background: linear-gradient(135deg, #172554, #1e293b);
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.min-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.65); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.min-bar-info {
  min-width: 0;
}

.min-bar-title {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.min-bar-sub {
  font-size: 12px;
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
}

.min-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.min-bar-rest {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  background: rgba(251, 146, 60, 0.16);
  padding: 4px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.min-bar-cta {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-weight: 650;
  font-size: 14px;
  transition: transform 0.1s ease, background 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-xs {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 7px;
}

.btn-lg {
  min-height: 50px;
  padding: 13px 20px;
  font-size: 15px;
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover { background: var(--primary-hover); }

.btn-brand {
  background: linear-gradient(135deg, var(--brand), var(--gold));
  color: #0b0e14;
  font-weight: 800;
}

.btn-success {
  background: var(--green);
  color: #052e16;
  font-weight: 800;
}

.btn-secondary {
  background: var(--elevated);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:active { background: var(--elevated); }

.btn-danger {
  background: var(--danger-soft);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.btn-danger-solid {
  background: var(--danger);
  color: #fff;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: var(--elevated);
  border: 1px solid var(--border);
  transition: background 0.15s, color 0.15s;
}

.btn-icon:active {
  background: var(--elevated-2);
  color: var(--text);
}

/* ─── Cards & Section Headers ────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 12px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 10px;
}

.section-title {
  font-size: 13px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin: 0;
}

.hero-cta-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(251, 146, 60, 0.12));
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 16px;
}

.hero-cta-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 8px 0 0;
  text-align: center;
}

/* ─── Routines & Folders ─────────────────────────────────────────────────── */
.routines-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.folder-block {
  margin-bottom: 14px;
}

.folder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
  gap: 8px;
}

.folder-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  min-height: 36px;
  flex: 1;
  text-align: left;
}

.folder-chevron {
  transition: transform 0.18s ease;
  color: var(--text-muted);
}

.folder-block.collapsed .folder-chevron {
  transform: rotate(-90deg);
}

.folder-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.folder-actions {
  display: flex;
  gap: 4px;
}

.routine-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}

.routine-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.routine-name {
  font-size: 16px;
  font-weight: 750;
  margin: 0;
  line-height: 1.25;
}

.routine-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.routine-preview {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 8px 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}

.routine-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.routine-card-actions .btn-start-routine {
  flex: 1;
}

.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.empty-state-icon {
  font-size: 36px;
  margin-bottom: 10px;
}

.empty-state h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 16px;
}

.empty-state p {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

/* ─── Active Workout Full-Screen Overlay ─────────────────────────────────── */
.workout-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workout-topbar {
  flex-shrink: 0;
  padding: calc(var(--safe-top) + 10px) 12px 10px;
  background: rgba(16, 21, 31, 0.97);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.workout-topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.workout-title-input {
  background: transparent;
  border: none;
  padding: 4px 6px;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  flex: 1;
  min-width: 0;
  border-radius: 6px;
}

.workout-title-input:focus {
  background: var(--elevated);
  box-shadow: none;
}

.workout-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
}

.wkpi {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.wkpi-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
}

.wkpi-value {
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.workout-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 10px calc(var(--safe-bottom) + 120px);
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

/* ─── Workout Exercise Card ──────────────────────────────────────────────── */
.w-exercise-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 10px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.w-exercise-card.has-superset {
  border-left: 4px solid var(--superset-color, var(--brand));
  padding-left: 10px;
}

.w-ex-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.w-ex-title-wrap {
  min-width: 0;
  flex: 1;
}

.w-ex-title {
  font-size: 15.5px;
  font-weight: 750;
  color: var(--primary);
  margin: 0;
  line-height: 1.25;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.superset-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--superset-color, var(--brand));
  color: #0b0e14;
  letter-spacing: 0.03em;
}

.w-ex-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.w-ex-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 34px;
  height: 34px;
  padding: 0 7px;
  border-radius: 8px;
  background: var(--elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.w-ex-tool-btn.active-rest {
  color: var(--primary);
  border-color: rgba(59, 130, 246, 0.35);
}

/* PB Header Banner */
.pb-banner-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.pb-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #fcd34d;
  border: 1px solid var(--gold-border);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.pb-pill.merged {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.22), rgba(251, 146, 60, 0.16));
  border-color: rgba(245, 158, 11, 0.5);
  color: #fde68a;
}

.last-date-pill {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.deload-ref-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 650;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--deload-soft);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.w-ex-note-input {
  width: 100%;
  background: rgba(28, 35, 51, 0.55);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.w-ex-note-input:focus {
  background: var(--elevated);
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: none;
}

/* ─── Set Table (Zero Horizontal Overflow on 360px!) ─────────────────────── */
.set-table-head {
  display: grid;
  grid-template-columns: 36px minmax(92px, 1.35fr) minmax(60px, 0.9fr) minmax(56px, 0.8fr) 40px;
  gap: 5px;
  padding: 0 2px 6px;
  font-size: 10.5px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: center;
}

.set-table-head.single-col {
  grid-template-columns: 36px minmax(96px, 1.3fr) minmax(88px, 1.4fr) 40px;
}

.set-row {
  display: grid;
  grid-template-columns: 36px minmax(92px, 1.35fr) minmax(60px, 0.9fr) minmax(56px, 0.8fr) 40px;
  gap: 5px;
  align-items: center;
  padding: 5px 2px;
  border-radius: 10px;
  margin-bottom: 4px;
  transition: background 0.16s ease;
  position: relative;
}

.set-row.single-col {
  grid-template-columns: 36px minmax(96px, 1.3fr) minmax(88px, 1.4fr) 40px;
}

.set-row.completed {
  background: var(--green-row);
}

.set-row-pr-banner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #fde68a;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.2), rgba(251, 146, 60, 0.18));
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 6px;
  padding: 3px 8px;
  margin-top: 2px;
  animation: prPop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes prPop {
  0% { transform: scale(0.9); opacity: 0; }
  60% { transform: scale(1.03); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.set-type-btn {
  width: 34px;
  height: 38px;
  border-radius: 8px;
  background: var(--elevated);
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  margin: 0 auto;
}

.set-type-btn.type-warmup {
  color: var(--brand);
  background: var(--brand-soft);
}

.set-type-btn.type-dropset {
  color: #60a5fa;
  background: var(--primary-soft);
}

.set-type-btn.type-failure {
  color: #f87171;
  background: var(--danger-soft);
}

/* Dual POSL. / PB Reference Column */
.ref-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.ref-tap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  max-width: 100%;
  padding: 2px 5px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.12s;
}

.ref-tap:active {
  background: rgba(255, 255, 255, 0.1);
}

.ref-last {
  color: var(--text-secondary);
}

.ref-pb {
  color: #fbbf24;
  font-weight: 750;
}

.ref-merged {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 3px 6px;
  font-weight: 750;
  font-size: 11px;
}

.ref-empty {
  color: var(--text-muted);
  font-size: 12px;
}

.set-input {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 4px 4px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.set-row.completed .set-input {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.35);
}

.set-check-btn {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}

.set-check-btn:active { transform: scale(0.92); }

.set-row.completed .set-check-btn {
  background: var(--green);
  border-color: var(--green);
  color: #052e16;
}

.w-ex-footer {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn-add-set {
  flex: 1;
  min-height: 38px;
  border-radius: 9px;
  background: var(--elevated);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--border);
}

.btn-del-last-set {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.workout-bottom-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

/* ─── Rest Timer Floating Bar ────────────────────────────────────────────── */
.rest-timer-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--safe-bottom) + 12px);
  z-index: 75;
  max-width: 616px;
  margin: 0 auto;
  background: rgba(20, 25, 35, 0.97);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.rest-progress-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  width: 100%;
}

.rest-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--brand));
  width: 100%;
  transition: width 0.25s linear;
}

.rest-bar-inner {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rest-bar-left {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.rest-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.rest-countdown {
  font-size: 22px;
  font-weight: 850;
  color: #fff;
}

.rest-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-rest-adj {
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--elevated);
  border: 1px solid var(--border-strong);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.btn-rest-skip {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--primary);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

/* ─── History Tab: KPIs & Calendar ───────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
}

.kpi-val {
  font-size: 20px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.kpi-lbl {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 3px;
  font-weight: 600;
}

.calendar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  margin-bottom: 14px;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cal-month-title {
  font-size: 15px;
  font-weight: 750;
  text-transform: capitalize;
}

.cal-weekdays, .cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.cal-weekday {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding-bottom: 4px;
}

.cal-day {
  height: 38px;
  border-radius: 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  position: relative;
}

.cal-day.today {
  border: 1px solid var(--primary);
  color: var(--text);
}

.cal-day.selected {
  background: var(--primary);
  color: #fff;
}

.cal-day.has-workout {
  color: var(--text);
  font-weight: 750;
}

.cal-dots {
  display: flex;
  gap: 2px;
  height: 5px;
}

.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}

.cal-dot.deload {
  background: var(--deload);
}

.cal-day.selected .cal-dot {
  background: #fff;
}

.cal-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-muted);
}

.cal-legend-items {
  display: flex;
  gap: 12px;
}

.cal-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* History Workout Cards */
.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.history-card:active {
  border-color: var(--primary);
}

.history-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.history-title {
  font-size: 16px;
  font-weight: 750;
  margin: 0;
}

.history-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--elevated);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.badge-pr {
  background: var(--gold-soft);
  color: #fcd34d;
  border: 1px solid var(--gold-border);
}

.badge-deload {
  background: var(--deload-soft);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.history-ex-list {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
  color: var(--text-secondary);
}

.history-ex-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.history-ex-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Exercises Tab ──────────────────────────────────────────────────────── */
.search-bar-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.exercise-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
}

.exercise-list-item:active {
  background: var(--elevated);
}

.ex-item-main {
  min-width: 0;
  flex: 1;
}

.ex-item-name {
  font-weight: 700;
  font-size: 14.5px;
  margin-bottom: 2px;
}

.ex-item-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.custom-tag {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 1px 6px;
  border-radius: 999px;
}

/* ─── Charts ─────────────────────────────────────────────────────────────── */
.chart-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.chart-tab-btn {
  min-height: 36px;
  border-radius: 8px;
  background: var(--elevated);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
}

.chart-tab-btn.active {
  background: var(--primary-soft);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.45);
}

.chart-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 8px 6px;
  position: relative;
}

.chart-tooltip {
  font-size: 12px;
  color: var(--text);
  background: var(--elevated-2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-variant-numeric: tabular-nums;
}

/* ─── Settings Tab ───────────────────────────────────────────────────────── */
.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 14px;
}

.settings-section h3 {
  margin: 0 0 10px;
  font-size: 15.5px;
  font-weight: 750;
  display: flex;
  align-items: center;
  gap: 8px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.setting-label {
  font-weight: 650;
  font-size: 14px;
}

.setting-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  background: var(--elevated-2);
  border-radius: 999px;
  transition: 0.2s;
  border: 1px solid var(--border-strong);
  cursor: pointer;
}

.slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .slider {
  background: var(--primary);
  border-color: var(--primary);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.switch.deload-switch input:checked + .slider {
  background: var(--deload);
  border-color: var(--deload);
}

.hevy-steps {
  margin: 0 0 12px;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.hevy-steps li { margin-bottom: 4px; }
.hevy-steps code {
  background: var(--elevated);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--brand);
  font-size: 12px;
}

.import-preview-box {
  background: var(--elevated);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 12px;
}

.import-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 10px 0;
}

.import-stat {
  background: var(--surface);
  border-radius: 8px;
  padding: 8px 10px;
}

.import-stat strong {
  display: block;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.import-stat span {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  margin: 10px 0;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  flex-shrink: 0;
  accent-color: var(--primary);
}

.version-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.version-chip {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.version-chip-lbl {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.version-chip-val {
  font-size: 15px;
  font-weight: 800;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* ─── Modals & Bottom Sheets ─────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.modal-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 85;
  max-width: 640px;
  margin: 0 auto;
  max-height: 92dvh;
  background: var(--surface);
  border-top: 1px solid var(--border-strong);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-sheet.fullscreen {
  top: 0;
  max-height: 100dvh;
  border-radius: 0;
  border-top: none;
  padding-top: var(--safe-top);
}

@keyframes slideUp {
  from { transform: translateY(36px); opacity: 0.4; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-size: 17px;
  font-weight: 800;
  margin: 0;
}

.modal-body {
  padding: 14px 16px calc(var(--safe-bottom) + 20px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.modal-footer {
  padding: 12px 16px calc(var(--safe-bottom) + 12px);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  background: var(--surface);
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

/* ─── Plate Calculator Visuals ───────────────────────────────────────────── */
.plate-bar-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 12px 0;
  overflow-x: auto;
}

.bar-shaft {
  height: 12px;
  width: 64px;
  background: linear-gradient(180deg, #e2e8f0, #94a3b8);
  border-radius: 3px;
  flex-shrink: 0;
}

.bar-collar {
  width: 10px;
  height: 24px;
  background: #cbd5e1;
  border-radius: 2px;
  flex-shrink: 0;
}

.plate-stack {
  display: flex;
  align-items: center;
  gap: 3px;
}

.plate-disc {
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 900;
  color: #fff;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22);
}

.plate-list-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* ─── Action Menu List ───────────────────────────────────────────────────── */
.action-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.action-list-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--elevated);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 650;
  text-align: left;
}

.action-list-btn.danger {
  color: #fca5a5;
  background: var(--danger-soft);
}

/* ─── Auth Gate Modal ────────────────────────────────────────────────────── */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(11, 14, 20, 0.96);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px 16px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  margin: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 26px 22px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  text-align: center;
  margin-bottom: 20px;
}

.auth-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand), var(--gold));
  color: #0b0e14;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(251, 146, 60, 0.35);
}

.auth-logo h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 850;
}

.auth-logo p {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.auth-error {
  color: #fca5a5;
  background: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  margin: 0 0 12px;
}

/* ─── Toast Notifications ────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--safe-top) + 12px);
  left: 12px;
  right: 12px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  max-width: 440px;
  width: 100%;
  background: var(--elevated-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 650;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.2s ease;
}

.toast.success { border-color: rgba(16, 185, 129, 0.5); background: #0d2b22; color: #a7f3d0; }
.toast.error { border-color: rgba(239, 68, 68, 0.5); background: #2c1215; color: #fecaca; }
.toast.pr { border-color: rgba(245, 158, 11, 0.65); background: #2c2008; color: #fde68a; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Deload Toggle Card in Finish Modal ─────────────────────────────────── */
.deload-card {
  background: var(--deload-soft);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius-md);
  padding: 12px;
  margin: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.deload-card-title {
  font-size: 14px;
  font-weight: 750;
  color: #e9d5ff;
}

.deload-card-sub {
  font-size: 12px;
  color: #cbd5e1;
  margin-top: 3px;
  line-height: 1.35;
}

/* ─── Small Phone Refinements (360px) ────────────────────────────────────── */
@media (max-width: 380px) {
  .set-table-head,
  .set-row {
    grid-template-columns: 32px minmax(86px, 1.3fr) minmax(54px, 0.85fr) minmax(50px, 0.78fr) 36px;
    gap: 4px;
  }
  .set-type-btn { width: 32px; height: 36px; font-size: 12px; }
  .set-check-btn { width: 36px; height: 36px; }
  .set-input { font-size: 14px; height: 38px; }
  .ref-tap { font-size: 10.5px; padding: 2px 3px; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   JUICED v2 — AURA GLASS & GLOW THEME (Proposal #2 + Rich Dynamic Main Color)
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --accent: #FF6B00;
  --accent-rgb: 255, 107, 0;
  --accent-fg: #FFFFFF;
  --bg: #07090F;
  --surface: rgba(20, 24, 34, 0.78);
  --surface-solid: #141822;
  --elevated: rgba(28, 34, 48, 0.86);
  --elevated-2: rgba(36, 44, 62, 0.92);
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.14);
  --accent-border: rgba(var(--accent-rgb), 0.34);
  --accent-glow: 0 10px 30px -8px rgba(var(--accent-rgb), 0.42);
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
}

body {
  background-color: var(--bg);
  background-image: none;
  position: relative;
  isolation: isolate;
}

/* Single GPU-composited fixed backdrop layer (zero CPU repaints on 120Hz scroll!) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  transform: translateZ(0);
  will-change: transform;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 95% 42% at 50% -10%, rgba(var(--accent-rgb), 0.30) 0%, rgba(var(--accent-rgb), 0.09) 42%, transparent 74%),
    radial-gradient(circle at 92% 38%, rgba(var(--accent-rgb), 0.10) 0%, transparent 45%),
    radial-gradient(circle at 6% 78%, rgba(var(--accent-rgb), 0.08) 0%, transparent 42%);
}

/* Header Glass + Accent Energy */
.app-header {
  background: rgba(8, 10, 16, 0.76);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.18);
}

.brand-mark {
  background: linear-gradient(135deg, var(--accent), rgba(var(--accent-rgb), 0.65));
  color: var(--accent-fg);
  box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.45);
}

.brand-name {
  background: linear-gradient(95deg, #ffffff 30%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-tab-label {
  color: var(--accent);
  font-weight: 700;
}

.profile-chip {
  border-color: rgba(var(--accent-rgb), 0.32) !important;
  background: rgba(var(--accent-rgb), 0.12) !important;
}

/* Fast GPU-friendly Glass Cards (specular rim + translucent gradient, zero per-card blur cost!) */
.card,
.routine-card,
.history-card,
.calendar-card,
.kpi-card,
.settings-section,
.exercise-card,
.hero-cta-card,
.chart-card,
.auth-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
}

.hero-cta-card {
  border-color: rgba(var(--accent-rgb), 0.34);
  background: linear-gradient(155deg, rgba(var(--accent-rgb), 0.18) 0%, rgba(18, 22, 32, 0.86) 65%);
  box-shadow: 0 12px 28px -14px rgba(var(--accent-rgb), 0.32), inset 0 1px 0 rgba(var(--accent-rgb), 0.25);
}

/* Native Chromium/WebView viewport virtualization for 120Hz scrolling */
.routine-card,
.history-card,
.exercise-card,
.routine-detail-ex-block {
  content-visibility: auto;
  contain-intrinsic-size: auto 210px;
}

.exercise-list-item {
  content-visibility: auto;
  contain-intrinsic-size: auto 66px;
}

.workout-scroll,
.modal-body {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

@media (hover: hover) {
  .routine-card:hover,
  .history-card:hover {
    border-color: rgba(var(--accent-rgb), 0.36);
  }
}

/* Primary & Brand Buttons driven richly by Main Accent Color */
.btn-primary,
.btn-brand {
  background: linear-gradient(135deg, var(--accent) 0%, rgba(var(--accent-rgb), 0.86) 100%) !important;
  color: var(--accent-fg) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 8px 24px -6px rgba(var(--accent-rgb), 0.48) !important;
  font-weight: 800;
  border-radius: 14px;
}

.btn-primary:active,
.btn-brand:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 13px;
}

.btn-secondary:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
}

.btn-accent-soft {
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 12px;
  font-weight: 700;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.26);
}

/* Floating Glass Pill Bottom Navigation (Proposal #2) */
.app-main {
  padding-bottom: calc(96px + var(--safe-bottom));
}

.bottom-nav {
  left: 14px;
  right: 14px;
  bottom: calc(10px + var(--safe-bottom));
  height: 62px;
  max-width: 560px;
  margin: 0 auto;
  padding: 6px;
  border-radius: 999px;
  background: rgba(16, 20, 30, 0.86);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(var(--accent-rgb), 0.26);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.85), 0 0 24px -8px rgba(var(--accent-rgb), 0.30);
}

.nav-btn {
  border-radius: 999px;
  height: 100%;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-btn::before {
  display: none !important;
}

.nav-btn.active {
  background: rgba(var(--accent-rgb), 0.22);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.35);
}

.nav-btn.active svg {
  filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.55));
}

/* Minimized workout bar floats cleanly above floating pill dock */
.minimized-workout-bar {
  bottom: calc(82px + var(--safe-bottom));
  border-radius: 18px;
  background: rgba(16, 20, 30, 0.92);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 14px 36px -10px rgba(var(--accent-rgb), 0.35);
}

.pulse-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.25);
}

.min-bar-cta {
  background: var(--accent);
  color: var(--accent-fg);
}

/* Circular Exercise Thumbnails (Lightweight border ring — zero shadow blur lag!) */
.ex-thumb {
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(var(--accent-rgb), 0.45);
  box-shadow: none;
}

.ex-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ex-thumb-simple svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Exercise Titles & Routine Cards (Hevy-inspired clean rows with thumbs) */
.ex-card-title,
.routine-ex-title {
  color: var(--accent);
  font-weight: 800;
}

.routine-ex-preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 14px;
}

.routine-ex-preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: #e2e8f0;
}

.routine-ex-preview-more {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  padding-left: 4px;
}

/* Hevy-style History Feed Cards (clean, no social buttons) */
.history-profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.history-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 900;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.35);
}

.history-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 0;
  margin: 6px 0 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.history-metric-lbl {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.history-metric-val {
  font-size: 14.5px;
  font-weight: 800;
  color: #f8fafc;
  margin-top: 2px;
}

.history-ex-thumb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  font-size: 13.5px;
  color: #e2e8f0;
}

/* Routine Detail Sheet (Hevy Screenshot #3) */
.routine-detail-chart-card {
  background: rgba(12, 16, 24, 0.72);
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  border-radius: 16px;
  padding: 14px;
  margin: 14px 0;
}

.metric-pills-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.metric-pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.15s ease;
}

.metric-pill.active {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.4);
}

.routine-detail-ex-block {
  background: rgba(16, 20, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 12px;
}

.routine-detail-ex-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.routine-detail-set-row {
  display: grid;
  grid-template-columns: 54px 1fr 1fr;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: #f1f5f9;
}

.routine-detail-set-row.head {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 14px 6px;
}

.routine-detail-set-row.alt {
  background: rgba(255, 255, 255, 0.03);
}

/* Switches, Filter Pills, Calendar & Active Workout Accents */
.switch input:checked + .slider {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.45);
}

.filter-chip.active,
.chart-tab.active {
  background: var(--accent) !important;
  color: var(--accent-fg) !important;
  border-color: transparent !important;
  box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.35);
}

.cal-dot {
  background: var(--accent);
  box-shadow: 0 0 6px rgba(var(--accent-rgb), 0.55);
}

.cal-day.today {
  border-color: var(--accent);
  color: var(--accent);
}

.cal-day.selected {
  background: rgba(var(--accent-rgb), 0.24);
  border-color: var(--accent);
}

.rest-timer-bar {
  background: rgba(14, 18, 28, 0.94);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(var(--accent-rgb), 0.35);
}

.rest-progress-fill {
  background: linear-gradient(90deg, var(--accent), rgba(var(--accent-rgb), 0.65));
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.55);
}

.btn-rest-skip {
  background: var(--accent);
  color: var(--accent-fg);
}

.workout-overlay {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 35% at 50% -10%, rgba(var(--accent-rgb), 0.24) 0%, transparent 70%);
}

.workout-topbar {
  background: rgba(8, 10, 16, 0.84);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.20);
}

.workout-stat-val.accent {
  color: var(--accent);
}

.modal-sheet {
  background: rgba(16, 20, 30, 0.94);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(var(--accent-rgb), 0.24);
}

/* Settings Color Swatches & 3-Way Image Mode Segmented Control */
.accent-swatch-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.accent-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.accent-swatch.active {
  border-color: #ffffff;
  transform: scale(1.12);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.45);
}

.segmented-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(0, 0, 0, 0.32);
  padding: 5px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 10px;
}

.seg-btn {
  padding: 9px 6px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
  transition: all 0.15s ease;
}

.seg-btn.active {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.42);
}

.img-mode-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.07);
}


/* ═══════════════════════════════════════════════════════════════════════════
   JUICED UI STYLES: LIQUID GLASS | NOTHING OS (NDOT) | CLASSIC DARK
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. LIQUID GLASS (Rich Frosted Look, 120Hz GPU-Optimized!) ── */
html[data-ui-style="glass"] body::before {
  background-color: #06080f;
  background-image:
    radial-gradient(ellipse 90% 42% at 50% -6%, rgba(var(--accent-rgb), 0.44) 0%, rgba(var(--accent-rgb), 0.14) 44%, transparent 74%),
    radial-gradient(circle at 92% 34%, rgba(var(--accent-rgb), 0.24) 0%, transparent 42%),
    radial-gradient(circle at 8% 76%, rgba(var(--accent-rgb), 0.20) 0%, transparent 44%),
    radial-gradient(circle at 78% 88%, rgba(120, 160, 255, 0.12) 0%, transparent 40%);
}

html[data-ui-style="glass"] .card,
html[data-ui-style="glass"] .routine-card,
html[data-ui-style="glass"] .history-card,
html[data-ui-style="glass"] .calendar-card,
html[data-ui-style="glass"] .kpi-card,
html[data-ui-style="glass"] .settings-section,
html[data-ui-style="glass"] .exercise-card,
html[data-ui-style="glass"] .routine-detail-chart-card,
html[data-ui-style="glass"] .routine-detail-ex-block,
html[data-ui-style="glass"] .auth-card {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.095) 0%, rgba(18, 22, 34, 0.66) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 10px 26px -14px rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

html[data-ui-style="glass"] .hero-cta-card {
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.28) 0%, rgba(255, 255, 255, 0.06) 55%, rgba(16, 20, 32, 0.68) 100%);
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  box-shadow:
    0 14px 32px -16px rgba(var(--accent-rgb), 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.30);
}

/* True frosted backdrop-filter reserved for fixed floating overlays only */
html[data-ui-style="glass"] .bottom-nav {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0%, rgba(14, 18, 28, 0.70) 100%);
  backdrop-filter: blur(20px) saturate(165%);
  -webkit-backdrop-filter: blur(20px) saturate(165%);
  border: 1px solid rgba(255, 255, 255, 0.20);
  box-shadow:
    0 16px 36px -10px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

html[data-ui-style="glass"] .app-header {
  background: rgba(10, 12, 20, 0.68);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

/* ── 2. NOTHING OS (Authentic Nothing Phone / Ndot Dot-Matrix Theme) ── */
html[data-ui-style="nothing"] {
  --font-ndot: 'Doto', 'Space Mono', monospace;
  --font-mono-n: 'Space Mono', ui-monospace, SFMono-Regular, monospace;
  --bg: #000000;
  --surface: #0b0b0d;
  --elevated: #141417;
  --elevated-2: #1c1c20;
  --border: rgba(255, 255, 255, 0.16);
  --border-strong: rgba(255, 255, 255, 0.26);
}

html[data-ui-style="nothing"] body::before {
  background-color: #000000;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 16px 16px;
}

html[data-ui-style="nothing"] .brand-name,
html[data-ui-style="nothing"] .header-tab-label,
html[data-ui-style="nothing"] .section-title,
html[data-ui-style="nothing"] .routine-name,
html[data-ui-style="nothing"] .history-title,
html[data-ui-style="nothing"] .kpi-val,
html[data-ui-style="nothing"] .wkpi-value,
html[data-ui-style="nothing"] .rest-countdown,
html[data-ui-style="nothing"] .cal-month-title,
html[data-ui-style="nothing"] .modal-title,
html[data-ui-style="nothing"] .settings-section h3,
html[data-ui-style="nothing"] .history-metric-val,
html[data-ui-style="nothing"] #auth-title {
  font-family: var(--font-ndot) !important;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html[data-ui-style="nothing"] .brand-name {
  background: none;
  -webkit-text-fill-color: #ffffff;
  color: #ffffff;
}

html[data-ui-style="nothing"] .brand-mark {
  border-radius: 50%;
  background: var(--accent);
  box-shadow: none;
}

html[data-ui-style="nothing"] .kpi-lbl,
html[data-ui-style="nothing"] .wkpi-label,
html[data-ui-style="nothing"] .history-metric-lbl,
html[data-ui-style="nothing"] .routine-meta,
html[data-ui-style="nothing"] .set-table-head,
html[data-ui-style="nothing"] .version-chip-lbl {
  font-family: var(--font-mono-n);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

html[data-ui-style="nothing"] .card,
html[data-ui-style="nothing"] .routine-card,
html[data-ui-style="nothing"] .history-card,
html[data-ui-style="nothing"] .calendar-card,
html[data-ui-style="nothing"] .kpi-card,
html[data-ui-style="nothing"] .settings-section,
html[data-ui-style="nothing"] .exercise-card,
html[data-ui-style="nothing"] .hero-cta-card,
html[data-ui-style="nothing"] .routine-detail-chart-card,
html[data-ui-style="nothing"] .routine-detail-ex-block,
html[data-ui-style="nothing"] .auth-card {
  background: #0b0b0d;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
  border-radius: 22px;
}

html[data-ui-style="nothing"] .hero-cta-card {
  border-style: dashed;
  border-color: rgba(var(--accent-rgb), 0.75);
}

html[data-ui-style="nothing"] .app-header {
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.22);
}

html[data-ui-style="nothing"] .bottom-nav {
  background: #0b0b0d;
  backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.9);
}

html[data-ui-style="nothing"] .nav-btn.active {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: none;
}

html[data-ui-style="nothing"] .nav-btn.active svg {
  filter: none;
}

html[data-ui-style="nothing"] .btn-primary,
html[data-ui-style="nothing"] .btn-brand {
  background: var(--accent) !important;
  color: var(--accent-fg) !important;
  box-shadow: none !important;
  border-radius: 999px;
  font-family: var(--font-mono-n);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

html[data-ui-style="nothing"] .btn-secondary,
html[data-ui-style="nothing"] .btn-accent-soft {
  border-radius: 999px;
  font-family: var(--font-mono-n);
}

html[data-ui-style="nothing"] .ex-thumb {
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.28);
}

html[data-ui-style="nothing"] .workout-overlay {
  background-color: #000000;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 16px 16px;
}

html[data-ui-style="nothing"] .rest-progress-fill {
  background-image: repeating-linear-gradient(90deg, var(--accent) 0 6px, transparent 6px 10px);
  box-shadow: none;
}

/* ── 3. CLASSIC DARK (Clean Solid Matte, Zero Blur) ── */
html[data-ui-style="classic"] body::before {
  background-color: #0b0e14;
  background-image: none;
}

html[data-ui-style="classic"] .card,
html[data-ui-style="classic"] .routine-card,
html[data-ui-style="classic"] .history-card,
html[data-ui-style="classic"] .calendar-card,
html[data-ui-style="classic"] .kpi-card,
html[data-ui-style="classic"] .settings-section,
html[data-ui-style="classic"] .exercise-card,
html[data-ui-style="classic"] .hero-cta-card,
html[data-ui-style="classic"] .routine-detail-chart-card,
html[data-ui-style="classic"] .routine-detail-ex-block {
  background: #141923;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

html[data-ui-style="classic"] .bottom-nav {
  background: #141923;
  backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
}


/* ═══════════════════════════════════════════════════════════════════════════
   JUICED LOGO + 120Hz GPU SPRING ANIMATIONS & SLIDING PILL NAV
   ═══════════════════════════════════════════════════════════════════════════ */

.brand-logo-img {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: block;
  object-fit: cover;
  border: 1.5px solid rgba(var(--accent-rgb), 0.48);
  flex-shrink: 0;
}

.auth-logo-img {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: block;
  margin: 0 auto 12px;
  border: 2px solid rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 10px 28px -8px rgba(var(--accent-rgb), 0.45);
}

/* Sliding Pill Indicator inside Bottom Nav */
.bottom-nav {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  position: fixed;
}

.nav-pill-slider {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc((100% - 10px) / 4);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.22);
  border: 1px solid rgba(var(--accent-rgb), 0.36);
  pointer-events: none;
  z-index: 0;
  transform: translate3d(0, 0, 0);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.22s ease;
  will-change: transform;
}

html[data-ui-style="nothing"] .nav-pill-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.bottom-nav .nav-btn {
  position: relative;
  z-index: 1;
  background: transparent !important;
  box-shadow: none !important;
  transition: color 0.2s ease, transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.bottom-nav .nav-btn:active {
  transform: scale(0.92);
}

.bottom-nav .nav-btn.active svg {
  animation: navIconPop 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes navIconPop {
  0%   { transform: scale(0.86); }
  55%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* Smooth Directional Tab Transitions (GPU transform + opacity only) */
.tab-view.slide-from-right {
  animation: tabSlideRight 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tab-view.slide-from-left {
  animation: tabSlideLeft 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tab-view.slide-fade {
  animation: tabFadeUp 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes tabSlideRight {
  from { opacity: 0; transform: translate3d(18px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes tabSlideLeft {
  from { opacity: 0; transform: translate3d(-18px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes tabFadeUp {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

.tab-label-pop {
  animation: labelSwap 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes labelSwap {
  from { opacity: 0; transform: translate3d(0, -4px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Smooth Modal, Sheet, Workout Overlay & Tactile Micro-Interactions */
.modal-backdrop {
  animation: backdropIn 0.2s ease both;
}

@keyframes backdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-sheet {
  animation: sheetSpringIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes sheetSpringIn {
  from { opacity: 0; transform: translate3d(0, 26px, 0) scale(0.985); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.workout-overlay:not(.hidden) {
  animation: overlayRise 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes overlayRise {
  from { opacity: 0; transform: translate3d(0, 28px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

.rest-timer-bar:not(.hidden) {
  animation: sheetSpringIn 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.btn,
.seg-btn,
.metric-pill,
.btn-icon,
.cal-day,
.set-check-btn {
  transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn:active,
.seg-btn:active,
.metric-pill:active,
.btn-icon:active,
.cal-day:active,
.set-check-btn:active {
  transform: scale(0.95);
}

/* Clean inline SVG icon alignment helper */
.ico-svg {
  display: inline-block;
  vertical-align: -2px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   JUICED v3 — UNIFIED ROUTINE BUILDER, ACTIVE WORKOUT, DRAG REORDER & SEARCH
   Matches Liquid Glass, Nothing OS (Ndot) & Classic Dark + Dynamic --accent
   ═══════════════════════════════════════════════════════════════════════════ */

/* Accent unification on Workout & Builder core elements */
.w-ex-title {
  color: var(--accent);
  font-weight: 800;
}

.w-ex-tool-btn.active-rest {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.14);
  border-color: rgba(var(--accent-rgb), 0.42);
}

.btn-icon.active-accent {
  background: var(--accent) !important;
  color: var(--accent-fg) !important;
  border-color: transparent !important;
  box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.4);
}

.wk-discard-icon {
  color: #fca5a5 !important;
  background: rgba(239, 68, 68, 0.14) !important;
  border: 1px solid rgba(239, 68, 68, 0.30) !important;
}

.w-exercise-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: var(--radius-lg);
  padding: 13px 12px;
  margin-bottom: 12px;
  box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color 0.18s ease;
}

.w-exercise-card.has-superset {
  border-left: 4px solid var(--superset-color, var(--accent));
}

.w-ex-header {
  align-items: center;
  margin-bottom: 8px;
  user-select: none;
  -webkit-user-select: none;
}

.w-ex-tool-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
}

.w-ex-note-input {
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 8px 11px;
}

.set-input {
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.set-input:focus {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.10);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.22);
}

.btn-add-set {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 11px;
  font-weight: 750;
  transition: background-color 0.15s ease, transform 0.12s ease;
}

.btn-add-set:active {
  transform: scale(0.98);
  background: rgba(var(--accent-rgb), 0.22);
}

.workout-kpis {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  padding: 9px 12px;
}

/* Routine Builder Layout & Controls */
.rb-meta-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: var(--radius-lg);
  padding: 13px 13px 14px;
  margin-bottom: 12px;
  box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.rb-select-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.rb-select-row select {
  padding: 8px 10px;
  font-size: 12.5px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.rb-set-head {
  display: grid;
  grid-template-columns: 36px 1fr 1fr 34px;
  gap: 6px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 750;
  color: var(--text-muted);
  margin-bottom: 5px;
  letter-spacing: 0.04em;
}

.rb-set-row {
  display: grid;
  grid-template-columns: 36px 1fr 1fr 34px;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.rb-del-set-btn {
  width: 34px !important;
  height: 36px !important;
  min-width: 34px !important;
  font-size: 13px;
  border-radius: 9px;
}

.rb-remove-btn {
  color: #fca5a5 !important;
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
}

.rb-reorder-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-reorder-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 750;
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.36);
  flex-shrink: 0;
  transition: transform 0.14s ease, background-color 0.16s ease, color 0.16s ease;
}

.btn-reorder-pill:active {
  transform: scale(0.95);
}

.btn-reorder-pill.active {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.4);
}

/* Drag-to-Reorder Handle, Ghost, Placeholder & Compact Reorder Rows */
.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 36px;
  color: var(--text-muted);
  cursor: grab;
  touch-action: none;
  flex-shrink: 0;
  border-radius: 8px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.drag-handle:active {
  cursor: grabbing;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.16);
}

body.is-dragging-list {
  user-select: none !important;
  -webkit-user-select: none !important;
  overflow: hidden !important;
}

.drag-placeholder {
  border: 2px dashed rgba(var(--accent-rgb), 0.65);
  background: rgba(var(--accent-rgb), 0.09);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  transition: height 0.14s ease;
}

.drag-ghost > * {
  border-color: var(--accent) !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.72), 0 0 0 1.5px rgba(var(--accent-rgb), 0.75) !important;
  opacity: 0.96;
}

.reorder-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-lg);
  padding: 10px 10px 10px 6px;
  margin-bottom: 9px;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.reorder-row.has-superset {
  border-left: 4px solid var(--superset-color, var(--accent));
}

.reorder-row-info {
  flex: 1;
  min-width: 0;
}

.reorder-row-name {
  font-size: 14.5px;
  font-weight: 750;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reorder-row-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.reorder-row-arrows {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.wk-reorder-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: var(--radius-lg);
  background: rgba(var(--accent-rgb), 0.14);
  border: 1px solid rgba(var(--accent-rgb), 0.36);
}

/* Inline Quick-Search Bar & Results (with Anatomical Thumbnails) */
.inline-ex-search-panel {
  position: relative;
}

.inline-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-search-ico {
  position: absolute;
  left: 13px;
  color: var(--accent);
  pointer-events: none;
  opacity: 0.9;
}

.inline-search-input {
  width: 100%;
  padding: 11px 36px 11px 38px !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(var(--accent-rgb), 0.28) !important;
  font-size: 14px !important;
}

.inline-search-input:focus {
  border-color: var(--accent) !important;
  background: rgba(var(--accent-rgb), 0.08) !important;
}

.inline-search-clear {
  position: absolute;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.picker-toolbar .inline-search-clear {
  right: 80px;
}

.inline-search-results {
  margin-top: 8px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  overflow: hidden;
  box-shadow: 0 14px 32px -10px rgba(0, 0, 0, 0.75);
  max-height: 360px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.inline-search-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  background: transparent;
  color: var(--text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background-color 0.14s ease;
}

.inline-search-item:last-child {
  border-bottom: none;
}

.inline-search-item:active {
  background: rgba(var(--accent-rgb), 0.14);
}

.inline-search-info {
  flex: 1;
  min-width: 0;
}

.inline-search-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inline-search-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.inline-search-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.38);
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.inline-search-add.added {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: transparent;
}

.inline-search-empty {
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* Upgraded Exercise Picker Toolbar & Muscle Chips */
.picker-toolbar {
  padding: 10px 14px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.picker-chips-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.picker-chips-row::-webkit-scrollbar {
  display: none;
}

.picker-chip {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.10);
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.picker-chip.active {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.36);
}

.exercise-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 15px;
  padding: 10px 12px;
  margin-bottom: 8px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.exercise-list-item.is-selected {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.14);
}

.picker-check-pill {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  flex-shrink: 0;
}

.picker-check-pill.checked {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: transparent;
}

/* ── THEME 1: LIQUID GLASS overrides for Builder, Workout & Fullscreen Modals ── */
html[data-ui-style="glass"] .workout-overlay,
html[data-ui-style="glass"] .modal-sheet.fullscreen {
  background-color: #06080f;
  background-image:
    radial-gradient(ellipse 90% 42% at 50% -6%, rgba(var(--accent-rgb), 0.40) 0%, rgba(var(--accent-rgb), 0.12) 44%, transparent 74%),
    radial-gradient(circle at 92% 38%, rgba(var(--accent-rgb), 0.18) 0%, transparent 42%),
    radial-gradient(circle at 8% 80%, rgba(var(--accent-rgb), 0.15) 0%, transparent 44%);
}

html[data-ui-style="glass"] .modal-sheet:not(.fullscreen) {
  background: linear-gradient(165deg, rgba(24, 28, 42, 0.94) 0%, rgba(12, 15, 24, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

html[data-ui-style="glass"] .modal-header,
html[data-ui-style="glass"] .modal-footer,
html[data-ui-style="glass"] .workout-topbar {
  background: rgba(10, 12, 20, 0.72);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-color: rgba(255, 255, 255, 0.14);
}

html[data-ui-style="glass"] .w-exercise-card,
html[data-ui-style="glass"] .rb-meta-card,
html[data-ui-style="glass"] .reorder-row,
html[data-ui-style="glass"] .exercise-list-item,
html[data-ui-style="glass"] .inline-search-results {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.095) 0%, rgba(18, 22, 34, 0.68) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 10px 26px -14px rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

html[data-ui-style="glass"] .exercise-list-item.is-selected {
  background: linear-gradient(155deg, rgba(var(--accent-rgb), 0.22) 0%, rgba(18, 22, 34, 0.72) 100%);
  border-color: rgba(var(--accent-rgb), 0.6);
}

html[data-ui-style="glass"] .workout-kpis {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.08) 0%, rgba(16, 20, 32, 0.65) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* ── THEME 2: NOTHING OS (NDOT) overrides for Builder, Workout & Fullscreen Modals ── */
html[data-ui-style="nothing"] .modal-sheet.fullscreen,
html[data-ui-style="nothing"] .workout-overlay {
  background-color: #000000;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 16px 16px;
}

html[data-ui-style="nothing"] .modal-sheet:not(.fullscreen) {
  background: #0b0b0d;
  backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

html[data-ui-style="nothing"] .modal-header,
html[data-ui-style="nothing"] .modal-footer,
html[data-ui-style="nothing"] .workout-topbar {
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.22);
}

html[data-ui-style="nothing"] .modal-footer {
  border-bottom: none;
  border-top: 1px dashed rgba(255, 255, 255, 0.22);
}

html[data-ui-style="nothing"] .w-exercise-card,
html[data-ui-style="nothing"] .rb-meta-card,
html[data-ui-style="nothing"] .reorder-row,
html[data-ui-style="nothing"] .exercise-list-item,
html[data-ui-style="nothing"] .inline-search-results,
html[data-ui-style="nothing"] .workout-kpis {
  background: #0b0b0d;
  backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
  border-radius: 20px;
}

html[data-ui-style="nothing"] .exercise-list-item.is-selected {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.14);
}

html[data-ui-style="nothing"] .workout-title-input,
html[data-ui-style="nothing"] .w-ex-title {
  font-family: var(--font-ndot) !important;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

html[data-ui-style="nothing"] .rb-set-head,
html[data-ui-style="nothing"] .btn-reorder-pill,
html[data-ui-style="nothing"] .picker-chip,
html[data-ui-style="nothing"] .btn-add-set {
  font-family: var(--font-mono-n);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

html[data-ui-style="nothing"] .btn-add-set,
html[data-ui-style="nothing"] .inline-search-input {
  border-radius: 999px !important;
}

/* ── THEME 3: CLASSIC DARK overrides for Builder, Workout & Fullscreen Modals ── */
html[data-ui-style="classic"] .workout-overlay,
html[data-ui-style="classic"] .modal-sheet.fullscreen {
  background-color: #0b0e14;
  background-image: none;
}

html[data-ui-style="classic"] .modal-sheet:not(.fullscreen),
html[data-ui-style="classic"] .modal-header,
html[data-ui-style="classic"] .modal-footer,
html[data-ui-style="classic"] .workout-topbar {
  background: #10151f;
  backdrop-filter: none;
}

html[data-ui-style="classic"] .w-exercise-card,
html[data-ui-style="classic"] .rb-meta-card,
html[data-ui-style="classic"] .reorder-row,
html[data-ui-style="classic"] .exercise-list-item,
html[data-ui-style="classic"] .inline-search-results,
html[data-ui-style="classic"] .workout-kpis,
html[data-ui-style="classic"] .ai-step-card {
  background: #141923;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* ─── AI Routine Import Modal Styles ─────────────────────────────────────── */
.ai-step-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-ui-style="glass"] .ai-step-card {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.095) 0%, rgba(18, 22, 34, 0.68) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 26px -14px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

html[data-ui-style="nothing"] .ai-step-card {
  background: #0b0b0d;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
  border-radius: 20px;
}

.ai-step-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.ai-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 13px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.ai-step-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.ai-step-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}

.ai-prompt-box {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow-y: auto;
}

.ai-paste-textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.45;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(var(--accent-rgb), 0.30);
  border-radius: 13px;
  padding: 11px 12px;
  color: var(--text);
}

.ai-paste-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.24);
}

.ai-preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-preview-ex-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.ai-preview-ex-name {
  font-size: 14px;
  font-weight: 750;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-preview-ex-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

.ai-preview-raw-hint {
  font-size: 10.5px;
  color: var(--text-muted);
  opacity: 0.78;
  margin-top: 2px;
}

.ai-match-badge {
  display: inline-flex;
  align-items: center;
  padding: 1.5px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.ai-match-badge.ok {
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.36);
}

.ai-match-badge.custom {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* ═══════════════════════════════════════════════════════════════════════════
   JUICED v4 — DOMOVSKÁ A (BENTO DASHBOARD) + TRÉNING 1/2 (FOCUS FLOW,
   AUTO-COLLAPSE COMPLETED EXERCISES & ENLARGED 2-ROW REST TIMER DOCK)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Home A: Weekly Activity Strip ── */
.weekly-strip-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: var(--radius-lg);
  padding: 12px 13px;
  margin-bottom: 12px;
  box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.weekly-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.weekly-strip-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.weekly-strip-vol {
  font-size: 12.5px;
  font-weight: 850;
  color: var(--accent);
}

.weekly-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.weekly-day-pill {
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid transparent;
}

.weekly-day-pill.today {
  border-color: rgba(255, 255, 255, 0.34);
  color: var(--text);
  font-weight: 800;
}

.weekly-day-pill.trained {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: transparent;
  font-weight: 850;
  box-shadow: 0 4px 12px -4px rgba(var(--accent-rgb), 0.55);
}

/* ── Home A: Next Up Recommended Hero Card ── */
.next-up-card {
  padding: 14px 15px !important;
  margin-bottom: 12px !important;
}

.next-up-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.next-up-eyebrow {
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-transform: uppercase;
}

.next-up-when {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.next-up-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.next-up-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.next-up-title {
  margin: 0;
  font-size: 19px;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.next-up-meta {
  font-size: 12.5px;
  color: #cbd5e1;
  margin-top: 3px;
}

.next-up-start-btn {
  padding: 11px 16px !important;
  min-height: 44px;
  font-size: 13.5px !important;
  border-radius: 15px !important;
  flex-shrink: 0;
}

/* ── Home A: 3-Button Quick Action Row ── */
.bento-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.bento-quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 8px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 750;
  transition: transform 0.14s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.bento-quick-btn:active {
  transform: scale(0.96);
}

.bento-quick-btn.accent {
  background: rgba(var(--accent-rgb), 0.15);
  border-color: rgba(var(--accent-rgb), 0.38);
  color: var(--accent);
}

/* ── Home A: 2-Column Bento Routine Grid & Avatar-Stack Cards ── */
.bento-routine-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.bento-routine-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  content-visibility: auto;
  contain-intrinsic-size: auto 168px;
}

.bento-card-top {
  cursor: pointer;
  min-width: 0;
}

.bento-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
}

.bento-routine-name {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bento-menu-btn {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  font-size: 15px;
  margin: -3px -4px 0 0;
}

.bento-card-meta {
  font-size: 11.5px;
  color: #cbd5e1;
  font-weight: 650;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bento-card-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.bento-avatar-stack {
  display: flex;
  align-items: center;
  margin-top: 9px;
}

.bento-avatar-stack > .ex-thumb:not(:first-child),
.bento-avatar-stack > .bento-more-dot {
  margin-left: -8px;
}

.bento-more-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(15, 20, 32, 0.92);
  border: 2px solid rgba(var(--accent-rgb), 0.45);
  color: var(--text);
  font-size: 10.5px;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bento-card-empty {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 10px;
}

.bento-start-btn {
  width: 100%;
  min-height: 36px;
  font-size: 12.5px;
  border-radius: 11px;
}

/* ── Active Workout 1 + 2: Top Progress Bar, Focus Next Set & Auto-Collapsed Completed Pill ── */
.wk-progress-track {
  height: 4px;
  width: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.wk-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #10b981);
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.w-ex-progress-track {
  height: 3px;
  width: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 8px;
}

.w-ex-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.25s ease, background-color 0.25s ease;
}

.w-ex-progress-fill.complete {
  background: #10b981;
}

/* Highlighted Active Next Set Row (Focus Flow) */
.set-row.is-next-set {
  background: rgba(var(--accent-rgb), 0.11);
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  border-radius: 12px;
  padding: 5px 4px;
  margin-left: -4px;
  margin-right: -4px;
}

.set-row.is-next-set .set-input {
  border-color: rgba(var(--accent-rgb), 0.52);
  background: rgba(var(--accent-rgb), 0.09);
}

.set-row.is-next-set .set-type-btn.type-normal {
  background: rgba(var(--accent-rgb), 0.20);
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.45);
}

/* Auto-Collapsed Completed Exercise Pill (Tréning 2) */
.w-ex-collapsed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  margin-bottom: 10px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14) 0%, rgba(16, 22, 32, 0.82) 100%);
  border: 1px solid rgba(16, 185, 129, 0.38);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.14s ease, border-color 0.16s ease;
  animation: tabFadeUp 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.w-ex-collapsed:active {
  transform: scale(0.985);
}

.w-ex-collapsed.has-superset {
  border-left: 4px solid var(--superset-color, #10b981);
}

.w-ex-collapsed-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.w-ex-done-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #10b981;
  color: #052e16;
  font-size: 13px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.w-ex-collapsed-info {
  min-width: 0;
  flex: 1;
}

.w-ex-collapsed-name {
  font-size: 14px;
  font-weight: 800;
  color: #d1fae5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.w-ex-collapsed-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.w-ex-collapsed-pr {
  color: #fcd34d;
  font-weight: 800;
}

.w-ex-expand-lbl {
  font-size: 11.5px;
  font-weight: 700;
  color: #6ee7b7;
  flex-shrink: 0;
}

.w-ex-collapse-btn {
  color: #6ee7b7 !important;
  border-color: rgba(16, 185, 129, 0.38) !important;
  background: rgba(16, 185, 129, 0.14) !important;
}

/* ── ENLARGED 2-ROW REST TIMER DOCK (Tréning 1 Hero Countdown!) ── */
.workout-scroll {
  padding-bottom: calc(var(--safe-bottom) + 200px);
}

.rest-timer-bar {
  left: 10px;
  right: 10px;
  bottom: calc(var(--safe-bottom) + 10px);
  padding: 13px 15px 13px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(var(--accent-rgb), 0.24) 0%, rgba(11, 14, 22, 0.96) 62%);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1.5px solid rgba(var(--accent-rgb), 0.62);
  box-shadow: 0 -10px 36px -6px rgba(var(--accent-rgb), 0.28), 0 20px 44px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rest-dock-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.rest-dock-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rest-label {
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.07em;
  color: var(--accent);
}

.rest-next-hint {
  font-size: 12.5px;
  color: #cbd5e1;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rest-countdown {
  font-size: 42px;
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #ffffff;
  flex-shrink: 0;
}

.rest-progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  overflow: hidden;
}

.rest-progress-fill {
  border-radius: 999px;
}

.rest-dock-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.3fr;
  gap: 7px;
}

.rest-dock-actions .btn-rest-adj,
.rest-dock-actions .btn-rest-skip {
  min-height: 44px;
  border-radius: 13px;
  font-size: 13.5px;
  font-weight: 800;
  padding: 0 6px;
}

.rest-dock-actions .btn-rest-adj {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f8fafc;
}

.rest-dock-actions .btn-rest-skip {
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  box-shadow: 0 6px 18px -4px rgba(var(--accent-rgb), 0.55);
}

/* ── Theme Parity: Liquid Glass, Nothing OS (Ndot) & Classic Dark ── */
html[data-ui-style="glass"] .weekly-strip-card,
html[data-ui-style="glass"] .bento-routine-card,
html[data-ui-style="glass"] .bento-quick-btn:not(.accent) {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.095) 0%, rgba(18, 22, 34, 0.68) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 26px -14px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

html[data-ui-style="nothing"] .weekly-strip-card,
html[data-ui-style="nothing"] .bento-routine-card,
html[data-ui-style="nothing"] .bento-quick-btn:not(.accent) {
  background: #0b0b0d;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
  border-radius: 20px;
}

html[data-ui-style="nothing"] .weekly-strip-label,
html[data-ui-style="nothing"] .next-up-eyebrow,
html[data-ui-style="nothing"] .rest-label,
html[data-ui-style="nothing"] .bento-quick-btn {
  font-family: var(--font-mono-n);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

html[data-ui-style="nothing"] .rest-timer-bar {
  background: #0b0b0d;
  backdrop-filter: none;
  border: 1.5px solid var(--accent);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.95);
}

html[data-ui-style="nothing"] .rest-dock-actions .btn-rest-adj,
html[data-ui-style="nothing"] .rest-dock-actions .btn-rest-skip {
  border-radius: 999px;
  font-family: var(--font-mono-n);
}

html[data-ui-style="nothing"] .w-ex-collapsed {
  background: #0b0b0d;
  border: 1px dashed rgba(16, 185, 129, 0.65);
}

html[data-ui-style="classic"] .weekly-strip-card,
html[data-ui-style="classic"] .bento-routine-card,
html[data-ui-style="classic"] .bento-quick-btn:not(.accent) {
  background: #141923;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

html[data-ui-style="classic"] .rest-timer-bar {
  background: #121722;
  backdrop-filter: none;
  border: 1.5px solid rgba(var(--accent-rgb), 0.62);
}

/* ═══════════════════════════════════════════════════════════════════════════
   JUICED v5 — WEEKLY MUSCLE HEATMAP + POST-WORKOUT RECAP, PHOTO & SHARE PNG
   ═══════════════════════════════════════════════════════════════════════════ */

.heatmap-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.heatmap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.heatmap-title {
  margin: 0;
  font-size: 15px;
  font-weight: 850;
}

.heatmap-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.heatmap-range-pills {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.heatmap-range-pills .metric-pill {
  padding: 5px 10px;
  font-size: 11.5px;
}

.heatmap-svg-wrap {
  max-width: 340px;
  margin: 4px auto 8px;
}

.heatmap-svg path {
  transition: fill 0.22s ease, stroke 0.22s ease, stroke-width 0.16s ease;
}

.heatmap-focus-bar {
  text-align: center;
  font-size: 12.5px;
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.14);
  border: 1px solid rgba(var(--accent-rgb), 0.36);
  border-radius: 10px;
  padding: 6px 10px;
  margin-bottom: 10px;
}

.heatmap-chips-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.heatmap-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 7px 9px;
  border-radius: 11px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-secondary);
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.12s ease;
}

.heatmap-chip:active { transform: scale(0.96); }

.heatmap-chip.worked {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.30);
  color: var(--text);
}

.heatmap-chip.hot {
  background: rgba(var(--accent-rgb), 0.22);
  border-color: rgba(var(--accent-rgb), 0.56);
  color: #ffffff;
}

.heatmap-chip.zero {
  opacity: 0.58;
}

.heatmap-chip.active {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.35);
  opacity: 1;
}

.hm-chip-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hm-chip-val {
  font-weight: 850;
  color: var(--accent);
}

.heatmap-chip.zero .hm-chip-val {
  color: var(--text-muted);
}

/* Post-Workout Recap, Gym Photo & Share PNG Modal */
.recap-delta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
}

.recap-delta-banner.up {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.20) 0%, rgba(16, 24, 32, 0.85) 100%);
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.recap-delta-banner.down {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.recap-delta-main {
  font-size: 14.5px;
  font-weight: 850;
  color: #f8fafc;
}

.recap-delta-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.recap-delta-pill {
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
  flex-shrink: 0;
}

.recap-delta-banner.down .recap-delta-pill {
  background: rgba(255, 255, 255, 0.10);
  color: #cbd5e1;
}

.recap-section-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-lg);
  padding: 13px 14px;
  margin-bottom: 12px;
}

.recap-section-title {
  font-size: 13.5px;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text);
}

.recap-pr-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recap-pr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 11px;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.28);
  font-size: 13px;
}

.recap-pr-name {
  font-weight: 750;
  color: #fef3c7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recap-pr-val {
  font-weight: 850;
  color: #fcd34d;
  flex-shrink: 0;
}

.recap-photo-wrap {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #05070c;
  max-height: 290px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.recap-photo-img {
  width: 100%;
  max-height: 290px;
  object-fit: cover;
  display: block;
}

.history-photo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.34);
}

html[data-ui-style="glass"] .heatmap-card,
html[data-ui-style="glass"] .recap-section-card {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.095) 0%, rgba(18, 22, 34, 0.68) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 26px -14px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

html[data-ui-style="nothing"] .heatmap-card,
html[data-ui-style="nothing"] .recap-section-card {
  background: #0b0b0d;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
  border-radius: 20px;
}

html[data-ui-style="nothing"] .heatmap-title,
html[data-ui-style="nothing"] .recap-section-title {
  font-family: var(--font-ndot) !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

html[data-ui-style="classic"] .heatmap-card,
html[data-ui-style="classic"] .recap-section-card {
  background: #141923;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* ═══════════════════════════════════════════════════════════════════════════
   JUICED v6 — LIVE + STEALTH ACTIVE WORKOUT REFINEMENT
   Keeps rich accent & status colors, eliminates harsh neon glow & loud floods
   ═══════════════════════════════════════════════════════════════════════════ */

/* Softer ambient backdrop during active lifting (easy on the eyes in gym!) */
html[data-ui-style="glass"] .workout-overlay {
  background-image:
    radial-gradient(ellipse 90% 34% at 50% -10%, rgba(var(--accent-rgb), 0.16) 0%, transparent 72%);
}

/* Calm crisp primary buttons inside active workout (color without neon glare) */
.workout-overlay .btn-primary,
.workout-overlay .btn-brand {
  box-shadow: none !important;
}

.workout-overlay .w-exercise-card .ex-thumb {
  border-width: 1.5px;
  border-color: rgba(var(--accent-rgb), 0.36);
}

/* Subtle matte rest tool chip (accent text, calm dark surface) */
.workout-overlay .w-ex-tool-btn.active-rest {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(var(--accent-rgb), 0.28);
  color: var(--accent);
}

/* Clean Accent PB header pill (no gold, no emoji) */
.workout-overlay .pb-pill,
.workout-overlay .pb-pill.merged {
  background: rgba(var(--accent-rgb), 0.10);
  border-color: rgba(var(--accent-rgb), 0.24);
  color: var(--accent);
}

/* Clean POSL. / PB Reference Column:
   - Last = large crisp white
   - PB underneath = small user accent color
   - Merged (Last == PB) = single large value in user accent color */
.workout-overlay .ref-cell {
  gap: 1px;
}

.workout-overlay .ref-tap {
  background: transparent;
  border: none;
  padding: 1px 4px;
  line-height: 1.15;
}

.workout-overlay .ref-last {
  font-size: 13.5px;
  font-weight: 750;
  color: #f8fafc;
}

.workout-overlay .ref-pb {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.92;
}

.workout-overlay .ref-merged {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--accent);
  background: transparent;
  border: none;
  padding: 2px 4px;
}

/* Active Next Set: Stealth 3px accent bar + clean neutral elevation (zero orange flood!) */
.workout-overlay .set-row.is-next-set {
  background: rgba(255, 255, 255, 0.045);
  border: none;
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 5px 5px 5px 7px;
  margin-left: -4px;
  margin-right: -4px;
}

.workout-overlay .set-row.is-next-set .set-input {
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(255, 255, 255, 0.17);
  color: #ffffff;
}

.workout-overlay .set-row.is-next-set .set-input:focus {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  box-shadow: none;
}

.workout-overlay .set-row.is-next-set .set-type-btn.type-normal {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

/* Completed Set: Calm muted emerald, no glaring boxes */
.workout-overlay .set-row.completed {
  background: rgba(16, 185, 129, 0.065);
  border-radius: 10px;
}

.workout-overlay .set-row.completed .set-input {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.22);
  color: #cbd5e1;
}

.workout-overlay .set-row.completed .set-check-btn {
  background: rgba(16, 185, 129, 0.24);
  border-color: rgba(16, 185, 129, 0.48);
  color: #6ee7b7;
}

/* Calm + Add Set button (keeps accent text, removes orange background glare) */
.workout-overlay .btn-add-set {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--accent);
}

.workout-overlay .btn-add-set:active {
  background: rgba(var(--accent-rgb), 0.12);
}

/* Calm Completed Collapsed Exercise Pill (clean matte dark + subtle emerald edge) */
.workout-overlay .w-ex-collapsed {
  background: rgba(18, 24, 34, 0.88);
  border: 1px solid rgba(16, 185, 129, 0.30);
}

.workout-overlay .w-ex-done-check {
  background: rgba(16, 185, 129, 0.24);
  border: 1px solid rgba(16, 185, 129, 0.50);
  color: #6ee7b7;
}

/* Big 2-Row Rest Timer Dock: Matte obsidian + crisp accent top bar & progress (ZERO outer halo!) */
.rest-timer-bar {
  background: rgba(13, 17, 26, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-top: 2.5px solid var(--accent);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.82);
}

.rest-progress-fill {
  background: var(--accent);
  box-shadow: none;
}

.rest-dock-actions .btn-rest-skip {
  box-shadow: none;
}

html[data-ui-style="nothing"] .rest-timer-bar {
  background: #0b0b0d;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-top: 2.5px solid var(--accent);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.92);
}

html[data-ui-style="classic"] .rest-timer-bar {
  background: #121722;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 2.5px solid var(--accent);
}

/* ═══════════════════════════════════════════════════════════════════════════
   COMPACT ANDROID / IPHONE "ADD TO HOME SCREEN" INSTALL SHEET
   ═══════════════════════════════════════════════════════════════════════════ */
.pwa-install-card {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--safe-bottom) + 14px);
  max-width: 440px;
  margin: 0 auto;
  z-index: 108;
  background: rgba(13, 17, 26, 0.96);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 2px solid var(--accent);
  border-radius: 20px;
  padding: 13px 14px 14px;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.84);
  animation: sheetSpringIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pwa-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.pwa-card-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pwa-brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1.5px solid rgba(var(--accent-rgb), 0.45);
  flex-shrink: 0;
}

.pwa-card-title {
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.2;
}

.pwa-card-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

.pwa-close-btn {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  font-size: 13px;
}

.pwa-platform-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin-bottom: 11px;
}

.pwa-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 750;
  color: var(--text-secondary);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pwa-tab-btn.active {
  background: var(--accent);
  color: var(--accent-fg);
}

.pwa-action-btn {
  min-height: 44px;
  box-shadow: none !important;
}

.pwa-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.pwa-apk-link {
  color: var(--accent);
  font-weight: 750;
  text-decoration: none;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  flex-shrink: 0;
}

.pwa-fallback-hint {
  margin-top: 9px;
  padding: 9px 10px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 12px;
  line-height: 1.4;
  color: #cbd5e1;
}

.pwa-ios-warn {
  margin-bottom: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.30);
  color: #fde68a;
  font-size: 11.5px;
}

.pwa-ios-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pwa-ios-step {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12.5px;
  color: #e2e8f0;
}

.pwa-step-dot {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 11px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pwa-ios-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 5px;
  margin-left: 3px;
  border-radius: 6px;
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
  vertical-align: middle;
}

html[data-ui-style="nothing"] .pwa-install-card {
  background: #0b0b0d;
  backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-top: 2px solid var(--accent);
}

html[data-ui-style="nothing"] .pwa-card-title {
  font-family: var(--font-ndot) !important;
  text-transform: uppercase;
}

/* ── SK / EN Language Switchers ── */
.segmented-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(0, 0, 0, 0.32);
  padding: 5px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 8px;
}

.auth-lang-pill {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-lang-btn {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  transition: background-color 0.14s ease, color 0.14s ease;
}

.auth-lang-btn.active {
  background: var(--accent);
  color: var(--accent-fg);
}

/* ── Auth Login / New Account Switcher ── */
.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 4px;
  margin: 0 0 16px;
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-mode-btn {
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 750;
  color: var(--text-muted);
  transition: background-color 0.14s ease, color 0.14s ease;
}

.auth-mode-btn.active {
  background: var(--accent);
  color: var(--accent-fg);
}

.auth-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-color-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.auth-color-dot.active {
  border-color: #ffffff;
  transform: scale(1.1);
}

/* ── Speed-Dial (!) Bug & Idea Reporter (Návrh A) ── */
.report-backdrop {
  position: fixed;
  inset: 0;
  z-index: 48;
  background: rgba(4, 6, 10, 0.56);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.report-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.report-anchor {
  position: fixed;
  left: max(14px, calc(50% - 280px + 2px));
  bottom: calc(82px + var(--safe-bottom));
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  transition: bottom 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.report-anchor.has-min-bar {
  bottom: calc(146px + var(--safe-bottom));
}

.report-fab {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(16, 20, 30, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-secondary);
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.78);
  display: grid;
  place-items: center;
  transition: transform 0.14s ease, border-color 0.14s ease, color 0.14s ease, background-color 0.14s ease;
}

html[data-ui-style="nothing"] .report-fab {
  background: #0d0d10;
  border-color: rgba(255, 255, 255, 0.28);
  backdrop-filter: none;
}

html[data-ui-style="classic"] .report-fab {
  background: #161c28;
  backdrop-filter: none;
}

.report-fab:active {
  transform: scale(0.92);
}

.report-fab.open {
  background: rgba(var(--accent-rgb), 0.20);
  border-color: var(--accent);
  color: var(--accent);
}

.report-fab .ico-x {
  display: none;
}

.report-fab.open .ico-bang {
  display: none;
}

.report-fab.open .ico-x {
  display: block;
}

.dial-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  opacity: 0;
  transform: translateY(10px) scale(0.92);
  transform-origin: bottom left;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.dial-menu.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.dial-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px 8px 10px;
  border-radius: 999px;
  background: rgba(16, 21, 33, 0.96);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 26px -8px rgba(0, 0, 0, 0.85);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  transition: transform 0.12s ease;
}

html[data-ui-style="nothing"] .dial-pill {
  background: #0b0b0e;
}

.dial-pill:active {
  transform: scale(0.96);
}

.dial-pill.bug {
  border-color: rgba(239, 68, 68, 0.45);
}

.dial-pill.idea {
  border-color: rgba(var(--accent-rgb), 0.52);
}

.dial-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.dial-pill.bug .dial-badge {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}

.dial-pill.idea .dial-badge {
  background: rgba(var(--accent-rgb), 0.20);
  color: var(--accent);
}

.dial-hint {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 2px;
}

.report-type-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.report-type-chip.bug {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.38);
}

.report-type-chip.idea {
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.42);
}

.report-ctx-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 11px;
  color: var(--text-muted);
}

.report-ctx-bar code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-secondary);
}

/* ── Admin Feedback Inbox in Settings ── */
.feedback-open-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent);
}

.feedback-filter-pills {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid var(--border);
}

.feedback-flt-btn {
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 750;
  color: var(--text-muted);
}

.feedback-flt-btn.active {
  background: var(--accent);
  color: var(--accent-fg);
}

.feedback-admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.feedback-admin-item {
  padding: 10px 11px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feedback-admin-item.done {
  opacity: 0.62;
}

.feedback-admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.feedback-admin-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}

.feedback-admin-msg {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.42;
  white-space: pre-wrap;
  word-break: break-word;
}

.feedback-admin-ctx {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

/* ── v18: Clean PR Trophy on Set Check, Skipped/Grouped Exercises & Custom Rest ── */
.set-check-btn.has-pr {
  position: relative;
  overflow: visible;
}

.set-pr-trophy {
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 12px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.8));
}

.wk-group-divider {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 10px 2px 6px;
}

.wk-group-divider:first-child {
  margin-top: 2px;
}

.wk-group-divider.done {
  color: #6ee7b7;
}

.wk-group-divider.skipped {
  color: #94a3b8;
  margin-top: 14px;
}

.workout-overlay .w-ex-collapsed.is-skipped,
.w-ex-collapsed.is-skipped {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.14);
}

.w-ex-done-check.is-skipped {
  background: rgba(148, 163, 184, 0.20);
  color: #cbd5e1;
}

.w-ex-collapsed.is-skipped .w-ex-collapsed-name {
  color: var(--text-secondary);
}

.w-ex-collapsed.is-skipped .w-ex-expand-lbl {
  color: var(--text-muted);
}

.rest-preset-wrap {
  position: relative;
}

.rest-preset-del {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  display: grid;
  place-items: center;
  border: 1.5px solid #0b0e14;
}

.rest-custom-box {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.rest-custom-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.rest-custom-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rest-custom-fields {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.rest-custom-fields input {
  width: 52px;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 8px 6px;
  border-radius: 10px;
}

.rest-custom-colon {
  font-size: 18px;
  font-weight: 900;
  color: var(--text-muted);
}
