.view-shell {
  --view-text: var(--text, #182a22);
  --view-dim: var(--muted, #52665a);
  --view-accent: var(--accent, #35634e);
  --view-lime: var(--lime, #d8f77c);
  --view-soft: var(--accent-faint, #eaf2e9);
  --view-bg: var(--bg, #f3f6f1);
  --view-white: var(--panel, #fff);
  --view-border: var(--line, #dce7de);
  --view-shadow: 0 1px 2px #182a2208, 0 10px 28px #182a220b;
  --view-display: var(--heading, 'DM Sans', system-ui, sans-serif);
  --view-card-pad: clamp(17px, 3.5vw, 30px);
  min-width: 0;
  color: var(--view-text);
}

.view-shell :is(h1,h2,p,ul,figure) { margin: 0; }
.view-shell .panel { border: 0; border-radius: 24px; background: var(--view-white); box-shadow: var(--view-shadow); }
.view-shell svg { flex: 0 0 auto; width: 18px; height: 18px; }
.view-shell .eyebrow { color: var(--view-accent); font-size: .8125rem; letter-spacing: .055em; }
.view-shell .button { justify-content: center; min-height: 48px; border-radius: 14px; }
.view-shell .icon-button { min-width: 44px; min-height: 44px; border-radius: 13px; color: var(--view-text); }
.view-shell a { text-decoration: none; }

.view-title, .view-section-title, .view-step-title {
  color: var(--view-text);
  font-family: var(--view-display);
  font-weight: 760;
  letter-spacing: -.045em;
  line-height: 1.05;
}

.view-title { font-size: clamp(2.5rem, 7vw, 4.3rem); }
.view-section-title { font-size: clamp(1.35rem, 3vw, 1.8rem); }
.view-lead, .view-hint { color: var(--view-dim); line-height: 1.5; }
.view-hint { font-size: .9375rem; }
.view-page-heading { margin-bottom: 6px; }

.view-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.view-back {
  display: inline-flex;
  width: max-content;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  color: var(--view-dim);
  font-weight: 650;
}

.view-back:hover { color: var(--view-text); }
.view-shell .view-favorite[aria-pressed='true'] { color: var(--view-accent); background: var(--view-soft); }
.view-favorite[aria-pressed='true'] svg { fill: currentColor; }

.view-shell .view-workout-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.07fr) minmax(0, .93fr);
  align-items: center;
  gap: 32px;
  padding: clamp(20px, 4vw, 44px);
  background: linear-gradient(112deg, #fff 12%, #f8fbf6 55%, #edf5eb);
}

.view-hero-content { display: grid; justify-items: start; gap: 12px; }
.view-hero-content:only-child { grid-column: 1 / -1; }
.view-lead { max-width: 53ch; }
.view-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.view-tags > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--view-border);
  border-radius: 999px;
  color: var(--view-accent);
  background: #ffffff90;
  font-size: .875rem;
  line-height: 1.25;
}

.view-tags svg { width: 15px; height: 15px; }
.view-start-actions { margin-top: 5px; }
.view-start-actions .button { min-height: 52px; padding-inline: 20px; font-weight: 720; }

.view-hero-picture, .view-player-image {
  display: grid;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--view-border);
  border-radius: 16px;
  background: var(--view-white);
  color: var(--view-accent);
  text-align: start;
  cursor: pointer;
}

.view-hero-picture > img, .view-player-image > img { display: block; width: 100%; height: auto; }
.view-hero-picture > span, .view-player-image > span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 43px;
  padding: 9px 12px;
  font-size: .875rem;
  font-weight: 660;
}

.view-hero-picture:hover, .view-player-image:hover { background: var(--view-soft); }

.view-variant-details { width: max-content; max-width: 100%; }
.view-variant-details summary, .view-player-options summary, .view-detail-round summary { list-style: none; cursor: pointer; }
.view-variant-details summary::-webkit-details-marker, .view-player-options summary::-webkit-details-marker, .view-detail-round summary::-webkit-details-marker { display: none; }
.view-variant-details summary {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  color: var(--view-dim);
  font-size: .875rem;
}

.view-variant-details summary strong { color: var(--view-accent); }
.view-variant-details summary > svg:last-child { width: 15px; height: 15px; }
.view-variant-details[open] summary > svg:last-child { transform: rotate(90deg); }
.view-shell .view-variant-details .view-hint { margin-top: 6px; font-size: .8125rem; }
.view-segment {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 4px;
  max-width: 100%;
  padding: 4px;
  border-radius: 12px;
  background: var(--view-soft);
}

.view-segment button {
  min-height: 40px;
  padding: 5px 10px;
  border: 0;
  border-radius: 9px;
  color: var(--view-dim);
  background: transparent;
  font-size: .875rem;
  font-weight: 680;
  cursor: pointer;
}

.view-segment button[aria-pressed='true'] { color: var(--view-text); background: var(--view-white); box-shadow: 0 1px 5px #182a2210; }
.view-detail-block { margin-top: 29px; }
.view-detail-block > h2, .view-progress-grid section > h2 { margin-bottom: 12px; }
.view-rounds { display: grid; gap: 9px; }
.view-shell .view-detail-round { overflow: hidden; border-radius: 16px; }

.view-detail-round summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 55px;
  padding: 12px 16px;
  color: var(--view-text);
  font-weight: 690;
}

.view-detail-round[open] summary { border-bottom: 1px solid var(--view-border); }
.view-detail-round[open] summary svg { transform: rotate(90deg); }
.view-round-count, .view-step-value { display: inline-flex; align-items: center; gap: 8px; color: var(--view-dim); font-size: .875rem; white-space: nowrap; }
.view-step-list { list-style: none; padding: 0; }
.view-step-list > li + li { border-top: 1px solid var(--view-border); }
.view-step-row {
  display: flex;
  width: 100%;
  min-height: 49px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border: 0;
  color: var(--view-text);
  background: transparent;
  text-align: start;
  cursor: pointer;
}

.view-step-row:hover, .view-detail-round summary:hover { background: #f5faf3; }
.view-step-row > span:first-child { display: grid; gap: 3px; }
.view-step-row small { color: var(--view-dim); font-size: .8125rem; }
.view-step-value { color: var(--view-accent); font-weight: 680; }
.view-round-rest { display: flex; align-items: center; gap: 8px; padding: 12px 16px; color: var(--view-accent); background: var(--view-soft); font-size: .875rem; }

.view-session { display: grid; align-content: start; gap: 14px; max-width: 720px; margin-inline: auto; }
.view-session-top { display: flex; align-items: start; justify-content: space-between; gap: 15px; }
.view-session-top .view-title { font-size: clamp(1.85rem, 5.8vw, 3rem); }
.view-shell .view-session-context { margin-top: 5px; color: var(--view-dim); font-size: .875rem; }
.view-paused-state {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border-radius: 17px;
  background: var(--view-soft);
  color: var(--view-text);
}
.view-paused-icon { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 12px; background: var(--view-white); color: var(--view-accent); }
.view-paused-state h2 { font-size: 1rem; line-height: 1.3; }
.view-shell .view-paused-state p { margin-top: 2px; color: var(--view-dim); font-size: .875rem; }
.view-shell .view-paused-state .button { min-height: 44px; padding-inline: 11px; border: 1px solid var(--view-border); background: var(--view-white); }
.view-player-progress { display: grid; gap: 8px; color: var(--view-dim); font-size: .875rem; }
.view-player-progress > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.view-player-progress strong { color: var(--view-text); }
.view-progress-bar {
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  color: var(--view-accent);
  background: #e3ebe2;
  appearance: none;
}
.view-progress-bar::-webkit-progress-bar { background: #e3ebe2; }
.view-progress-bar::-webkit-progress-value { background: #75a785; border-radius: 999px; }
.view-progress-bar::-moz-progress-bar { background: #75a785; border-radius: 999px; }

.view-player-card { display: grid; gap: 16px; padding: var(--view-card-pad); }
.view-player-content {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  justify-items: start;
  align-items: start;
  gap: 8px 14px;
}
.view-player-content > :not(.view-session-clock) { grid-column: 1; }
.view-player-content .view-step-title:focus { outline: none; }
.view-step-title { font-size: clamp(1.75rem, 7vw, 3.4rem); overflow-wrap: anywhere; }
.view-shell .view-step-target { color: var(--view-accent); font-size: clamp(1.14rem, 4vw, 1.55rem); font-weight: 760; }
.view-session-clock {
  display: grid;
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  justify-items: end;
  gap: 4px;
  padding: 9px 12px;
  border-radius: 13px;
  background: var(--view-soft);
}
.view-session-clock > span { display: inline-flex; align-items: center; gap: 5px; color: var(--view-dim); font-size: .8125rem; white-space: nowrap; }
.view-session-clock svg { width: 15px; height: 15px; }
.view-session-clock strong, .view-result, .view-break-clock {
  color: var(--view-accent);
  font-family: var(--view-display);
  font-size: clamp(1.5rem, 5vw, 2.3rem);
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.view-session-clock.is-countdown { background: #e4f2dc; }
.view-session-clock.is-countdown strong { font-size: clamp(1.8rem, 7vw, 2.85rem); }
.view-player-card.is-rest .view-player-content { justify-items: center; grid-template-columns: minmax(0,1fr); gap: 10px; text-align: center; }
.view-player-card.is-rest .view-session-clock { grid-area: auto; justify-items: center; margin-top: 5px; }
.view-player-card.is-rest .view-session-clock strong { font-size: clamp(2.8rem, 12vw, 5rem); }

.view-up-next {
  display: grid;
  grid-template-columns: 38px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 9px 10px;
  border-radius: 16px;
  background: var(--view-soft);
  color: var(--view-dim);
}
.view-next-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: var(--view-accent); background: #fff; }
.view-up-next > div { display: grid; gap: 2px; }
.view-up-next > div span, .view-up-next small { font-size: .8125rem; }
.view-up-next strong { color: var(--view-text); }
.view-up-next small { padding-inline-end: 3px; white-space: nowrap; }
.view-player-actions {
  position: sticky;
  z-index: 8;
  bottom: 0;
  display: flex;
  gap: 8px;
  padding: 10px 0 max(10px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--view-bg) 94%, transparent);
  backdrop-filter: blur(10px);
}
.view-player-actions > .button-primary { flex: 1; min-width: 0; min-height: 52px; gap: 8px; font-weight: 720; }
.view-player-actions .view-pause-action { min-height: 52px; padding-inline: 13px; white-space: nowrap; }
.view-player-actions .icon-button { display: grid; place-items: center; min-width: 48px; min-height: 52px; padding: 0; border: 1px solid var(--view-border); background: var(--view-white); }
.view-player-options { position: relative; }
.view-player-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 7px);
  width: max-content;
  max-width: min(235px, 70vw);
  padding: 6px;
  border: 1px solid var(--view-border);
  border-radius: 13px;
  background: var(--view-white);
  box-shadow: var(--view-shadow);
}
.view-player-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--view-text);
  background: transparent;
  font-size: .875rem;
  text-align: start;
  cursor: pointer;
}
.view-player-menu button:hover, .view-player-options[open] summary { background: var(--view-soft); }

.view-completion, .view-empty, .view-next-planned {
  display: grid;
  justify-items: center;
  gap: 13px;
  padding: clamp(24px, 5vw, 44px) 20px;
  text-align: center;
}
.view-empty > p { max-width: 39ch; color: var(--view-dim); line-height: 1.5; }
.view-completion .view-title { font-size: clamp(2rem, 6vw, 3.5rem); }
.view-completion .view-result { font-size: clamp(2.25rem, 8vw, 3.65rem); }
.view-next-planned { padding-block: 24px; }

.view-success-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--view-soft);
  color: var(--view-accent);
}
.view-success-icon > svg { width: 23px; height: 23px; }
.view-completion .view-success-icon { background: var(--view-lime); color: var(--view-text); }
.view-reps { display: grid; gap: 6px; max-width: 100%; margin: 4px 0; }
.view-reps label { color: var(--view-dim); font-size: .875rem; font-weight: 650; }
.view-reps-controls { display: grid; grid-template-columns: 44px minmax(42px, 76px) 44px; align-items: center; gap: 6px; }
.view-reps-controls .icon-button { width: 44px; height: 44px; color: var(--view-accent); background: var(--view-soft); border: 0; }
.view-reps-controls input { width: 100%; height: 44px; padding: 0 3px; border: 1px solid var(--view-border); border-radius: 10px; color: var(--view-text); background: var(--view-white); text-align: center; font-size: 1.125rem; font-weight: 740; -moz-appearance: textfield; }
.view-reps-controls input::-webkit-inner-spin-button { appearance: none; }

.view-exit-dialog {
  width: min(410px, calc(100% - 28px));
  padding: 23px;
  border: 0;
  border-radius: 23px;
  color: var(--view-text);
  background: var(--view-white);
  box-shadow: 0 18px 55px #14271e30;
}
.view-exit-dialog::backdrop { background: #14271e64; backdrop-filter: blur(3px); }
.view-shell .view-exit-dialog > p { margin-top: 9px; color: var(--view-dim); line-height: 1.5; }
.view-dialog-actions { display: grid; gap: 7px; margin-top: 17px; }
.view-danger { color: #a13132; }
.view-dialog-actions .view-danger { border: 0; background: #fbefee; }

.view-progress, .view-profile { display: grid; gap: 17px; }
.view-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 11px; }
.view-stat { display: grid; justify-items: start; gap: 5px; min-height: 127px; padding: clamp(11px, 2.7vw, 21px); }
.view-stat .view-stat-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 10px; color: var(--view-accent); background: var(--view-soft); }
.view-stat-icon svg { width: 17px; height: 17px; }
.view-stat strong { color: var(--view-text); font-family: var(--view-display); font-size: clamp(1.5rem, 4.9vw, 2.65rem); font-weight: 780; letter-spacing: -.035em; line-height: 1.05; overflow-wrap: anywhere; }
.view-stat > span:last-child { color: var(--view-dim); font-size: .875rem; }
.view-week-card { padding: var(--view-card-pad); }
.view-card-heading { display: flex; align-items: start; justify-content: space-between; gap: 9px; }
.view-shell .view-card-heading .view-hint { margin-top: 5px; }
.view-fraction {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--view-accent);
  background: var(--view-soft);
  font-size: .8125rem;
  white-space: nowrap;
}
.view-fraction svg { width: 15px; height: 15px; }
.view-week-bars { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: clamp(5px, 2vw, 15px); margin-top: 18px; }
.view-day { display: grid; justify-items: center; gap: 7px; color: var(--view-dim); font-size: .875rem; }
.view-day.is-today { color: var(--view-accent); font-weight: 760; }
.view-bar-track { display: flex; align-items: end; width: min(64px,100%); height: 65px; overflow: hidden; border-radius: 9px; background: #edf3ed; }
.view-bar-track > span { display: grid; place-items: center; width: 100%; height: var(--value); overflow: hidden; border-radius: 9px; color: var(--view-text); background: #aed0ad; font-size: .8125rem; font-weight: 750; }
.view-day.is-today .view-bar-track { box-shadow: 0 0 0 1px #9db9a2 inset; }
.view-day.is-today .view-bar-track > span { background: var(--view-lime); }

.view-progress-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 17px; }
.view-result-list { display: grid; overflow: hidden; list-style: none; padding: 0; }
.view-result-list > li + li { border-top: 1px solid var(--view-border); }
.view-result-row {
  display: grid;
  grid-template-columns: 37px minmax(0,1fr) auto auto;
  align-items: center;
  gap: 9px;
  min-height: 65px;
  padding: 10px 13px;
  color: var(--view-text);
}
.view-result-row:hover { background: #f5faf3; }
.view-result-manage { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding-right: 8px; }
.view-result-manage .view-result-row { grid-template-columns: 37px minmax(0, 1fr) auto; padding-right: 7px; }
.view-result-list .view-delete-training { color: #a13132; background: transparent; }
.view-result-list .view-delete-training:hover,
.view-result-list .view-delete-training:focus-visible { background: #faebe9; }
.view-result-icon { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 11px; background: var(--view-soft); color: var(--view-accent); }
.view-result-name, .view-result-meta { display: grid; min-width: 0; gap: 3px; }
.view-result-name > :is(strong,small) { overflow-wrap: anywhere; }
.view-result-meta { text-align: right; }
.view-result-meta > strong { color: var(--view-accent); white-space: nowrap; }
.view-result-row small, .view-result-chevron { color: var(--view-dim); }
.view-result-row small { font-size: .8125rem; }

.view-profile { max-width: 800px; }
.view-profile-user { display: flex; align-items: center; gap: 14px; padding: var(--view-card-pad); }
.view-profile-user h2 { overflow-wrap: anywhere; }
.view-shell .view-profile-user .view-hint { margin-top: 4px; }
.view-profile-initial { display: grid; flex: 0 0 auto; place-items: center; width: 50px; height: 50px; border-radius: 15px; color: var(--view-text); background: var(--view-lime); font-size: 1.45rem; font-weight: 760; }
.view-settings { display: grid; padding: var(--view-card-pad); }
.view-shell .view-settings h2 { margin-bottom: 13px; }
.view-settings > .button { justify-self: start; margin-top: 12px; }
.view-setting-row {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 9px 0;
  border: 0;
  border-top: 1px solid var(--view-border);
  color: var(--view-text);
  background: transparent;
  text-align: start;
}
.view-setting-row small { display: block; margin-top: 4px; color: var(--view-dim); font-size: .875rem; }
.view-select { position: relative; flex: 0 0 auto; }
.view-select::after { position: absolute; inset: calc(50% - 5px) 12px auto auto; width: 8px; height: 8px; transform: rotate(45deg); border: solid var(--view-accent); border-width: 0 2px 2px 0; pointer-events: none; content: ''; }
.view-select select {
  min-height: 40px;
  padding: 5px 29px 5px 9px;
  border: 1px solid var(--view-border);
  border-radius: 10px;
  color: var(--view-text);
  background: var(--view-bg);
  appearance: none;
}
.view-setting-button { min-height: 52px; cursor: pointer; }
.view-setting-button:hover { color: var(--view-accent); }
.view-setting-button > span { display: flex; align-items: center; gap: 9px; }
.view-setting-button.view-danger { color: #a13132; }
.view-toggle {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  margin: 0;
  border: 1px solid #a7b7aa;
  border-radius: 999px;
  background: #dde7dc;
  cursor: pointer;
  appearance: none;
}
.view-toggle::before { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #182a2232; content: ''; }
.view-toggle:checked { border-color: var(--view-accent); background: var(--view-accent); }
.view-toggle:checked::before { transform: translateX(18px); }
.view-import > input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.view-import:focus-within { outline: 2px solid var(--view-accent); outline-offset: 3px; }

@media (max-width: 730px) {
  .view-shell .view-workout-hero { gap: 18px; }
  .view-progress-grid { grid-template-columns: minmax(0,1fr); }
}

@media (max-width: 560px) {
  .view-shell .view-workout-hero { grid-template-columns: minmax(0,1fr); gap: 13px; padding: 18px; }
  .view-hero-content { gap: 9px; }
  .view-start-actions { width: 100%; margin-top: 6px; }
  .view-start-actions .button { width: 100%; }
  .view-hero-picture { width: 100%; }
  .view-hero-picture > span, .view-player-image > span { min-height: 39px; }
  .view-detail-block { margin-top: 21px; }
  .view-session { gap: 12px; }
  .view-session:has(.view-player-actions) { padding-bottom: calc(75px + env(safe-area-inset-bottom)); }
  .view-player-actions {
    position: fixed;
    inset-inline: 0;
    padding: 9px var(--gutter, 18px) calc(9px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--view-border);
  }
  .view-player-card { gap: 12px; }
  .view-player-card.is-timed:not(.is-rest) .view-session-clock { grid-row: 1 / span 2; }
  .view-player-card .view-reps { grid-column: 1 / -1; }
  .view-stat-grid { gap: 7px; }
  .view-stat-grid .view-stat { min-height: 112px; border-radius: 17px; }
  .view-stat > span:last-child { font-size: .8125rem; }
}

@media (max-width: 365px) {
  .view-stat > span:last-child { font-size: .75rem; }
  .view-result-row { grid-template-columns: 33px minmax(0,1fr) auto; gap: 7px; padding-inline: 10px; }
  .view-result-chevron { display: none; }
  .view-result-icon { width: 33px; height: 33px; }
  .view-session-clock { padding-inline: 8px; }
  .view-session-clock > span { gap: 3px; font-size: .75rem; }
  .view-player-content { column-gap: 7px; }
  .view-player-actions { gap: 5px; }
  .view-player-actions > .button-primary { gap: 5px; padding-inline: 9px; }
  .view-player-actions .view-pause-action { padding-inline: 9px; }
  .view-player-actions .view-pause-action svg { display: none; }
  .view-player-actions [data-action='view-step-done'] svg { display: none; }
  .view-player-actions .icon-button { min-width: 44px; }
  .view-paused-state { grid-template-columns: auto minmax(0,1fr); gap: 8px; }
  .view-paused-state .button { grid-column: 2; justify-self: start; }
}
