:root {
  color-scheme: light;
  --bg: #f3f4fb;
  --panel: #ffffff;
  --text: #262735;
  --muted: #8b8fa3;
  --line: #e8e9f3;
  --accent: #37d3dc;
  --accent-strong: #20adb9;
  --purple: #7557e8;
  --coral: #ff7580;
  --gold: #f7c948;
  --success: #20c982;
  --warn: #d79400;
  --shadow: 0 22px 60px rgba(76, 83, 116, 0.12);
  --soft-shadow: 0 12px 34px rgba(76, 83, 116, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  overflow-x: hidden;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  background:
    radial-gradient(circle at 18% 10%, rgba(55, 211, 220, 0.14), transparent 26%),
    linear-gradient(180deg, #f8f8fd 0%, var(--bg) 100%);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 16px;
  background: linear-gradient(180deg, #38d1dc 0%, #31c8d6 100%);
  color: #fff;
  box-shadow: 18px 0 42px rgba(47, 197, 211, 0.24);
}

.sidebar-brand {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin-bottom: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.logo-mark,
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 3px solid currentColor;
  border-radius: 8px;
  font-weight: 900;
}

.sidebar-nav {
  display: grid;
  gap: 10px;
  width: 100%;
}

.sidebar-nav a,
.sidebar-logout {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 13px 8px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.84rem;
  font-weight: 750;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.sidebar-nav a span,
.sidebar-logout span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid currentColor;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 900;
}

.sidebar-nav a:hover,
.sidebar-nav a.active,
.sidebar-logout:hover {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  transform: translateY(-1px);
}

.sidebar-logout {
  margin-top: auto;
  width: 100%;
}

.app-main {
  min-width: 0;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 84px;
  padding: 18px 34px;
  background: var(--panel);
  border-bottom: 1px solid rgba(232, 233, 243, 0.8);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 14px 34px rgba(76, 83, 116, 0.07);
}

.menu-toggle {
  display: none;
  place-items: center;
  width: 42px;
  height: 42px;
  min-height: 42px;
  border: 1px solid #dfe3ec;
  border-radius: 8px;
  padding: 0;
  background: #fff;
  color: var(--text);
  box-shadow: none;
  gap: 4px;
}

.menu-toggle span,
.menu-toggle::before,
.menu-toggle::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.menu-open .menu-toggle span {
  opacity: 0;
}

.menu-open .menu-toggle::before {
  transform: translateY(6px) rotate(45deg);
}

.menu-open .menu-toggle::after {
  transform: translateY(-6px) rotate(-45deg);
}

.sidebar-backdrop {
  display: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #202230;
  font-weight: 800;
  font-size: 1.42rem;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-color: var(--accent);
  color: var(--accent-strong);
  font-size: 0.9rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 22px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
}

.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff8aa3, #7557e8);
  color: #fff;
  font-size: 0.82rem;
  box-shadow: 0 10px 22px rgba(117, 87, 232, 0.24);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.grid > *,
.form-row > * {
  min-width: 0;
}

.panel,
.card,
.auth-card {
  background: var(--panel);
  border: 1px solid rgba(232, 233, 243, 0.95);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--soft-shadow);
}

.panel + .panel {
  margin-top: 18px;
}

h1,
h2,
h3 {
  margin: 0 0 14px;
  line-height: 1.2;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.9rem, 3vw, 2.7rem);
}

h2 {
  font-size: 1.35rem;
}

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

label {
  display: block;
  font-weight: 650;
  margin: 12px 0 6px;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

textarea {
  min-height: 90px;
}

input[type="date"] {
  display: block;
  min-width: 0;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  padding: 11px 20px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(117, 87, 232, 0.22);
}

.button.secondary,
button.secondary {
  background: #eef0f8;
  color: var(--text);
  box-shadow: none;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.workout-entry-form {
  display: grid;
  gap: 18px;
  align-content: start;
}

.selection-panel {
  display: grid;
  gap: 12px;
}

.selection-panel[hidden] {
  display: none;
}

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

.selection-header h2 {
  margin: 0;
}

.compact-button {
  min-height: 34px;
  border-radius: 8px;
  padding: 7px 12px;
}

.selection-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  grid-auto-rows: 1fr;
  gap: 12px;
}

.selection-card {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(3.2em, auto) auto;
  align-items: stretch;
  gap: 9px;
  border: 1px solid #dfe3ec;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 10px 24px rgba(76, 83, 116, 0.08);
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.selection-card:hover,
.selection-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(32, 173, 185, 0.16);
  transform: translateY(-1px);
}

.selection-card[aria-disabled="true"] {
  background: #f1f3f6;
  color: #77808e;
  opacity: 0.72;
  box-shadow: none;
  cursor: not-allowed;
}

.selection-card[aria-disabled="true"]:hover,
.selection-card[aria-disabled="true"]:focus-visible {
  border-color: #dfe3ec;
  box-shadow: none;
  transform: none;
}

.selection-card.is-selected {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(117, 87, 232, 0.16), 0 12px 28px rgba(76, 83, 116, 0.1);
}

.selection-card img,
.selection-card-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #edf1f3;
}

.selection-card img {
  display: block;
  object-fit: cover;
}

.selection-card-placeholder {
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  font-size: 2rem;
  font-weight: 850;
  text-transform: uppercase;
}

.selection-card > span:not(.selection-card-placeholder):not(.inactive-card-badge) {
  min-width: 0;
  color: var(--text);
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.selection-card[aria-disabled="true"] > span:not(.selection-card-placeholder):not(.inactive-card-badge) {
  color: #596273;
}

.inactive-card-badge {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 9px;
  background: #e2e6ec;
  color: #596273;
  font-size: 0.72rem;
  font-weight: 850;
}

.set-submit-row {
  margin-bottom: 0;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.checkbox input {
  width: auto;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 30% 20%, rgba(55, 211, 220, 0.24), transparent 30%),
    linear-gradient(135deg, #f7f8fd, #eef0f8);
}

.auth-card {
  width: min(430px, 100%);
  box-shadow: var(--shadow);
}

.image-single img,
.carousel-slide img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #edf1f3;
}

.image-carousel {
  position: relative;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 12px;
  padding: 0 0 10px;
  -webkit-overflow-scrolling: touch;
}

.carousel-slide {
  flex: 0 0 100%;
  margin: 0;
  scroll-snap-align: start;
}

.carousel-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  z-index: 2;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.carousel-prev {
  left: 10px;
}

.carousel-next {
  right: 10px;
}

.modal-open {
  overflow: hidden;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

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

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 26, 38, 0.52);
  backdrop-filter: blur(8px);
}

.image-modal-card {
  position: relative;
  z-index: 1;
  width: min(880px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid rgba(223, 228, 239, 0.9);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(22, 26, 38, 0.28);
}

.image-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #edf0f7;
}

.image-modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.image-modal-close {
  min-height: 34px;
  border-radius: 8px;
  padding: 7px 11px;
  background: #f4f6fa;
  color: var(--text);
  box-shadow: none;
}

.image-modal-content {
  padding: 20px;
  max-height: calc(100vh - 150px);
  overflow: auto;
}

.image-modal-content .image-single img,
.image-modal-content .carousel-slide img {
  aspect-ratio: 16 / 9;
  max-height: 560px;
  object-fit: contain;
}

.save-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

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

.save-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 26, 38, 0.44);
}

