/* ============================================================
   Round Log: app.css
   Mobile-first, clean, functional. No framework.
   ============================================================ */

:root {
  --bg:          #0f1117;
  --surface:     #1a1d27;
  --surface2:    #232636;
  --border:      #2e3147;
  --text:        #e8eaf0;
  --text-muted:  #7b80a0;
  --accent:      #00e5ff;
  --accent-dim:  #0d4552;
  --accent-on:   #0f1117;
  --brand-cyan:  var(--accent);
  --ok:          #3ecf8e;
  --warn:        #f5a623;
  --danger:      #e05252;
  --boxing:      #c47af5;
  --circuit:     var(--accent);
  --radius:      8px;
  --radius-sm:   4px;
  --font:        -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:   "SF Mono", "Fira Code", monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────── */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-logo,
.brand-title {
  color: var(--brand-cyan);
}

.site-logo {
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
  min-width: 0;
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.site-nav {
  display: none;
}

.nav-link {
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover, .nav-link.active {
  background: var(--accent-dim);
  color: var(--accent);
}
.nav-link-tabata {
  color: #00cfe8;
}
.nav-link-tabata:hover,
.nav-link-tabata.active {
  background: rgba(0, 229, 255, 0.12);
  color: #00e5ff;
}

.lang-toggle { display: flex; gap: 2px; }
.lang-btn {
  padding: 0.25rem 0.5rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
}
.lang-active { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }

/* ── Header overflow menu (⋮) ─────────────────────────────── */

.header-overflow-wrap {
  position: relative;
}

.header-overflow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.header-overflow-btn:hover,
.header-overflow-btn[aria-expanded="true"] {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface2));
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.header-overflow-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 12.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  z-index: 250;
  padding: 0.35rem 0;
}

.header-overflow-menu[hidden] {
  display: none !important;
}

.header-overflow-item {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  text-align: left;
  border: none;
  background: none;
  font-family: inherit;
  cursor: pointer;
}

.header-overflow-item:hover,
.header-overflow-item.is-active {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
}

.header-overflow-tabata:hover,
.header-overflow-tabata.is-active {
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.08);
}

.header-overflow-divider {
  height: 1px;
  margin: 0.35rem 0;
  background: var(--border);
}

.header-overflow-logout {
  margin: 0;
}

/* ── Mobile bottom nav (legacy, hidden in favour of menu button) ── */

.mobile-nav {
  display: none;
}

.mobile-nav-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.45rem 0.25rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.65rem;
  line-height: 1.1;
  min-height: 3.25rem;
  transition: color 0.15s, background 0.15s;
}

.mobile-nav-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.mobile-nav-tabata.active,
.mobile-nav-tabata:hover {
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.08);
}

/* ── Main ─────────────────────────────────────────────── */

.site-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 1rem;
  padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
}
.site-main:has(.circuit-builder-page) {
  max-width: 1200px;
}
.stats-placeholder { display: grid; gap: 1rem; }

/* ── Bottom tab bar ─────────────────────────────────────── */
.bottom-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.3rem 0.15rem calc(0.3rem + env(safe-area-inset-bottom, 0px));
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  min-width: 0;
  padding: 0.35rem 0.1rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.1;
}
.bottom-nav-item span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bottom-nav-item.is-on { color: #ff4d8d; }
.bottom-nav-icon {
  width: 1.4rem;
  height: 1.4rem;
  flex-shrink: 0;
}

/* ── Page header ────────────────────────────────────────── */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}
.page-header h1 { font-size: 1.4rem; font-weight: 700; }
.page-header-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.session-id-tag { font-size: 0.75rem; color: var(--text-muted); font-weight: 400; margin-left: 0.35rem; }

/* ── Cards ─────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}
.card-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.75rem; }
.card-item { padding: 0.6rem 1rem; }
.card-item-actions { display: flex; align-items: stretch; gap: 0; padding: 0; overflow: hidden; }
.card-item-actions .card-link { flex: 1; padding: 0.6rem 1rem; min-width: 0; align-items: flex-start; }
.card-item-delete { display: flex; align-items: center; padding: 0 0.65rem; border-left: 1px solid var(--border); margin: 0; }
.card-link-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.card-preview { display: block; color: var(--text-muted); font-size: 0.8rem; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.card-link { display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: var(--text); gap: 0.75rem; }
.card-meta { color: var(--text-muted); font-size: 0.85rem; flex-shrink: 0; }
.slot-meta-inline { display: block; color: var(--text-muted); font-size: 0.78rem; font-weight: 400; margin-top: 0.1rem; }
.slot-name .badge { margin-left: 0.35rem; vertical-align: middle; font-size: 0.65rem; }

.circuit-timing-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}
.circuit-timing-row {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  padding: 0.35rem 0.55rem;
  min-width: 4.5rem;
  flex: 0 0 auto;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.circuit-timing-row.circuit-timing-total {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface2));
  padding: 0.4rem 0.65rem;
}
.circuit-timing-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}
.circuit-timing-value {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.circuit-timing-hint { margin-top: 0.5rem; margin-bottom: 0; }
.circuit-timing-notes {
  margin-top: 0.65rem;
  padding-top: 0.6rem;
  border-top: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
}
.circuit-timing-notes p {
  margin: 0 0 0.3rem;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-muted);
}
.circuit-timing-notes p:last-child { margin-bottom: 0; }
.circuit-timing-block {
  margin: 0.75rem 0 1rem;
  padding: 0.65rem 0.75rem;
  width: fit-content;
  max-width: 100%;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface2));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: var(--radius);
}
.circuit-timing-heading {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.circuit-timing-block .circuit-timing-summary { margin-top: 0; }
.circuit-timing-row.circuit-timing-total .circuit-timing-value {
  color: var(--accent);
  font-size: 1.05rem;
}

/* ── Buttons ────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
a.btn,
a.btn:hover,
a.btn:focus {
  text-decoration: none;
}
.page-header-actions a.btn-header-link {
  text-decoration: none;
  border-color: var(--border);
}
.page-header-actions a.btn-header-link:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  color: var(--text);
}
.btn:hover { opacity: 0.85; }
.btn-primary  { background: var(--accent);   color: var(--accent-on); font-weight: 600; }
.btn-secondary{ background: var(--surface2); color: var(--text); border-color: var(--border); }
.btn-danger   { background: var(--danger);   color: #fff; }
.btn-ghost    { background: none; color: var(--text-muted); border-color: var(--border); }
.btn-full     { width: 100%; justify-content: center; margin-top: 0.5rem; }

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  font-size: 0.9rem;
}
.btn-icon:hover, .btn-danger-icon:hover { color: var(--danger); }
.btn-icon-xs { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.75rem; padding: 0.1rem 0.3rem; }

/* ── Forms ──────────────────────────────────────────────── */

.input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.4rem 0.6rem;
  font-size: 0.875rem;
  width: 100%;
}
.input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.input-sm  { width: auto; min-width: 8rem; }
.input-xs  { width: 5rem; }
.input-num { width: 5rem; text-align: right; }
.textarea  { resize: vertical; font-family: var(--font); }

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 0.75rem;
}
.form-row-tight { gap: 0.4rem; }
.label-wide { flex: 1; display: flex; flex-direction: column; gap: 0.25rem; }
.label-inline { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; }

label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; color: var(--text-muted); }
label input, label select, label textarea { color: var(--text); }

.unit { font-size: 0.8rem; color: var(--text-muted); }

/* ── Tables ──────────────────────────────────────────────── */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table th {
  text-align: left;
  padding: 0.4rem 0.5rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.data-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }

/* ── Dashboard ──────────────────────────────────────────── */

.stat-row { display: flex; gap: 2rem; }
.stat { display: flex; flex-direction: column; }
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1; color: var(--accent); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); }

.freq-grid { display: flex; flex-direction: column; gap: 0.4rem; }
.freq-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.35rem 0.5rem; border-radius: var(--radius-sm); }
.freq-ok { background: color-mix(in srgb, var(--ok) 10%, transparent); }
.freq-partial { background: color-mix(in srgb, var(--warn) 8%, transparent); }
.freq-name { width: 9rem; font-size: 0.85rem; }
.freq-dots { display: flex; gap: 4px; }
.freq-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border); }
.freq-dot-filled { background: var(--ok); }
.freq-count { font-size: 0.8rem; color: var(--text-muted); margin-left: auto; }

