/*
  Relentless — Dark Theme Tokens and Shared UI
  Only layout/theme styles; no functional changes.
*/
:root {
  --bg: #0B0F14;
  /* page background */
  --panel: #0F172A;
  /* card/panel background */
  --line: #1F2937;
  /* subtle borders */
  --text: #F5F7FB;
  /* primary text */
  --muted: #9CA3AF;
  /* secondary text */
  --accent: #22C55E;
  /* brand accent */
  --ok: #A7F3D0;
  /* success/ok */

  /* Hevy-inspired tracker design tokens */
  --tracker-card-bg: #111827;
  --tracker-card-border: rgba(55, 65, 81, 0.5);
  --tracker-card-radius: 12px;
  --tracker-section-gap: 20px;
  --tracker-accent: #22C55E;
  --tracker-accent-shadow: rgba(34, 197, 94, 0.25);
  --tracker-muted: #9CA3AF;
  --tracker-focus: #fff;
  --tracker-subtle-bg: #0F172A;
}

html,
body {
  overflow-x: hidden;
}

.bg {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, system-ui, sans-serif;
}

.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin: 14px 0;
}

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

.actions {
  align-items: center;
}

label {
  color: var(--muted);
  font-size: 12px;
}

input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  background: #0b0f14;
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 14px;
  box-sizing: border-box;
}

/* Date input styling for dark theme */
input[type="date"] {
  color-scheme: dark;
  cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

.btn {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn[disabled] {
  opacity: .75;
  cursor: wait;
}

.muted {
  color: var(--muted);
}

.status {
  color: var(--muted);
  font-size: 12px;
}

.helper {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 15, 20, .8);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
}

.nav a {
  color: var(--text);
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  height: 100%;
  background: rgba(17, 24, 39, .9);
  backdrop-filter: blur(6px);
}

.topbar>.topbar-inner {
  width: 100%;

  flex: 1 0 auto;
}

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

.tb-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.tb-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.tb-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-right: 10px;
}

/* Mobile hamburger + drawer */
.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid #374151;
  border-radius: 8px;
  background: #1F2937;
  color: #E5E7EB;
  cursor: pointer;
  font-size: 24px;
  font-weight: 300;
  min-width: 44px;
  min-height: 44px;
}

@media (max-width: 900px) {
  .hamburger {
    display: inline-flex;
  }
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100dvh;
  width: 240px;
  background: #0F172A;
  border-right: 1px solid #1F2937;
  transform: translateX(-100%);
  transition: transform .2s ease;
  z-index: 1000;
  padding: 12px;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Responsive modal (used for confirmations) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity .18s ease;
}
.modal-overlay.open { opacity: 1; }
.modal-card {
  width: 100%;
  max-width: 460px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
}
.modal-title { font-weight: 800; font-size: 18px; margin-bottom: 8px; }
.modal-body { color: var(--muted); line-height: 1.4; margin-bottom: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
@media (max-width: 520px){
  .modal-card { max-width: 92vw; padding: 14px; border-radius: 12px; }
  .modal-title { font-size: 16px; }
  .modal-actions .btn { width: auto; padding: 10px 12px; }
}

.phase-btn,
.tier-btn {
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid #374151;
  background: #1F2937;
  color: #E5E7EB;
  font-size: 12px;
}

.phase-btn.active,
.tier-btn.active {
  background: #22C55E;
  color: #0B0F14;
  border-color: #16A34A;
}

/* Tablet adjustments: tighter buttons */
@media (max-width: 900px) {
  .tb-center {
    gap: 6px;
  }

  .phase-btn,
  .tier-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
}

/* Mobile: hide center controls and shrink gaps */
/* Mobile layout: stack navbar and center section */
/* Better card responsiveness on mobile */
@media (max-width: 600px) {
  .card {
    padding: 12px;
    border-radius: 14px;
    margin: 10px 0;
  }
}

@media (max-width: 480px) {
  .card {
    padding: 10px;
    border-radius: 12px;
  }
}

@media (max-width: 600px) {
  .topbar-inner {
    flex-direction: column;
    /* stack vertically */
    align-items: flex-start;
    /* left-align content */
    gap: 6px;
    padding: 8px;
  }

  .tb-left {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* space between hamburger and logo */
  }

  .tb-center {
    display: flex;
    /* show middle section again */
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
  }

  .tb-right {
    display: none !important;
    /* hide user info and signout */
  }

  .hamburger {
    display: inline-flex;
  }
}

.brand {
  display: flex;
  align-items: center;
}

.brand img {
  height: 48px;
  /* default size for non-topbar contexts */
  width: auto;
  object-fit: contain;
  display: block;
  max-width: 360px;
}

/* Larger, readable logo in the sticky topbar across apps */
.topbar .brand img {
  height: 65px;
}

@media (max-width: 900px) {
  .topbar .brand img {
    height: 48px;
  }
}

@media (max-width: 600px) {
  .topbar .brand img {
    height: 42px;
  }
}


.wordmark {
  font-weight: 900;
  letter-spacing: 0.12em;
  font-size: 12px;
  line-height: 1;
  margin-bottom: 2px;
}

.brand>div {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Center text elements */
  text-align: center;
}

.tag {
  color: white;
  font-weight: 700;
  font-size: 6px;
  letter-spacing: 0.08em;
}

/* Utility: centered full-height layout (landing) */
.screen-center {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--text);
}

