/* PersonalFit — Graphite & Vermilion. Dark is the default theme. */

:root, :root[data-theme="dark"] {
  --bg: #0E1012;
  --surface: #1A1D21;
  --surface-2: #262A30;
  --pressed: #30353C;
  --track-off: #676E78;
  --seg-on: #5C6470;
  --separator: rgba(255, 255, 255, 0.09);
  --text: #F3F4F6;
  --text-2: #A2A8B2;
  --text-3: #8C939D;
  --main: #3B424C;
  --on-main: #F3F4F6;
  --main-ink: #B4BCC8;
  --accent: #FF5A3A;
  --on-accent: #1C0500;
  --accent-ink: #FF7358;
  --scrim: rgba(0, 0, 0, 0.55);
  --shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #FFFFFF;
  --surface: #F1F2F4;
  --surface-2: #E4E6EA;
  --pressed: #D8DBE0;
  --track-off: #828993;
  --seg-on: #2C3139;
  --separator: rgba(17, 19, 23, 0.1);
  --text: #111317;
  --text-2: #565C66;
  --text-3: #5A616B;
  --main: #2C3139;
  --on-main: #FFFFFF;
  --main-ink: #2C3139;
  --accent: #D83414;
  --on-accent: #FFFFFF;
  --accent-ink: #B8290C;
  --scrim: rgba(17, 19, 23, 0.35);
  --shadow: 0 -8px 32px rgba(17, 19, 23, 0.14);
  color-scheme: light;
}

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 12px;
  --gutter: 16px;
  --tabbar-h: 50px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.35 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
input, button, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--main-ink); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */

main {
  padding: calc(var(--safe-top) + 8px) 0 calc(var(--tabbar-h) + var(--safe-bottom) + 32px);
  max-width: 560px;
  margin: 0 auto;
}
.tab { padding: 0 var(--gutter); }

.large-title {
  font-size: 34px;
  line-height: 41px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 6px 0 12px;
}
.section-title {
  font-size: 20px;
  line-height: 25px;
  font-weight: 600;
  margin: 32px 0 10px;
}
.subtle { color: var(--text-2); }
.footnote { font-size: 13px; line-height: 18px; color: var(--text-2); margin: 8px 4px 0; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
}

.setup-note { display: grid; gap: 12px; margin: 0 0 20px; }
.setup-note p { margin: 0; font-size: 15px; line-height: 21px; color: var(--text-2); }
.confirm-profile { display: grid; gap: 8px; margin-top: 12px; }
.confirm-profile .footnote { margin: 0 4px; }

/* ---------- Hero numbers ---------- */

.hero { margin: 0 0 16px; }
.hero .label { font-size: 15px; color: var(--text-2); }
.hero .value {
  font-size: 56px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.hero .value .u { font-size: 22px; font-weight: 600; color: var(--text-2); margin-left: 6px; letter-spacing: 0; }
.hero .value.idle { color: var(--text-3); }
.hero .sub { font-size: 15px; color: var(--text-2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.hero .sub b { color: var(--text); font-weight: 600; }

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

.entry { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.entry-row { display: flex; gap: 10px; align-items: stretch; }
.num-field {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 0 14px;
  min-height: 52px;
}
.num-field input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 28px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 8px 0;
  align-self: center;
}
.num-field input::placeholder { color: var(--text-3); }
.num-field .unit { color: var(--text-2); font-size: 17px; align-self: center; }
.num-field:focus-within { box-shadow: inset 0 0 0 2px var(--main-ink); }

.date-field { flex: 0 0 auto; display: flex; }
.date-field input, .field-input {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 10px;
  background: var(--surface-2);
  min-height: 52px;
  padding: 0 12px;
  font-size: 17px;
  color: var(--text);
  outline: none;
}
.date-field input { min-width: 138px; text-align: center; }
.date-field input::-webkit-date-and-time-value { text-align: center; }
.date-field input:focus-visible, .field-input:focus-visible { box-shadow: inset 0 0 0 2px var(--main-ink); }
.field-input::placeholder { color: var(--text-3); }

.hint { margin: -2px 2px 0; font-size: 13px; line-height: 18px; color: var(--text-2); min-height: 0; }
.hint:empty { display: none; }
.hint.error { color: var(--text); font-weight: 500; display: flex; align-items: flex-start; gap: 6px; }
.hint .warn { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }

.past-note { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px 2px -6px; font-size: 15px; color: var(--text-2); }
.past-note b { color: var(--text); font-weight: 600; }
.past-note .btn.quiet { font-size: 15px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text);
  transition: transform 90ms var(--ease), filter 90ms var(--ease);
  touch-action: manipulation;
}
.btn:active { transform: scale(0.97); filter: brightness(0.92); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.block { width: 100%; }
.btn-row { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.btn-row .btn { padding: 0 10px; }
.btn.quiet { background: transparent; color: var(--text); min-height: 44px; padding: 0 8px; }
.btn:disabled { opacity: 0.4; transform: none; filter: none; cursor: default; }

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--text);
  transition: background 90ms var(--ease);
}
.icon-btn:active { background: var(--pressed); }
.icon-btn:disabled { color: var(--text-3); opacity: 0.45; background: transparent; cursor: default; }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- Segmented control ---------- */

.seg {
  display: flex;
  background: var(--surface-2);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  flex: 1;
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
  padding: 0 12px;
  touch-action: manipulation;
}
/* Visual pill is 38pt; the tap area extends into the track padding to reach 44pt. */
.seg button { position: relative; min-width: 44px; }
.seg button::after { content: ""; position: absolute; inset: -3px 0; }
.seg button[aria-pressed="true"] { background: var(--seg-on); color: var(--on-main); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); }
.seg.compact { flex: 0 0 auto; }
.seg.compact button { flex: 0 0 auto; padding: 0 12px; }

/* ---------- Switch ---------- */

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 15px;
  cursor: pointer;
}
.toggle > span:nth-child(2) { flex: 1; }
.toggle input {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 51px;
  height: 31px;
  margin: 0;
  border-radius: 16px;
  background: var(--track-off);
  position: relative;
  transition: background 150ms var(--ease);
  cursor: pointer;
}
.toggle input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 150ms var(--ease);
}
.toggle input:checked { background: var(--main-ink); }
:root[data-theme="dark"] .toggle input:checked { background: var(--text); }
:root[data-theme="dark"] .toggle input:checked::after { background: var(--bg); box-shadow: none; }
.toggle input:checked::after { transform: translateX(20px); }