.home-page { display: grid; gap: 1rem; }
.home-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.1rem 1rem 1.15rem;
}
.home-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.home-section-title {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
  font-weight: 800;
}
.home-section-head .home-section-title { margin-bottom: 0.65rem; }
.home-see-more {
  color: #ff4d8d;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}
.home-see-more:hover { color: #ff7aae; }
.home-flash-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  text-align: center;
  margin-bottom: 1rem;
}
.home-flash-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.home-flash-value {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.55rem;
  font-weight: 800;
  color: #ff4d8d;
  letter-spacing: -0.02em;
}
.home-flash-start {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.1rem;
  border-radius: 999px;
  background: #ff4d8d;
  color: #111;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
}
.home-flash-start:hover { background: #ff6aa0; }
.home-flash-edit {
  display: block;
  margin-top: 0.65rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-decoration: none;
}
.home-flash-edit:hover { color: #ff4d8d; }
.home-goals { display: grid; gap: 1.15rem; }
.home-goal-title {
  margin: 0 0 0.7rem;
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
}
.home-streak {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
}
.home-streak-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  color: var(--text-muted);
}
.home-streak-mark {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
  background: var(--surface2);
}
.home-streak-day.is-done .home-streak-mark {
  background: color-mix(in srgb, #ff4d8d 22%, var(--surface2));
  color: #ff4d8d;
}
.home-streak-day.is-today .home-streak-num { color: var(--text); font-weight: 800; }
.home-streak-num { font-size: 0.78rem; font-weight: 700; }
.home-streak-mon { font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.04em; }
.home-goal-meta {
  margin: 0.65rem 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.home-goal-ok { color: var(--ok); }
.home-week-goal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.home-week-copy { flex: 1; min-width: 0; }
.home-week-copy .home-goal-title,
.home-week-copy .home-goal-meta { text-align: left; }
.home-week-numbers {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-muted);
}
.home-week-numbers strong {
  font-size: 1.6rem;
  color: var(--text);
  font-weight: 800;
}
.home-ring {
  --pct: 0;
  width: 5.4rem;
  height: 5.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: conic-gradient(#ff4d8d calc(var(--pct) * 1%), var(--surface2) 0);
}
.home-ring-value {
  width: 3.9rem;
  height: 3.9rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  font-weight: 800;
}
.home-today-lead {
  margin: 0 0 0.55rem;
  font-size: 1.02rem;
  font-weight: 700;
}
.home-today-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.65rem; }
.home-today-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  background: var(--accent-dim);
  color: var(--accent);
}
.home-today-btn { width: 100%; margin-top: 0.55rem; }
.home-today form { margin: 0; }
.home-month-label { margin: 0; color: var(--text-muted); font-size: 0.82rem; }
.home-month-value { margin: 0.2rem 0 0; font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; }
.home-activity-list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.home-activity {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  border-left: 4px solid var(--w-color, #ff4d8d);
}
.home-activity-main {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.8rem;
  text-decoration: none;
  color: inherit;
}

.stats-card { display: flex; flex-direction: column; gap: 0.75rem; }
.stats-card-hint { margin: 0; }
.stats-total-row { margin-bottom: 0.25rem; }
.stats-category-list,
.stats-ranked-list,
.stats-weekday-grid { display: flex; flex-direction: column; gap: 0.65rem; }
.stats-category-head,
.stats-ranked-row,
.stats-weekday-row { display: grid; grid-template-columns: 6.5rem 1fr auto; align-items: center; gap: 0.65rem; }
.stats-category-head { grid-template-columns: 1fr auto; }
.stats-category-name,
.stats-ranked-name,
.stats-weekday-label { font-size: 0.85rem; }
.stats-category-value,
.stats-ranked-count,
.stats-weekday-count { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }
.stats-bar {
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 80%, transparent);
  overflow: hidden;
}
.stats-bar-inline { min-width: 0; }
.stats-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  min-width: 0;
}
.stats-bar-boxing { background: #e07a5f; }
.stats-bar-strength { background: var(--accent); }
.stats-bar-cardio { background: #3ecf8e; }
.stats-bar-muscle { background: color-mix(in srgb, var(--accent) 75%, #fff); }
.stats-bar-weekday { background: color-mix(in srgb, var(--accent) 55%, var(--surface2)); }
.stats-busiest { margin: 0; font-size: 0.9rem; color: var(--text); }

/* ── Session list ─────────────────────────────────────────── */

.session-list { list-style: none; }
.session-list-full .session-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  background: var(--surface);
}
.session-list-full .session-item:last-child { margin-bottom: 0; }
.session-item { border-bottom: 1px solid var(--border); }
.session-item:last-child { border-bottom: none; }
.session-link { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.7rem 0; text-decoration: none; color: var(--text); }
.session-list-full .session-link { padding: 0.875rem 1rem; }
.session-link:hover { background: color-mix(in srgb, var(--surface2) 50%, transparent); }
.session-list-full .session-link:hover { border-radius: var(--radius); }
.session-date { font-weight: 600; }
.session-dur  { font-size: 0.8rem; color: var(--text-muted); }
.session-meta-top { display: flex; gap: 0.5rem; align-items: baseline; font-size: 0.82rem; color: var(--text-muted); }
.session-time { font-variant-numeric: tabular-nums; }
.session-header-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.session-blocks-row, .session-blocks { display: flex; gap: 0.4rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--text-muted); }
.session-tags-row { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-top: 0.15rem; }
.session-empty-blocks { font-size: 0.82rem; color: var(--text-muted); margin: 0.25rem 0 0; font-style: italic; }

.session-timeline {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.timeline-row {
  display: grid;
  grid-template-columns: 5.5rem 1.5rem 1fr;
  gap: 0.5rem;
  align-items: start;
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border-left: 3px solid var(--border);
}
.timeline-boxing  { border-left-color: var(--boxing); }
.timeline-circuit { border-left-color: var(--circuit); }
.timeline-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  padding-top: 0.1rem;
}
.timeline-icon { font-size: 1rem; line-height: 1.2; }
.timeline-body { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.timeline-title { font-size: 0.88rem; font-weight: 600; }
.timeline-detail { font-size: 0.78rem; color: var(--text-muted); }

.block-pill { padding: 0.15rem 0.5rem; border-radius: 99px; font-size: 0.78rem; }
.block-boxing  { background: color-mix(in srgb, var(--boxing) 15%, transparent); color: var(--boxing); }
.block-circuit { background: color-mix(in srgb, var(--circuit) 15%, transparent); color: var(--circuit); }

/* ── Block cards ────────────────────────────────────────── */

.block-card {
  border-radius: var(--radius);
  padding: 0.875rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
}
.block-boxing  { background: color-mix(in srgb, var(--boxing)  5%, var(--surface)); border-color: color-mix(in srgb, var(--boxing) 30%, var(--border)); }
.block-circuit { background: color-mix(in srgb, var(--circuit) 5%, var(--surface)); border-color: color-mix(in srgb, var(--circuit) 30%, var(--border)); }

.block-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.block-icon  { font-size: 1.1rem; }
.block-title { font-weight: 600; flex: 1; }
.block-meta  { font-weight: 400; font-size: 0.78rem; color: var(--text-muted); display: block; }

.block-timing {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.45rem 0.6rem;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}
.block-timing-form { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.block-timing-form .label-inline { display: flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; font-weight: 500; color: var(--text); }
.block-timing-form input[type="time"] { min-width: 7.5rem; font-size: 0.9rem; }
.block-timing-boxing {
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}
.block-timing-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.block-timing-planned {
  font-size: 0.85rem;
  color: var(--text);
}
.block-timing-planned strong {
  color: var(--boxing);
  font-variant-numeric: tabular-nums;
}
.block-timing-scheduled {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--boxing);
  font-variant-numeric: tabular-nums;
}
.block-timing-details { margin-top: 0.15rem; }
.block-timing-toggle {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
  padding: 0.15rem 0;
}
.block-timing-toggle::-webkit-details-marker { display: none; }
.block-timing-toggle::before { content: "▸ "; }
.block-timing-details[open] > .block-timing-toggle::before { content: "▾ "; }
.block-timing-details > .block-timing-form {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
}
.block-timing-boxing .block-timing-end { font-size: 0.85rem; color: var(--text); }
.block-timing-boxing .block-timing-end strong { color: var(--boxing); font-variant-numeric: tabular-nums; }
.block-timing-muted { color: var(--text-muted); font-style: italic; }
.block-timing-dur { font-size: 0.82rem; color: var(--circuit); font-weight: 600; font-variant-numeric: tabular-nums; margin-left: auto; }
.block-timing-label { font-size: 0.75rem; color: var(--text-muted); flex: 1 1 100%; }
@media (min-width: 640px) { .block-timing-label { flex: 1 1 auto; } }

/* ── Slots bar ───────────────────────────────────────────── */

.slots-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background: var(--surface2);
  border-radius: var(--radius-sm);
}
.slot-pill {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.78rem;
}
.slot-add { border-style: dashed; color: var(--accent); cursor: pointer; background: none; }
.slot-pos { font-weight: 700; color: var(--text-muted); font-size: 0.7rem; }
.slot-picker { padding: 0.75rem; background: var(--surface2); border-radius: var(--radius-sm); margin-bottom: 0.5rem; }

/* ── Cycle card ──────────────────────────────────────────── */

.cycle-card {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
}
.cycle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.cycle-title { font-weight: 600; font-size: 0.85rem; color: var(--text-muted); }

/* ── Perf row ────────────────────────────────────────────── */

.perf-exercise { display: flex; flex-direction: column; gap: 0.25rem; }
.perf-ex-name { font-weight: 500; }
.prev-perf { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 0.2rem; }

.btn-swap {
  background: none;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  padding: 0.1rem 0.35rem;
  cursor: pointer;
  margin-top: 0.2rem;
}
.btn-swap:hover { border-color: var(--accent); color: var(--accent); }

.swap-picker {
  margin-top: 0.35rem;
  padding: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.swap-options { display: flex; flex-direction: column; gap: 0.25rem; }
.swap-option {
  text-align: left;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
}
.swap-option:hover { border-color: var(--accent); background: var(--accent-dim); }
.swap-current { border-color: var(--ok); color: var(--ok); }
.swap-option small { color: var(--text-muted); display: block; font-size: 0.75rem; }

.side-badge {
  font-size: 0.7rem;
  background: var(--surface2);
  color: var(--text-muted);
  padding: 0 0.35rem;
  border-radius: 99px;
  font-style: normal;
  border: 1px solid var(--border);
}

/* ── Boxing: rounds / chips ─────────────────────────────── */

.chip-group { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.4rem; align-items: center; }
.chip { display: flex; align-items: center; gap: 0.25rem; cursor: pointer; }
.chip-radio { position: absolute; opacity: 0; width: 0; }
.chip input[type=radio] { position: absolute; opacity: 0; width: 0; height: 0; }
.chip span, .chip {
  padding: 0.25rem 0.6rem;
  border-radius: 99px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  user-select: none;
}
.chip:has(input:checked) { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.chip-btn { cursor: pointer; font-family: inherit; }
.chip-btn.chip-active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

.boxing-mode-bar { margin-bottom: 0.75rem; }
.boxing-class-panel { margin-top: 0.25rem; }
.add-block-forms { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-start; }
.add-block-form { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; padding: 0.5rem; background: var(--surface2); border-radius: var(--radius-sm); }
.block-time-fields { margin: 0; }
.session-optional-times { margin: 0.5rem 0; font-size: 0.85rem; color: var(--text-muted); }
.session-optional-times summary { cursor: pointer; margin-bottom: 0.35rem; }
.add-block-templates { border-bottom: 1px dashed var(--border); padding-bottom: 0.75rem; margin-bottom: 0.75rem; }
.template-quick-bar { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.template-quick-btn { font-size: 0.82rem; }
.template-select-row { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }

.preset-chip {
  padding: 0.25rem 0.6rem;
  border-radius: 99px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
}
.preset-chip:hover { border-color: var(--accent); color: var(--accent); }
.cycle-chip-active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.template-cycles-row { align-items: center; margin-bottom: 0.5rem; }
.inline-cycles-form { display: inline; vertical-align: baseline; }
.input-inline-num { width: 2.5rem; display: inline-block; padding: 0.1rem 0.25rem; vertical-align: baseline; }
.input-cycles-num { width: 2.75rem; }
.circuit-settings { margin-bottom: 0.75rem; }
.circuit-settings-row { flex-wrap: wrap; align-items: center; gap: 0.35rem 0.65rem; }
.circuit-settings-row .settings-label { font-size: 0.82rem; color: var(--text-muted); }
.btn-xs { padding: 0.2rem 0.5rem; font-size: 0.75rem; }
.template-group { margin-bottom: 1.5rem; }
.template-group-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; color: var(--text); }
.preset-label { font-size: 0.8rem; color: var(--text-muted); }

.add-round-form { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.75rem; }
.round-num { font-weight: 700; color: var(--text-muted); width: 1.5rem; }

/* ── Add block bar ──────────────────────────────────────── */

.add-block-bar { border-style: dashed; border-color: var(--accent-dim); }
.session-logged-blocks { margin-bottom: 0; }
.session-empty-log { text-align: center; padding: 1.5rem 1rem; }
.session-empty-log .session-empty-blocks { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.session-add-workout-footer { margin-top: 1.25rem; text-align: center; }
.block-delete-form { margin-left: auto; flex-shrink: 0; }
.block-delete-btn { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.block-delete-btn:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.session-add-block-panel {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 3px solid var(--border);
  background: color-mix(in srgb, var(--surface2) 80%, var(--surface));
  border-radius: var(--radius);
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-bottom: 0.5rem;
}
.add-block-collapsible { border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface2); }
.add-block-collapsible > .add-block-inner { padding: 0 0.75rem 0.75rem; }
.add-block-collapsible > .add-block-bar { border: none; background: transparent; padding-top: 0; margin: 0; }
.add-block-summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  list-style: none;
}
.add-block-summary::-webkit-details-marker { display: none; }
.add-block-summary::before { content: "＋ "; color: var(--accent); }
.add-block-collapsible[open] > .add-block-summary::before { content: "− "; }
.session-logged-hint { margin-top: 0.5rem; margin-bottom: 0.75rem; }
.template-quick-boxing { border-color: var(--accent-dim); }
.add-block-bar h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.75rem; }
.add-block-group { margin-bottom: 0.75rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.add-block-group:last-child { border-bottom: none; margin-bottom: 0; }
.add-block-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 0.4rem; }

/* ── Tags / Filter bar ──────────────────────────────────── */

.filter-bar { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1rem; }
.tag {
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  text-decoration: none;
  color: var(--text-muted);
}
.tag-active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.tag-clear { color: var(--danger); border-color: var(--danger); }

/* ── Settings ─────────────────────────────────────────────── */

.targets-grid { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.target-row { display: flex; align-items: center; gap: 0.75rem; flex-direction: row; }
.target-name { width: 9rem; font-size: 0.875rem; color: var(--text); }

/* ── Misc ─────────────────────────────────────────────────── */

.empty-state { color: var(--text-muted); text-align: center; padding: 2rem; font-size: 0.9rem; }
.empty-hint { color: var(--text-muted); font-size: 0.82rem; margin: 0.5rem 0 0.75rem; }
.description { color: var(--text-muted); margin-bottom: 1rem; font-size: 0.9rem; }
.meta-row { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 0.75rem; }
.badge { background: var(--surface2); border: 1px solid var(--border); border-radius: 99px; font-size: 0.7rem; padding: 0.05rem 0.4rem; color: var(--text-muted); }
.link-all { display: block; text-align: right; margin-top: 0.75rem; font-size: 0.82rem; color: var(--accent); text-decoration: none; }
.flash { padding: 0.6rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: 0.875rem; }
.flash-message { background: color-mix(in srgb, var(--circuit) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--circuit) 40%, var(--border)); }
.flash-error { background: color-mix(in srgb, var(--danger) 15%, var(--surface)); border: 1px solid var(--danger); }

.slot-list { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.75rem; }
.slot-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.5rem; background: var(--surface2); border-radius: var(--radius-sm); }
.slot-item.dragging { opacity: 0.5; border: 1px dashed var(--accent); }
.slot-drag-handle { flex: 1; min-width: 0; cursor: grab; user-select: none; padding: 0.15rem 0; }
.slot-item:active .slot-drag-handle { cursor: grabbing; }
.slot-name { flex: 1; min-width: 0; }
.add-slot-details { margin-top: 0.5rem; }
.add-slot-details summary { cursor: pointer; }

/* ── Circuit pot builder ─────────────────────────────────── */

.back-link {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 0.25rem;
}
.back-link:hover { color: var(--accent); }

.circuit-builder-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) {
  .circuit-builder-layout { grid-template-columns: 1fr; }
}

.panel-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.circuit-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.circuit-card-header .card-title { margin-bottom: 0; }

.pot-panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}
.pot-panel-header .panel-title { margin-bottom: 0; }
.pot-save-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pot-save-hint { margin: -0.35rem 0 0.75rem; }

.circuit-defaults-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  margin-bottom: 0.35rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.badge-circuit { background: color-mix(in srgb, var(--circuit) 20%, var(--surface2)); color: var(--circuit); border-color: color-mix(in srgb, var(--circuit) 40%, var(--border)); }
.badge-isometric { background: color-mix(in srgb, var(--warn) 15%, var(--surface2)); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); }
.badge-carry { background: color-mix(in srgb, var(--ok) 12%, var(--surface2)); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }
.badge-equipment { font-size: 0.72rem; }

