* { box-sizing: border-box; }
:root {
  --bg-gradient: linear-gradient(180deg, #071121, #0e1830);
  --text-color: #f4f7ff;
  --subtle-color: #a7b5d8;
  --card-bg: rgba(18, 31, 63, 0.96);
  --card-shadow: 0 12px 45px rgba(0, 0, 0, 0.38);
  --input-border: #2d3f72;
  --input-bg: #091326;
  --input-text: #ffffff;
  --primary-btn-bg: #2f6fff;
  --primary-btn-text: #ffffff;
  --secondary-btn-bg: #87aefe;
  --secondary-btn-text: #061021;
  --flash-bg: #4f1b20;
  --flash-text: #ffd6da;
  --surface-strong: #172548;
  --surface-soft: #152542;
  --chip-bg: #243b6a;
  --chip-active-bg: #2f6fff;
  --link-color: #8fb1ff;
  --hero-bg: linear-gradient(135deg, #1d335f, #122547);
  --theme-toggle-bg: rgba(18, 31, 63, 0.84);
  --theme-toggle-border: rgba(143, 177, 255, 0.5);
  --theme-toggle-text: #eef4ff;
  --exercise-card-bg: #152542;
  --exercise-card-border: rgba(143, 177, 255, 0.18);
  --badge-bg: #2a4f88;
  --badge-title: #e5eeff;
  --badge-text: #c5d5ff;
  --stats-wrap-bg: rgba(14, 24, 48, 0.8);
  --stats-title-bg: rgba(35, 59, 106, 0.55);
  --stats-header-bg: rgba(18, 37, 71, 0.9);
  --stats-header-text: #d6e4ff;
  --stats-label: #c6d7ff;
  --stats-subtle: #9fb0d9;
  --stats-row-hover: rgba(47, 111, 255, 0.12);
  --history-panel-bg: #0f1d36;
  --history-panel-border: rgba(203, 224, 255, 0.2);
  --history-chart-bg: rgba(255, 255, 255, 0.03);
  --history-chart-border: rgba(143, 177, 255, 0.2);
  --history-axis: rgba(213, 226, 255, 0.45);
  --history-line: #6fa3ff;
  --history-dot: #d9e8ff;
  --history-label: #d4e3ff;
  --workout-detail-wrap-bg: rgba(20, 36, 68, 0.74);
  --feedback-label-color: #d9e6ff;
  --emoji-option-bg: #162b54;
  --emoji-option-small: #b7c8f5;
  --empty-color: #9fb0d9;
}

body.theme-light {
  --bg-gradient: linear-gradient(180deg, #eef4ff, #dce8ff);
  --text-color: #13213f;
  --subtle-color: #4a5f88;
  --card-bg: rgba(255, 255, 255, 0.94);
  --card-shadow: 0 12px 36px rgba(32, 56, 106, 0.2);
  --input-border: #aec4ee;
  --input-bg: #f6f9ff;
  --input-text: #13213f;
  --primary-btn-bg: #2f6fff;
  --primary-btn-text: #ffffff;
  --secondary-btn-bg: #d4e2ff;
  --secondary-btn-text: #0e1a33;
  --flash-bg: #ffe5ea;
  --flash-text: #6d1f2f;
  --surface-strong: #e8efff;
  --surface-soft: #edf3ff;
  --chip-bg: #dbe7ff;
  --chip-active-bg: #2f6fff;
  --link-color: #1f4fb5;
  --hero-bg: linear-gradient(135deg, #d8e6ff, #edf3ff);
  --theme-toggle-bg: rgba(255, 255, 255, 0.9);
  --theme-toggle-border: rgba(68, 98, 161, 0.35);
  --theme-toggle-text: #122247;
  --exercise-card-bg: #eaf1ff;
  --exercise-card-border: rgba(115, 141, 197, 0.32);
  --badge-bg: #d9e6ff;
  --badge-title: #19305e;
  --badge-text: #2f4f8b;
  --stats-wrap-bg: #ffffff;
  --stats-title-bg: #e7efff;
  --stats-header-bg: #24365b;
  --stats-header-text: #edf3ff;
  --stats-label: #3e5584;
  --stats-subtle: #4b6291;
  --stats-row-hover: rgba(47, 111, 255, 0.08);
  --history-panel-bg: #ffffff;
  --history-panel-border: rgba(114, 139, 190, 0.26);
  --history-chart-bg: #f5f8ff;
  --history-chart-border: rgba(114, 139, 190, 0.26);
  --history-axis: rgba(86, 113, 168, 0.45);
  --history-line: #2f6fff;
  --history-dot: #376fd7;
  --history-label: #1f3f79;
  --workout-detail-wrap-bg: #f1f6ff;
  --feedback-label-color: #355588;
  --emoji-option-bg: #e4edff;
  --emoji-option-small: #43649a;
  --empty-color: #47608d;
}

body.theme-dark {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-gradient);
  color: var(--text-color);
  font-family: Arial, Helvetica, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}
.phone-shell {
  width: 100%;
  max-width: 420px;
}
.screen-card {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--card-shadow);
}
.auth-card h1, .screen-card h2 {
  margin: 0 0 8px;
}

.brand-bar {
  margin-bottom: 12px;
}

.brand-link {
  display: block;
  width: 100%;
  text-decoration: none;
  color: var(--text-color);
}

.brand-logo {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.brand-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
}
.subtle, .muted, .tiny {
  color: var(--subtle-color);
}
.tiny { font-size: 13px; }
.login-footer-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.login-footer-row a {
  color: var(--link-color);
  text-decoration: none;
  white-space: nowrap;
}

.login-footer-row span a {
  text-decoration: underline;
}

.login-footer-row a:hover {
  text-decoration: underline;
}
label {
  display: block;
  margin-top: 12px;
  margin-bottom: 6px;
  font-size: 14px;
}
input, select {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--input-text);
  margin-top: 4px;
}
.primary-btn, .secondary-btn {
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  border-radius: 12px;
  border: none;
  font-weight: bold;
  cursor: pointer;
}
.primary-btn {
  background: var(--primary-btn-bg);
  color: var(--primary-btn-text);
}
.secondary-btn {
  background: var(--secondary-btn-bg);
  color: var(--secondary-btn-text);
}
.flash {
  background: var(--flash-bg);
  color: var(--flash-text);
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
}
.top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.version-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #243b6a;
  color: #dbe6ff;
  font-size: 11px;
  font-weight: bold;
}
.small-link {
  color: var(--link-color);
  text-decoration: none;
}
.theme-toggle {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 40;
  border: 1px solid var(--theme-toggle-border);
  background: var(--theme-toggle-bg);
  color: var(--theme-toggle-text);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.hero-card {
  margin-top: 16px;
  background: var(--hero-bg);
  border-radius: 18px;
  padding: 16px;
}
.hero-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.hero-label, .hero-badge {
  font-size: 12px;
  color: #cbd6f7;
}
.hero-badge {
  background: rgba(255,255,255,0.08);
  padding: 5px 9px;
  border-radius: 999px;
}
.hero-title {
  font-size: 20px;
  font-weight: bold;
}
.session-label {
  display: block;
  margin: 10px 0 6px;
  font-size: 13px;
  color: #a7b5d8;
}
.field-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field-label {
  font-size: 12px;
  color: #a7b5d8;
}
.timer-card {
  margin-top: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
}
.timer-label {
  font-size: 12px;
  color: #a7b5d8;
  margin-bottom: 6px;
}
#workout-timer {
  font-size: 30px;
  font-weight: bold;
  letter-spacing: 0.04em;
}
.timer-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}
.timer-icon-btn {
  flex: 0 0 56px;
  width: 56px;
  padding: 10px 0;
  font-size: 18px;
}
.small-btn {
  width: auto;
  flex: 1;
  margin-top: 0;
  padding: 10px 8px;
  font-size: 13px;
}
.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}
.choice-card {
  display: block;
  background: var(--surface-strong);
  border-radius: 18px;
  padding: 18px 14px;
  text-decoration: none;
  color: var(--text-color);
  min-height: 140px;
}
.choice-icon {
  font-size: 26px;
  margin-bottom: 14px;
}
.choice-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 6px;
}
.choice-text {
  color: var(--subtle-color);
  font-size: 13px;
}
.group-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: visible;
  padding: 14px 0;
}
.group-chip {
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--chip-bg);
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-color);
  text-decoration: none;
}
.group-chip.active {
  background: var(--chip-active-bg);
}
.plan-form, .log-form {
  margin-top: 14px;
}
.exercise-list {
  margin-top: 18px;
}
.group-section {
  margin-bottom: 18px;
}
.group-title {
  font-size: 14px;
  color: var(--subtle-color);
  margin-bottom: 10px;
}
.select-card {
  display: grid;
  grid-template-columns: 42px 92px 1fr;
  gap: 10px;
  align-items: center;
  background: var(--surface-soft);
  padding: 12px;
  border-radius: 16px;
  margin-bottom: 12px;
  min-height: 116px;
  width: 100%;
}
.select-visual,
.exercise-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}
.exercise-image {
  width: 92px;
  height: 92px;
  border-radius: 12px;
  object-fit: cover;
  background: #d9e4ff;
}
.toggle-btn {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 12px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  background: #2e9f63;
  color: white;
}
.toggle-btn.is-active {
  background: #c73a4a;
}
.toggle-static {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2a4f88;
  color: #d9e8ff;
  font-weight: bold;
}
.icon-visual {
  width: 92px;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #d9e4ff;
  color: #081225;
  font-size: 36px;
}
.large-icon {
  width: 92px;
  height: 92px;
}
.select-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 3px;
}
.select-card.is-selected {
  outline: 2px solid #53d07a;
  box-shadow: inset 0 0 0 1px rgba(83, 208, 122, 0.45);
}
.selected-pill {
  display: none;
  align-self: flex-start;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #1f7043;
  color: #dffde9;
  font-size: 11px;
  font-weight: bold;
}
.selected-pill.visible {
  display: inline-flex;
}
.select-body strong {
  display: block;
  line-height: 1.2;
}
.select-body small {
  color: #9fb0d9;
  margin-top: 4px;
}
.exercise-card {
  background: var(--exercise-card-bg);
  border: 1px solid var(--exercise-card-border);
  padding: 12px;
  border-radius: 16px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
}
.exercise-visual .exercise-image {
  width: 92px;
  height: 92px;
}
.zoomable-exercise-image {
  cursor: zoom-in;
}
.session-card {
  margin-top: 14px;
  display: block;
  min-height: 0;
  padding: 14px;
}
.session-card .session-top-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  align-items: start;
}
.session-card .exercise-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-top: 10px;
}
.session-card .exercise-head {
  align-items: flex-start;
  gap: 10px;
}
.session-card .extra-set-btn {
  margin-top: auto;
  width: 100%;
}
.session-card .metric-row {
  grid-template-columns: minmax(74px, 1fr) 56px 56px minmax(92px, auto);
  gap: 8px;
}
.session-card .side-label {
  font-size: 14px;
}
.session-card .badge-history {
  min-width: 90px;
  margin-left: 6px;
}
.session-card .set-row-actions {
  justify-content: flex-end;
}
.session-card .remove-set-btn {
  white-space: nowrap;
}
.icon-badge {
  position: absolute;
  right: 4px;
  top: 4px;
  background: rgba(12, 20, 41, 0.82);
  border-radius: 999px;
  padding: 4px 6px;
  font-size: 12px;
}
.exercise-visual {
  position: relative;
}
.exercise-visual .icon-visual {
  width: 92px;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #d9e4ff;
  color: #081225;
  font-size: 36px;
}
.exercise-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.badge {
  background: var(--badge-bg);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 12px;
}
.badge-history {
  min-width: 104px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  line-height: 1.1;
}
.history-title {
  color: var(--badge-title);
  font-size: 14px;
  font-weight: bold;
}
.history-points {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: var(--badge-text);
  font-size: 12px;
  gap: 2px;
}
.last-run {
  margin-top: 8px;
  font-size: 13px;
  color: #9fb0d9;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.metric-row {
  display: grid;
  grid-template-columns: auto 56px 70px auto;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.side-label {
  font-size: 12px;
  color: #a7b5d8;
}
.compact-input {
  width: 100%;
  min-width: 0;
  text-align: center;
  padding: 7px 6px;
}
.set-entries {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.set-entry {
  margin-top: 0;
}
.set-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.extra-set-btn {
  margin-top: 8px;
  padding: 9px 10px;
  font-size: 12px;
}
.set-row-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
}
.remove-set-btn {
  border: none;
  background: #344f7e;
  color: #e3ecff;
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 11px;
}
.secondary-link {
  display: inline-block;
  margin-top: 12px;
  color: #8fb1ff;
  text-decoration: none;
  font-size: 14px;
}
.no-scroll {
  overflow: hidden;
}
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 24, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 18px;
}
.lightbox-overlay[hidden] {
  display: none;
}
.lightbox-content {
  position: relative;
  width: min(92vw, 460px);
  max-height: 88vh;
  background: #0f1d36;
  border-radius: 16px;
  border: 1px solid rgba(203, 224, 255, 0.2);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-image {
  width: 100%;
  max-height: calc(88vh - 20px);
  object-fit: contain;
  border-radius: 12px;
  background: #d9e4ff;
}
.lightbox-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: #f1f5ff;
  color: #0f1d36;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.as-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.two-col-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.selection-action-dock {
  position: sticky;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  margin-top: 14px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(7, 17, 33, 0.2);
  border: 1px solid rgba(143, 177, 255, 0.25);
  backdrop-filter: blur(6px);
  z-index: 3;
}
.selection-action-dock .two-col-actions {
  margin-top: 0;
}
.selection-action-dock .primary-btn,
.selection-action-dock .secondary-btn {
  margin-top: 0;
}
.selection-action-dock .back-home-btn {
  display: flex;
  width: 100%;
  margin-top: 12px;
}
.workout-item {
  margin-bottom: 10px;
  min-height: auto;
}
.workout-actions {
  margin-top: 12px;
}
.workout-actions form {
  margin: 0;
}
.workout-actions .secondary-btn {
  margin-top: 0;
}
.workout-actions .primary-btn {
  margin-top: 0;
}
.compact-action {
  margin-top: 0;
  padding: 10px;
  font-size: 13px;
}
.delete-btn {
  margin-top: 0;
  background: #3c547f;
  color: #eaf1ff;
}
.back-home-btn {
  margin-top: 10px;
}
.stats-grid {
  margin-top: 12px;
}
.feedback-card {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}

