/* ===========================================================
   SIŁKA 3 — stylizacja vGPT_1.0.4
   =========================================================== */

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

:root {
  --bg: #0a0a0a;
  --bg-2: #141414;
  --bg-3: #1c1c1c;
  --bg-4: #242424;
  --line: #2a2a2a;
  --line-2: #3a3a3a;

  --green: #22c55e;
  --green-glow: #39ff7c;
  --green-dark: #0f5a2b;
  --green-row-light: #143f25;
  --green-row-dark: #0c2818;

  --red: #ef4444;
  --red-glow: #ff5a5a;
  --red-dark: #5a1212;

  --yellow: #fbbf24;
  --yellow-glow: #ffe066;
  --yellow-dark: #6b4e00;

  --orange: #ff8c3a;
  --orange-dark: #c4521a;

  --text: #f3f4f6;
  --text-dim: #a1a1aa;
  --text-dimmer: #6b7280;
  --text-faded: #4b5563;

  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

[hidden] { display: none !important; }

body {
  background:
    radial-gradient(1200px 600px at 50% -100px, #1a1a1a 0%, transparent 60%),
    linear-gradient(180deg, #0a0a0a 0%, #070707 100%);
}

button {
  border: none;
  background: none;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  font-size: inherit;
}
input { font-family: inherit; }

#app {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease-out;
  padding-top: var(--safe-t);
  padding-bottom: var(--safe-b);
}
.screen.active {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================
   EKRAN 0 — STRONA STARTOWA
   ========================================================== */
.screen--home {
  background:
    radial-gradient(circle at 50% 10%, rgba(34,197,94,0.10), transparent 55%);
}

.home-top {
  flex: 0 0 25%;
  display: flex;
  padding: 18px 16px 10px;
  position: relative;
}

.home-finish-img {
  flex: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--green-dark);
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(57,255,124,0.18);
}
.home-finish-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* MEGA START — jeden duży przycisk na całą górną sekcję */
.home-btn-mega {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #0f2a18 0%, #061a0d 100%);
  border: 2px solid var(--green-dark);
  transition: transform 120ms ease-out, border-color 180ms, box-shadow 180ms;
  overflow: hidden;
  font-family: 'Rajdhani', sans-serif;
  box-shadow: 0 0 24px rgba(57,255,124,0.18);
}
.home-btn-mega::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.04) 50%, transparent 100%);
  pointer-events: none;
}
.home-btn-mega__icon {
  font-size: clamp(56px, 16vw, 90px);
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(0,0,0,0.5));
}
.home-btn-mega__label {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--green-glow);
  text-shadow: 0 0 14px rgba(57,255,124,0.4);
}
.home-btn-mega:active,
.home-btn-mega.clicked {
  transform: scale(0.97);
  border-color: var(--green-glow);
  box-shadow: 0 0 36px rgba(57,255,124,0.4);
}
.home-btn-mega.holding {
  border-color: var(--yellow);
  box-shadow: 0 0 40px rgba(251,191,36,0.5);
  animation: holdPulse 0.4s ease-in-out infinite alternate;
}
@keyframes holdPulse {
  from { box-shadow: 0 0 30px rgba(251,191,36,0.4); }
  to   { box-shadow: 0 0 60px rgba(251,191,36,0.7); }
}
.home-btn-mega.disabled {
  opacity: 0.35;
  filter: grayscale(0.6);
  pointer-events: none;
}

/* --- Tabela historii --- */
.history-wrap {
  flex: 1 1 75%;
  display: flex;
  flex-direction: column;
  margin: 6px 12px 12px;
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  border: 1px solid var(--line);
  overflow: hidden;
  min-height: 0;
}

.history-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #1a1a1a 0%, #141414 100%);
  position: relative;
}

.history-title {
  margin: 0;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.16em;
  color: var(--text);
  flex: 0 0 auto;
}
.history-title span {
  color: var(--green-glow);
  text-shadow: 0 0 12px rgba(57,255,124,0.5);
}

/* Wersja — przygaszona ale CZYTELNA */
.version-tag {
  flex: 1 1 auto;
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(180,180,190,0.60);
  font-weight: 600;
  margin-left: 4px;
  cursor: pointer;
  user-select: none;
}

