    html, body { min-height: 100dvh; }
    body { margin: 0; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #050b18; color: #f9fafb; display: flex; min-height: 100vh; padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); box-sizing: border-box; }
    .sidebar { width: 360px; max-width: 100%; padding: 18px 20px; background: #0b1020; border-right: 1px solid #1f2937; transition: width 0.25s ease, padding 0.25s ease; box-sizing:border-box; display:flex; flex-direction:column; gap:12px; padding-top: calc(18px + env(safe-area-inset-top)); padding-left: calc(20px + env(safe-area-inset-left)); padding-right: calc(20px + env(safe-area-inset-right)); }
.sidebar.hidden { width: 0; padding: 0; overflow: hidden; border-right: none; height: 0; margin: 0; }
body.pre-workout { justify-content: center; }
body.pre-workout .sidebar { width: min(960px, 100%); padding: 28px; border-right: none; }
body.pre-workout .main { display: none; }
h1 { font-size: 20px; margin-bottom: 16px; }
label { font-size: 14px; display: block; margin-bottom: 4px; color: #9ca3af; }
.form-card { position:relative; overflow:visible; background: rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.05); border-radius:12px; padding:16px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); display:flex; flex-direction:column; gap:12px; }
.form-card .brand-mark { margin-bottom:4px; }
.form-headline { margin:0 0 6px 0; }
.form-sub { margin:0 0 10px 0; color:#cbd5e1; font-size:13px; }
.lang-switch { display:flex; justify-content:flex-end; margin-bottom:6px; position:relative; }
.lang-toggle { background:#0f172a; color:#e5e7eb; border:1px solid rgba(255,255,255,0.2); border-radius:8px; padding:6px 10px; font-size:12px; cursor:pointer; }
.lang-menu { position:absolute; top:110%; right:0; background:#0b1020; border:1px solid rgba(255,255,255,0.2); border-radius:10px; padding:6px; display:none; flex-direction:column; gap:4px; z-index:20; min-width:140px; }
.lang-menu.open { display:flex; }
.lang-option { display:flex; align-items:center; gap:8px; padding:6px 8px; border-radius:8px; cursor:pointer; color:#e5e7eb; }
.lang-option:hover { background:rgba(59,130,246,0.15); }
.field { margin-bottom: 12px; }
.form-grid { display:grid; grid-template-columns: 1fr; gap:12px; }
select, input[type="number"], input[type="tel"] { width: 100%; max-width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid #374151; background: #020617; color: #e5e7eb; font-size: 14px; box-sizing:border-box; display:block; position: relative; z-index: 1; }
    input[type="number"]::-webkit-inner-spin-button,
    input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
    input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
#minutes { max-width: 320px; min-width: 0; display: block; }
.equip-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; font-size: 13px; color: #e5e7eb; }
.equip-item { display:flex; align-items:center; gap:8px; padding:10px 10px; border:1px solid rgba(255,255,255,0.08); border-radius:10px; background: rgba(255,255,255,0.03); cursor:pointer; transition: background 0.15s ease, border-color 0.15s ease; }
.equip-item.selected { background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.6); }
.equip-label { display:flex; align-items:center; gap:6px; margin:0; pointer-events:none; }
.equip-buy { margin-left:auto; font-size:12px; color:#93c5fd; text-decoration:none; padding:2px 6px; border:1px solid rgba(147,197,253,0.3); border-radius:8px; }
.equip-actions { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; gap:8px; }
.equip-actions label { font-weight:700; }
.equip-clear { background:none; border:1px solid rgba(255,255,255,0.25); color:#e5e7eb; padding:3px 8px; border-radius:10px; cursor:pointer; font-size:12px; line-height:1; width:auto; min-width:0; }
button { width: 100%; max-width: 100%; box-sizing: border-box; display:block; margin-top: 8px; padding: 12px 14px; border-radius: 12px; border: none; font-weight: 700; font-size: 15px; cursor: pointer; background: linear-gradient(135deg, #1d4ed8, #ec4899); color: white; }
button:disabled { opacity: 0.5; cursor: default; }
    .main { flex: 1; display: flex; flex-direction: column; padding: 12px 14px 10px; gap: 6px; align-items: center; padding-left: calc(14px + env(safe-area-inset-left)); padding-right: calc(14px + env(safe-area-inset-right)); }
.main > * { width: 100%; max-width: 1400px; }
.brand-mark { display:flex; flex-direction:column; gap:6px; align-items:flex-start; text-decoration:none; color:inherit; }
.brand-word { font-family: 'Arial Black', Impact, sans-serif; font-size: 22px; letter-spacing:0.12em; font-weight:900; color:#f8fafc; }
.brand-underline { display:block; height:4px; width:120px; background: linear-gradient(90deg, #ff4d79, #ff2f56); border-radius:3px; transform: skewX(-8deg); }
.brand-lockup { display:flex; flex-direction:row; align-items:center; gap:8px; font-size:18px; letter-spacing:0.2em; grid-area: brand; text-decoration:none; color:inherit; }
.brand-underline.tight { width:90px; height:4px; }
.brand-url { display:none; }
    .top-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 14px; border-radius: 14px; background: radial-gradient(circle at top left, #1d4ed8, #020617 55%); border: 1px solid #1f2937; position: sticky; bottom: 0; width: 100%; max-width: 100vw; box-sizing:border-box; margin: 0 auto; z-index: 5; padding-left: calc(12px + env(safe-area-inset-left)); padding-right: calc(12px + env(safe-area-inset-right)); }
.top-bar-left { display: flex; flex-direction: column; gap: 4px; }
.top-bar-right { display:flex; flex-direction:column; gap:8px; align-items:flex-end }
.timer-big { font-size: 40px; font-weight: 700; letter-spacing: 0.08em; font-family: 'SFMono-Regular', 'Menlo', 'Consolas', monospace; min-width: 96px; text-align: right; line-height: 1; }
.pill { font-size: 14px; padding: 8px 12px; border-radius: 999px; background: rgba(15,23,42,0.6); border: 1px solid rgba(148,163,184,0.4); display: inline-flex; align-items: center; gap: 8px; font-weight: 600; letter-spacing: 0.04em; }
.pill-row { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:6px; }
.pill span.key { font-weight: 600; color: #e5e7eb; } .pill span.val { color: #a5b4fc; }
.status-type { text-transform: uppercase; font-size: 13px; letter-spacing: 0.16em; color: #a5b4fc; font-weight: 600; }
.format-desc { font-size: 11px; color: #e5e7eb; opacity: 0.8; }
.grid { flex: 1; display: grid; grid-template-columns: 1fr; gap: 6px; min-height: 0; align-content: start; align-items: start; grid-auto-rows: max-content; }

@media (min-width: 900px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field { margin-bottom: 10px; }
}
.current-card { position: relative; border-radius: 18px; padding: 0; background: #020617; border: 1px solid rgba(17,24,39,0.6); display: flex; flex-direction: column; overflow:hidden; box-sizing:border-box; }
.current-header { display:grid; grid-template-columns: minmax(0,0.7fr) minmax(0,0.3fr); grid-template-rows: auto auto; grid-template-areas: "main meta" "bar bar"; align-items:start; gap:6px 12px; padding: 8px 8px 6px; background: linear-gradient(135deg, #0e1a3a, #16254f); border-bottom: 1px solid #0b162f; min-height: 142px; box-sizing:border-box; }
.current-card.rest-mode { background: linear-gradient(180deg, #0b3b2b 0%, #0f3d2e 100%); border-color: rgba(20,92,67,0.8); }
.current-card.rest-mode .current-header { background: linear-gradient(180deg, #0c3f2f 0%, #0a2f24 100%); border-bottom: none; padding: 8px 8px 6px; }
.current-card.complete-mode { background: radial-gradient(circle at 20% 20%, #0f172a 0%, #0b1e2c 45%, #07111f 100%); border-color: #0f172a; min-height: 360px; }
.current-card.warmcool-mode { background: linear-gradient(180deg, #0a3426 0%, #0d402f 100%); border-color: rgba(34,197,94,0.6); }
.current-card.warmcool-mode .current-header { background: linear-gradient(180deg, #0c3f2f 0%, #0a2f24 100%); border-bottom: none; }
.current-card.complete-mode .current-header { background: transparent; border-bottom: none; }
.current-main { display:flex; flex-direction:column; gap:6px; grid-area: main; }
.current-titles { display:flex; flex-direction:column; gap:4px; }
.current-name { font-size: 22px; font-weight: 700; letter-spacing:0.02em; line-height:1.2; display:block; overflow:hidden; }
.current-meta { font-size: 13px; color: #9ca3af; text-transform: uppercase; letter-spacing:0.12em; min-height: 36px; max-height: 36px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.current-meta:empty { visibility:hidden; }
.current-card.rest-mode .current-name { font-size: 26px; }
.current-card.rest-mode .current-meta { font-size: 15px; color: #e5e7eb; }
.current-card.complete-mode .current-name { font-size: 28px; }
.current-card.complete-mode .current-meta { font-size: 16px; color: #cbd5e1; }
.video-wrapper { margin: 0; border-radius: 0; overflow: hidden; background: #000; height: clamp(240px, 50vh, 640px); display:none; align-items:center; justify-content:center; box-sizing:border-box; }
.current-card.rest-mode .video-wrapper { border-top: none; }
.rest-panel { display:none; padding:8px 10px; color:#d1fae5; font-size:13px; font-weight:800; letter-spacing:0.04em; text-transform:uppercase; background: linear-gradient(90deg, rgba(34,197,94,0.18), rgba(16,185,129,0.18)); border-radius: 0 0 14px 14px; border-top: 1px solid rgba(34,197,94,0.35); align-items:center; justify-content:space-between; gap:10px; }
.rest-panel .rest-title { font-size:14px; color:#bbf7d0; }
.rest-panel .rest-sub { font-size:12px; font-weight:600; color:#c0eadc; margin:0; text-transform:none; letter-spacing:0.02em; }
.current-card.rest-mode .rest-panel { display:flex; }
.complete-panel { display:none; padding: 40px 24px 32px; color:#e5e7eb; }
.complete-panel h2 { font-size: 32px; margin: 0 0 8px; }
.complete-panel p { margin:4px 0; color:#cbd5e1; font-size:15px; }
.complete-stats { display:flex; flex-wrap:wrap; gap:12px; margin-top:12px; }
.complete-chip { padding:10px 14px; border-radius:12px; background: rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.08); font-weight:700; font-size:13px; letter-spacing:0.08em; text-transform:uppercase; color:#f8fafc; }
.feedback-card { margin-top:20px; padding:14px; border-radius:12px; background: rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.08); display:flex; flex-direction:column; gap:10px; }
.feedback-card h3 { margin:0; font-size:18px; }
.feedback-card label { font-size:13px; color:#cbd5e1; }
.feedback-card input[type="email"] { width:100%; padding:10px; border-radius:10px; border:1px solid rgba(255,255,255,0.12); background: rgba(0,0,0,0.2); color:#e5e7eb; font-size:14px; box-sizing:border-box; margin:0; }
.feedback-card textarea { width:100%; min-height:110px; padding:10px; border-radius:10px; border:1px solid rgba(255,255,255,0.12); background: rgba(0,0,0,0.2); color:#e5e7eb; font-size:14px; resize:vertical; box-sizing:border-box; margin:0; }
.feedback-actions { display:grid; grid-template-columns: 1fr; gap:10px; align-items:center; width:100%; }
.feedback-actions button { width:100%; text-decoration:none; text-align:center; padding:12px 14px; border-radius:10px; border:1px solid rgba(255,255,255,0.12); background: linear-gradient(135deg, #2563eb, #1d4ed8); color:#f8fafc; font-weight:700; letter-spacing:0.02em; cursor:pointer; box-sizing:border-box; }
.donation-copy { font-size:12px; color:#cbd5e1; }
.donation-row { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:8px; width:100%; }
.donation-btn { display:block; text-align:center; padding:10px 12px; border-radius:10px; border:1px solid rgba(255,255,255,0.12); background: linear-gradient(135deg, #2d66ff, #1e45ea); color:#f8fafc; font-weight:700; letter-spacing:0.02em; text-decoration:none; box-sizing:border-box; font-size:14px; }
.feedback-hint { font-size:12px; color:#9ca3af; min-height:14px; }
iframe { border: 0; width: 100%; height: 100%; }
.stations { display: flex; flex-direction: column; gap: 10px; border-radius: 16px; background: #020617; border: 1px solid #111827; padding: 12px; box-sizing: border-box; overflow: hidden; }
.stations.preview-mode { display: grid; grid-template-columns: 1fr; gap: 14px; padding: 12px; width: 100%; max-height: calc(100vh - 320px); min-height: 320px; align-items: stretch; box-sizing: border-box; overflow: hidden; }
.preview-hero { display: flex; flex-direction: column; align-self: stretch; min-height: 100%; height: 100%; min-height: 0; min-width: 0; }
.preview-queue { display: grid; grid-template-columns: 1fr; grid-auto-rows: minmax(150px, 1fr); gap: 12px; align-items: stretch; overflow-x: hidden; overflow-y: auto; align-self: stretch; height: 100%; min-height: 0; padding-right: 2px; min-width: 0; }
.station { display: grid; grid-template-columns: 80px 1fr 140px; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; position: relative; overflow: hidden; background: linear-gradient(135deg, rgba(15,23,42,0.95), rgba(25,33,55,0.9)); }
.station.active { box-shadow: 0 0 0 2px #a855f7; background: linear-gradient(135deg, rgba(39, 46, 80, 0.95), rgba(63, 77, 122, 0.9)); }
.station-number { font-size: 28px; font-weight: 700; opacity: 0.3; }
.station-info-title { font-size: 14px; font-weight: 600; } .station-info-meta { font-size: 11px; color: #9ca3af; }
.controls { display:flex; gap:8px; flex-wrap:nowrap; }
.small-btn { padding: 12px 16px; border-radius: 14px; border: none; cursor: pointer; background: rgba(255,255,255,0.12); color: #fff; font-weight: 700; font-size: 15px; white-space: nowrap; width:auto; min-width:0; }
.empty-state { font-size: 13px; color: #6b7280; margin-top: 12px; }
.timer-wrap { text-align:right; }
.timer-sub { font-size:12px; letter-spacing:0.08em; text-transform:uppercase; color:#9ca3af; margin-top:4px; }
.site-footer { display:none; width:100%; text-align:center; padding:12px 10px 16px; color:#6b7280; font-size:12px; }
body.pre-workout .site-footer { display:block; }
.toggle-row { display:flex; flex-wrap:wrap; gap:10px; margin-top:4px; }
.toggle-option { display:flex; align-items:center; gap:8px; padding:10px 12px; border:1px solid rgba(255,255,255,0.08); border-radius:10px; background: rgba(255,255,255,0.03); cursor:pointer; transition: background 0.15s ease, border-color 0.15s ease; user-select:none; }
.toggle-option.selected { background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.6); }
.toggle-option input { display:none; }
@media (max-width: 900px) {
      body { flex-direction: column; align-items: stretch; }
  .grid { grid-template-columns: 1fr; gap: 6px; }
  .sidebar { display:block; width:100%; padding:12px 10px; border-right:none; border-bottom:1px solid #1f2937; }
  .sidebar.hidden { display:none; }
  .main { padding: 6px 8px 12px; align-items: stretch; padding-bottom: 90px; } /* leave room for sticky footer */
  .current-card { margin-top: 0; }
  .video-wrapper { height: clamp(170px, 44vh, 460px); }
  .round-circle { width:100px; height:100px; }
  .format-desc { display:none; }
  .top-bar { flex-direction: column; align-items: flex-start; gap: 6px; position: fixed; left: 0; right: 0; bottom: 0; max-width: 100vw; border-radius: 0; padding: 10px 12px 14px; box-sizing:border-box; }
  .top-bar-left { width: 100%; align-items: center; text-align: center; }
  .top-bar-right { width: 100%; min-width:0; align-items:center; gap: 6px; box-sizing:border-box; }
  .controls { width: 100%; max-width:100%; min-width:0; display:grid; grid-template-columns: repeat(3, 1fr); gap:8px; box-sizing:border-box; padding: 0; }
  .timer-wrap { width: 100%; text-align:center; margin: 0 auto; }
  .timer-big { text-align:center; min-width: 0; }
  .small-btn { width:100%; text-align:center; padding: 12px 10px; min-width:0; white-space:normal; font-size:14px; box-sizing:border-box; border-radius:12px; }
}

/* Rest overlay styling (F45-inspired) */
:root {
  --clock-work-start:#ff4d6d;
  --clock-work-end:#ff9f6e;
  --clock-rest-start:#22c55e;
  --clock-rest-end:#34d399;
  --clock-track:rgba(255,255,255,0.08);
  --clock-dynamic: var(--clock-work-start);
}
.round-clock { display:flex; align-items:flex-start; gap:8px; max-width:100%; width:100%; justify-self:end; grid-area: meta; box-sizing:border-box; }
.round-label { display:none; }
.round-meta { display:flex; flex-direction:column; gap:4px; text-align:right; align-items:flex-end; justify-content:flex-start; width:100%; }
.round-meta-line { display:flex; flex-direction:column; gap:2px; align-items:flex-end; font-size:12px; letter-spacing:0.08em; text-transform:uppercase; color:#cbd5e1; font-weight:700; line-height:1.1; }
.round-meta-line .meta-label { font-weight:700; color:#dbeafe; display:block; }
.round-meta-line .meta-value { font-weight:900; color:#f8fafc; letter-spacing:0.08em; font-size:18px; display:block; }

/* Linear progress bar (used on small screens instead of circle) */
.round-bar {
  display:block;
  position: relative;
  flex:1;
  min-width:180px;
  height:28px;
  border-radius:999px;
  background: #020617;
  border:1px solid rgba(148,163,184,0.7);
  overflow:hidden;
  margin-top:4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  grid-area: bar;
  width:100%;
}
.round-bar-fill {
  position:absolute;
  inset:0;
  width:0%;
  background: linear-gradient(90deg, var(--clock-work-start), var(--clock-work-end));
  transition: width 0.2s ease-out, background 0.15s ease-out;
}
.round-bar-label {
  position:absolute;
  top:50%;
  left:50%;
  transform: translate(-50%, -50%);
  font-size:14px;
  font-weight:800;
  color:#f9fafb;
  text-shadow:0 1px 2px rgba(0,0,0,0.7);
  letter-spacing:0.04em;
}
.preview-card { position:relative; background: linear-gradient(135deg, rgba(17,24,39,0.92), rgba(30,41,59,0.9)); border:1px solid rgba(31,41,55,0.9); box-shadow: 0 10px 24px rgba(0,0,0,0.32); border-radius:14px; padding:12px; display:flex; flex-direction:column; gap:8px; min-height:150px; width:100%; max-width:100%; flex:1; isolation:isolate; box-sizing: border-box; overflow:hidden; outline:none; -webkit-tap-highlight-color: transparent; }
.preview-card:focus { outline:none; }
.preview-media { position:relative; width:100%; flex:1; aspect-ratio: 16 / 9; border-radius:10px; overflow:hidden; background:#0b1020; }
.preview-card.hero .preview-media { min-height: 320px; }
.preview-card img { width:100%; height:100%; object-fit:contain; display:block; background:#000; }
.preview-title-overlay { position:absolute; inset:auto 6px 6px 6px; padding:8px 10px; border-radius:10px; background:linear-gradient(180deg, rgba(0,0,0,0.0), rgba(0,0,0,0.7)); color:#f8fafc; font-weight:700; font-size:15px; line-height:1.2; }
.preview-card .title { display:none; }
.preview-card .meta { display:none; }
.preview-card.hero { min-height: 260px; height:100%; flex:1; box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 10px 24px rgba(0,0,0,0.32); }
.preview-hero .preview-card { width:100%; height:100%; min-width:0; max-width:none; }

/* Responsive GIF sizing */
#localGif { width:100%; height:100%; object-fit:contain; background:#000; }
@media (min-width: 1400px) {
  #localGif { object-fit:contain; }
}
@media (max-width: 900px) {
  .video-wrapper { height: clamp(220px, 50vh, 620px); }
}

@media (max-width: 1100px) {
  .round-clock { gap:10px; }
  .round-circle { width:110px; height:110px; }
  .round-circle span { font-size:32px; }
  .round-meta { font-size:12px; }
  .stations.preview-mode { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 820px) {
  .current-header { grid-template-columns: 0.7fr 0.3fr; grid-template-rows: auto auto; grid-template-areas: "main meta" "bar bar"; }
  .round-clock { align-self:stretch; max-width:100%; flex-direction:column; align-items:flex-end; justify-content:space-between; gap:8px; width:100%; box-sizing:border-box; height:100%; }
  .round-circle { display:none !important; }
  .round-bar { display:block !important; height:28px; margin-top:0; }
  .round-meta { flex:1; flex-direction:column; align-items:flex-end; justify-content:space-between; text-align:right; gap:6px; width:100%; align-self:stretch; }
  .stations.preview-mode { grid-template-columns: 1fr; gap: 10px; }
  .preview-hero, .preview-queue { min-width: 100%; }
  .controls { width: 100%; display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:8px; box-sizing:border-box; padding: 0 8px 8px; }
}