.backend-link {
  opacity: 0.9;
}

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

.backend-card {
  background: #172548;
  border-radius: 16px;
  padding: 14px;
  border: 1px solid rgba(143, 177, 255, 0.2);
}

@media (max-width: 520px) {
  .session-card .metric-row {
    grid-template-columns: minmax(60px, 1fr) 52px 52px minmax(84px, auto);
    gap: 8px;
  }
}

.backend-filter-row {
  margin-bottom: 12px;
}

.backend-create-card {
  margin-top: 12px;
}

.backend-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.backend-title {
  font-size: 18px;
}

.stats-shell {
  max-width: 1200px;
}

.stats-screen {
  padding: 24px;
}

.exercise-table-wrap {
  margin-top: 22px;
  border: 1px solid rgba(203, 224, 255, 0.16);
  border-radius: 16px;
  overflow: hidden;
  background: var(--stats-wrap-bg);
}

.table-title {
  margin: 0;
  padding: 14px 16px;
  background: var(--stats-title-bg);
  font-size: 16px;
}

.stats-filter-row {
  display: grid;
  grid-template-columns: auto 170px auto 170px auto 190px auto 1fr 140px;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(143, 177, 255, 0.18);
}

.top-filter {
  margin-top: 10px;
  border: 1px solid rgba(143, 177, 255, 0.18);
  border-radius: 14px;
}