.slot-pot-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; margin: 0; padding: 0; min-height: 3rem; }
.slot-pot-list.pot-drop-active { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: var(--radius); }
.slot-pot-actions { display: flex; flex-direction: column; gap: 0.15rem; flex-shrink: 0; }
.slot-move-btn { font-size: 0.75rem; line-height: 1; padding: 0.15rem 0.35rem; }

.scratch-cta { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.scratch-cta-title { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 0.35rem; text-transform: none; letter-spacing: normal; }

.circuit-meta-bar { margin-bottom: 1rem; }
.circuit-name-input { min-width: min(100%, 320px); font-size: 1.05rem; font-weight: 600; }
.circuit-name-label { flex: 1; min-width: 200px; }
.meta-saved-slot { min-width: 5rem; }
.saved-badge { font-size: 0.82rem; color: var(--ok); font-weight: 500; }
.circuit-step-title { font-size: 0.9rem; font-weight: 600; margin: 0 0 0.5rem; color: var(--text); }
.circuit-log-row { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.badge-upcoming { background: color-mix(in srgb, var(--accent) 15%, var(--surface2)); color: var(--accent); margin-left: 0.35rem; }
.sessions-hint { margin-bottom: 1rem; padding: 0.65rem 0.85rem; background: var(--surface2); border-radius: var(--radius-sm); }
.circuit-log-form { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: flex-end; margin-bottom: 0.35rem; }
.slot-pot-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.slot-pot-item.dragging { opacity: 0.55; border-style: dashed; border-color: var(--accent); }
.slot-pot-handle { cursor: grab; color: var(--accent); font-size: 1.1rem; padding: 0.35rem 0.25rem; user-select: none; touch-action: none; flex-shrink: 0; }
.slot-pot-handle:active { cursor: grabbing; }
.slot-pot-pos { font-weight: 700; color: var(--accent); font-size: 0.75rem; min-width: 1.25rem; padding-top: 0.2rem; }
.slot-pot-main { flex: 1; min-width: 0; }
.slot-pot-name { display: block; font-weight: 500; margin-bottom: 0.45rem; font-size: 0.9rem; }
.slot-pot-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  align-items: flex-end;
}
.slot-field { display: flex; flex-direction: column; gap: 0.15rem; }
.slot-field-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.slot-field-kind { min-width: 6.5rem; }

.input-pill {
  border-radius: 99px;
  padding: 0.25rem 0.55rem;
  font-size: 0.82rem;
  width: 4.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
input[type="time"].input-pill,
input[type="time"].input-time {
  width: auto;
  min-width: 7.75rem;
}
.input-pill-sm { width: 4rem; }
select.input-pill { width: auto; min-width: 5.5rem; }

.library-search { width: 100%; margin-bottom: 0.5rem; }

.library-muscle-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.library-filter-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-right: 0.15rem;
}
.library-mg-chip {
  cursor: pointer;
  font-family: inherit;
  background: var(--surface2);
}
.library-mg-chip.tag-active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.library-mode-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}
.library-mode-btn {
  cursor: pointer;
  font-family: inherit;
  background: var(--surface2);
}
.badge-pattern {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface2));
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}
.slot-pattern-badge { margin-right: 0.35rem; font-size: 0.65rem; vertical-align: middle; }

