/* ThoeneFit. Dark rubber-floor base, chalk-white type, bumper-plate colours used
   only where they mean something: blue = next up, green = done, yellow = warm-up,
   red = destructive. */

:root {
  --bg: #12151a;
  --surface: #1b2027;
  --raised: #262d37;
  --line: #3b4553;
  --chalk: #f4f2ec;
  --muted: #a6afbb;
  --blue: #5aa2ff;
  --green: #3dd68c;
  --mint: #3af29c;
  --yellow: #f5c63c;
  --red: #ff6b5e;
  --ink: #0e1115;
  --display: "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Segoe UI", system-ui, sans-serif;
  --tabs-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--chalk);
  font: 400 16px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  padding-bottom: calc(var(--tabs-h) + var(--safe-b));
}

body.resting {
  padding-bottom: calc(var(--tabs-h) + var(--safe-b) + 84px);
}

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd,
figure,
fieldset {
  margin: 0;
  padding: 0;
}

ol,
ul {
  list-style: none;
}

fieldset {
  border: 0;
  min-width: 0;
}

h1 {
  font: 700 32px/1.1 var(--display);
  letter-spacing: 0.01em;
}

h2 {
  font: 700 21px/1.2 var(--display);
  letter-spacing: 0.01em;
}

h3 {
  font: 600 16px/1.3 var(--body);
}