.edit-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.edit-action {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #000;
  transition: transform 120ms;
}
.edit-action.cancel {
  background: var(--red);
  box-shadow: 0 0 12px rgba(239,68,68,0.35);
}
.edit-action.accept {
  background: var(--green);
  box-shadow: 0 0 12px rgba(34,197,94,0.35);
}
.edit-action:active { transform: scale(0.92); }

.history-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Rajdhani', sans-serif;
}

/* Nagłówek tabeli — jaśniejszy od wierszy danych, dobrze widoczny */
.history-table thead {
  position: sticky;
  top: 0;
  z-index: 3;
}
.history-table thead tr {
  background: #2a2a2a;
}
.history-table th {
  padding: 8px 4px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  border-bottom: 1px solid var(--line-2);
  background: #2a2a2a;
  color: var(--text);
}
.history-table th.col-3m,
.history-table th.col-br {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: #c4e8ff;
}

/* Ikony w nagłówku — wyciszone */
.th-content {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
}
.th-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  color: rgba(210,210,220,0.70);
  opacity: 0.80;
  transition: opacity 180ms, background 180ms;
}
.th-btn:active { transform: scale(0.9); opacity: 1; background: rgba(255,255,255,0.08); }
.th-btn--edit.active {
  opacity: 1;
  background: rgba(251,191,36,0.18);
  color: var(--yellow);
}
.th-btn--goal {
  background: rgba(251,191,36,0.18);
  color: var(--yellow);
  opacity: 0.95;
}

/* Komórki danych */
.history-table td {
  padding: 8px 4px;
  text-align: center;
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

/* Rozróżnienie ważności kolumn — istotne wytłuszczone, mało istotne wyblakłe ale czytelne */
.history-table td.col-num {
  font-family: 'Orbitron', sans-serif;
  font-weight: 500;
  font-size: 11px;
  color: #7a8090; /* mało istotne — czytelne */
}
.history-table td.col-date {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);       /* istotne */
}
.history-table td.col-dow {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);       /* istotne */
}
.history-table td.col-duration {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: #8a9ab0; /* mało istotne — ale czytelne */
}
.history-table td.col-break {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);       /* istotne */
}
.history-table td.col-3m {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #b5d8ff;           /* istotne */
}
.history-table td.col-br {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: #8a9ab0; /* mało istotne — ale czytelne */
}

/* Tło naprzemienne — bardzo subtelna alternacja */
.history-table tbody tr.row-light td { background: #161616; }
.history-table tbody tr.row-dark  td { background: #121212; }

/* Pierwszy wiersz dzisiejszy planowany — wyraźne żółte tło */
.history-table tbody tr.row-planned td {
  background: rgba(251,191,36,0.22);
  color: #fff7d1;
}
.history-table tbody tr.row-planned td.col-date,
.history-table tbody tr.row-planned td.col-dow {
  color: #ffe47a;
  font-weight: 700;
}
.history-table tbody tr.row-planned td.col-break,
.history-table tbody tr.row-planned td.col-3m {
  color: #fff7d1;
}
.history-table tbody tr.row-planned td.col-num,
.history-table tbody tr.row-planned td.col-duration,
.history-table tbody tr.row-planned td.col-br {
  color: rgba(255,240,180,0.55);
}

/* Wiersz dzisiejszy ukończony — świecąco zielony */
.history-table tbody tr.row-today-done td {
  background: linear-gradient(180deg, #0e7a3a 0%, #0a5a2b 100%);
  color: #eaffea;
  box-shadow: inset 0 0 0 2px var(--green-glow);
  animation: glowPulse 2.5s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { box-shadow: inset 0 0 0 2px var(--green-glow), 0 0 12px rgba(57,255,124,0.18); }
  50%      { box-shadow: inset 0 0 0 2px var(--green-glow), 0 0 28px rgba(57,255,124,0.45); }
}

.history-table tbody tr.editing td.col-date {
  outline: 2px dashed var(--yellow);
  outline-offset: -3px;
  cursor: pointer;
}
.history-table tbody tr.clickable-date td.col-date {
  cursor: pointer;
  color: var(--yellow);
  text-decoration: underline;
}

/* ==========================================================
   GÓRNY PANEL (wspólny dla ekranu 1 i 2)
   ========================================================== */
.top-panel {
  flex: 0 0 25%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  padding: 10px 12px 8px;
  align-items: stretch;
  position: relative;
}

.counters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 80px;
}

.counter {
  flex: 1;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(28px, 8vw, 38px);
  letter-spacing: 0.04em;
  border: 2px solid transparent;
  background: #0d0d0d;
  position: relative;
  overflow: hidden;
}
.counter::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent);
  pointer-events: none;
}
.counter--done {
  color: var(--green-glow);
  border-color: var(--green-dark);
  text-shadow: 0 0 14px rgba(57,255,124,0.5);
}
.counter--left {
  color: var(--red-glow);
  border-color: var(--red-dark);
  text-shadow: 0 0 14px rgba(239,68,68,0.5);
}