/* Utility: buttons row */
.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Utility: small code badge */
code.badge {
  background: var(--bg);
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

@media (max-width: 700px) {
  .wrap {
    padding: 12px;
  }

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

  label {
    align-self: start;
  }

  .nav {
    flex-wrap: wrap;
    gap: 8px;
  }

  .brand {
    gap: 8px;
  }

  .btn-row {
    flex-wrap: wrap;
  }

  input {
    padding: 6px 8px;
    font-size: 13px;
  }
}

/* Global responsive helpers */
.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

img,
video {
  max-width: 100%;
  height: auto;
}

@media (max-width: 900px) {
  .shell {
    padding: 14px;
  }
}

@media (max-width: 600px) {
  .shell {
    padding: 12px;
  }

  .nav {
    position: sticky;
    top: 0;
  }
}

/* Phase 6 – Equipment UI */
.chip {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid #374151;
  border-radius: 999px;
  background: transparent;
  color: #E5E7EB;
  font-size: 12px;
  font-weight: 600;
  cursor: default;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  line-height: 1.3;
}

/* Make chip-as-button clickable when used on goal modes */
.chip.goalModeBtn,
.goalModeBtn.chip {
  cursor: pointer;
  user-select: none;
}

.chip.goalModeBtn[aria-pressed="true"],
.goalModeBtn.chip[aria-pressed="true"] {
  background: #22C55E;
  color: #0B0F14;
  border-color: #16A34A;
}

.chip:hover {
  border-color: var(--accent);
}

/* Status chips with metrics - allow multi-line display */
#a_status,
#k_status,
#workoutTime,
#goalTierBadge,
#equipmentProfileName {
  white-space: normal;
  word-break: break-word;
  text-align: center;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Readiness/progress bar (reusable) */
.progress-rail {
  width: 100%;
  height: 8px;
  background: #374151;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #22C55E;
}

.equip-list {
  min-height: 40px;
}


/* Card emphasis variants */
.card.emphasis {
  border-color: rgba(255, 255, 255, .08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

/* Width helpers used across pages */
.span6 {
  grid-column: span 6;
}

.span12 {
  grid-column: span 12;
}

/* Meraki-style dark UI skin (scoped; no functional changes) */
.meraki {
  background: #000;
  color: #D1D5DB;
}

.meraki .nav {
  background: rgba(17, 24, 39, .9);
  border-bottom: 1px solid #1F2937;
  color: #E5E7EB;
}

.meraki .nav a {
  color: #E5E7EB;
}

.meraki .wordmark {
  color: #FFFFFF;
}

.meraki .card {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}

.meraki .muted {
  color: #9CA3AF;
}

.meraki .btn {
  background: #22C55E;
  color: #0B0F14;
  border-radius: 12px;
  font-weight: 700;
}

.meraki .btn.ghost {
  background: #1F2937;
  color: #E5E7EB;
  border: 1px solid #374151;
}

/* Text/link button variant (no background, green text, underline on hover) */
.btn.link,
.meraki .btn.link {
  background: transparent !important;
  color: #22C55E !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

.btn.link:hover,
.meraki .btn.link:hover {
  text-decoration: underline;
}

.meraki .pill {
  border-color: #374151;
  background: #0B0F14;
  color: #E5E7EB;
}

.meraki table {
  font-size: 14px;
}

.meraki th {
  color: #9CA3AF;
}

.meraki td {
  color: #D1D5DB;
}

/* Sidebar layout */
.layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  align-items: start;
  width: 100%;
  overflow-x: hidden;
}

.sidebar {
  position: sticky;
  top: 64px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  border-right: 1px solid var(--line);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
}

.side-item:hover {
  background: #1F2937;
  color: var(--text);
  border-color: #374151;
}

.side-item.active {
  background: #111827;
  color: #E5E7EB;
  border-color: #374151;
}

.side-section {
  margin: 6px 4px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

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

  .sidebar {
    display: none;
  }
}

/* ===========================================
   Themed Select Dropdown — Relentless Dark UI
   =========================================== */
select {
  width: 100%;
  padding: 8px 32px 8px 10px;
  /* space for arrow */
  border-radius: 8px;
  border: 1px solid var(--line);
  /* background: #ffffff; */
  background-color: #ffffff;
  /* matches .bg / input fields */
  color: #111827;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;

  /* remove native styles */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  /* custom dropdown arrow */
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 12px center, right 6px center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

select:hover {
  border-color: #374151;
  /* slight highlight on hover */
}

select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.25);
  /* subtle glow of accent color */
}

select option {
  background-color: #0F172A;
  /* dropdown list background */
  color: var(--text);
}

/* Compact variant for narrow viewports */
@media (max-width: 600px) {
  select {
    padding: 6px 28px 6px 8px;
    font-size: 13px;
  }
}

/* Markdown/Description styling (Plan preview)
   Matches JSX/screenshot spacing and typography*/
.markdown,
.desc {
  color: #D1D5DB;
  /* slightly dimmer body like the screenshot */
  font-size: 14px;
  line-height: 1.55;
  font-family: Inter, -apple-system, system-ui, Segoe UI, Roboto, sans-serif;
}

.markdown h1,
.markdown h2,
.markdown h3,
.desc h1,
.desc h2,
.desc h3 {
  margin: 10px 0 6px;
  line-height: 1.3;
  font-weight: 800;
}

.markdown h3,
.desc h3 {
  font-size: 16px;
  color: #E5E7EB;
}

.markdown p,
.desc p {
  margin: 8px 0;
}

.markdown ul,
.desc ul {
  margin: 6px 0 6px 1.25rem;
  padding-left: 1rem;
}

.markdown li,
.desc li {
  margin: 2px 0;
}

.markdown> :first-child,
.desc> :first-child {
  margin-top: 0 !important;
}

.markdown> :last-child,
.desc> :last-child {
  margin-bottom: 0 !important;
}

/* ===========================================
   Card header row + time badge styles
   =========================================== */
.time-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #E5E7EB;
  border: 1px solid #374151;
  background: #1F2937;
  padding: 6px 10px;
  border-radius: 999px;
}

/* Apply pill look to dashboard workout time id without editing HTML */
#workoutTime {
  color: #ffffff;
  border: 1px solid #374151;
  /* background: #1F2937; */
  padding: 6px 10px;
  border-radius: 999px;
}