/* ---------- Lists (inset grouped) ---------- */

.list { background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.list:empty { display: none; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 17px;
  position: relative;
}
.row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  height: 1px;
  background: var(--separator);
}
button.row:active { background: var(--pressed); }
.row .main { flex: 1; min-width: 0; }
.row .main .t { display: block; }
.row .main .s { display: block; font-size: 13px; color: var(--text-2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .val { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.row .val .u { font-weight: 400; color: var(--text-2); margin-left: 3px; }
.row .chev { color: var(--text-3); width: 8px; height: 13px; flex: 0 0 auto; }
.list-more { display: flex; justify-content: center; padding: 4px 0 0; }
.empty { color: var(--text-2); font-size: 15px; line-height: 21px; margin: 0; }

/* ---------- Weight chart ---------- */

.chart-card { padding: 12px 12px 6px; }
.chart-controls { display: flex; gap: 8px; }
.chart-controls .seg:first-child { flex: 1; }
.period-nav { display: flex; align-items: center; justify-content: space-between; margin: 6px -4px 0; }
.period-label { font-size: 15px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.chart { position: relative; height: 220px; margin: 2px 0 0; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .axis { font-size: 11px; fill: var(--text-2); font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--separator); stroke-width: 1; }
.chart .series { fill: none; stroke: var(--text-2); stroke-opacity: 0.5; stroke-width: 1.5; stroke-linejoin: round; }
.chart .real { fill: var(--accent-ink); }
.chart .interp { fill: var(--surface); stroke: var(--accent-ink); stroke-width: 1.5; }
.chart .fit { fill: none; stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: 0.75; }
.chart .avg { fill: none; stroke: var(--main-ink); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .cursor { stroke: var(--text-2); stroke-width: 1; }
.chart .picked { fill: none; stroke: var(--text); stroke-width: 2; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 0 24px; color: var(--text-2); font-size: 15px; line-height: 21px; }
.chart-readout { min-height: 20px; font-size: 13px; color: var(--text-2); text-align: center; font-variant-numeric: tabular-nums; }
.toggles { border-top: 1px solid var(--separator); margin: 6px 4px 0; padding-top: 6px; }
.swatch { width: 18px; height: 0; flex: 0 0 auto; border-top: 2px solid var(--main-ink); }
.swatch.fit { border-top: 2px dashed var(--text); opacity: 0.75; }
.swatch.avg { border-top-width: 3px; border-radius: 2px; }

/* ---------- Stats row ---------- */

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--surface); border-radius: var(--radius); }
.stat { padding: 14px 12px; position: relative; }
.stat + .stat::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 1px; background: var(--separator); }
.stat .k { font-size: 13px; line-height: 16px; color: var(--text-2); }
.stat .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; letter-spacing: -0.01em; }
.stat .v .u { font-size: 13px; font-weight: 500; color: var(--text-2); margin-left: 2px; letter-spacing: 0; }
.stat .n { font-size: 12px; line-height: 16px; color: var(--text-2); margin-top: 2px; }

.card-lead { margin: 0; font-size: 15px; line-height: 21px; color: var(--text-2); }
.card-lead b { color: var(--text); font-weight: 600; }
.card-note { margin: 8px 0 0; font-size: 13px; line-height: 18px; color: var(--text-2); }
.needs { margin: 8px 0 0; padding-left: 20px; font-size: 15px; line-height: 21px; }
.needs li + li { margin-top: 4px; }

/* ---------- Key-value card ---------- */

.kv { display: grid; gap: 0; }
.kv .r { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; }
.kv .r + .r { border-top: 1px solid var(--separator); }
.kv .r .k { color: var(--text-2); font-size: 15px; }
.kv .r .v { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Bottom sheet ---------- */

dialog.sheet {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: 560px;
  max-height: calc(100% - var(--safe-top) - 24px);
  margin: 0 auto;
  padding: 0 0 calc(var(--safe-bottom) + 16px);
  border: 0;
  border-radius: 14px 14px 0 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow-y: auto;
  overscroll-behavior: contain;
}
dialog.sheet[open] { animation: sheet-up 240ms var(--ease); }
dialog.sheet::backdrop { background: var(--scrim); }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 0 16px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.sheet-head h2 { font-size: 17px; font-weight: 600; margin: 0; }
.sheet-body { padding: 8px 16px 0; display: grid; gap: 12px; }
.sheet-body p { margin: 0; }
.sheet-body .msg { font-size: 15px; line-height: 21px; color: var(--text-2); }
.sheet-actions { display: grid; gap: 8px; margin-top: 4px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--text-2); padding-left: 2px; }
.field .num-field input { font-size: 22px; }
.field .field-input { width: 100%; }

/* ---------- Tab bar ---------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: stretch;
  padding: 0 4px var(--safe-bottom);
  background: var(--bg);
  border-top: 1px solid var(--separator);
}
.tabbar button {
  flex: 1 1 0;
  min-width: 0;
  height: var(--tabbar-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  touch-action: manipulation;
}
.tabbar button[aria-current="page"] { color: var(--accent-ink); }
.tabbar .ti { width: 26px; height: 26px; display: grid; place-items: center; }
.tabbar .ti svg { width: 25px; height: 25px; }
.tabbar button.gear { flex: 0 0 48px; }
.tabbar button.gear .ti svg { width: 21px; height: 21px; }

/* ---------- Exercise ---------- */

.grow { flex: 1 1 auto; min-width: 0; display: flex; }
.grow .field-input, .grow.field { width: 100%; }
.grow.field { display: grid; }
.preview { margin: 0 2px; font-size: 15px; line-height: 20px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.preview.ready { color: var(--text); font-weight: 600; }
.row.total { min-height: 44px; color: var(--text-2); font-size: 15px; }
.row.total .val { color: var(--text); }
.big-stat { display: flex; align-items: baseline; gap: 8px; }
.big-stat .v { font-size: 40px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.big-stat .u { font-size: 15px; color: var(--text-2); }
.big-stat + .card-note { margin-top: 4px; }

/* ---------- Run plan (Exercise tab) ---------- */

.view-switch { margin: 0 0 16px; }
.rp .row { align-items: baseline; }
.rp .row .main .s { white-space: normal; overflow: visible; line-height: 18px; } /* wraps instead of "…" */
.rp .row .main .s + .t { margin-top: 6px; }
.rp-head { min-height: 0; padding-top: 10px; padding-bottom: 6px; font-size: 13px; line-height: 18px; color: var(--text-2); }
.rp-lead { flex: 0 0 44px; font-variant-numeric: tabular-nums; }
.rp-row.rest .t { color: var(--text-2); }
.rp .row.rp-track { align-items: center; padding-top: 2px; padding-bottom: 2px; }
.rp-check { flex: 1 1 0; display: grid; place-items: center; min-height: 44px; cursor: pointer; }
.rp-head .rp-check { min-height: 0; }
.card.rp-kv { padding: 4px 16px; }

/* Check circle: drawn like the on/off switch, so "done" uses the switch's on colors, never vermilion. */
.check {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin: 0;
  border: 2px solid var(--text-3);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.check:checked { background: var(--main-ink); border-color: var(--main-ink); }
.check:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 6.5px;
  width: 12px;
  height: 6.5px;
  border: solid var(--on-main);
  border-width: 0 0 2.2px 2.2px;
  transform: rotate(-45deg);
}
:root[data-theme="dark"] .check:checked { background: var(--text); border-color: var(--text); }
:root[data-theme="dark"] .check:checked::after { border-color: var(--bg); }

/* ---------- Fasting ---------- */

.fast-card { display: grid; justify-items: center; text-align: center; padding: 28px 16px 16px; gap: 6px; }
.fast-state { font-size: 15px; font-weight: 600; color: var(--text-2); }
.fast-state.on { color: var(--text); }
.timer {
  font-size: 64px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin: 2px 0 4px;
}
.timer.idle { color: var(--text-3); }
.fast-sub { margin: 0 0 12px; font-size: 15px; line-height: 21px; color: var(--text-2); max-width: 30ch; }
.start-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0 0 10px;
  padding: 0 14px;
  border: 0;
  border-radius: 22px;
  background: var(--surface-2);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.start-btn:active { background: var(--pressed); }
.start-btn .edit { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.fast-card .btn { margin-top: 4px; }
.fast-card .hint { text-align: center; }

/* ---------- Summary ---------- */

.week-card { padding: 8px 16px 6px; }
.week-card .period-nav { margin: 0 -8px 2px; }
.kv .r .k small { display: block; font-size: 12px; line-height: 16px; color: var(--text-3); margin-top: 1px; }
.kv .r .v .muted { color: var(--text-2); font-weight: 500; }
.kv .r .v.days { display: grid; gap: 2px; font-weight: 400; font-size: 15px; color: var(--text-2); }
.kv .r .v.days b { color: var(--text); font-weight: 600; margin-left: 4px; }

.cal-card { padding: 8px 10px 12px; }
.cal-card .period-nav { margin: 0 -2px 6px; }
.cal-card .seg { margin: 0 2px; }
.cal-count { margin: 10px 0 8px; text-align: center; font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.cal-count b { color: var(--text); font-weight: 600; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head span { text-align: center; font-size: 12px; color: var(--text-2); padding: 2px 0 6px; }
.cal-cell { min-height: 46px; display: flex; align-items: center; justify-content: center; }
.cal-cell.day { padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--text); }
.cal-cell.day:active { background: var(--pressed); }
.cal-cell .dn { font-size: 15px; font-variant-numeric: tabular-nums; width: 34px; height: 34px; line-height: 34px; border-radius: 50%; text-align: center; }
.cal-cell.on .dn { background: var(--accent); color: var(--on-accent); font-weight: 600; }
/* Today: a ring with a surface-colored gap, so it reads on both a filled and an empty day. */
.cal-cell.today .dn { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); font-weight: 700; }
.cal-cell.future .dn { color: var(--text-3); opacity: 0.5; }

.day-h { display: flex; align-items: center; gap: 8px; margin: 8px 0 -4px; font-size: 15px; font-weight: 600; }
.day-h svg { width: 10px; height: 10px; display: block; }
.m-weight svg, .m-calories svg, .m-exercise svg, .m-fasting svg { fill: var(--main-ink); }
.day-h .tot { margin-left: auto; font-weight: 500; color: var(--text-2); font-variant-numeric: tabular-nums; }
.list.inset { background: var(--surface-2); }
.list.inset .row { min-height: 44px; }
.add-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.add-row .btn { padding: 0 6px; font-size: 15px; min-height: 48px; }

/* ---------- Settings ---------- */

.section-title.first { margin-top: 4px; }
.list.settings .row { min-height: 56px; justify-content: space-between; }
.list.settings .row .main { flex: 1 1 auto; }
.list.settings .row .main .s { font-size: 13px; }
.field-input.compact { min-height: 44px; padding: 0 10px; min-width: 0; }
.num-field.compact { min-height: 44px; flex: 0 0 auto; padding: 0 10px; border-radius: 9px; }
.num-field.compact input { font-size: 17px; width: 64px; padding: 4px 0; text-align: right; }
.num-field.compact.tiny input { width: 28px; }
.height { display: flex; gap: 6px; }
.btn.small { min-height: 44px; padding: 0 16px; font-size: 15px; }
.set-hint { margin: 8px 4px 0; }
.about { text-align: center; margin-top: 24px; color: var(--text-3); }

/* Reduced motion: sheets fade instead of sliding; press and switch feedback stays, without movement. */
@keyframes sheet-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  dialog.sheet[open] { animation: sheet-fade 160ms ease-out; }
  .btn:active { transform: none; }
  .toggle input::after { transition: none; }
}