/* Środek — przyciski back + zegarek */
.top-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--line-2);
  background: rgba(40,40,40,0.6);
  color: var(--text);
  transition: transform 120ms, color 180ms, border-color 180ms;
  font-weight: 700;
}
.back-btn--home {
  width: 52px;
  height: 38px;
  border-radius: 11px;
  font-size: 26px;
  line-height: 1;
}
.back-btn--arrow {
  width: 52px;
  height: 38px;
  border-radius: 11px;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}
.back-btn:active {
  transform: scale(0.92);
  color: var(--green-glow);
  border-color: var(--green);
}

/* Zegarek treningu — duży, w centrum, w oprawie */
.training-clock {
  position: relative;
  width: clamp(82px, 22vw, 108px);
  height: clamp(82px, 22vw, 108px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;   /* odsunięty od przycisku home nad nim */
}
.clock-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.clock-frame circle {
  fill: #0d0d0d;
  stroke: var(--yellow-dark);
  stroke-width: 3;
  filter: drop-shadow(0 0 6px rgba(251,191,36,0.25));
}
.clock-frame line {
  stroke: var(--yellow-dark);
  stroke-width: 2;
  stroke-linecap: round;
}
.clock-text {
  position: relative;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  /* font-size dynamiczny: 2 cyfry=duży, 4-5 znaków=mniejszy */
  font-size: clamp(14px, 5vw, 24px);
  color: var(--yellow);
  text-shadow: 0 0 10px rgba(251,191,36,0.5);
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
}

/* --- Prawa strona: zielony przycisk / żółty licznik --- */
.action-area {
  position: relative;
  width: clamp(100px, 28vw, 140px);
  display: flex;
  align-items: stretch;
}

.big-green-btn {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #2ee86a 0%, #14803c 60%, #0a4d24 100%);
  box-shadow:
    0 0 0 3px #0a4d24,
    0 0 30px rgba(57,255,124,0.55),
    inset 0 -8px 20px rgba(0,0,0,0.4),
    inset 0 6px 14px rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 120ms, box-shadow 200ms;
  align-self: center;
}
.big-green-btn:active {
  transform: scale(0.94);
  box-shadow:
    0 0 0 3px #0a4d24,
    0 0 50px rgba(57,255,124,0.9),
    inset 0 -6px 14px rgba(0,0,0,0.4),
    inset 0 4px 10px rgba(255,255,255,0.2);
}
.big-green-btn__check {
  color: #fff;
  font-size: clamp(40px, 11vw, 54px);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.rest-timer {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffd64a 0%, #c9920a 60%, #7a5a00 100%);
  box-shadow:
    0 0 0 3px #6b4a00,
    0 0 40px rgba(251,191,36,0.6),
    inset 0 -8px 20px rgba(0,0,0,0.35),
    inset 0 6px 14px rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  transition: transform 120ms;
  cursor: pointer;
  animation: restTick 1s ease-in-out infinite;
}
.rest-timer:active { transform: scale(0.94); }
.rest-timer span {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(38px, 10vw, 48px);
  color: #1a1200;
  text-shadow: 0 1px 0 rgba(255,255,255,0.25);
}
@keyframes restTick {
  0%, 100% { box-shadow: 0 0 0 3px #6b4a00, 0 0 40px rgba(251,191,36,0.6), inset 0 -8px 20px rgba(0,0,0,0.35), inset 0 6px 14px rgba(255,255,255,0.2); }
  50%      { box-shadow: 0 0 0 3px #6b4a00, 0 0 64px rgba(251,191,36,0.85), inset 0 -8px 20px rgba(0,0,0,0.35), inset 0 6px 14px rgba(255,255,255,0.2); }
}

/* Ikona torby w toolbarze */
.bag-indicator {
  font-size: 24px;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 10px;
  transition: transform 150ms;
  margin-left: auto;
  position: relative;
}
.bag-indicator:active { transform: scale(0.88); }
.bag-emoji {
  display: inline-block;
  position: relative;
}
.bag-emoji--warn {
  filter: drop-shadow(0 0 6px rgba(239,68,68,0.9)) drop-shadow(0 0 12px rgba(239,68,68,0.6));
}
.bag-emoji--warn::after {
  content: '!';
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--red);
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 11px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(239,68,68,0.7);
  animation: bagPulse 1.4s ease-in-out infinite;
}
.bag-emoji--ok {
  filter: drop-shadow(0 0 8px rgba(57,255,124,0.8)) drop-shadow(0 0 14px rgba(57,255,124,0.5));
}
.bag-emoji--ok::after {
  content: '✓';
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--green);
  color: #fff;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 900;
  font-size: 13px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(57,255,124,0.7);
}
@keyframes bagPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}

/* ==========================================================
   EKRAN PAKOWANIA
   ========================================================== */
.screen--pack {
  background: linear-gradient(180deg, #0a0a0a 0%, #0d0d0d 100%);
}

.pack-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 10px;
  gap: 12px;
}

.pack-title {
  margin: 0;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.1em;
  color: var(--text);
}

.pack-nav-btn {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 120ms;
  color: #000;
}
.pack-nav-btn:active { transform: scale(0.92); }
.pack-nav-btn--cancel {
  background: var(--red);
  box-shadow: 0 0 16px rgba(239,68,68,0.4);
}
.pack-nav-btn--accept {
  background: var(--green);
  box-shadow: 0 0 16px rgba(34,197,94,0.4);
}

.pack-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 6px 8px 6px;
  overflow-y: auto;
}