.exercise-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.exercise-library-form { margin: 0; }
.exercise-library-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: visible;
}
.exercise-library-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.45rem 0.45rem 0.45rem 0.65rem;
}
.exercise-library-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
  padding: 0.2rem 0.15rem;
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s;
}
.exercise-library-card-body:hover { color: var(--accent); }
.exercise-library-card-name { font-weight: 500; line-height: 1.3; }
.exercise-library-card-badges { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.exercise-library-card-head .exercise-info { flex-shrink: 0; margin-left: 0; margin-top: 0.1rem; }
.exercise-library-grid .exercise-info-tooltip {
  bottom: auto;
  top: calc(100% + 6px);
  left: auto;
  right: 0;
  transform: none;
  max-width: min(260px, 80vw);
}
.exercise-library-form:hover .exercise-library-card {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface2));
}

/* ── Exercise cards (list page) ───────────────────────────── */

.exercise-library-toolbar {
  margin-bottom: 0.65rem;
}
.exercise-library-toolbar .exercise-library-search {
  width: 100%;
}
.exercise-library-filters {
  margin-bottom: 0.85rem;
}
.exercise-library-sections {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.exercise-library-section-title {
  margin: 0 0 0.35rem;
  padding: 0 0.15rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.exercise-library-muscle-title {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--text);
}
.exercise-library-subsection {
  margin-bottom: 0.55rem;
}
.exercise-library-subsection:last-child {
  margin-bottom: 0;
}
.exercise-library-subsection-title {
  margin: 0 0 0.25rem;
  padding: 0.35rem 0.65rem 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.exercise-library-filters .library-mg-chip {
  text-decoration: none;
}
.exercise-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: visible;
  background: var(--surface);
}
.exercise-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
  min-height: 2.5rem;
  position: relative;
}
.exercise-row:has(.exercise-info.is-open) {
  z-index: 120;
}
.exercise-row-actions .exercise-info-tooltip {
  left: auto;
  right: 0;
  bottom: auto;
  top: calc(100% + 6px);
  transform: none;
  max-width: min(300px, calc(100vw - 1.25rem));
  white-space: normal;
}
.exercise-row-actions .exercise-info.is-open .exercise-info-tooltip {
  z-index: 1000;
}
.exercise-row:last-child {
  border-bottom: none;
}
.exercise-row-main {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
  gap: 0.25rem;
  font-size: 0.88rem;
  line-height: 1.25;
}
.exercise-row-tag {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.exercise-row-sep {
  color: var(--text-muted);
  opacity: 0.55;
  flex-shrink: 0;
  font-size: 0.75rem;
}
.exercise-row-name {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.exercise-row-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
}
.exercise-row-delete {
  margin: 0;
}
.exercise-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.exercise-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  padding-right: 2.25rem;
}
.exercise-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
  margin-bottom: 0.45rem;
}
.exercise-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}
.exercise-card-meta { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.35rem; }
.exercise-card-muscles { font-size: 0.78rem; color: var(--text-muted); line-height: 1.35; margin: 0; }
.exercise-history-link { display: inline-block; margin-top: 0.5rem; font-size: 0.8rem; color: var(--accent); text-decoration: none; }
.exercise-history-link:hover { text-decoration: underline; }
.exercise-history-list { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; }
.exercise-history-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.exercise-history-date { font-weight: 600; min-width: 9rem; font-size: 0.85rem; }
.exercise-history-cycles { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; font-size: 0.85rem; color: var(--text-muted); }
.exercise-history-cycle { white-space: nowrap; }
.exercise-card-delete {
  position: absolute;
  top: 0.5rem;
  right: 0.35rem;
  margin: 0;
}