a {
  color: var(--blue);
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

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

.small {
  font-size: 14px;
}

.center {
  text-align: center;
}

.pad {
  padding: 24px 0;
}

.icon {
  display: inline-flex;
  flex: none;
}

/* ---- layout ---- */

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.page.narrow {
  max-width: 400px;
  padding-top: 18vh;
}

.page.has-bar {
  padding-bottom: 96px;
}

.page-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stack.loading {
  opacity: 0.45;
}

.section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.card {
  background: var(--surface);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.splash {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
}

.brand-mark {
  width: 96px;
  height: 96px;
}

/* Wide logo: drawn for dark backgrounds, so it sits straight on the page. */
.brand-wide {
  display: block;
  width: min(220px, 62%);
  height: auto;
  margin: 14px auto 6px;
}

.brand-wide.lead {
  width: min(300px, 88%);
  margin: 0 auto 14px;
}

.brand-wide.small {
  width: 170px;
  margin: 0 0 2px -2px;
}


.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin: -8px 0 -10px -6px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.notice {
  background: var(--raised);
  border-left: 4px solid var(--yellow);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
}

/* ---- buttons ---- */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 18px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--raised);
  color: var(--chalk);
  font: 600 17px/1 var(--body);
  text-decoration: none;
  cursor: pointer;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn.primary {
  background: var(--chalk);
  border-color: var(--chalk);
  color: var(--ink);
  font-weight: 700;
}

.btn.danger {
  border-color: var(--red);
  color: var(--red);
  background: transparent;
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn.block {
  width: 100%;
}

.btn.grow {
  flex: 1;
}

.btn.small {
  min-height: 44px;
  padding: 0 14px;
  font-size: 15px;
  border-radius: 10px;
}

.btn.square {
  width: 52px;
  padding: 0;
  flex: none;
}

.btn[aria-pressed="true"] {
  border-color: var(--blue);
  color: var(--blue);
}

/* ---- forms ---- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.field-hint {
  font-size: 14px;
  color: var(--muted);
}

input[type="text"],
input[type="password"],
input[type="search"],
select,
textarea {
  appearance: none;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--raised);
  color: var(--chalk);
  font: 400 17px/1.3 var(--body);
}

select {
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--blue);
}

.form-error {
  color: var(--red);
  min-height: 1.4em;
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.choice {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 56px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--raised);
  color: var(--chalk);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.choice-label {
  font-weight: 600;
}

.choice-hint {
  font-size: 13px;
  color: var(--muted);
}

.choice[aria-pressed="true"] {
  border-color: var(--chalk);
  background: var(--chalk);
  color: var(--ink);
}

.choice[aria-pressed="true"] .choice-hint {
  color: #3d4652;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stepper-value {
  flex: 1;
  text-align: center;
  font: 700 24px/1 var(--display);
  font-variant-numeric: tabular-nums;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  appearance: none;
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid var(--line);
  border-radius: 22px;
  background: transparent;
  color: var(--chalk);
  font: 600 15px/1 var(--body);
  cursor: pointer;
}

.checks {
  display: grid;
  gap: 2px;
}

.checks legend {
  font: 700 17px/1.2 var(--display);
  padding: 10px 0 6px;
}

.checks.tight {
  grid-template-columns: 1fr 1fr;
}

.check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  cursor: pointer;
}

.check input {
  appearance: none;
  flex: none;
  width: 26px;
  height: 26px;
  border: 2px solid var(--line);
  border-radius: 7px;
  background: var(--raised);
}

.check input:checked {
  border-color: var(--green);
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230e1115' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 18px no-repeat;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.filters {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 8px;
}

/* ---- today ---- */

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.controls .field:last-child {
  grid-column: 1 / -1;
}

.summary {
  font: 700 19px/1.2 var(--display);
}

.plan {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-row {
  background: var(--surface);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.plan-main h3 {
  font: 700 20px/1.2 var(--display);
}

/* Exercise names on Today and in a workout open that exercise's history. */
.name-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: -10px 0 -4px;
  color: var(--chalk);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.name-link .icon {
  color: var(--blue);
}

/* Today in mint, like Settings: the heading and the planned exercise names.
   The in-progress workout keeps white names, so green stays "done" there. */
.tab-home > h1,
.today-head h1,
.plan-row .name-link,
.plan-row .name-link .icon {
  color: var(--mint);
}

.plan-row .name-link {
  text-decoration-color: rgba(58, 242, 156, 0.35);
}

.target {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.last {
  color: var(--muted);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.why {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.plan-actions {
  display: flex;
  gap: 8px;
}

.fold summary,
.why-fold summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 600;
}

.why-fold summary {
  min-height: 36px;
  font-size: 14px;
  color: var(--blue);
}

.meters {
  display: grid;
  gap: 8px;
}

.meter {
  display: grid;
  grid-template-columns: 96px 1fr 44px 62px;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.meter-track {
  height: 8px;
  border-radius: 4px;
  background: var(--raised);
  overflow: hidden;
}

.meter-fill {
  display: block;
  height: 100%;
  background: var(--green);
}

.meter-track.low .meter-fill {
  background: var(--yellow);
}

.meter-num {
  text-align: right;
}

.meter-sets {
  color: var(--muted);
  text-align: right;
}

.action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--tabs-h) + var(--safe-b));
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
  max-width: 560px;
  margin: 0 auto;
}

/* ---- active workout ---- */

.workout-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin: calc(-18px - env(safe-area-inset-top, 0px)) -16px 0;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.workout-head h1 {
  font-size: 26px;
}

.workout-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.elapsed {
  font: 700 24px/1 var(--display);
  font-variant-numeric: tabular-nums;
}

.sync {
  font-size: 13px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
  background: var(--raised);
  color: var(--green);
}

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

.sync.pending {
  color: var(--ink);
  background: var(--yellow);
}

.lift {
  gap: 8px;
  padding: 14px 12px 12px;
}

.lift-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 0 4px;
}

.lift.complete h2::after {
  content: " ✓";
  color: var(--green);
}

.set-head,
.set {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 14px minmax(0, 1fr) 60px;
  align-items: center;
  gap: 8px;
}

.set-head {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  padding-top: 2px;
}

.sets {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.set {
  border-radius: 14px;
}

/* Cardio (#18): minutes, distance and level instead of weight × reps. */
.set-head.cardio,
.set.cardio {
  grid-template-columns: 28px repeat(3, minmax(0, 1fr)) 60px;
  gap: 6px;
}

.set.cardio .set-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  font-size: 18px;
  cursor: default;
}

.set.cardio input.num {
  font-size: 24px;
}

.set-tag {
  appearance: none;
  width: 44px;
  height: 60px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: 700 22px/1 var(--display);
  cursor: pointer;
}

.set.warm .set-tag {
  color: var(--yellow);
}

/* Someone else's workout (#13): the sets as plain lines, nothing to edit. */
.sets.read-only {
  gap: 2px;
}

.set-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 18px/1.3 var(--display);
  font-variant-numeric: tabular-nums;
}

.set-line .set-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 36px;
  font-size: 18px;
  cursor: default;
}

.set-line.warm .set-tag {
  color: var(--yellow);
}

input.num {
  min-height: 60px;
  padding: 0 4px;
  text-align: center;
  font: 700 28px/1 var(--display);
  font-variant-numeric: tabular-nums;
}

input.num::placeholder {
  color: #6f7a88;
  font-weight: 600;
  font-size: 20px;
}

.times {
  color: var(--muted);
  text-align: center;
}

.set.next input.num {
  border-color: var(--blue);
}

.set.next .set-tag {
  color: var(--blue);
}

.set.done input.num {
  background: transparent;
  border-color: transparent;
  color: var(--green);
}

/* The complete-set control is drawn as a weight plate: outer rim, inner hub. */
.plate {
  appearance: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid var(--line);
  background: var(--raised);
  box-shadow: inset 0 0 0 7px var(--surface), inset 0 0 0 9px var(--line);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.set.next .plate {
  border-color: var(--chalk);
  box-shadow: inset 0 0 0 7px var(--surface), inset 0 0 0 9px var(--chalk);
  color: var(--chalk);
}

.plate[aria-pressed="true"] {
  border-color: var(--green);
  background: var(--green);
  box-shadow: none;
  color: var(--ink);
}

.set-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.finish {
  margin-top: 8px;
}

.routine-note {
  border-left-color: var(--mint);
}

.routine-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.routine-row > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.share-card {
  border: 2px solid var(--green);
}

.shared-note {
  border-left-color: var(--green);
}

.share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.share-row > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.share-status.accepted,
.share-status.started {
  color: var(--green);
}

.install-card {
  border: 2px solid var(--blue);
}

.install-card .btn.ghost {
  align-self: flex-start;
  padding-left: 0;
}

.resume {
  border: 2px solid var(--blue);
}

.cues {
  line-height: 1.55;
}

/* ---- rest timer ---- */

.rest {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--tabs-h) + var(--safe-b));
  z-index: 8;
  background: var(--raised);
  border-top: 1px solid var(--line);
}