/* Contain chips/badges in card headers - allow wrapping */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start; /* Changed from center to flex-start to allow wrapping */
  margin-bottom: 12px;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap; /* Allow items to wrap if needed */
}

.card-header h3 {
  flex-shrink: 0;
  min-width: 0;
  margin: 0;
}

.card-header .chip {
  max-width: calc(100% - 20px);
  flex-shrink: 1;
  /* Allow multi-line text in chips */
  white-space: normal;
  text-align: center;
}

/* ===========================================
   Buttons: primary CTA (matches screenshot)
   =========================================== */
.btn.btn-primary {
  padding: 14px 18px;
  font-size: 16px;
  border-radius: 14px;
  border: 2px solid black;
}

/* Link-looking action inside cards (e.g., Open tracker link style) */
.action-link {
  color: #34D399;
  font-weight: 700;
  text-decoration: none;
}

.action-link:hover {
  text-decoration: underline;
}

/* Top-row helper: keep three key cards in a single horizontal row.
   On narrow screens the row becomes horizontally scrollable to preserve single-row layout. */
.top-row {
  display: flex;
  gap: 16px;
  align-items: stretch;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  box-sizing: border-box;
  scroll-snap-type: x mandatory;
}

/* Make each child card flexible, equal-width, and ensure a sensible minimum size.
   Use column flex so inner elements flow top→bottom and content can stretch. */