.bodyweight-wrap {
  margin-top: 14px;
}

.bodyweight-grid {
  margin: 12px 16px 0;
}

.bodyweight-actions {
  margin: 12px 16px 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
}

.bodyweight-actions .compact-action {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}

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

.stats-graph-grid .exercise-table-wrap {
  margin-top: 0;
}

.bodyweight-panel {
  width: min(460px, 94vw);
}

.stats-filter-row label {
  margin: 0;
  font-size: 12px;
  color: var(--stats-label);
}

.stats-filter-row input,
.stats-filter-row select {
  margin-top: 0;
  height: 40px;
}

.stats-filter-btn {
  margin-top: 0;
  height: 40px;
  padding: 0 12px;
}

.table-subtle {
  padding: 0 16px 10px;
  color: var(--stats-subtle);
  font-size: 12px;
}

.exercise-table {
  width: 100%;
  border-collapse: collapse;
}

.exercise-table th,
.exercise-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(143, 177, 255, 0.18);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

.exercise-table th {
  color: var(--stats-header-text);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--stats-header-bg);
}

.exercise-table tbody tr:hover {
  background: var(--stats-row-hover);
}

.exercise-history-row {
  cursor: pointer;
}

.table-exercise-image {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  object-fit: cover;
  background: #d9e4ff;
}

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