.search-bar { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.checkbox-label { flex-direction: row; align-items: center; gap: 0.3rem; font-size: 0.85rem; color: var(--text); cursor: pointer; }

/* ── Exercise how-to (ⓘ + tooltip) ─────────────────────────── */

.exercise-info {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  margin-left: 0.25rem;
  outline: none;
}
.exercise-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}
.exercise-info-tooltip {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  z-index: 200;
  width: max-content;
  max-width: min(280px, 85vw);
  padding: 0.5rem 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text);
  font-weight: 400;
  text-align: left;
  pointer-events: none;
}
.exercise-info:hover .exercise-info-tooltip,
.exercise-info:focus .exercise-info-tooltip,
.exercise-info.is-open .exercise-info-tooltip {
  display: block;
}

/* Boxing round table: ⓘ hints in column headers */
.boxing-rounds-table thead th {
  white-space: nowrap;
  vertical-align: bottom;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.82rem;
}
.boxing-rounds-table thead .exercise-info-tooltip {
  bottom: auto;
  top: calc(100% + 6px);
  white-space: normal;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}
.boxing-field-label {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-bottom: 0.2rem;
  text-transform: none;
  letter-spacing: normal;
}
.boxing-field-label .exercise-info-tooltip {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}
.boxing-add-round-form .boxing-duration-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ── Weekly plan (dashboard) ───────────────────────────────── */

.week-plan-day {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--surface2);
}
.week-plan-today { border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface2)); }
.week-plan-label { font-size: 0.85rem; font-weight: 600; min-width: 12rem; }
.week-plan-templates { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.week-plan-tag {
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
  background: var(--accent-dim);
  color: var(--accent);
}
.week-plan-tag-secondary { background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); }
.today-plan-box {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.today-plan-box h3 { font-size: 0.9rem; margin-bottom: 0.35rem; }
.today-plan-items { list-style: disc; padding-left: 1.25rem; margin-bottom: 0.75rem; font-size: 0.875rem; }

.block-live-timer {
  margin: 0.75rem 0;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--circuit) 10%, var(--surface2));
  border: 1px solid color-mix(in srgb, var(--circuit) 30%, var(--border));
}
.block-boxing .block-live-timer {
  background: color-mix(in srgb, var(--boxing) 10%, var(--surface2));
  border-color: color-mix(in srgb, var(--boxing) 30%, var(--border));
}
.boxing-rest-settings {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
}
.boxing-rest-settings .card-title-sm {
  font-size: 0.9rem;
  margin: 0 0 0.35rem;
}
.boxing-rest-form .input-suffix {
  margin-left: 0.15rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.boxing-session-duration {
  margin: 0.5rem 0 0.75rem;
}
.boxing-session-duration-hint {
  margin: 0.35rem 0 0;
}
.boxing-start-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 0.25rem;
}
.boxing-rounds-table { font-size: 0.875rem; width: 100%; table-layout: fixed; min-width: 36rem; }
.boxing-rounds-table .input-sm { min-width: 0; width: 100%; max-width: 100%; box-sizing: border-box; }
.boxing-rounds-table .label-grow { flex: 1; min-width: 0; }
.boxing-rounds-table .boxing-drill-name-input { min-width: 0; }
.boxing-rounds-table .boxing-activity-input { min-width: 0; }
.boxing-rounds-table th:nth-child(1),
.boxing-rounds-table td:nth-child(1) { width: 2.25rem; }
.boxing-rounds-table th:nth-child(2),
.boxing-rounds-table td:nth-child(2) { width: 6.5rem; }
.boxing-rounds-table th:nth-child(3),
.boxing-rounds-table td:nth-child(3) { width: 9rem; }
.boxing-rounds-table th:nth-child(4),
.boxing-rounds-table td:nth-child(4) { width: 7rem; }
.boxing-rounds-table th:nth-child(5),
.boxing-rounds-table td:nth-child(5) { width: 8.5rem; }
.boxing-rounds-table th:nth-child(7),
.boxing-rounds-table td:nth-child(7) { width: 2rem; }
.boxing-rounds-table .boxing-notes-cell { min-width: 0; width: auto; }
.boxing-rounds-table .boxing-notes-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 3.5rem;
  resize: vertical;
  line-height: 1.35;
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.boxing-rounds-table .boxing-round-timing .input-xs { width: 100%; max-width: 4rem; box-sizing: border-box; }
.boxing-rounds-table .hiit-inline-fields { max-width: 100%; }
.boxing-add-round-form .boxing-notes-add-label { display: block; margin-top: 0.5rem; }
.boxing-add-round-form .boxing-notes-input { min-height: 4.5rem; }
.boxing-round-rest td { color: var(--muted); font-style: italic; }
.hiit-inline-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: end;
}
.hiit-field {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.hiit-field .input-xs { width: 3.25rem; }
.boxing-add-round-form {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.boxing-add-round-form .label-grow { flex: 1; }
.btn-live-timer {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 1.05rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
}
.live-timer-hint { margin: 0.35rem 0 0; text-align: center; }
.dash-live-timer-box {
  margin-top: 0.75rem;
  padding: 0.85rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface2));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
}
.btn-live-timer-dash {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 1.05rem;
  padding: 0.85rem 1rem;
  text-decoration: none;
  margin-bottom: 0.35rem;
}

body:has(.live-timer-page) .site-header { display: none; }
body:has(.live-timer-page) .bottom-nav { display: none; }
body:has(.live-timer-page) .site-main { padding: 0; max-width: none; min-height: 100dvh; background: #0a0a0a; }

.live-timer-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
  color: #fff;
  font-family: "Segoe UI", system-ui, sans-serif;
  user-select: none;
}