.top-row>section,
.top-row>div.card {
  flex: 1 1 0;
  min-width: 280px;
  /* Increased from 240px */
  min-height: 260px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  scroll-snap-align: start;
}

@media (max-width: 600px) {
  .chip {
    font-size: 11px;
    padding: 4px 8px;
    max-width: 100%;
    line-height: 1.4;
  }
  
  /* Allow chips to take more space on mobile if needed */
  .card-header {
    align-items: flex-start;
  }
  
  .card-header .chip {
    max-width: 65%; /* Give chip more room on mobile */
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .chip {
    font-size: 10px;
    padding: 3px 7px;
    line-height: 1.4;
  }
  
  .card-header .chip {
    max-width: 60%;
    font-size: 9px;
    padding: 3px 6px;
  }
}

@media (max-width: 400px) {
  .card-header .chip {
    max-width: 55%;
    font-size: 9px;
  }
}

/* Responsive reductions for smaller viewports */
@media (max-width: 900px) {

  .top-row>section,
  .top-row>div.card {
    min-width: 260px;
    min-height: 240px;
  }
}

@media (max-width: 600px) {
  .top-row {
    gap: 12px;
  }

  .top-row>section,
  .top-row>div.card {
    min-width: 85vw;
    /* Make cards almost full-width for better mobile UX */
    min-height: auto;
    /* Allow height to be content-driven */
  }
}

@media (max-width: 480px) {
  .top-row {
    gap: 10px;
    padding: 0 4px 4px 4px;
  }

  .top-row>section,
  .top-row>div.card {
    min-width: 90vw;
  }
}

/* Responsive timer display */
@media (max-width: 600px) {
  #restTimer {
    font-size: 40px !important;
  }
}

@media (max-width: 480px) {
  #restTimer {
    font-size: 36px !important;
  }
}

/* Better button layouts on mobile */
@media (max-width: 600px) {
  .tracker-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .tracker-actions .btn {
    flex: 1 1 auto;
    min-width: calc(50% - 4px);
  }
}

@media (max-width: 480px) {
  .btn {
    padding: 10px 14px;
    font-size: 14px;
  }

  .btn.ghost {
    padding: 8px 12px;
  }
}

/* Responsive chips */
@media (max-width: 600px) {
  .chip {
    font-size: 11px;
    padding: 4px 8px;
  }
}

@media (max-width: 480px) {
  .chip {
    font-size: 10px;
    padding: 3px 7px;
  }
}