.save-modal-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  border: 1px solid rgba(223, 228, 239, 0.95);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(22, 26, 38, 0.24);
}

.save-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.save-modal-header h2,
.save-modal-card p {
  margin: 0;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
  background: #fbfcfd;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  background: transparent;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 0;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tbody tr {
  background: #fff;
  box-shadow: 0 10px 26px rgba(76, 83, 116, 0.06);
}

tbody td:first-child {
  border-radius: 8px 0 0 8px;
}

tbody td:last-child {
  border-radius: 0 8px 8px 0;
}

.summary-card strong {
  display: block;
  font-size: 1.72rem;
  margin-top: 4px;
}

.summary-card {
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: "";
  position: absolute;
  right: -26px;
  top: -30px;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background: rgba(55, 211, 220, 0.18);
}

.chart-box {
  position: relative;
  min-height: 280px;
}

canvas {
  max-width: 100%;
}

.chart-tooltip {
  position: absolute;
  z-index: 4;
  display: none;
  max-width: 220px;
  border: 1px solid rgba(223, 228, 239, 0.95);
  border-radius: 8px;
  padding: 7px 9px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 10px 26px rgba(22, 26, 38, 0.16);
  font-size: 0.82rem;
  font-weight: 750;
  pointer-events: none;
}

.notice {
  display: inline-flex;
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff5de;
  color: var(--warn);
  font-weight: 650;
}