.workout-history-card {
  border: none;
  text-align: left;
  cursor: pointer;
}

.workout-history-card:hover {
  outline: 1px solid rgba(111, 163, 255, 0.8);
}

.history-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 14, 28, 0.82);
  padding: 20px;
}

.history-modal[hidden] {
  display: none;
}

.history-panel {
  position: relative;
  width: min(940px, 94vw);
  background: var(--history-panel-bg);
  border: 1px solid var(--history-panel-border);
  border-radius: 16px;
  padding: 22px;
}

.history-panel h3 {
  margin: 0;
}

.history-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  padding-right: 44px;
}

#history-title {
  font-size: 32px;
  line-height: 1.08;
}

#history-meta {
  font-size: 14px;
}

.history-favorite-btn {
  margin-top: 0;
  min-width: 210px;
  padding: 10px 14px;
}

.history-chart {
  width: 100%;
  height: 240px;
  margin-top: 16px;
  background: var(--history-chart-bg);
  border-radius: 12px;
  border: 1px solid var(--history-chart-border);
}

.history-modal-close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: #f1f5ff;
  color: #0f1d36;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

#history-empty {
  margin-top: 12px;
}

.workout-metrics-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.workout-stat-tile {
  min-height: 98px;
}

.workout-stat-tile .choice-title {
  margin-top: 8px;
  margin-bottom: 0;
  font-size: 24px;
}