.tracker-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  font-size: 14px;
}

@media (max-width: 600px) {
  .tracker-modes {
    gap: 8px;
    font-size: 13px;
  }

  .tracker-modes button {
    padding: 10px 8px !important;
  }
}

@media (max-width: 520px) {
  .tracker-modes {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 380px) {
  .tracker-modes {
    grid-template-columns: 1fr;
  }
}

/* Small visual smoothing for the horizontal container on dark backgrounds */
.top-row::-webkit-scrollbar {
  height: 8px;
}

.top-row::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.top-row::-webkit-scrollbar-track {
  background: transparent;
}

/* ===========================================
   Hevy-Inspired Tracker UI Utilities
   =========================================== */

/* Tracker content container */
.tracker-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Tracker section spacing */
.tracker-section {
  margin-bottom: var(--tracker-section-gap);
}

/* Tracker card base (softer borders than default .card) */
.tracker-card {
  background: var(--tracker-card-bg);
  border: 1px solid var(--tracker-card-border);
  border-radius: var(--tracker-card-radius);
  padding: 16px;
  margin-bottom: var(--tracker-section-gap);
}

/* Tab navigation */
.tab-header {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--tracker-card-border);
  margin-bottom: 16px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--tracker-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--tracker-focus);
}

.tab-btn.active {
  color: var(--tracker-focus);
  border-bottom-color: var(--tracker-accent);
}

.tab-content {
  display: none;
}

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

/* Exercise card styling */
.exercise-card {
  background: var(--tracker-card-bg);
  border: 1px solid var(--tracker-card-border);
  border-radius: var(--tracker-card-radius);
  padding: 16px;
  margin-bottom: 16px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.exercise-card:hover {
  border-color: rgba(55, 65, 81, 0.8);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.exercise-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.exercise-info {
  flex: 1;
}

.exercise-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--tracker-focus);
  margin: 0 0 4px 0;
}

.exercise-prescription {
  font-size: 13px;
  color: var(--tracker-muted);
  margin: 0;
}

/* Previous set indicator (Hevy-style) */
.previous-set-badge {
  font-size: 12px;
  color: #60A5FA;
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 12px;
  display: inline-block;
}

/* Log button enhancement */
.btn-log {
  background: var(--tracker-accent);
  color: #0B0F14;
  border: none;
  border-radius: 10px;
  padding: 2px 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-log:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--tracker-accent-shadow);
}

.btn-log:active {
  transform: translateY(0);
}

/* Inline log form styling */
.inline-log-form {
  margin-top: 16px;
  padding: 18px;
  background: var(--tracker-subtle-bg);
  border: 1px solid var(--tracker-card-border);
  border-radius: var(--tracker-card-radius);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.1);
  animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
  to {
    opacity: 1;
    max-height: 800px;
    padding-top: 16px;
    padding-bottom: 16px;
  }
}

/* Activity card (unified feedback + recent sets) */
.activity-card {
  transition: opacity 0.2s ease;
}

.activity-card.subdued {
  opacity: 0.5;
  pointer-events: none;
}

.activity-section {
  margin-bottom: 12px;
}

.activity-section:last-child {
  margin-bottom: 0;
}

/* Enhanced hero card (rest timer) */
.hero-timer-card {
  position: relative;
}

.hero-timer-display {
  font-size: clamp(48px, 12vw, 64px);
  font-weight: 800;
  color: var(--tracker-focus);
  text-align: center;
  margin: 8px 0;
}

.hero-progress-bar {
  height: 10px;
  width: 100%;
  background: #374151;
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0;
}

.hero-progress-fill {
  height: 100%;
  background: var(--tracker-accent);
  width: 0%;
  transition: width 0.3s ease-out;
}

/* Enhanced finish CTA */
.finish-section {
  border-top: 2px solid #374151;
  padding-top: 32px;
  margin-top: 32px;
}