.rest[hidden] {
  display: none;
}

.rest-bar {
  height: 6px;
  background: var(--line);
}

.rest-bar span {
  display: block;
  height: 100%;
  background: var(--blue);
}

.rest.over .rest-bar span {
  background: var(--green);
}

.rest-row {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 16px;
}

.rest-label {
  color: var(--muted);
  font-weight: 600;
}

.rest-time {
  flex: 1;
  font: 700 34px/1 var(--display);
  font-variant-numeric: tabular-nums;
}

.rest.over .rest-time {
  color: var(--green);
}

/* ---- lists ---- */

.log {
  display: flex;
  flex-direction: column;
}

.log li + li {
  border-top: 1px solid var(--line);
}

.log-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 13px 2px;
  min-height: 56px;
  justify-content: center;
  color: var(--chalk);
  text-decoration: none;
}

/* Manage users (#21): actions sit under each account. */
.account-row .plan-actions {
  flex-wrap: wrap;
  margin-top: 8px;
}

.log-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.log-title {
  font: 700 19px/1.25 var(--display);
  font-variant-numeric: tabular-nums;
}

.log-meta,
.log-names {
  font-size: 14px;
  color: var(--muted);
}

.map-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
}

input[type="file"] {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: var(--raised);
  color: var(--chalk);
  font: 400 16px/1.3 var(--body);
}

.list-head {
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font: 700 19px/1.2 var(--display);
  color: var(--muted);
}

.badge.alert {
  background: var(--yellow);
  color: var(--ink);
}

.request h3 {
  font: 700 19px/1.2 var(--display);
}