.history-page {
  display: grid;
  gap: 20px;
}

.history-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 24px;
  align-items: end;
  padding: 26px;
  border: 1px solid #dfe7e3;
  border-radius: 8px;
  background:
    radial-gradient(circle at 84% 12%, rgba(117, 87, 232, 0.16), transparent 28%),
    linear-gradient(135deg, rgba(255,255,255,0.96), rgba(246,248,253,0.96));
  box-shadow: 0 18px 50px rgba(23, 32, 42, 0.08);
}

.history-hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin-bottom: 8px;
}

.history-hero p {
  margin: 0;
  color: var(--muted);
  max-width: 620px;
}

.eyebrow {
  color: var(--accent-strong) !important;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  margin-bottom: 8px !important;
  text-transform: uppercase;
}

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

.history-stats div {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(55, 211, 220, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.history-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  text-transform: uppercase;
}

.history-stats strong {
  display: block;
  margin-top: 6px;
  font-size: 1.55rem;
  line-height: 1;
}

.history-section {
  padding: 22px;
  border: 1px solid #dde5e1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 42px rgba(23, 32, 42, 0.06);
}

.history-add-form {
  display: grid;
  gap: 12px;
}

.history-add-form .form-row {
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
}

.history-add-form input,
.history-add-form select,
.history-add-form textarea {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.history-add-form input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading .help {
  margin: -6px 0 0;
}

.accordion {
  width: 100%;
  border: 1px solid #dfe4ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(76, 83, 116, 0.08);
  overflow: hidden;
}

.accordion + .accordion {
  margin-top: 14px;
}

.accordion-child {
  width: calc(100% - 28px);
  margin: 14px 0 14px 28px;
  border-color: #e5e7ef;
  box-shadow: none;
}

.accordion-header {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  background: linear-gradient(180deg, #f8f9fc, #f1f3f7);
}

.accordion-header.has-leading-action {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
}

.accordion-leading-action {
  display: flex;
  align-items: center;
  padding-left: 16px;
}

.accordion-header.has-leading-action .accordion-trigger {
  padding-left: 0;
}

.accordion-trigger {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 0;
  border-radius: 0;
  padding: 18px 0 18px 20px;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.accordion-header:hover {
  background: #eceff5;
}

.accordion-trigger:focus-visible {
  outline: 3px solid rgba(117, 87, 232, 0.32);
  outline-offset: -3px;
}

.accordion-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #d7dbe6;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.accordion-icon::before,
.accordion-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: #5f6677;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.accordion-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.accordion.is-open > .accordion-header > .accordion-trigger .accordion-icon::after {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(0deg);
}

.accordion-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.accordion-title {
  font-size: 1rem;
  font-weight: 850;
  color: var(--text);
}

.accordion-description {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.accordion-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 6px 12px;
  background: #e8ebf2;
  color: #596073;
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.accordion-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px 12px 0;
}

.accordion-action-form {
  margin: 0;
}

.accordion-panel {
  overflow: hidden;
  transition: max-height 0.24s ease;
}

.accordion-panel[hidden] {
  display: none;
}

.accordion-panel-inner {
  padding: 0;
  border-top: 1px solid #edf0f7;
  background: #f6f7fb;
}

.accordion-child > .accordion-header > .accordion-trigger {
  padding: 15px 16px;
}

.accordion-child > .accordion-header {
  background: #f7f8fb;
}

.accordion-child > .accordion-header:hover {
  background: #eef1f6;
}

.accordion-child > .accordion-header > .accordion-trigger .accordion-icon {
  width: 30px;
  height: 30px;
  background: #ffffff;
  border-color: #dfe3ec;
}

.accordion-child > .accordion-panel > .accordion-panel-inner {
  background: #fbfcff;
}

.history-group {
  border: 1px solid #dce5e0;
  border-radius: 8px;
  background: #fff;
  margin: 14px 0;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(23, 32, 42, 0.055);
}

.history-group summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  cursor: pointer;
  font-weight: 750;
  background: linear-gradient(180deg, #ffffff, #f7faf8);
  list-style: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.history-group summary::-webkit-details-marker {
  display: none;
}

.history-group summary::before {
  content: "";
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background:
    linear-gradient(45deg, transparent 45%, #ffffff 45% 55%, transparent 55%),
    var(--purple);
  font-size: 0.82rem;
  font-weight: 900;
  transition: transform 0.16s ease;
}

.history-group[open] > summary::before {
  transform: rotate(90deg);
}

.history-group summary:hover {
  background: #f0f7f3;
}

.summary-title {
  flex: 1;
  min-width: 0;
  font-size: 1rem;
}

.summary-meta,
.history-group summary span:last-child {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: #f0edff;
  color: var(--muted);
  font-weight: 650;
  white-space: nowrap;
  font-size: 0.86rem;
}

.history-group.nested {
  margin: 14px 16px;
  border-color: #e5ebe8;
  box-shadow: none;
}

.history-group.nested summary {
  background: #ffffff;
  padding: 14px 16px;
}

.history-group.deeper summary {
  font-weight: 700;
  background: #fbfcfd;
  border-bottom: 1px solid #edf1f3;
}

.history-group table {
  margin: 0;
}

.sheet-wrap {
  overflow-x: auto;
  padding: 16px 16px 16px 28px;
  background: #f8f9fe;
}

.sheet-wrap.wide {
  padding: 16px 16px 16px 28px;
}

.sheet-table {
  min-width: 760px;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid #e1e4f0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(76, 83, 116, 0.06);
}

.set-sheet {
  min-width: 1280px;
  table-layout: fixed;
}

.set-col-exercise {
  width: 17%;
}

.set-col-time {
  width: 7%;
}

.set-col-reps {
  width: 7%;
}

.set-col-weight,
.set-col-duration {
  width: 9%;
}

.set-col-intensity {
  width: 10%;
}

.set-col-calories {
  width: 9%;
}

.set-col-one-rm {
  width: 8%;
}

.set-col-notes {
  width: 14%;
}

.set-col-actions {
  width: 10%;
}

.compact-sheet {
  min-width: 680px;
}

.sheet-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 14px;
  background: #f0f3fb;
  border-right: 1px solid #dde2ef;
  border-bottom: 1px solid #d8deec;
  color: #5e6478;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.sheet-table thead th:last-child,
.sheet-table tbody td:last-child {
  border-right: 0;
}

.sheet-table tbody tr {
  background: #fff;
  box-shadow: none;
}

.sheet-table tbody tr:nth-child(even) {
  background: #fbfcff;
}

.sheet-table tbody tr:hover {
  background: #f4fbfc;
}

.sheet-table tbody td {
  padding: 13px 14px;
  border-right: 1px solid #edf0f7;
  border-bottom: 1px solid #edf0f7;
  color: #303342;
  font-size: 0.94rem;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.sheet-table tbody tr:last-child td {
  border-bottom: 0;
}

.sheet-table tbody td:first-child,
.sheet-table tbody td:last-child {
  border-radius: 0;
}

.number-cell {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 750;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: capitalize;
}

.sheet-input {
  width: 100%;
  min-width: 92px;
  border: 1px solid #dfe3ec;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  font-size: 0.9rem;
  box-shadow: none;
}

.sheet-input.number {
  min-width: 76px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.weight-col,
.weight-cell {
  min-width: 128px;
}

.sheet-input.weight-input {
  min-width: 112px;
}

.sheet-input.notes {
  min-width: 180px;
}

.tooltip-label {
  cursor: help;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.exercise-name-cell {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.plan-source-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  background: #eefbfc;
  color: #1497a5;
  font-size: 0.74rem;
  font-weight: 850;
  white-space: nowrap;
}

.mobile-set-summary {
  display: none;
}

.image-icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  min-height: 32px;
  border: 1px solid #dfe3ec;
  border-radius: 8px;
  padding: 0;
  background: #ffffff;
  color: transparent;
  box-shadow: none;
  font-size: 0;
}

.image-icon-button::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid #5f6677;
  border-radius: 4px;
  background:
    radial-gradient(circle at 75% 25%, #5f6677 0 2px, transparent 2px),
    linear-gradient(135deg, transparent 47%, #5f6677 48% 55%, transparent 56%);
}

.image-icon-button:hover,
.image-icon-button:focus-visible {
  border-color: #bfc5d2;
  background: #f6f8fb;
  outline: none;
}

.image-icon-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(117, 87, 232, 0.22);
}

.image-icon-button.small {
  width: 28px;
  height: 28px;
  min-height: 28px;
  border-radius: 7px;
}

.image-icon-button.small::before {
  width: 14px;
  height: 14px;
}

.management-list {
  display: grid;
  gap: 14px;
}

.exercise-management-list {
  margin-top: 18px;
}

.exercise-body-part-group {
  display: grid;
  gap: 14px;
}

.exercise-body-part-group[hidden] {
  display: none;
}

.exercise-body-part-group + .exercise-body-part-group {
  padding-top: 6px;
}

.management-item {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e1e4f0;
  border-radius: 8px;
  background: #fbfcff;
  box-shadow: 0 10px 28px rgba(76, 83, 116, 0.06);
}

.management-item.is-inactive {
  background: #f4f6f9;
  opacity: 0.78;
}

.management-item.is-reordered {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(55, 211, 220, 0.18), 0 10px 28px rgba(76, 83, 116, 0.06);
}

.order-save-form {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 12px;
}

.management-title {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.move-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.management-edit-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
}

.management-edit-form select {
  min-width: 170px;
}

.management-edit-form:has(select) {
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 220px) auto auto auto;
}

.inline-check,
.compact-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.inline-check input {
  width: auto;
  margin: 0;
}

.compact-field {
  align-items: end;
}

.management-image-form {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding-left: 42px;
}

.management-image-form label {
  margin: 0;
}

.management-image-form button {
  min-height: 42px;
}

.management-item > .accordion-child {
  width: 100%;
  margin: 0;
  box-shadow: none;
}

.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  padding: 14px;
}

.thumbnail-card {
  overflow: hidden;
  border: 1px solid #e1e4f0;
  border-radius: 8px;
  background: #fff;
}

.thumbnail-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #edf1f3;
  border-bottom: 1px solid #edf0f7;
}

.thumbnail-meta {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.thumbnail-meta > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thumbnail-actions,
.thumbnail-actions form {
  display: flex;
  align-items: end;
  gap: 8px;
}

.thumbnail-actions {
  justify-content: space-between;
}

.thumbnail-actions label {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.sort-input {
  width: 74px;
  min-width: 74px;
  margin-top: 4px;
  padding: 7px 8px;
  text-align: right;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sheet-action {
  min-height: 34px;
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 0.82rem;
  box-shadow: none;
}

.sheet-action.compact {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 0.78rem;
}

.sheet-action.icon-only {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: currentColor;
}

.sheet-action.compact.icon-only {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
}

.sheet-action.icon-only::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  background: currentColor;
}

.save-icon::before {
  width: 18px;
  height: 18px;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 3h12l2 2v16H5V3zm2 2v5h9V5H7zm2 11v3h6v-3H9zm9-9.2L16.2 5H18v1.8z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 3h12l2 2v16H5V3zm2 2v5h9V5H7zm2 11v3h6v-3H9zm9-9.2L16.2 5H18v1.8z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.delete-icon::before {
  clip-path: polygon(30% 8%, 70% 8%, 70% 18%, 92% 18%, 92% 30%, 84% 30%, 78% 92%, 22% 92%, 16% 30%, 8% 30%, 8% 18%, 30% 18%);
}

.move-up-icon,
.move-down-icon {
  background: #f8f9fe;
  color: #596273;
  border: 1px solid #dfe3ec;
}

.move-up-icon::before {
  clip-path: polygon(50% 16%, 86% 56%, 68% 56%, 68% 86%, 32% 86%, 32% 56%, 14% 56%);
}

.move-down-icon::before {
  clip-path: polygon(32% 14%, 68% 14%, 68% 44%, 86% 44%, 50% 84%, 14% 44%, 32% 44%);
}

.sheet-action.save {
  background: var(--purple);
  color: #fff;
}

.sheet-action.delete {
  background: #fff0f2;
  color: #c33e4b;
  border: 1px solid #ffd8de;
}

.intensity-light {
  background: #ecfbff;
  color: #168c9a;
}

.intensity-moderate {
  background: #f0edff;
  color: #6650d5;
}

.intensity-vigorous {
  background: #fff0f2;
  color: #d84c5a;
}

.history-card-list,
.set-card-list {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: #f7faf9;
}

.history-card,
.set-card {
  background: #ffffff;
  border: 1px solid #e1e9e5;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(23, 32, 42, 0.04);
}

.workout-card {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) minmax(140px, 0.8fr) minmax(180px, 2fr);
  gap: 14px;
  align-items: start;
}

.label,
.set-metrics dt {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.history-card strong,
.set-card-topline strong {
  font-size: 1.06rem;
}

.history-card-notes p,
.set-notes {
  margin: 0;
  color: #344252;
}

.set-card-list {
  padding-left: 18px;
  padding-right: 18px;
}

.set-card {
  display: grid;
  gap: 12px;
  border-left: 4px solid rgba(55, 211, 220, 0.85);
}

.set-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf1f3;
}

.set-card-topline span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 11px;
  background: #eefbfc;
  color: #1497a5;
  font-size: 0.84rem;
  font-weight: 750;
  text-transform: capitalize;
}

.set-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 0;
}

.set-metrics div {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: #f8f9fe;
}

.set-metrics dd {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 750;
  color: var(--text);
}

.set-notes {
  border-top: 1px solid #edf1f3;
  padding-top: 10px;
}

.plans-list {
  display: grid;
  gap: 18px;
}

.plan-panel {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid #e1e4f0;
  border-radius: 8px;
  background: #fbfcff;
}

.plan-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.plan-header h3 {
  margin-bottom: 6px;
}

.plan-add-exercise-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.plan-add-exercise-form label {
  grid-column: 1 / -1;
  margin-bottom: -6px;
}

.plan-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.plan-card-grid.is-focused {
  grid-template-columns: 1fr;
}

.plan-card-grid.is-focused .plan-card[hidden] {
  display: none !important;
}

.plan-panel.is-focused-plan .order-save-form {
  display: none;
}

.plan-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #e1e4f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(76, 83, 116, 0.06);
}

.plan-card.is-focused {
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  align-items: start;
}

.plan-card.is-focused .move-actions {
  display: none;
}

.plan-card-tile {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.plan-card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: #edf1f3;
}

.plan-card-image.placeholder {
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  font-size: 2rem;
  font-weight: 850;
  text-transform: uppercase;
}

.plan-card-overlay {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
}

.plan-card-overlay.top {
  top: 0;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.62), transparent);
}

.plan-card-overlay.bottom {
  bottom: 0;
  background: linear-gradient(0deg, rgba(17, 24, 39, 0.72), transparent);
}

.plan-card-name {
  min-width: 0;
  color: #fff;
  font-weight: 850;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}

.plan-start-button,
.plan-stop-button {
  min-height: 34px;
  border-radius: 8px;
  padding: 7px 12px;
  color: #fff;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

.plan-start-button {
  background: #20c982;
}

.plan-stop-button {
  background: #d84c5a;
}

.plan-card.is-pending {
  background: #f1f3f6;
  color: #6d7480;
  opacity: 0.76;
  box-shadow: none;
}

.plan-card.is-pending .plan-card-image {
  filter: grayscale(0.9);
}

.plan-card.is-started {
  border-color: var(--accent);
  background: #f7feff;
  color: var(--text);
  opacity: 1;
  box-shadow: 0 0 0 3px rgba(55, 211, 220, 0.2), 0 12px 30px rgba(32, 173, 185, 0.12);
}

.plan-card.is-complete {
  background: #ffffff;
  color: var(--text);
  opacity: 1;
}

.plan-card.is-started .plan-card-image {
  filter: none;
}

.plan-card.is-focused .plan-card-tile {
  position: sticky;
  top: 12px;
}

.plan-card-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.plan-card-summary div {
  padding: 10px;
  border-radius: 8px;
  background: #f8f9fe;
}

.plan-card-summary dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.plan-card-summary dd {
  margin: 0;
  font-weight: 850;
}

.plan-set-form {
  display: grid;
  gap: 10px;
}

.plan-set-form[hidden] {
  display: none;
}

.plan-card.is-started .plan-set-form:not([hidden]) {
  display: grid;
}

.plan-set-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.plan-card .move-actions .sheet-action {
  background: rgba(255, 255, 255, 0.92);
}

.settings-data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.danger-card {
  border-color: #ffd8de;
  background: #fff9fa;
}

.notice.error {
  border-color: #ffd8de;
  background: #fff0f2;
  color: #b83544;
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
    background: var(--bg);
  }

  .sidebar {
    background: var(--accent-strong);
  }

  .avatar {
    background: var(--purple);
  }

  .auth-page {
    background: var(--bg);
  }

  .history-hero,
  .accordion-header,
  .history-group summary {
    background: #ffffff;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(82vw, 320px);
    height: 100vh;
    align-items: stretch;
    padding: 18px 16px;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 24px 0 70px rgba(22, 26, 38, 0.28);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .menu-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: block;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: rgba(22, 26, 38, 0.44);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .menu-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .menu-open {
    overflow: hidden;
  }

  .sidebar-brand {
    width: 52px;
    height: 52px;
    margin: 0 0 18px;
  }

  .sidebar-nav {
    display: grid;
    gap: 10px;
    overflow: visible;
  }

  .sidebar-nav a,
  .sidebar-logout {
    min-width: 0;
    grid-template-columns: 34px minmax(0, 1fr);
    justify-items: start;
    align-items: center;
    padding: 12px;
    text-align: left;
  }

  .sidebar-logout {
    display: grid;
  }

  .app-header {
    align-items: center;
    min-height: 66px;
    padding: 12px 14px;
    gap: 10px;
  }

  .menu-toggle {
    display: inline-grid;
    flex: 0 0 auto;
  }

  .brand {
    font-size: 1.1rem;
    min-width: 0;
  }

  .brand span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-actions {
    gap: 10px;
  }

  .user-chip span:last-child {
    display: none;
  }

  .panel,
  .card,
  .history-section,
  .history-hero {
    border-radius: 8px;
  }

  .panel,
  .card {
    padding: 16px;
  }

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

  .selection-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  }

  th,
  td {
    padding: 8px 6px;
  }

  .history-group summary {
    align-items: flex-start;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .history-group summary::before {
    grid-row: span 2;
  }

  .history-group summary span:last-child {
    white-space: normal;
  }

  .history-hero {
    grid-template-columns: 1fr;
    padding: 20px;
  }

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

  .history-section {
    padding: 16px;
  }

  .accordion-header {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .accordion-header.has-leading-action {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
  }

  .accordion-leading-action {
    padding: 15px 0 8px 14px;
    align-self: start;
  }

  .accordion-header.has-leading-action .accordion-trigger {
    padding-left: 0;
  }

  .accordion-header.has-leading-action .accordion-header-actions {
    grid-column: 1 / -1;
    padding-left: 58px;
  }

  .accordion-trigger {
    grid-template-columns: 30px minmax(0, 1fr);
    padding: 15px 14px 8px;
  }

  .accordion-header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    padding: 0 14px 14px 58px;
  }

  .accordion-meta {
    justify-content: flex-start;
  }

  .accordion-child {
    width: calc(100% - 14px);
    margin: 10px 0 10px 14px;
  }

  .history-group.nested {
    margin: 10px 8px;
  }

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

  .set-card-list {
    padding: 10px;
  }

  .sheet-wrap,
  .sheet-wrap.wide {
    overflow: visible;
    padding: 10px 10px 10px 18px;
  }

  .sheet-table,
  .set-sheet {
    min-width: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .sheet-table thead {
    display: none;
  }

  .sheet-table,
  .sheet-table tbody,
  .sheet-table tr,
  .sheet-table td {
    display: block;
    width: 100%;
  }

  .sheet-table tbody tr {
    margin-bottom: 12px;
    border: 1px solid #e1e4f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(76, 83, 116, 0.07);
    overflow: hidden;
  }

  .sheet-table tbody tr:nth-child(even) {
    background: #fff;
  }

  .sheet-table tbody td {
    display: grid;
    grid-template-columns: minmax(120px, 42%) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    border-right: 0;
    border-bottom: 1px solid #edf0f7;
    padding: 11px 12px;
    text-align: left;
  }

  .sheet-table tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .sheet-table tbody td:last-child {
    border-bottom: 0;
  }

  .set-sheet tbody tr {
    display: block;
    padding: 10px;
  }

  .set-sheet tbody tr:not(.is-editing) > td:not(.mobile-set-summary) {
    display: none;
  }

  .set-sheet tbody tr:not(.is-editing) > .mobile-set-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: center;
    border-bottom: 0;
    padding: 4px;
  }

  .mobile-set-summary::before {
    display: none;
  }

  .mobile-set-title {
    min-width: 0;
    font-weight: 850;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .mobile-set-facts {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 10px;
    color: #4f566b;
    font-size: 0.88rem;
    font-weight: 700;
  }

  .mobile-modify-button {
    min-height: 32px;
    padding: 7px 11px;
  }

  .set-sheet tbody tr.is-editing {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
  }

  .set-sheet tbody tr.is-editing > .mobile-set-summary {
    display: none;
  }

  .set-sheet tbody tr.is-editing > td {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    border-bottom: 0;
    padding: 7px 8px;
    min-width: 0;
  }

  .set-sheet tbody tr.is-editing > td[data-label="Exercise"],
  .set-sheet tbody tr.is-editing > td[data-label="Notes"],
  .set-sheet tbody tr.is-editing > td[data-label="Actions"] {
    grid-column: 1 / -1;
  }

  .set-sheet tbody tr.is-editing > td[data-label="Calories"],
  .set-sheet tbody tr.is-editing > td[data-label="1RM"] {
    display: none;
  }

  .set-sheet tbody td::before {
    font-size: 0.65rem;
    letter-spacing: 0.06em;
  }

  .set-sheet .exercise-name-cell {
    align-items: center;
    gap: 8px;
    font-weight: 800;
  }

  .set-sheet .sheet-input {
    min-height: 34px;
    padding: 7px 9px;
  }

  .set-sheet .row-actions {
    justify-content: flex-end;
    padding-top: 2px;
  }

  .number-cell {
    text-align: left;
  }

  .sheet-input.number {
    text-align: left;
  }

  .weight-col,
  .weight-cell,
  .sheet-input.weight-input {
    min-width: 0;
  }

  .row-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .plan-header,
  .plan-add-exercise-form {
    grid-template-columns: 1fr;
  }

  .plan-header {
    display: grid;
  }

  .plan-card.is-focused {
    grid-template-columns: 1fr;
  }

  .plan-card.is-focused .plan-card-tile {
    position: relative;
    top: auto;
  }

  .management-title,
  .management-edit-form,
  .management-edit-form:has(select),
  .management-image-form {
    grid-template-columns: 1fr;
  }

  .management-title {
    align-items: start;
  }

  .management-image-form {
    padding-left: 0;
  }

  .thumbnail-grid {
    grid-template-columns: 1fr;
    padding: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .accordion-panel,
  .accordion-icon::before,
  .accordion-trigger {
    transition: none;
  }
}