.workout-detail-section {
  margin-top: 16px;
}

.workout-detail-section h4 {
  margin: 0 0 8px;
}

.workout-detail-wrap {
  background: var(--workout-detail-wrap-bg);
}

.workout-detail-table {
  min-width: 720px;
}

@media (max-width: 900px) {
  .stats-shell {
    max-width: 420px;
  }

  .stats-screen {
    padding: 18px;
  }

  .exercise-table-wrap {
    overflow-x: auto;
  }

  .exercise-table {
    min-width: 720px;
  }

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

  .workout-history-grid {
    grid-template-columns: 1fr;
  }

  .stats-graph-grid {
    grid-template-columns: 1fr;
  }

  .workout-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workout-detail-table {
    min-width: 680px;
  }

  .history-panel {
    width: min(94vw, 94vw);
    padding: 14px;
  }

  #history-title {
    font-size: 26px;
  }

  .history-favorite-btn {
    min-width: 100%;
  }

  .backend-grid {
    grid-template-columns: 1fr;
  }
}
.feedback-label {
  margin: 0 0 10px;
  color: var(--feedback-label-color);
  font-size: 14px;
  font-weight: bold;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.emoji-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 12px;
  background: var(--emoji-option-bg);
  cursor: pointer;
}
.emoji-option input {
  margin: 0;
  width: auto;
}
.emoji-option span {
  font-size: 22px;
}
.emoji-option small {
  color: var(--emoji-option-small);
}
.empty-item {
  color: var(--empty-color);
  font-size: 13px;
  margin-bottom: 12px;
}
@media (max-width: 480px) {
  body { padding: 10px; }
  .screen-card { border-radius: 18px; }
  .choice-grid { grid-template-columns: 1fr; }
}