.btn-finish {
  background: var(--tracker-accent);
  color: #0B0F14;
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 18px;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 8px 20px var(--tracker-accent-shadow);
  transition: all 0.2s ease;
}

.btn-finish:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px var(--tracker-accent-shadow);
}

.btn-finish:active {
  transform: translateY(0);
}

/* Floating rest timer refinements */
.floating-timer {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: #0B0F14;
  color: #E5E7EB;
  padding: 12px 14px;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--tracker-card-border);
  z-index: 9999;
  min-width: 220px;
  transition: all 0.2s ease;
}

.floating-timer.paused {
  border-color: #fbbf24;
}

.floating-timer-time {
  font-weight: 800;
  font-size: 20px;
  color: var(--tracker-accent);
  text-align: center;
}

.floating-timer.paused .floating-timer-time {
  color: #fbbf24;
}

.floating-timer-adjust-btn {
  background: transparent;
  border: 1px solid;
  border-radius: 8px;
  padding: 5px 7px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.floating-timer-adjust-btn.minus {
  color: #fbbf24;
  border-color: #fbbf24;
}

.floating-timer-adjust-btn.plus {
  color: var(--tracker-accent);
  border-color: var(--tracker-accent);
}

.floating-timer-adjust-btn:hover {
  transform: scale(1.05);
}

/* ===== Hevy-Style Upfront Set Display ===== */

/* Set table container */
.set-table-container {
  margin-top: 16px;
  animation: fadeIn 0.3s ease-out;
}

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

/* Header row with field labels */
.set-header-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin-bottom: 4px;
  background: transparent;
}