.live-top-bar {
  display: grid;
  grid-template-columns: 2.5rem 1fr 2.5rem;
  align-items: start;
  padding: 0.65rem 0.75rem 0.25rem;
  background: #0a0a0a;
}
.live-top-btn {
  color: #ccc;
  text-decoration: none;
  font-size: 1.25rem;
  line-height: 1;
  background: none;
  border: none;
  padding: 0.25rem;
}
.live-top-center { text-align: center; }
.live-top-title {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: #e74c3c;
  font-weight: 700;
}
.live-state-work .live-top-title { color: #b8e986; }
.live-state-prepare .live-top-title,
.live-state-idle .live-top-title { color: #d4e157; }
.live-total-elapsed {
  display: block;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  margin-top: 0.15rem;
  color: #b8e986;
}
.live-state-rest .live-total-elapsed { color: #ff6b6b; }

.live-main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem 1rem 0.5rem;
  min-height: 38vh;
  transition: background 0.25s ease;
}
.live-state-idle .live-main-panel,
.live-state-prepare .live-main-panel { background: #d4e157; color: #111; }
.live-state-work .live-main-panel { background: #39d353; color: #111; }
.live-state-rest .live-main-panel { background: #ff4757; color: #fff; }
.live-state-finished .live-main-panel { background: #333; color: #fff; }

.live-main-phase {
  margin: 0 0 0.35rem;
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  font-weight: 800;
  letter-spacing: 0.06em;
}
.live-main-exercise {
  margin: 0 0 0.75rem;
  font-size: clamp(0.85rem, 3.5vw, 1rem);
  font-weight: 600;
  opacity: 0.85;
  min-height: 1.2rem;
  max-width: 90%;
}
.live-main-countdown {
  margin: 0;
  font-size: clamp(3.5rem, 18vw, 5.5rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.02em;
}

.live-next-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.live-next-work { background: #39d353; color: #111; }
.live-next-rest,
.live-next-cycle_rest { background: #ff4757; color: #fff; }
.live-next-prepare { background: #d4e157; color: #111; }
.live-next-label { font-size: 1.1rem; }
.live-next-time { font-size: 1.35rem; font-variant-numeric: tabular-nums; }

.live-weight-panel {
  padding: 0.5rem 1rem;
  background: #141414;
  border-top: 1px solid #222;
}
.live-weight-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #ccc;
}
.live-weight-input { width: 5rem; text-align: center; }

.live-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 0.5rem;
  padding: 1rem 0.75rem 1.5rem;
  background: #0a0a0a;
}
.live-stat { text-align: center; }
.live-stat-value {
  display: block;
  font-size: clamp(2rem, 10vw, 2.75rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.live-stat-rounds .live-stat-value { color: var(--accent); }
.live-stat-cycles .live-stat-value { color: #feca57; }
.live-stat-label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: #888;
  font-weight: 700;
}

.live-control-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 5.5rem;
}
.live-ring-btn {
  position: relative;
  width: 4.75rem;
  height: 4.75rem;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.live-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.live-ring-track {
  fill: none;
  stroke: #333;
  stroke-width: 6;
}
.live-ring-progress {
  fill: none;
  stroke: #39d353;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 276.46;
  stroke-dashoffset: 276.46;
  transition: stroke-dashoffset 0.1s linear;
}
.live-state-rest .live-ring-progress { stroke: #ff4757; }
.live-state-prepare .live-ring-progress,
.live-state-idle .live-ring-progress { stroke: #d4e157; }
.live-ring-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #fff;
  pointer-events: none;
}
.live-action-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #39d353;
}
.live-state-rest .live-action-label { color: #ff4757; }

.live-start-btn {
  width: 4.75rem;
  height: 4.75rem;
  border-radius: 50%;
  border: none;
  background: #d4e157;
  color: #111;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 0 0 4px #222;
}
.live-start-btn:active { transform: scale(0.96); }

/* ── Free Tabata setup (interval list) ─────────────────────── */
.tabata-settings-page {
  max-width: 28rem;
  margin: 0 auto;
  padding-bottom: 1.5rem;
}

.free-interval-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 0.75rem minmax(0, 1fr) 4.75rem 1.75rem;
  column-gap: 0.75rem;
  align-items: center;
}
.free-interval-row {
  display: contents;
}
.free-interval-row > * {
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--border);
}
.free-interval-list > .free-interval-row:last-child > * {
  border-bottom: none;
}
.free-interval-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  align-self: center;
}
.free-dot-prepare { background: #ff6b00; }
.free-dot-work { background: #00e5ff; }
.free-dot-rest { background: #ff1493; }
.free-dot-rounds { background: var(--accent); }
.free-dot-cycles { background: #ff6b00; }
.free-dot-between { background: #ff6b00; }
label.free-interval-name {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  cursor: pointer;
}
.tabata-value-input.input-pill {
  width: 100%;
  max-width: 4.75rem;
  justify-self: end;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.45rem 0.35rem;
  background: var(--surface);
  border-color: var(--border);
}
.free-interval-unit {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.free-timer-setup { margin-bottom: 0; }
.free-timer-sound { margin-top: 0.75rem; }
.free-timer-sound-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  cursor: pointer;
}
.free-timer-sound-label input { width: 1.1rem; height: 1.1rem; }
.free-timer-sound-options {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.free-timer-sound-options[hidden] { display: none; }
.free-timer-choice {
  display: grid;
  gap: 0.4rem;
}
.free-timer-choice[hidden] { display: none; }
.free-timer-choice-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.free-timer-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}
.free-timer-seg-opt {
  position: relative;
  cursor: pointer;
}
.free-timer-seg-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.free-timer-seg-opt span {
  display: block;
  text-align: center;
  padding: 0.55rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface2);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.free-timer-seg-opt input:checked + span {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--text);
}
.free-timer-seg-opt input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tabata-intervals-title {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.tabata-settings-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.25rem 0;
}
.tabata-toolbar-cancel {
  justify-self: start;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
}
.tabata-toolbar-cancel:hover { color: var(--text); }
.tabata-toolbar-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
}
.tabata-toolbar-save {
  justify-self: end;
  border: none;
  background: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6bcb77;
  cursor: pointer;
  padding: 0;
}
.tabata-toolbar-save:hover { opacity: 0.85; }

.tabata-start-btn {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding: 1.05rem 1.5rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #00e5ff 0%, #00b4d8 100%);
  color: #001018;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 229, 255, 0.22);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.tabata-start-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(0, 229, 255, 0.32);
}
.tabata-start-btn:active { transform: scale(0.98); }
.tabata-start-icon {
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.tabata-start-icon::after {
  content: "";
  position: absolute;
  left: 0.38rem;
  top: 0.18rem;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.32rem 0 0.32rem 0.48rem;
  border-color: transparent transparent transparent currentColor;
}

/* ── Mobile tweaks ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header-actions {
    width: 100%;
  }

  .page-header-actions .btn,
  .page-header-actions form {
    flex: 1;
  }

  .page-header-actions button {
    width: 100%;
  }

  .form-row { flex-direction: column; }
  .stat-row { gap: 1rem; }
  .freq-name { width: 7rem; }
  .data-table { font-size: 0.8rem; }
  .input-num { width: 4rem; }

  .tabata-settings-page {
    padding-bottom: 2rem;
  }

  .targets-grid {
    grid-template-columns: 1fr;
  }

  /* Gym-friendly tap targets and readable inputs (prevents iOS zoom) */
  .btn {
    min-height: 2.75rem;
    padding: 0.65rem 1.1rem;
    font-size: 0.95rem;
    touch-action: manipulation;
  }

  .btn-sm {
    min-height: 2.5rem;
    padding: 0.55rem 0.9rem;
  }

  .input,
  .input-num,
  .input-sm,
  select.input,
  textarea.input {
    font-size: 16px;
    min-height: 2.75rem;
  }

  .input-num {
    width: 5.5rem;
    min-width: 5.5rem;
    text-align: center;
    font-weight: 600;
  }

  .session-list-full .session-link {
    padding: 1rem 1.1rem;
    min-height: 3.5rem;
  }

  .session-date {
    font-size: 1.05rem;
  }

  .btn-live-timer,
  .btn-live-timer-dash {
    font-size: 1.15rem;
    padding: 1rem 1.25rem;
    min-height: 3.25rem;
  }

  .block-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .block-meta {
    display: block;
    margin-top: 0.35rem;
    line-height: 1.45;
  }

  .slot-pill {
    font-size: 0.85rem;
    padding: 0.4rem 0.65rem;
  }

  .cycle-card {
    padding: 0.85rem;
  }

  /* Performance log: one exercise card per row instead of a wide table */
  .perf-table {
    display: block;
    border: none;
  }

  .perf-table thead {
    display: none;
  }

  .perf-table tbody {
    display: block;
  }

  .perf-table tr {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem;
    margin-bottom: 0.75rem;
  }

  .perf-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border: none;
  }

  .perf-table td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    flex: 1 1 auto;
    min-width: 0;
  }

  .perf-table td.perf-exercise {
    display: block;
    padding-bottom: 0.65rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid var(--border);
  }

  .perf-table td.perf-exercise::before {
    display: none;
  }

  .perf-ex-name {
    font-size: 1rem;
  }

  .perf-table td > .input,
  .perf-table td > .input-sm {
    flex: 0 0 auto;
    max-width: 9rem;
  }

  .perf-table td[data-label] {
    flex-wrap: wrap;
  }

  .perf-table .prev-perf,
  .perf-table .pace-hint {
    flex: 1 1 100%;
    text-align: right;
    margin-top: 0.15rem;
  }

  .block-timing-form input[type="time"] {
    min-width: 9rem;
    min-height: 2.75rem;
  }

  .header-overflow-item {
    min-height: 3rem;
    font-size: 1rem;
  }
}

/* ── Workout library ──────────────────────────────────────── */

.workouts-page {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 60px;
}

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

.workouts-header h1 {
  margin: 0;
  font-size: 2rem;
}

.page-subtitle {
  margin: 6px 0 0;
  color: var(--text-muted);
}

.workout-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.workout-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.workout-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 7px 13px;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: inherit;
}

.workout-tab:hover {
  color: var(--text);
  border-color: var(--accent);
}

.workout-tab.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.workout-search {
  width: min(340px, 100%);
  max-width: 100%;
}

.workout-section {
  margin-top: 36px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.15rem;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 0.87rem;
}

.workout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.workout-card,
.programme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  min-width: 0;
}

.workout-card:hover,
.programme-card:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.workout-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.workout-card-title {
  margin: 4px 0 0;
  font-size: 1rem;
  line-height: 1.35;
}

.workout-card-label {
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.workout-card-label.flexible {
  color: var(--ok);
}

.workout-card-label.core {
  color: var(--warn);
}

.workout-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 12px 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.workout-card-stats strong {
  color: var(--text);
}

.workout-exercise-preview {
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.workout-preview-exercise {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 7px;
  padding: 3px 0;
  font-size: 0.82rem;
  line-height: 1.35;
}

.preview-number {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.workout-more {
  margin-top: 5px;
  padding-left: 29px;
  color: var(--accent);
  font-size: 0.78rem;
}

.workout-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 11px;
}

.workout-tag {
  padding: 3px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.workout-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
}

.start-workout-form {
  margin: 0;
}

.workout-menu {
  position: relative;
  flex-shrink: 0;
}

.workout-menu summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 1.3rem;
}

.workout-menu summary::-webkit-details-marker {
  display: none;
}

.workout-menu summary:hover {
  background: var(--surface2);
  color: var(--text);
}

.workout-menu-dropdown {
  position: absolute;
  z-index: 30;
  right: 0;
  top: 38px;
  width: 170px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.workout-menu-dropdown a,
.workout-menu-dropdown button {
  display: block;
  width: 100%;
  padding: 9px 10px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  font-size: 0.85rem;
  font-family: inherit;
}

.workout-menu-dropdown a:hover,
.workout-menu-dropdown button:hover {
  background: var(--surface2);
}

.workout-menu-dropdown form {
  margin: 0;
}

.workout-menu-dropdown .menu-danger {
  color: var(--danger);
}

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

.programme-day {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.programme-card .workout-card-title {
  margin-top: 7px;
}

.workout-card.is-hidden,
.programme-card.is-hidden,
.workout-section.is-hidden {
  display: none;
}

@media (max-width: 950px) {
  .workout-grid,
  .programme-grid {
    grid-template-columns: 1fr;
  }

  .workout-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .workout-search {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .workouts-page {
    width: min(100% - 20px, 1400px);
    padding-top: 18px;
  }

  .workouts-header {
    flex-direction: column;
  }

  .workouts-header form,
  .workouts-header .btn {
    width: 100%;
  }

  .workout-card-actions .btn,
  .workout-card-actions form {
    flex: 1;
  }

  .workout-card-actions button {
    width: 100%;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Interval workout list + editor (Phase 2) ───────────── */
.interval-page { position: relative; padding-bottom: 4.5rem; }
.interval-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.interval-header h1 { margin: 0; }
.interval-gym-link {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
}
.interval-gym-link:hover { color: var(--text); }

/* History calendar (Phase 5) */
.history-page {
  padding-bottom: 5.5rem;
}
.history-header h1 {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 800;
}
.history-month-nav {
  display: grid;
  grid-template-columns: 2.75rem 1fr 2.75rem;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}
.history-month-title {
  margin: 0;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: capitalize;
}
.history-month-btn {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  text-decoration: none;
  font-size: 1.5rem;
  line-height: 1;
}
.history-month-btn:hover { border-color: var(--accent); color: var(--accent); }
.history-calendar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.65rem 0.5rem 0.75rem;
  margin-bottom: 1.1rem;
}
.history-weekdays,
.history-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
}
.history-weekdays { margin-bottom: 0.35rem; }
.history-weekday {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}
.history-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  border-radius: 999px;
  text-decoration: none;
  color: inherit;
  padding: 0.15rem;
}
.history-day.is-outside { visibility: hidden; pointer-events: none; }
.history-day.is-selected {
  background: color-mix(in srgb, #ff4d8d 22%, var(--surface2));
  box-shadow: inset 0 0 0 2px #ff4d8d;
}
.history-day.is-today:not(.is-selected) {
  box-shadow: inset 0 0 0 1px var(--border);
}
.history-day-num {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.1;
}
.history-day-badge {
  position: absolute;
  top: 0.1rem;
  right: 0.15rem;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.05rem;
  text-align: center;
}
.history-day-heading {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: capitalize;
  color: var(--text-muted);
}
.history-run-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.history-run-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  border-left: 4px solid var(--w-color, #ff4d8d);
}
.history-run-play { flex-shrink: 0; }
.history-run-main {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.history-run-datepill {
  display: grid;
  justify-items: center;
  min-width: 2.6rem;
  padding: 0.25rem 0.35rem;
  border-radius: 10px;
  background: var(--surface2);
  line-height: 1.05;
}
.history-run-date-day {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--w-color, #ff4d8d);
}
.history-run-date-mon,
.history-run-date-year {
  font-size: 0.58rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.history-run-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-run-meta {
  margin: 0.12rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.history-run-actions {
  position: relative;
  flex-shrink: 0;
}
.history-run-menu-btn {
  width: 2.4rem;
  height: 2.4rem;
  border: none;
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}
.history-run-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.25rem);
  z-index: 30;
  min-width: 9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.history-run-menu-item {
  display: block;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.history-run-menu-item:hover { background: var(--surface2); }
.history-run-menu-item.is-danger { color: var(--danger); }
.history-run-menu-item.is-disabled {
  padding: 0.65rem 0.85rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.history-run-menu form { margin: 0; }
.history-gym-link-wrap {
  margin-top: 1.25rem;
  text-align: center;
}
.history-gym-link {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.history-gym-link:hover { color: var(--accent); }

.history-section-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 800;
}
.history-timer-runs {
  margin-bottom: 1.25rem;
}
.interval-run-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.interval-run-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.interval-run-main {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
}
.interval-run-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
}
.interval-run-meta {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.interval-play-disabled {
  opacity: 0.35;
  background: var(--surface2);
  color: var(--text-muted);
}
.interval-card-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.65rem; }
.interval-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.interval-card-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
}
.interval-play-link {
  display: block;
  flex-shrink: 0;
  text-decoration: none;
  border-radius: 8px;
}
.interval-play-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.interval-play {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 8px;
  background: var(--w-color, #ff4d8d);
  color: #fff;
  font-size: 0.85rem;
}
.interval-card-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}
.interval-card-meta {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.interval-card-toggle {
  border: none;
  background: var(--surface2);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  min-width: 2.6rem;
  min-height: 2.6rem;
  border-radius: 8px;
  padding: 0.25rem 0.4rem;
  cursor: pointer;
}
.interval-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.35rem;
  padding: 0 0.75rem 0.75rem;
  border-top: 1px solid var(--border);
}
.interval-card-actions[hidden] { display: none !important; }
.interval-card-actions a,
.interval-card-actions button {
  display: block;
  width: 100%;
  padding: 0.55rem 0.3rem;
  border: none;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.interval-card-actions .is-danger { color: var(--danger); }
.interval-fab,
.workout-hub-fab {
  position: fixed;
  right: 1rem;
  bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 14px;
  border: none;
  background: #ff4d8d;
  color: #fff;
  font-size: 2rem;
  font-weight: 400;
  line-height: 3.2rem;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(255, 77, 141, 0.35);
  z-index: 210;
  cursor: pointer;
  font-family: inherit;
}
.workout-hub-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.workout-hub-toolbar { margin-bottom: 1rem; }
.workout-hub-toolbar-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.65rem;
}
.workout-hub-toolbar-actions .workout-search { flex: 1; min-width: 0; }
.workout-hub-select-btn {
  flex-shrink: 0;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.workout-hub-select-btn.is-active {
  border-color: var(--accent);
  color: var(--accent);
}
.interval-play-slot {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  flex-shrink: 0;
}
.interval-play-slot > * {
  grid-area: 1 / 1;
}
.workout-hub-check-wrap {
  display: none;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  margin: 0;
  cursor: pointer;
}
.workout-hub-page.is-select-mode .workout-hub-check-wrap {
  display: grid;
}
.workout-hub-page.is-select-mode .interval-play-slot .interval-play-link,
.workout-hub-page.is-select-mode .interval-play-slot .interval-play-disabled {
  visibility: hidden;
  pointer-events: none;
}
.workout-hub-check {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.workout-hub-bulk-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 212;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.85rem;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.workout-hub-bulk-bar[hidden] { display: none !important; }
.workout-hub-bulk-count {
  font-size: 0.85rem;
  font-weight: 700;
}
.workout-hub-bulk-all,
.workout-hub-bulk-delete {
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.workout-hub-bulk-delete {
  border-color: var(--danger);
  color: var(--danger);
}
.workout-hub-bulk-delete:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.workout-hub-type {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.interval-card-pair-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.workout-tab {
  text-transform: none;
}
.interval-card-link {
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.interval-play-open { opacity: 0.72; }
.interval-play-disabled {
  display: grid;
  place-items: center;
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 10px;
  opacity: 0.35;
  flex-shrink: 0;
}
.workout-hub-fab-wrap {
  position: fixed;
  right: 1rem;
  bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  z-index: 211;
}
.workout-hub-fab-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.5rem);
  min-width: 11rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.workout-hub-fab-menu[hidden] { display: none !important; }
.workout-hub-fab-item {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: none;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.workout-hub-fab-item:last-child { border-bottom: none; }
.workout-hub-fab-item:hover { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); color: var(--accent); }
.workout-hub-fab-wrap .interval-fab { position: static; }
[data-workout-card].is-hidden { display: none !important; }
@media (min-width: 901px) {
  .interval-fab { bottom: 1.5rem; }
}

.interval-editor { max-width: 28rem; margin: 0 auto; }
.interval-editor-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 1rem;
}
.interval-editor-bar h1 {
  margin: 0;
  text-align: center;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.interval-editor-close,
.interval-editor-save {
  border: none;
  background: none;
  color: var(--text);
  font-size: 1.15rem;
  text-decoration: none;
  cursor: pointer;
  padding: 0.25rem;
}
.interval-editor-close { justify-self: start; }
.interval-editor-save { justify-self: end; }
.interval-name-row {
  display: grid;
  grid-template-columns: 1fr 3rem;
  gap: 0.6rem;
  align-items: center;
}
.interval-name-input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
}
.interval-color-wrap { display: block; }
.interval-color {
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: none;
  cursor: pointer;
}
.interval-stats {
  display: flex;
  gap: 1.25rem;
  margin: 0.75rem 0 1.25rem;
  color: var(--text-muted);
  font-weight: 700;
}
.interval-empty-slots {
  text-align: center;
  padding: 2.5rem 1rem;
}
.interval-empty-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--text-muted);
  line-height: 4rem;
  font-size: 1.6rem;
}
.interval-empty-title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 800;
}

.interval-editor {
  padding-bottom: 5.5rem;
}
.interval-slot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.interval-slot-list.is-reordering .interval-slot-wrap:not(.is-dragging) {
  transition: transform 0.18s ease;
}
.interval-slot-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  touch-action: pan-y;
  will-change: transform;
}
.interval-slot-wrap.is-dragging {
  opacity: 0.96;
  z-index: 8;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
  transition: box-shadow 0.12s ease;
}
.interval-slot-under {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.interval-slot-under-action {
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--slot-action-width, 6.75rem);
  margin: 0;
  display: flex;
  pointer-events: auto;
}
.interval-slot-under-action.is-dup { left: 0; }
.interval-slot-under-action.is-del { right: 0; }
.interval-slot-under-action button {
  flex: 1;
  width: 100%;
  border: none;
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  padding: 0 0.35rem;
}
.interval-slot-under-action.is-dup button { background: #f08a24; }
.interval-slot-under-action.is-del button { background: var(--danger); }
.interval-slot {
  position: relative;
  display: grid;
  grid-template-columns: 2.75rem 1.65rem 1fr;
  align-items: center;
  gap: 0.25rem 0.35rem;
  padding: 0.7rem 0.65rem 0.7rem 0.35rem;
  background: var(--surface);
  z-index: 1;
  transition: transform 0.18s ease-out;
  will-change: transform;
}
.interval-slot.is-rest { background: var(--surface2); }
.interval-slot-num {
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.85rem;
}
.interval-slot-main {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.interval-slot-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.interval-slot-time {
  color: var(--w-color, #ff4d8d);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}
.interval-slot-load {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.interval-slot-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  min-height: 2.75rem;
  margin: -0.35rem 0;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--text-muted);
  cursor: grab;
  touch-action: none;
  padding: 0;
  flex-shrink: 0;
}
.interval-slot-handle:active {
  cursor: grabbing;
  color: var(--w-color, #ff4d8d);
  background: color-mix(in srgb, var(--w-color, #ff4d8d) 10%, transparent);
}
.interval-slot-grip {
  display: block;
  pointer-events: none;
}
.interval-editor-tools {
  position: fixed;
  right: 1rem;
  bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 0.55rem;
  z-index: 210;
}
.interval-editor-tools form { margin: 0; }
.interval-tool-btn {
  width: 3.1rem;
  min-height: 3.1rem;
  border: none;
  border-radius: 12px;
  background: #fff;
  color: #16181f;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}
.interval-tool-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.interval-fab-inline {
  position: static;
  bottom: auto;
  right: auto;
}
@media (min-width: 901px) {
  .interval-editor-tools { bottom: 1.5rem; }
}

.interval-sheet {
  position: fixed;
  inset: 0;
  z-index: 320;
}
.interval-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.interval-sheet-card {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.1rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
}
.interval-sheet-card h2 {
  margin: 0 0 0.85rem;
  text-align: center;
  font-size: 1rem;
}
.interval-wheels {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.interval-wheels select {
  min-width: 5.2rem;
  padding: 0.7rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 800;
  text-align: center;
}
.interval-wheel-sep {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-muted);
}
.interval-load-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.interval-load-row[hidden] {
  display: none;
}
.interval-load-label {
  flex: 0 0 auto;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}
.interval-load-row input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.7rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  text-align: center;
}
.interval-sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.interval-sheet-cancel,
.interval-sheet-accept {
  border: none;
  border-radius: 10px;
  padding: 0.75rem 0.6rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.interval-sheet-cancel {
  background: var(--surface2);
  color: var(--text);
}
.interval-sheet-accept {
  background: #ff4d8d;
  color: #fff;
}

.interval-picker { max-width: 28rem; margin: 0 auto; padding-bottom: 1rem; }
.interval-picker-search {
  position: relative;
  margin-bottom: 1rem;
}
.interval-picker-search input {
  width: 100%;
  padding: 0.75rem 2.4rem 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
}
.interval-picker-clear {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.25rem 0.4rem;
}
.interval-picker-group { margin-bottom: 0.85rem; }
.interval-picker-group h2 {
  margin: 0 0 0.35rem;
  color: #ff4d8d;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
}
.interval-picker-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}
.interval-picker-row {
  display: block;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.interval-picker-row:hover { background: var(--surface2); }

/* Circuit playlist editor */
.playlist-editor .playlist-rest-row {
  margin: 0 0 1rem;
}
.playlist-items-heading {
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}
.playlist-item-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}
.playlist-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}
.playlist-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.playlist-item-num {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--text-muted);
}
.playlist-item-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.playlist-item-repeats {
  margin: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.playlist-times-prefix {
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
}
.playlist-times-select {
  width: 3.1rem;
  min-width: 3.1rem;
  height: 2.35rem;
  padding: 0 0.35rem;
  margin: 0;
  text-align: center;
}
.playlist-item-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.playlist-item-actions form {
  margin: 0;
  display: flex;
}
.playlist-icon-btn {
  width: 2.35rem;
  min-width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.playlist-delete-btn {
  height: 2.35rem;
  padding: 0 0.55rem;
  white-space: nowrap;
}
.playlist-field {
  display: block;
  margin: 0;
}
.playlist-field-label {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.playlist-field-control {
  width: 100%;
  height: 2.75rem;
  margin: 0;
  box-sizing: border-box;
}
.playlist-add-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.playlist-add-heading {
  font-size: 0.9rem;
  margin: 0 0 0.65rem;
}
.playlist-add-grid {
  display: grid;
  grid-template-columns: 1fr 5.25rem;
  gap: 0.5rem;
  align-items: end;
}
.playlist-field-grow {
  min-width: 0;
}
.playlist-field-narrow {
  min-width: 0;
}
.playlist-add-btn {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 0.15rem;
}
.playlist-footer-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.playlist-footer-actions form {
  width: 100%;
  margin: 0;
}
.playlist-footer-actions .btn-block {
  width: 100%;
  box-sizing: border-box;
}

.app-build-tag {
  margin: 0;
  padding: 0 0 4.5rem;
  text-align: center;
  font-size: 0.62rem;
  color: var(--text-muted);
  opacity: 0.55;
}
