:root {
  --ink: #f2f7f1;
  --muted: #95a59b;
  --paper: #050706;
  --surface: #101611;
  --line: #26332d;
  --green: #19c884;
  --green-2: #78f0b7;
  --lime: #d8ff64;
  --orange: #ff815d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48), 0 0 42px rgba(25, 200, 132, 0.08);
  --radius: 22px;
  font-family: "PingFang SC", "Microsoft YaHei", Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 92% 4%, rgba(216, 255, 100, 0.16), transparent 29rem),
    radial-gradient(circle at 4% 28%, rgba(25, 200, 132, 0.2), transparent 25rem),
    radial-gradient(circle at 82% 78%, rgba(255, 129, 93, 0.12), transparent 23rem),
    linear-gradient(180deg, #0b100d 0%, #050706 44%, #030403 100%),
    var(--paper);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(120, 240, 183, 0.34);
  outline-offset: 2px;
}

.app-shell {
  width: min(100%, 1160px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 42px 110px;
}

.topbar {
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.sync-pill {
  max-width: 150px;
  padding: 8px 11px;
  border: 1px solid rgba(120, 240, 183, 0.24);
  border-radius: 999px;
  color: var(--green-2);
  background: rgba(12, 17, 14, 0.78);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px 6px 14px 6px;
  color: #07100b;
  background: var(--lime);
  font-size: 21px;
  font-weight: 800;
  transform: rotate(-3deg);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(16, 22, 17, 0.76);
}

.icon-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.page {
  display: none;
  animation: page-in 0.32s ease both;
}

.page.active {
  display: block;
}

.auth-screen {
  min-height: calc(100vh - 210px);
  display: grid;
  place-items: center;
  padding: 34px 0 70px;
}

.auth-screen[hidden] {
  display: none;
}

.auth-card {
  width: min(100%, 500px);
  padding: 34px;
}

.auth-card h1 {
  margin: 0;
  font-size: clamp(31px, 5vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.auth-copy,
.auth-setup,
.login-error {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.auth-copy {
  margin: 15px 0 24px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label span {
  display: block;
  margin: 0 0 8px 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.login-form .primary-button {
  width: 100%;
  margin-top: 4px;
}

.login-error {
  min-height: 22px;
  margin: 0;
  color: #ff9f87;
}

.auth-setup {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 129, 93, 0.1);
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
}

.hero {
  min-height: 280px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 46px 52px;
  border-radius: 30px;
  color: #f7fff7;
  background:
    radial-gradient(circle at 78% 20%, rgba(216, 255, 100, 0.26), transparent 18rem),
    radial-gradient(circle at 30% 110%, rgba(25, 200, 132, 0.28), transparent 19rem),
    linear-gradient(135deg, #17241c 0%, #08100c 58%, #030504 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  top: -150px;
  right: 6%;
  width: 340px;
  height: 340px;
  border: 55px solid rgba(216, 255, 100, 0.1);
  border-radius: 50%;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: var(--lime);
}

.hero h1 {
  margin: 0;
  font-size: clamp(37px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.hero h1 em {
  color: var(--lime);
  font-family: Georgia, "Songti SC", serif;
  font-weight: 400;
}

.hero-copy {
  max-width: 470px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.64);
  font-size: 14px;
  line-height: 1.7;
}

.primary-button,
.ghost-button,
.save-button,
.add-exercise-button {
  border: 0;
  border-radius: 15px;
  font-weight: 700;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 14px 18px;
  color: #031008;
  background: linear-gradient(135deg, var(--lime), var(--green));
}

.hero-button {
  z-index: 1;
  flex: none;
  min-width: 154px;
  color: #031008;
  background: rgba(216, 255, 100, 0.92);
}

.primary-button.small {
  padding: 11px 15px;
  font-size: 13px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.stat-card {
  min-height: 142px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: center;
  padding: 25px 28px;
  border: 1px solid rgba(120, 240, 183, 0.16);
  border-radius: var(--radius);
  background: rgba(16, 22, 17, 0.78);
  backdrop-filter: blur(16px);
}

.stat-card span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  margin-top: 8px;
  font-family: Georgia, serif;
  font-size: clamp(33px, 5vw, 48px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat-card small {
  align-self: end;
  margin: 0 0 4px 10px;
  color: var(--muted);
}

.stat-card.accent {
  border-color: rgba(216, 255, 100, 0.72);
  background: linear-gradient(135deg, var(--lime), #8dffbd);
  color: #07100b;
}

.stat-card.accent span,
.stat-card.accent small {
  color: #233318;
}

.panel {
  border: 1px solid rgba(120, 240, 183, 0.16);
  border-radius: var(--radius);
  background: rgba(16, 22, 17, 0.82);
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px);
}

.chart-panel,
.recent-panel {
  margin-top: 16px;
  padding: 30px;
}

.section-heading,
.page-heading,
.exercise-header,
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.section-heading h2,
.exercise-header h2,
.dialog-heading h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.04em;
}

.compact-select {
  max-width: 190px;
  padding: 9px 34px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
}

.chart-actions,
.page-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.chart-actions .text-button:disabled {
  color: #526058;
  cursor: not-allowed;
}

.segmented-control {
  display: inline-flex;
  gap: 4px;
  margin-top: 22px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(4, 7, 5, 0.86);
}

.segmented-control button {
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.segmented-control button.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.chart-wrap {
  height: 290px;
  position: relative;
  margin-top: 18px;
}

#trendChart,
#detailTrendChart {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  align-content: center;
  color: var(--muted);
  text-align: center;
}

.chart-empty.show {
  display: grid;
}

.chart-empty span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--green);
  background: rgba(216, 255, 100, 0.16);
  font-size: 22px;
}

.chart-empty p {
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.6;
}

.text-button,
.ghost-button {
  border: 0;
  color: var(--green-2);
  background: transparent;
  font-size: 13px;
}

.session-list {
  margin-top: 22px;
}

.empty-state {
  padding: 30px 18px;
  border: 1px dashed var(--line);
  border-radius: 15px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.session-row {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 17px 0;
  border-top: 1px solid var(--line);
}

.session-row:first-child {
  border-top: 0;
}

.session-date {
  color: var(--muted);
  font-size: 12px;
}

.session-date strong {
  display: block;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 26px;
}

.session-main strong,
.session-main small {
  display: block;
}

.session-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.inline-exercise-link {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
}

.inline-exercise-link:hover {
  color: var(--green-2);
}

.session-main small,
.session-volume {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.session-volume {
  text-align: right;
}

.session-volume strong {
  display: block;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 19px;
}

.page-heading {
  margin: 32px 0 24px;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 48px);
  letter-spacing: -0.055em;
}

.session-meta {
  display: grid;
  grid-template-columns: minmax(180px, 0.38fr) 1fr;
  gap: 18px;
  padding: 22px;
}

.session-meta label span,
.field-label {
  display: block;
  margin: 0 0 8px 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
}

input {
  padding: 13px 14px;
}

input::placeholder {
  color: #647068;
}

.exercise-header {
  margin: 36px 4px 16px;
}

.exercise-header > span {
  color: var(--muted);
  font-size: 12px;
}

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

.exercise-card {
  padding: 22px;
}

.exercise-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.exercise-card-heading h3 {
  margin: 0;
  font-size: 17px;
}

.exercise-index {
  display: inline-grid;
  width: 28px;
  height: 28px;
  margin-right: 9px;
  place-items: center;
  border-radius: 9px;
  color: var(--green);
  background: rgba(216, 255, 100, 0.15);
  font-family: Georgia, serif;
}

.remove-exercise {
  border: 0;
  color: #ff9f87;
  background: transparent;
  font-size: 12px;
}

.sets-table {
  margin-top: 20px;
}

.set-row {
  display: grid;
  grid-template-columns: 42px 1fr 1fr 36px;
  gap: 10px;
  align-items: end;
  margin-top: 10px;
}

.set-row.header {
  align-items: center;
  margin-top: 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.set-number {
  align-self: center;
  text-align: center;
  color: var(--muted);
  font-family: Georgia, serif;
  font-weight: 700;
}

.number-field {
  position: relative;
}

.number-field input {
  padding-right: 39px;
  text-align: center;
  font-weight: 700;
}

.number-field span {
  position: absolute;
  right: 11px;
  bottom: 14px;
  color: var(--muted);
  font-size: 10px;
  pointer-events: none;
}

.remove-set {
  width: 34px;
  height: 44px;
  border: 0;
  color: #6f7a72;
  background: transparent;
  font-size: 20px;
}

.add-set-button {
  margin: 16px 0 0 51px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--green);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.add-exercise-button {
  width: 100%;
  margin-top: 14px;
  padding: 19px;
  border: 1px dashed rgba(120, 240, 183, 0.32);
  color: var(--green);
  background: rgba(16, 22, 17, 0.48);
}

.add-exercise-button span {
  margin-right: 7px;
}

.save-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 26px;
  padding: 17px 20px;
  color: #031008;
  background: linear-gradient(135deg, var(--green), var(--lime));
}

.save-button small {
  color: rgba(3, 16, 8, 0.68);
  font-weight: 400;
}

.history-toolbar {
  margin-bottom: 18px;
}

.search-box {
  width: min(100%, 380px);
  position: relative;
  display: block;
}

.search-box svg {
  width: 18px;
  position: absolute;
  top: 13px;
  left: 14px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
}

.search-box input {
  padding-left: 42px;
}

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

.history-card {
  padding: 22px;
}

.history-card-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.history-date {
  margin: 0 0 6px;
  color: var(--green-2);
  font-size: 12px;
  font-weight: 700;
}

.history-card h3 {
  margin: 0;
  font-size: 18px;
}

.history-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.history-actions {
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

.history-actions button {
  padding: 7px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.history-actions .delete-session {
  color: #ff9f87;
}

.history-metrics {
  display: flex;
  gap: 22px;
  margin-top: 18px;
  padding: 14px 0;
  border-block: 1px solid var(--line);
}

.history-metrics span {
  color: var(--muted);
  font-size: 11px;
}

.history-metrics strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 18px;
}

.history-exercises {
  display: grid;
  gap: 10px;
  margin-top: 15px;
}

.history-exercise {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) 1fr;
  gap: 16px;
  font-size: 12px;
}

.history-exercise strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-exercise span {
  color: var(--muted);
}

.history-pr-mark {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #07100b;
  background: var(--lime);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.detail-stat-grid {
  grid-template-columns: repeat(4, 1fr);
}

.detail-panel {
  margin-top: 16px;
  padding: 26px;
}

.record-list,
.detail-history-list,
.template-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.record-row,
.detail-history-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.record-row span,
.detail-history-row span,
.record-row small {
  color: var(--muted);
  font-size: 12px;
}

.record-row strong {
  font-family: Georgia, serif;
  font-size: 22px;
}

.detail-history-row {
  grid-template-columns: 1fr auto;
}

.detail-history-row strong,
.detail-history-row span {
  display: block;
}

.detail-history-row strong {
  margin-bottom: 4px;
}

.detail-latest {
  margin: 20px 0 0;
  color: var(--green-2);
  font-size: 12px;
  font-weight: 700;
}

.pr-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.pr-badges span {
  padding: 3px 7px;
  border-radius: 999px;
  color: #07100b;
  background: var(--lime);
  font-size: 10px;
  font-weight: 800;
}

.template-dialog-card {
  width: min(720px, calc(100vw - 28px));
}

.template-save-current {
  width: 100%;
}

.template-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(4, 7, 5, 0.42);
}

.template-card label span {
  display: block;
  margin: 0 0 7px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.template-card-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

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

.delete-template {
  padding: 10px;
  border: 0;
  color: #ff9f87;
  background: transparent;
  font-size: 12px;
}

.template-exercise-list {
  display: grid;
  gap: 8px;
}

.template-exercise-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 78px 32px 32px 32px;
  align-items: end;
  gap: 8px;
}

.template-exercise-row strong {
  align-self: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-exercise-row input {
  padding: 10px 8px;
  text-align: center;
}

.template-exercise-row button {
  width: 32px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface);
}

.template-exercise-row button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.bottom-nav {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 18px;
  width: min(calc(100% - 32px), 390px);
  height: 68px;
  display: grid;
  grid-template-columns: 1fr 76px 1fr;
  align-items: center;
  padding: 8px 18px;
  border: 1px solid rgba(120, 240, 183, 0.18);
  border-radius: 24px;
  background: rgba(9, 13, 10, 0.84);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
}

.bottom-nav button {
  height: 50px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border: 0;
  color: #78847c;
  background: transparent;
  font-size: 10px;
}

.bottom-nav button.active {
  color: var(--green);
}

.bottom-nav svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.bottom-nav .record-nav {
  width: 58px;
  height: 58px;
  place-self: center;
  border-radius: 19px;
  color: #041008;
  background: linear-gradient(135deg, var(--lime), var(--green));
  box-shadow: 0 10px 28px rgba(25, 200, 132, 0.34);
  font-size: 28px;
}

dialog {
  width: min(calc(100% - 28px), 520px);
  max-height: min(720px, calc(100vh - 40px));
  padding: 0;
  border: 0;
  border-radius: 24px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.62);
}

dialog::backdrop {
  background: rgba(2, 4, 3, 0.68);
  backdrop-filter: blur(4px);
}

.dialog-card {
  padding: 26px;
}

.close-button {
  border: 0;
  font-size: 22px;
}

.dialog-search {
  width: 100%;
  margin-top: 24px;
}

.exercise-options {
  max-height: 390px;
  overflow-y: auto;
  margin-top: 14px;
}

.option-group-title {
  margin: 18px 5px 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.exercise-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 10px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.exercise-option:first-of-type {
  border-top: 0;
}

.exercise-option span {
  color: var(--green-2);
  font-size: 18px;
}

.add-custom-button {
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  border: 1px dashed var(--green-2);
  border-radius: 12px;
  color: var(--green);
  background: transparent;
}

.dialog-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.sync-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(4, 7, 5, 0.42);
}

.sync-summary span,
.sync-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.sync-summary span {
  color: var(--muted);
}

.sync-summary strong {
  color: var(--green);
}

.data-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.data-actions .ghost-button {
  display: grid;
  place-items: center;
  padding: 13px;
  border: 1px solid var(--line);
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.danger-zone strong,
.danger-zone small {
  display: block;
}

.danger-zone small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.danger-zone button {
  padding: 9px 12px;
  border: 1px solid rgba(255, 129, 93, 0.36);
  border-radius: 10px;
  color: #ff9f87;
  background: rgba(255, 129, 93, 0.1);
  font-size: 12px;
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 104px;
  max-width: calc(100% - 36px);
  padding: 11px 17px;
  border-radius: 12px;
  color: #031008;
  background: var(--lime);
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 700px) {
  .app-shell {
    padding: 0 16px 105px;
  }

  .topbar {
    height: 76px;
  }

  .sync-pill {
    max-width: 96px;
  }

  .topbar-actions {
    gap: 5px;
  }

  .hero {
    min-height: 335px;
    display: block;
    padding: 34px 27px;
    border-radius: 25px;
  }

  .hero-copy {
    margin-top: 14px;
  }

  .hero-button {
    position: absolute;
    bottom: 28px;
    left: 27px;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-card {
    min-height: 120px;
    padding: 20px;
  }

  .stat-card:first-child {
    grid-column: 1 / -1;
  }

  .chart-panel,
  .recent-panel {
    padding: 22px 18px;
  }

  .chart-wrap {
    height: 235px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .chart-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
  }

  .compact-select {
    max-width: 145px;
  }

  .segmented-control {
    width: 100%;
  }

  .segmented-control button {
    flex: 1;
    padding-inline: 6px;
  }

  .session-meta {
    grid-template-columns: 1fr;
  }

  .exercise-card {
    padding: 18px 13px;
  }

  .set-row {
    grid-template-columns: 32px 1fr 1fr 28px;
    gap: 6px;
  }

  .number-field input {
    padding-inline: 7px 28px;
  }

  .number-field span {
    right: 7px;
  }

  .add-set-button {
    margin-left: 38px;
  }

  .save-button small {
    display: none;
  }

  .history-card {
    padding: 19px 16px;
  }

  .history-exercise {
    grid-template-columns: 100px 1fr;
    gap: 10px;
  }

  .detail-stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .detail-panel {
    padding: 22px 18px;
  }

  .record-row {
    grid-template-columns: 1fr auto;
  }

  .record-row small {
    grid-column: 1 / -1;
  }

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

  .template-card-actions {
    justify-content: space-between;
  }

  .template-exercise-row {
    grid-template-columns: 1fr 62px 28px 28px 28px;
    gap: 6px;
  }

  .template-exercise-row button {
    width: 28px;
  }

  .data-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 400px) {
  .brand small {
    display: none;
  }

  .sync-pill {
    display: none;
  }

  .hero h1 {
    font-size: 37px;
  }

  .session-row {
    grid-template-columns: 54px 1fr;
    gap: 12px;
  }

  .session-volume {
    display: none;
  }

  .page-heading {
    margin-top: 18px;
  }

  .page-actions {
    gap: 3px;
  }

  .detail-stat-grid {
    grid-template-columns: 1fr;
  }

  .template-exercise-row {
    grid-template-columns: 1fr 58px 26px 26px 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