.set-header-cell {
  flex: 1 1 0;
  min-width: 0;
  font-size: 9px;
  font-weight: 700;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

.set-number-header {
  flex: 0 0 28px;
  text-align: center;
}

.actions-header {
  flex: 0 0 102px;
}

/* Individual set row - Hevy-style horizontal layout */
.set-row {
  display: flex;
  align-items: center;    /* ✅ aligns buttons + inputs perfectly */
  gap: 6px;
  padding: 3px 5px;
  border: 1px solid #374151;
  border-radius: 6px;
  margin-bottom: 6px;
  transition: all 0.2s ease;
  background: #1F2937;
}


.set-row[data-status="logged"] {
  background: #0F172A;
  opacity: 0.8;
  border-color: #2D3748;
}

.set-row[data-status="current"] {
  background: #1F2937;
  border-color: #22C55E;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.1);
}

.set-row[data-status="pending"] {
  background: #111827;
  opacity: 0.5;
  border-color: #2D3748;
}

.set-row:hover:not([data-status="pending"]) {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Set number label */
.set-number-label {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  font-weight: 700;
  font-size: 15px;
  color: #9CA3AF;
}

/* Input field wrappers (no labels - header shows them) */
.set-input-wrapper {
  flex: 1 1 0;
  min-width: 0;
}

.set-input-wrapper input {
  width: 100%;
  padding: 6px 6px;
  border-radius: 5px;
  border: 1px solid #374151;
  background: #111827;
  color: white;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  line-height: 1.1;
  outline: none;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.set-input-wrapper input::placeholder {
  color: #6B7280;
  opacity: 0.6;
}

.set-input-wrapper input:focus {
  border-color: #22C55E;
  background: #0F172A;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15);
}

.set-input-wrapper input:disabled {
  background: #0D1117;
  color: #6B7280;
  cursor: not-allowed;
  border-color: #2D3748;
}

/* Action buttons container - fixed width for consistency */
.set-row > div[style*="display: flex"] {
  flex: 0 0 auto;
  display: flex !important;
  gap: 6px;
  align-items: flex-start;
  margin-left: auto;
  width: 102px; /* 60px log + 36px delete + 6px gap */
}

/* Action button */
.set-action-btn {
  height: 26px;              /* was 32px */
  min-height: 0;             /* kill default button min-height */
  box-sizing: border-box;
  padding: 0 10px;
  border-radius: 6px;
  border: none;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  width: 60px;
  white-space: nowrap;

  display: flex;             /* ensures perfect vertical centering */
  align-items: center;
  justify-content: center;
  line-height: 1;            /* avoid font-based height inflation */
}


.set-action-btn:disabled {
  cursor: default;
  opacity: 1;
}

/* Delete button styling */
.set-delete-btn {
  height: 26px;              /* was 32px */
  min-height: 0;
  box-sizing: border-box;
  padding: 0 !important;
  width: 36px !important;

  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1 !important;
}

/* Optical alignment fix: buttons sit ~1px lower than inputs in Chrome */
.set-action-btn,
.set-delete-btn,
.set-number-label {
  position: relative;
  top: -4px;   
}

/* Per-exercise rest timer - Subtle Hevy-style */
.exercise-rest-settings {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-top: 1px solid #2D3748;
  border-radius: 0;
  margin-top: 10px;
  font-size: 13px;
}

.exercise-rest-settings span {
  font-weight: 600;
  color: #9CA3AF;
  font-size: 13px;
  flex-shrink: 0;
}

/* Time display/input - clean and minimal */
.exercise-rest-settings input {
  background: transparent;
  border: none;
  color: #E5E7EB;
  font-weight: 700;
  font-size: 14px;
  width: 50px;
  padding: 4px;
  text-align: left;
  outline: none;
  transition: all 0.15s ease;
}

.exercise-rest-settings input:focus {
  background: #1F2937;
  border-radius: 4px;
  padding: 4px 8px;
}

.exercise-rest-settings input:disabled {
  cursor: default;
}

/* Toggle button - ON/OFF state */
.exercise-rest-settings .rest-toggle {
  margin-left: auto;
  background: transparent;
  border: 1px solid #4B5563;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.2s ease;
  color: #9CA3AF;
  min-width: 48px;
  text-align: center;
}

.exercise-rest-settings .rest-toggle:hover {
  border-color: #6B7280;
  color: #D1D5DB;
}

.exercise-rest-settings .rest-toggle[data-state="on"] {
  background: rgba(34, 197, 94, 0.1);
  border-color: #22C55E;
  color: #22C55E;
}

.exercise-rest-settings .rest-toggle[data-state="off"] {
  background: rgba(239, 68, 68, 0.1);
  border-color: #EF4444;
  color: #EF4444;
}

/* Edit mode indicator */
.exercise-rest-settings.editing input {
  background: #1F2937;
  border: 1px solid #22C55E;
  border-radius: 4px;
  padding: 4px 8px;
}

/* Add Set button - Hevy-style */
.add-set-btn {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  background: transparent;
  border: 1px dashed #4B5563;
  border-radius: 10px;
  color: #9CA3AF;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-set-btn:hover {
  border-color: #22C55E;
  color: #22C55E;
  border-style: solid;
  background: rgba(34, 197, 94, 0.05);
  transform: translateY(-1px);
}

.add-set-btn:active {
  transform: translateY(0);
}

/* Collapsible notes section */
.collapsible-notes {
  margin-top: 12px;
}

.collapsible-notes button {
  background: none;
  border: none;
  color: #6B7280;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.collapsible-notes button:hover {
  color: #9CA3AF;
}

.collapsible-notes textarea {
  display: none;
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  background: #1F2937;
  border: 1px solid #374151;
  border-radius: 6px;
  color: white;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  outline: none;
}

.collapsible-notes textarea:focus {
  border-color: #22C55E;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

#floatingRestTimer {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
}

/* Animated border using conic-gradient */
#floatingRestTimer::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  padding: 2px;
  background: conic-gradient(
    from 0deg at 50% 50%,
    #22C55E 0deg,
    #22C55E var(--countdown-angle, 360deg),
    #374151 var(--countdown-angle, 360deg),
    #374151 360deg
  );
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
}

#floatingRestTimer.counting::before {
  background: conic-gradient(
    from 0deg at 50% 50%,
    #22C55E 0deg,
    #22C55E var(--countdown-angle, 360deg),
    #374151 var(--countdown-angle, 360deg),
    #374151 360deg
  );
}

#floatingRestTimer.paused::before {
  background: conic-gradient(
    from 0deg at 50% 50%,
    #fbbf24 0deg,
    #fbbf24 var(--countdown-angle, 360deg),
    #374151 var(--countdown-angle, 360deg),
    #374151 360deg
  );
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .tracker-container {
    padding: 0 12px;
  }

  .exercise-name {
    font-size: 16px;
  }

  .exercise-prescription {
    font-size: 12px;
  }

  .btn-log {
    padding: 4px 10px;
    font-size: 13px;
  }

  .hero-timer-display {
    font-size: clamp(40px, 10vw, 48px);
  }

  /* Responsive set rows for tablets */
  .set-row {
    gap: 6px;
    padding: 10px;
  }

  .set-number-label {
    width: 28px;
    font-size: 15px;
  }

  .set-row > div input {
    padding: 7px 5px;
    font-size: 13px;
  }

  .set-row > div label {
    font-size: 9px;
  }

  .set-action-btn {
    padding: 2px 2px;
    font-size: 12px;
    min-width: 55px;
  }

  .set-delete-btn {
    padding: 2px !important;
    min-width: 34px !important;
    font-size: 12px !important;
  }

  .exercise-rest-settings {
    padding: 10px 12px;
    gap: 8px;
  }

  .exercise-rest-settings span {
    font-size: 13px;
  }

  .exercise-rest-settings input {
    width: 60px;
    padding: 7px 8px;
    font-size: 13px;
  }

  .exercise-rest-settings button {
    padding: 7px 10px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .tracker-card {
    padding: 12px;
  }

  .exercise-card {
    padding: 12px;
  }

  .inline-log-form {
    padding: 12px;
  }

  .btn-finish {
    font-size: 16px;
    padding: 12px 16px;
  }

  /* Responsive set rows for mobile - wrap to two rows */
  .set-row {
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 8px;
  }

  .set-header-row {
    padding: 4px 8px;
    flex-wrap: wrap;
  }

  .set-number-label {
    width: 24px;
    font-size: 13px;
  }

  .set-number-header {
    flex: 0 0 24px;
  }

  /* Input fields - first row takes full width */
  .set-input-wrapper {
    flex: 1 1 0;
    min-width: 50px;
  }

  .set-input-wrapper input {
    padding: 5px 4px;
    font-size: 13px;
  }

  .set-header-cell {
    font-size: 8px;
  }

  /* Action buttons move to second row, full width */
  .set-row > div[style*="display: flex"] {
    flex: 1 1 100%;
    width: 100%;
    margin-top: 8px;
    justify-content: stretch !important;
    gap: 6px;
  }

  .set-action-btn {
    flex: 1;
    font-size: 12px;
    padding: 2px;
    min-width: 0;
    width: auto;
  }

  .set-delete-btn {
    flex: 0 0 auto;
    padding: 2px !important;
    width: 44px !important;
    min-width: 44px !important;
    font-size: 12px !important;
  }

  /* Hide actions header on mobile since buttons are on separate row */
  .actions-header {
    display: none;
  }

  /* Rest settings - horizontal on mobile */
  .exercise-rest-settings {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
  }

  .exercise-rest-settings span {
    flex: 0 0 auto;
    font-size: 13px;
  }

  .exercise-rest-settings input {
    flex: 1 1 auto;
    max-width: 100px;
  }

  .exercise-rest-settings button {
    flex: 1 1 calc(50% - 4px);
    padding: 8px;
  }

  /* Add Set button */
  .add-set-btn {
    padding: 12px;
    font-size: 14px;
  }
}