.pack-item {
  position: relative;
  aspect-ratio: 5 / 6;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 300ms, filter 300ms, transform 120ms;
  background: #0a0a0a;
  -webkit-user-select: none;
  user-select: none;
}
.pack-item:active { transform: scale(0.93); }

.pack-item__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Spakowany — mocno przygaszony */
.pack-item.packed {
  opacity: 0.22;
  filter: grayscale(0.8) brightness(0.6);
}

/* Zielona obwódka na zaznaczonym — zastąpiona przygaszeniem */

.pack-progress {
  flex: 0 0 auto;
  text-align: center;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-dimmer);
  padding: 6px 0 10px;
  letter-spacing: 0.1em;
}
.pack-progress.done { color: var(--green-glow); }
.exercises-scroll {
  flex: 1 1 75%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 12px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.exercise-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exercise-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 8px 14px 8px 8px;
  background: linear-gradient(180deg, #1a1a1a 0%, #141414 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 120ms, border-color 180ms, opacity 200ms, filter 200ms;
  cursor: pointer;
}
.exercise-item:active { transform: scale(0.985); }

.exercise-item__thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: #0d0d0d;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  color: var(--text-dim);
  font-size: 24px;
}
.exercise-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.exercise-item__name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.exercise-item__sets {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 22px;
  color: var(--text);
  min-width: 52px;
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.exercise-item__sets small {
  color: var(--text-dimmer);
  font-size: 14px;
}

/* Kule — stan serii (mała wersja na liście) */
.sets-dots {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 5px;
  justify-content: flex-end;
  align-items: center;
}
.ball {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.ball.empty {
  background: radial-gradient(circle at 35% 35%, rgba(251,191,36,0.45) 0%, rgba(180,140,40,0.35) 60%, rgba(120,90,20,0.4) 100%);
  border: 1px solid rgba(251,191,36,0.45);
  box-shadow: inset 0 -2px 3px rgba(0,0,0,0.3), 0 0 4px rgba(251,191,36,0.2);
}
.ball.filled {
  background: radial-gradient(circle at 35% 35%, #b6ffce 0%, var(--green-glow) 50%, #14803c 100%);
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.3), 0 0 8px rgba(57,255,124,0.6);
}

.sets-fallback {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
}

/* Kule — duża wersja na ekranie 2 */
.sets-dots-large {
  display: grid;
  gap: 8px;
  justify-content: center;
  justify-items: center;
  padding: 4px 0;
}
.ball-lg {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-block;
}
.ball-lg.empty {
  background: radial-gradient(circle at 35% 35%, rgba(251,191,36,0.5) 0%, rgba(180,140,40,0.4) 60%, rgba(110,80,15,0.5) 100%);
  border: 1.5px solid rgba(251,191,36,0.5);
  box-shadow: inset 0 -3px 5px rgba(0,0,0,0.35), 0 0 6px rgba(251,191,36,0.25);
}
.ball-lg.filled {
  background: radial-gradient(circle at 35% 35%, #b6ffce 0%, var(--green-glow) 50%, #14803c 100%);
  box-shadow: inset 0 -3px 6px rgba(0,0,0,0.35), 0 0 12px rgba(57,255,124,0.7);
}

/* Przycisk Dodaj ćwiczenie — nieco inny wygląd */
.exercise-item--add {
  border-style: dashed;
  border-color: var(--line-2);
  opacity: 0.7;
}
.exercise-item--add:active { transform: scale(0.985); }
.exercise-item--add:hover { opacity: 1; }
.exercise-item__thumb--add {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 36px;
  color: var(--green-glow);
  background: rgba(34,197,94,0.08);
  border-color: var(--green-dark);
}

/* Tryb przestawiania (reorderowania) ćwiczenia */
.exercise-item.reordering {
  background: linear-gradient(180deg, #3a3a3a 0%, #2c2c2c 100%);
  border-color: var(--yellow);
  box-shadow: 0 0 16px rgba(251,191,36,0.35);
  grid-template-columns: 64px 1fr auto;
}
.reorder-ok {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: var(--green);
  color: #000;
  font-size: 30px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 100ms;
  box-shadow: 0 0 14px rgba(34,197,94,0.45);
}
.reorder-ok:active { transform: scale(0.92); }
.reorder-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.reorder-btn {
  width: 50px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 100ms, background 150ms;
}
.reorder-btn:active { transform: scale(0.9); background: rgba(255,255,255,0.22); }

/* Wykonane — pełna jasność kul, wyciemniona reszta dla rozróżnienia od aktywnych */
.exercise-item.done {
  filter: brightness(0.65);
}
.exercise-item.done .exercise-item__sets {
  filter: none;  /* kule pełna jasność */
}
.exercise-item.done .ball.filled,
.exercise-item.done .ball-lg.filled {
  filter: brightness(1.4);  /* jaszcze jaśniejsze niż norma */
}
.exercise-item.done .exercise-item__name {
  text-decoration: line-through;
  opacity: 0.6;
}

/* Trwale nieaktywne — bardzo wyciemnione */
.exercise-item.inactive-permanent {
  opacity: 0.32;
  filter: grayscale(0.7) brightness(0.7);
}

/* ==========================================================
   EKRAN 2 — WYKONANIE ĆWICZENIA
   ========================================================== */
.exercise-body {
  flex: 1 1 75%;
  position: relative;
  padding: 4px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  min-height: 0;
}

/* Przycisk edycji — bardzo wyciszony, ledwo widoczny */
.edit-exercise-btn {
  position: absolute;
  top: 6px;
  left: 14px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.10);
  color: rgba(220,220,225,0.75);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  opacity: 0.85;
  transition: opacity 200ms, transform 120ms;
}
.edit-exercise-btn:active {
  transform: scale(0.9);
  opacity: 1;
  color: var(--yellow);
}

.exercise-layout {
  display: grid;
  grid-template-columns: minmax(110px, 35%) 1fr;
  gap: 10px;
  align-items: stretch;
  min-height: 0;
}

.exercise-params {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 50px 10px 10px 10px;
  background: linear-gradient(180deg, #141414 0%, #0e0e0e 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.param {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  background: #0a0a0a;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.param__label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dimmer);
}
.param__value {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 22px;
  line-height: 1.1;
  text-align: center;
}
.param.sets   .param__value { color: var(--green-glow); }
.param.reps   .param__value { color: #b5d8ff; font-size: 18px; }
.param.weight .param__value { color: var(--yellow); }

.exercise-image-wrap {
  position: relative;
  background: #0a0a0a;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.exercise-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.exercise-image.hidden { display: none; }
.exercise-image-fallback {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 80px;
  color: var(--text-dimmer);
  letter-spacing: 0.1em;
}

.helper-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.helper-images img {
  flex: 1 1 28%;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.helper-images:empty { display: none; }

/* ==========================================================
   OVERLAY ODLICZANIA PRZERWY
   ========================================================== */
.rest-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: calc(18px + var(--safe-t)) 24px calc(24px + var(--safe-b));
  animation: restOverlayIn 200ms ease-out;
}
@keyframes restOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.rest-charge {
  width: min(64vw, 335px);
  width: min(64vw, 36dvh, 335px);
  max-width: 335px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 3dvh, 28px);
  user-select: none;
}
.rest-charge__percent {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(38px, 11vw, 82px);
  line-height: 1;
  color: #44d875;
  text-shadow:
    0 0 10px rgba(68,216,117,0.48),
    0 0 28px rgba(68,216,117,0.20);
}
.rest-charge__battery {
  --rest-charge-shell-scale-x: 1.3;
  --rest-charge-shell-side-mask: 27%;
  position: relative;
  width: 100%;
  aspect-ratio: 335 / 746;
  overflow: visible;
  isolation: isolate;
}
.rest-charge__image {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  transform: scaleX(var(--rest-charge-shell-scale-x));
  transform-origin: center center;
}
.rest-charge__battery::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: url("Photos/Bateria.png") center / 100% 100% no-repeat;
  transform: scaleX(var(--rest-charge-shell-scale-x));
  transform-origin: center center;
  -webkit-mask:
    linear-gradient(#000 0 0) left / var(--rest-charge-shell-side-mask) 100% no-repeat,
    linear-gradient(#000 0 0) right / var(--rest-charge-shell-side-mask) 100% no-repeat;
  mask:
    linear-gradient(#000 0 0) left / var(--rest-charge-shell-side-mask) 100% no-repeat,
    linear-gradient(#000 0 0) right / var(--rest-charge-shell-side-mask) 100% no-repeat;
}
.rest-charge__fill {
  /* Measured from Photos/Bateria.png, 335x746 px:
     fill cavity x=55..289, y=134..618, size 235x485 px.
     vGPT_1.0.4 keeps the left/top/height fixed and extends only the right edge. */
  position: absolute;
  left: 16.41791%;
  top: 17.962466%;
  width: 70.149254%;
  height: 65.013405%;
  z-index: 4;
  overflow: hidden;
  border-radius: 4% / 2%;
  pointer-events: none;
  mix-blend-mode: screen;
}
.rest-charge__segments {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column-reverse;
  gap: 7px;
}
.rest-charge__module {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  border-radius: 4px;
  opacity: 0;
  background:
    linear-gradient(90deg, rgba(218,245,225,0.16), transparent 22%, transparent 74%, rgba(218,245,225,0.10)),
    linear-gradient(180deg, #153820 0%, #2da956 52%, #12642f 100%);
  box-shadow: none;
  filter: brightness(0.22) saturate(0.62);
}
.rest-charge__module::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(245,255,248,0.12), transparent 34%, transparent 72%, rgba(245,255,248,0.06));
  opacity: 0.34;
}
.rest-charge__module.is-on {
  opacity: 1;
  filter: brightness(0.95) saturate(0.88);
  box-shadow:
    0 0 5px rgba(68,216,117,0.20),
    inset 0 0 8px rgba(218,245,225,0.13);
}
.rest-charge__module.is-new {
  animation: restChargeModuleBrighten 620ms ease-out both;
}
@keyframes restChargeModuleBrighten {
  0% {
    opacity: 0.22;
    filter: brightness(0.16) saturate(0.45);
    box-shadow:
      0 0 0 rgba(68,216,117,0),
      inset 0 0 5px rgba(218,245,225,0.05);
  }
  55% {
    opacity: 0.86;
    filter: brightness(0.78) saturate(0.75);
    box-shadow:
      0 0 4px rgba(68,216,117,0.14),
      inset 0 0 7px rgba(218,245,225,0.10);
  }
  100% {
    opacity: 1;
    filter: brightness(0.95) saturate(0.88);
    box-shadow:
      0 0 5px rgba(68,216,117,0.20),
      inset 0 0 8px rgba(218,245,225,0.13);
  }
}
.rest-overlay__seconds {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-height: 700px) {
  .rest-charge {
    width: min(58vw, 300px);
    width: min(58vw, 34dvh, 300px);
    gap: 12px;
  }
  .rest-charge__percent {
    font-size: clamp(32px, 9vw, 58px);
  }
}

/* ==========================================================
   ANIMACJA — ZIELONA SUPERNOWA + CZARNA FALA
   ========================================================== */

/* Migający zielony po zakończeniu odliczania — zsynchronizowany z ekranem */
.rest-done-overlay {
  position: absolute;
  inset: 0;
  z-index: 45;
  background: #00ff5e;
  cursor: pointer;
  animation: restDoneFlash 0.6s ease-in-out 6 forwards;  /* 6 iteracji ≈ 3.6s */
}
@keyframes restDoneFlash {
  0%   { opacity: 0; }
  30%  { opacity: 0.9; }
  70%  { opacity: 0.9; }
  100% { opacity: 0; }
}

/* Cichy "przycisk" — dolna 1/3 ekranu ćwiczenia. Niewidoczny.
   AKTYWNY TYLKO gdy ekran ćwiczenia jest aktywny — inaczej nadpisuje pointer-events na innych ekranach */
.standby-trigger {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 33%;
  z-index: 8;
  background: transparent;
  pointer-events: none;  /* domyślnie wyłączony */
  cursor: pointer;
}
.screen.active .standby-trigger {
  pointer-events: auto;  /* aktywny tylko gdy ekran ćwiczenia jest aktywny */
}

/* Czarny ekran czuwania — pełny ekran, klik gdziekolwiek wraca */
.standby-overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: #000;
  cursor: pointer;
  animation: standbyFadeIn 250ms ease-out;
}
@keyframes standbyFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Supernowa — rozbłysk po wykonaniu ćwiczenia */
.celebration {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(57,255,124,0.5) 0%, rgba(57,255,124,0.15) 30%, transparent 70%);
  animation: novaFade 1.5s ease-out forwards;
}
.celebration__core {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, #d8ffe8 30%, rgba(57,255,124,0.6) 60%, transparent 100%);
  filter: blur(2px);
  animation: novaCore 1.5s cubic-bezier(.2,.8,.3,1) forwards;
}
.celebration__ring {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.85);
  animation: novaRing 1.5s ease-out forwards;
}

/* Druga faza — czarna fala maskująca zmianę ekranu */
.celebration--blackwave {
  background: transparent;
  animation: blackwaveFade 0.9s ease-out forwards;
}
.celebration--blackwave .celebration__core {
  background: radial-gradient(circle, #000 0%, #000 60%, rgba(0,0,0,0.85) 80%, transparent 100%);
  filter: none;
  animation: blackwaveCore 0.9s ease-out forwards;
}
.celebration--blackwave .celebration__ring {
  border-color: #000;
  animation: blackwaveRing 0.9s ease-out forwards;
}

@keyframes blackwaveCore {
  0%   { transform: scale(0); opacity: 1; }
  60%  { transform: scale(2.5); opacity: 1; }
  100% { transform: scale(5.0); opacity: 1; }
}
@keyframes blackwaveRing {
  0%   { transform: scale(0); opacity: 1; }
  60%  { transform: scale(2.8); opacity: 0.8; }
  100% { transform: scale(5.5); opacity: 0; }
}
@keyframes blackwaveFade {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  100% { opacity: 1; }
}

/* Trzecia faza — drugi zielony rozbłysk po przerysowaniu ekranu */
.celebration--phase2 .celebration__core {
  animation: novaCore 1.0s cubic-bezier(.2,.8,.3,1) forwards;
}
.celebration--phase2 .celebration__ring {
  animation: novaRing 1.0s ease-out forwards;
}
@keyframes novaFade {
  0%   { opacity: 0; }
  10%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes novaCore {
  0%   { transform: scale(0); opacity: 0; }
  20%  { transform: scale(0.6); opacity: 1; }
  60%  { transform: scale(2.0); opacity: 0.7; }
  100% { transform: scale(3.5); opacity: 0; }
}
@keyframes novaRing {
  0%   { transform: scale(0); opacity: 1; border-width: 8px; }
  60%  { transform: scale(2.2); opacity: 0.8; border-width: 3px; }
  100% { transform: scale(3.8); opacity: 0; border-width: 1px; }
}

/* ==========================================================
   MODALE
   ========================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  animation: fadeIn 180ms ease-out;
}
.modal__sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: var(--bg-2);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  border: 1px solid var(--line);
  border-bottom: none;
  padding: 14px 18px calc(18px + var(--safe-b));
  animation: sheetUp 220ms cubic-bezier(.2,1,.2,1);
  max-height: 94vh;
  overflow-y: auto;
}
.modal__sheet--confirm {
  max-width: 420px;
  border-radius: var(--radius-xl);
  margin-bottom: calc(40px + var(--safe-b));
  align-self: center;
}
.modal { align-items: flex-end; }
.modal:has(.modal__sheet--confirm) { align-items: center; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.modal__head h2 {
  margin: 0;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.04em;
}
.modal__close {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: #252525;
  color: var(--text);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.confirm-text {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field > span {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dimmer);
}
.field input[type="text"],
.field input[type="number"] {
  background: #0a0a0a;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}
.field input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(34,197,94,0.2);
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.field.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.field.checkbox input { width: 20px; height: 20px; accent-color: var(--green); }
.field.checkbox span { text-transform: none; letter-spacing: 0.02em; font-size: 14px; color: var(--text); }

.rest-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.rest-secs-field {
  width: 90px;
  flex-shrink: 0;
}
.rest-secs-field input {
  text-align: center;
  font-weight: 700;
}

.modal__foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform 120ms, background 180ms;
}
.btn:active { transform: scale(0.97); }
.btn--ghost   { background: #2a2a2a; color: var(--text); }
.btn--primary {
  background: linear-gradient(180deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff;
  box-shadow: 0 0 20px rgba(34,197,94,0.35);
}
.btn--danger {
  background: linear-gradient(180deg, var(--red) 0%, var(--red-dark) 100%);
  color: #fff;
  box-shadow: 0 0 20px rgba(239,68,68,0.35);
}

/* Kalendarz */
.calendar__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.calendar__navbtn {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: #252525;
  color: var(--text);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.calendar__title {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: capitalize;
}
.calendar__weekdays,
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar__weekdays span {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dimmer);
  padding: 4px 0;
}
.calendar__day {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: #1a1a1a;
  color: var(--text);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 140ms, transform 120ms;
}
.calendar__day:active { transform: scale(0.9); }
.calendar__day.muted    { color: var(--text-dimmer); opacity: 0.5; }
.calendar__day.today    { outline: 2px solid var(--yellow); outline-offset: -2px; }
.calendar__day.selected { background: var(--green-dark); color: var(--green-glow); }
.calendar__day.disabled { opacity: 0.25; pointer-events: none; }

/* TOAST */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + var(--safe-b));
  transform: translateX(-50%);
  background: #1a1a1a;
  color: var(--text);
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  font-size: 14px;
  font-weight: 600;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: toastIn 220ms ease-out;
  max-width: calc(100% - 40px);
  text-align: center;
}
.toast.ok  { border-color: var(--green-dark); }
.toast.err { border-color: var(--red-dark); }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.install-hint {
  position: absolute;
  top: calc(6px + var(--safe-t));
  right: 12px;
  padding: 6px 10px;
  background: rgba(34,197,94,0.1);
  border: 1px solid var(--green-dark);
  border-radius: 10px;
  font-size: 11px;
  color: var(--green-glow);
  pointer-events: none;
  animation: fadeIn 600ms ease-out;
  cursor: pointer;
}

/* --- Małe ekrany --- */
@media (max-height: 700px) {
  .home-btn-mega__icon { font-size: 56px; }
  .home-btn-mega__label { font-size: 18px; }
  .counter { font-size: 28px; min-height: 42px; }
  .exercise-item__thumb { width: 56px; height: 56px; }
  .exercise-item { padding: 6px 12px 6px 6px; grid-template-columns: 56px 1fr auto; }
}

@media (max-width: 430px) {
  .field-row { grid-template-columns: 1fr 1fr; }
  .field-row .field:nth-child(3) { grid-column: 1 / -1; }
}

@media (max-width: 380px) {
  .history-table th,
  .history-table td { font-size: 12px; padding: 6px 2px; }
  .history-table td.col-num,
  .history-table td.col-duration,
  .history-table td.col-br { font-size: 11px; }
  .history-table th.col-3m,
  .history-table th.col-br { font-size: 11px; }
}