/* The request form is taller than sign-in, so it starts nearer the top. */
.page.narrow.request-page {
  padding-top: 8vh;
}

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--raised);
  color: var(--muted);
  font: 600 12px/1.4 var(--body);
  vertical-align: middle;
}

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
}

.facts dt {
  color: var(--muted);
  font-size: 14px;
}

.steps {
  list-style: decimal;
  padding-left: 22px;
  display: grid;
  gap: 6px;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
  background: var(--surface);
  border-radius: 12px;
  /* Vertical swipes still scroll the page; sideways drags move along the line. */
  touch-action: pan-y;
  cursor: crosshair;
}

.chart svg:focus {
  outline: none; /* tapping focuses the chart; only keyboard focus shows a ring */
}

.chart svg:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.chart .guide {
  stroke: var(--line);
  stroke-width: 1.5;
}

.chart .sel {
  fill: var(--mint);
  stroke: var(--bg);
  stroke-width: 2;
}

/* Date range for exercise history: one compact row. */
.range .choice {
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
}

.range .choice-label {
  font-size: 15px;
  white-space: nowrap;
}

/* Details for the point you tapped, above the chart. Its height is fixed per chart
   (--readout-rows is set by lineChart), so the chart never moves while you scrub (#75). */
.chart-readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-sizing: content-box;
  height: calc(var(--readout-rows, 2) * 19px);
  padding-bottom: 8px;
  overflow: hidden;
  line-height: 19px;
}

.chart-readout-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 14px;
  line-height: 19px;
  font-variant-numeric: tabular-nums;
}

.chart-readout-text strong {
  font-size: 15px;
}

.chart-readout-text > * {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--clamp, 1);
  line-clamp: var(--clamp, 1);
  overflow: hidden;
  min-height: calc(var(--clamp, 1) * 19px); /* each line keeps its place, too */
  overflow-wrap: anywhere;
}

.chart-readout .btn {
  flex: none;
}

/* Underlined so it reads as a link (#19). */
.trend-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.chart path {
  fill: none;
  stroke: var(--chalk);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart.dense path {
  stroke-width: 1.6;
}

.chart circle.dot {
  fill: var(--chalk);
}

.chart circle.dot.latest {
  fill: var(--blue);
}

.chart figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---- tab bar ---- */

.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  height: calc(var(--tabs-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 30px;
  border-radius: 999px;
  transition: background-color 0.15s ease;
}

/* The selected tab (#111): a mint pill behind the icon and a bolder mint label,
   so it reads at a glance rather than by colour alone. */
.tab[aria-current="page"] {
  color: var(--mint);
  font-weight: 700;
}

.tab[aria-current="page"] .tab-icon {
  background: rgba(58, 242, 156, 0.18);
}

/* During a workout the Today spot is Pause / Play (#111). */
.pause-tab {
  appearance: none;
  border: 0;
  background: none;
  font-family: inherit;
  cursor: pointer;
  color: var(--mint);
}

.pause-tab .tab-icon {
  background: rgba(58, 242, 156, 0.10);
  box-shadow: inset 0 0 0 1.5px rgba(58, 242, 156, 0.45);
}

.pause-tab.paused {
  color: var(--yellow);
}

.pause-tab.paused .tab-icon,
.pause-tab.paused[aria-current="page"] .tab-icon {
  background: var(--yellow);
  color: var(--ink);
  box-shadow: none;
}

.pause-tab:active .tab-icon {
  transform: scale(0.94);
}

/* The Workout tab on other tabs: mint with a slow pulse while a workout is
   running, so it is clear one is going. Yellow and still while paused. */
.workout-tab {
  color: var(--mint);
}

.workout-tab .tab-icon {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px rgba(58, 242, 156, 0.45);
  animation: workout-pulse 2s ease-out infinite;
}

.workout-tab.paused {
  color: var(--yellow);
}

.workout-tab.paused .tab-icon {
  box-shadow: inset 0 0 0 1.5px rgba(245, 198, 60, 0.5);
  animation: none;
}

@keyframes workout-pulse {
  0% {
    box-shadow: inset 0 0 0 1.5px rgba(58, 242, 156, 0.45), 0 0 0 0 rgba(58, 242, 156, 0.55);
  }
  70% {
    box-shadow: inset 0 0 0 1.5px rgba(58, 242, 156, 0.45), 0 0 0 9px rgba(58, 242, 156, 0);
  }
  100% {
    box-shadow: inset 0 0 0 1.5px rgba(58, 242, 156, 0.45), 0 0 0 0 rgba(58, 242, 156, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .workout-tab .tab-icon {
    animation: none;
  }
}

/* On other tabs during a workout: the way back to it. */
.back-to-workout {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: #16352a;
  box-shadow: inset 0 0 0 1px rgba(58, 242, 156, 0.4), 0 6px 18px rgba(0, 0, 0, 0.35);
  color: var(--chalk);
  text-decoration: none;
}

.back-to-workout.paused {
  background: #3a3216;
  box-shadow: inset 0 0 0 1px rgba(245, 198, 60, 0.5), 0 6px 18px rgba(0, 0, 0, 0.35);
}

.btw-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 14px;
}

.btw-label strong {
  font: 700 17px/1.2 var(--display);
}

.btw-label > span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.back-to-workout.paused .btw-label > span {
  color: var(--yellow);
  font-weight: 600;
}

.btw-go {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  color: var(--mint);
  font-weight: 700;
}

.btw-go .icon {
  transform: rotate(180deg);
}

/* The workout screen while paused. */
.paused-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #3a3216;
  box-shadow: inset 0 0 0 1px rgba(245, 198, 60, 0.5);
}

.paused-banner > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.paused-banner strong {
  color: var(--yellow);
  font: 700 19px/1.2 var(--display);
}

.paused-banner .btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.elapsed.paused {
  color: var(--yellow);
}

/* ---- sheets and toasts ---- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(6, 8, 11, 0.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-panel {
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  padding-bottom: var(--safe-b);
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 8px 6px 18px;
}

.sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 18px 20px;
}

.pick {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  min-height: 56px;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--raised);
  color: var(--chalk);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.pick:disabled {
  opacity: 0.5;
}

.pick-name {
  font: 700 18px/1.2 var(--display);
}

.pick-meta {
  font-size: 14px;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--tabs-h) + var(--safe-b) + 100px);
  z-index: 40;
  max-width: 528px;
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--chalk);
  color: var(--ink);
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.toast.show {
  opacity: 1;
}

.toast.bad {
  background: var(--red);
}

.toast.show.tappable {
  pointer-events: auto;
  cursor: pointer;
}

/* Settings: the version opens the release notes. */
.app-version a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* What's new */
ul.notes {
  list-style: disc;
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ---- Settings (#103) ----------------------------------------------------
   Mint headings so each section is easy to find while scrolling on a phone,
   and setup or maintenance tucked behind one-line links to their own screens. */
.settings-main > h1,
.settings-main .section > h2 {
  color: var(--mint);
}

.settings-main .section {
  gap: 12px;
  padding-top: 22px;
}

.settings-main .section > h2 {
  font-size: 22px;
}

/* A group of links reads as one card, with a chevron on every row. */
.link-list {
  background: var(--surface);
  border-radius: 14px;
  padding: 0 14px;
}

.link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  padding: 12px 0;
}

.link-row .log-title {
  font-size: 18px;
}

.link-row .log-meta {
  grid-column: 1;
}

.link-row .chevron {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  color: var(--muted);
  transform: rotate(180deg);
}

.link-row:active {
  opacity: 0.7;
}

.install-help > h3 {
  margin-top: 6px;
}

.add-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--mint);
}

.link-row .badge.alert {
  background: var(--yellow);
}

/* ---- Feedback (#20) ---------------------------------------------------- */
.feedback-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 2px;
}

.feedback-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.feedback-head .log-title {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.feedback-row .log-meta a {
  color: var(--muted);
}

.status-pill {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--raised);
  color: var(--chalk);
  font: 600 13px/1.4 var(--body);
}

.status-pill.done {
  background: var(--mint);
  color: var(--ink);
}

.status-pill.closed {
  background: transparent;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
}

.public-note {
  text-align: center;
}
