:root {
  font-family: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-size: 16px;
  color: #1f2937;
  background: #f3f4f6;
  font-synthesis: none;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --header: #1e293b;
  --primary: #2563eb;
  --success: #059669;
  --paper: #fff;
  --radius: 12px;
  /* Older reusable components refer to these two names. */
  --green: #2563eb;
  --lime: #dbeafe;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { border: 0; background: transparent; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 700; margin-bottom: 8px; overflow-wrap: anywhere; }
h2 { font-size: 22px; line-height: 1.3; }
h3 { font-size: 18px; line-height: 1.3; }
p { line-height: 1.5; overflow-wrap: anywhere; }
small, .muted { color: var(--muted); }
small { font-size: 13px; }
em { font-style: normal; }
img { max-width: 100%; }
.icon { width: 22px; height: 22px; display: inline-block; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* Native-style navigation: one compact top bar, with no fixed bottom menu. */
.native-header { position: sticky; top: 0; z-index: 20; height: 58px; padding: 0 14px; display: flex; align-items: center; gap: 10px; color: #fff; background: var(--header); }
.native-back, .native-gear { flex: 0 0 40px; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 44px; padding: 0; border-radius: 8px; color: #fff; font-size: 27px; }
.native-back { flex: 0 0 auto; width: auto; min-width: 82px; height: 36px; padding: 7px 10px; border: 1px solid #475569; background: #334155; font-size: 15px; font-weight: 700; white-space: nowrap; }
.native-back:active, .native-gear:active { background: #ffffff1a; }
.native-title { flex: 1; min-width: 0; margin: 0; font-size: 22px; line-height: 1.15; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.native-gear { margin-left: auto; }
.native-main { width: 100%; max-width: 1100px; margin: 0 auto; padding: 14px 14px calc(28px + env(safe-area-inset-bottom)); min-width: 0; }
.native-home-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.native-home-actions .button { width: 100%; }
.native-home-actions > .button:first-child { grid-column: 1/-1; }
.native-add { width: 100%; margin-top: 12px; }
.native-section-title { margin: 14px 0 12px; font-size: 20px; }
.native-connection { margin: 16px 0 0; font-size: 12px; color: var(--muted); }
.native-client-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.native-client-toolbar > span { display: flex; align-items: center; gap: 8px; min-width: 0; }
.native-client-toolbar strong { overflow-wrap: anywhere; }
.native-client-toolbar .client-switch { flex-shrink: 0; margin: 0; padding: 8px 10px; }
.native-detail-heading { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.native-detail-heading h2 { font-size: 20px; margin: 8px 0; }
.native-detail-heading .button { flex-shrink: 0; }
.native-tabs, .tabs { display: flex; gap: 4px; margin: 14px 0; border-bottom: 1px solid var(--line); overflow-x: auto; max-width: 100%; }
.native-tabs button, .tabs button { flex: 1 0 auto; min-height: 44px; padding: 10px 12px; font-size: 15px; border-bottom: 3px solid transparent; color: var(--muted); white-space: nowrap; }
.native-tabs button.active, .tabs button.active, .native-tabs [aria-selected="true"] { border-color: var(--primary); color: var(--primary); font-weight: 700; }
.native-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; overflow: visible; border: 0; }
.native-tabs button { min-width: 0; padding: 10px 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; white-space: normal; overflow-wrap: anywhere; }
.native-tabs button.active { background: #eff6ff; border-color: var(--primary); }
.client-switch { display: flex; gap: 8px; min-width: 0; max-width: 100%; overflow-x: auto; padding: 2px 0 10px; margin-bottom: 4px; }
.client-switch button { flex: 0 0 auto; min-height: 40px; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 9px; font-weight: 600; }
.client-switch button.active, .client-switch [aria-pressed="true"] { color: #fff; border-color: var(--primary); background: var(--primary); }

/* Native two-column navigation cards keep their shape at phone widths. */
.native-client-grid, .native-muscle-grid, .native-machine-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.native-client-card, .muscle-card, .machine-card { display: block; width: 100%; min-width: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); overflow: hidden; text-align: center; box-shadow: 0 2px 4px #0000000a; }
.native-client-card:active, .muscle-card:active, .machine-card:active { background: #eff6ff; }
.person-photo { display: flex; align-items: center; justify-content: center; width: 100%; height: 150px; background: #e5e7eb; color: #64748b; font-size: 44px; font-weight: 700; object-fit: cover; overflow: hidden; }
.person-photo img, .person-photo .avatar { display: block; width: 100%; height: 100%; margin: 0; border-radius: 0; object-fit: cover; }
.person-photo .avatar:not(img) { display: flex; align-items: center; justify-content: center; font-size: 44px; }
.person-photo .icon { width: 60px; height: 60px; }
.person-name { display: block; padding: 12px 8px; margin: 0; font-size: 21px; line-height: 1.2; font-weight: 700; overflow-wrap: anywhere; }
.native-client-card .badge { margin: 0 8px 10px; }
.native-client-card p { margin: 0 8px 12px; font-size: 13px; }
.muscle-card { min-height: 92px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 22px; line-height: 1.2; font-weight: 700; overflow-wrap: anywhere; }
.muscle-card h2, .muscle-card h3, .muscle-card strong { font-size: 22px; line-height: 1.2; margin: 0; }
.muscle-card small { font-size: 13px; font-weight: 400; }
.muscle-card p { margin: 3px 0 0; font-size: 12px; font-weight: 400; line-height: 1.1; color: var(--muted); }
.machine-card { min-height: 198px; }
.machine-card .machine-photo, .machine-card > img, .machine-card .exercise-placeholder { display: block; width: 100%; height: 136px; margin: 0; border-radius: 0; object-fit: contain; background: #fff; }
.machine-card .exercise-placeholder { display: flex; align-items: center; justify-content: center; color: #94a3b8; }
.machine-label { display: flex; align-items: center; justify-content: center; min-height: 60px; padding: 8px; font-size: 20px; line-height: 1.2; font-weight: 700; overflow-wrap: anywhere; }
.machine-label h3 { font-size: inherit; margin: 0; }

/* Existing controls retain their data hooks and form behavior. */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; min-height: 44px; padding: 11px 15px; border: 1px solid transparent; border-radius: 9px; background: var(--primary); color: #fff; font-size: 16px; font-weight: 600; line-height: 1.25; text-align: center; text-decoration: none; white-space: normal; overflow-wrap: anywhere; }
.button.primary { background: var(--primary); color: #fff; }
.button.secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.button.soft { background: #dbeafe; color: #1d4ed8; }
.button.danger { background: #fee2e2; color: #b91c1c; }
.button.link { background: transparent; color: var(--primary); padding: 8px; }
.buttons, .inline-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.buttons > *, .inline-actions > * { min-width: 0; max-width: 100%; }
.page-head, .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head > div, .panel-head > div { min-width: 0; }
.page-head p { color: var(--muted); font-size: 14px; margin: 0; }
.panel { padding: 16px; margin-bottom: 16px; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head h2 { margin: 0; font-size: 20px; }
.section-tag { display: inline-block; flex-shrink: 0; padding: 5px 8px; font-size: 12px; color: var(--muted); background: #f3f4f6; border-radius: 8px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.search { flex: 1; min-width: 140px; max-width: 440px; }
.search label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 14px; }
label { display: block; min-width: 0; font-size: 14px; font-weight: 600; color: #374151; }
label input, label select, label textarea { margin-top: 6px; }
input:not([type=checkbox]):not([type=file]):not([type=hidden]), select, textarea { display: block; width: 100%; min-width: 0; max-width: 100%; min-height: 46px; padding: 10px 11px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; color: var(--ink); font-size: 16px; }
input[type=checkbox] { width: 20px; height: 20px; flex-shrink: 0; margin: 0; accent-color: var(--primary); }
input[type=file] { display: block; width: 100%; max-width: 100%; font-size: 14px; margin-top: 8px; }
textarea { min-height: 96px; resize: vertical; line-height: 1.4; }
select { appearance: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.full { grid-column: 1/-1; }
form .buttons { margin-top: 18px; }
form small, .form-hint { display: block; margin-top: 7px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.form-error { color: #b91c1c; font-size: 14px; line-height: 1.4; margin: 12px 0 0; overflow-wrap: anywhere; }
.fields-row { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }

/* Detail screen follows the Android photo/settings and large numeric row. */
.native-workout { min-width: 0; }
.native-main[data-workout-step="detail"] .native-tabs { display: flex; gap: 4px; }
.native-main[data-workout-step="detail"] .native-tabs button { flex: 1 1 0; font-size: 13px; min-height: 36px; padding: 7px 4px; }
.native-workout .rest-timer { margin-bottom: 10px; padding: 8px; }
.native-workout .panel { padding: 8px; }
.detail-top { display: grid; grid-template-columns: minmax(0,44fr) minmax(0,56fr); gap: 10px; margin-bottom: 14px; align-items: stretch; }
.detail-top > * { min-width: 0; }
.machine-photo { display: block; width: 100%; height: 150px; margin: 12px 0; object-fit: contain; border-radius: 10px; background: #fff; }
.detail-top .machine-photo, .detail-top > img, .detail-top .exercise-placeholder { width: 100%; height: 150px; margin: 0; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.detail-top .machine-photo:not(img) { display: flex; align-items: center; justify-content: center; color: #94a3b8; }
.detail-top .machine-photo .icon { width: 48px; height: 48px; }
.machine-settings { min-width: 0; margin: 0; }
.machine-settings label { font-size: 14px; }
.machine-settings textarea { height: 126px; min-height: 126px; padding: 9px; font-size: 15px; }
.machine-settings .button { width: 100%; margin-top: 6px; padding: 6px; min-height: 36px; font-size: 13px; }
.set-entry { display: grid; grid-template-columns: minmax(0,1fr) 58px; gap: 8px; align-items: end; margin-top: 14px; }
.set-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; min-width: 0; }
.set-fields label { text-align: center; font-size: 13px; }
#set-form .set-fields input { height: 58px; min-height: 58px; padding: 7px 3px; font-size: 28px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.set-fields input::-webkit-inner-spin-button, .set-fields input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.set-fields input { -moz-appearance: textfield; }
.set-ok { display: inline-flex; align-items: center; justify-content: center; width: 58px; min-width: 58px; height: 58px; min-height: 58px; padding: 0; margin: 0; border-radius: 9px; background: var(--success); color: #fff; font-size: 20px; font-weight: 700; }
.native-saved-row { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)) 58px; gap: 8px; align-items: center; margin-top: 8px; }
.native-row-head { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)) 58px; gap: 8px; text-align: center; color: var(--muted); font-size: 12px; }
.native-saved-row > span { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 58px; padding: 7px 3px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.native-saved-row > button { width: 58px; height: 58px; padding: 0; border-radius: 9px; color: #fff; background: var(--success); font-size: 20px; font-weight: 700; }
.record-button { width: 100%; margin-top: 16px; background: var(--success); color: #fff; }
.rest-timer { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px; border-radius: 10px; border: 1px solid #bfdbfe; background: #eff6ff; }
.rest-timer .timer-value { min-width: 70px; font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rest-timer > div { min-width: 0; }
.rest-timer small { display: block; }
.rest-timer button { margin-left: auto; }
.workout-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; }
.workout-grid .panel { margin-bottom: 0; }
.table-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { padding: 10px 7px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); text-align: left; }
td { padding: 12px 7px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td:first-child { min-width: 95px; white-space: normal; overflow-wrap: anywhere; }
td button { min-width: 36px; min-height: 36px; padding: 7px; border-radius: 7px; background: #eff6ff; color: var(--primary); }
details { border-top: 1px solid var(--line); padding: 14px 0; }
summary { display: flex; justify-content: space-between; gap: 10px; cursor: pointer; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
details .table-scroll { margin-top: 12px; }

/* Secondary screens keep the same neutral cards and familiar blue actions. */
.avatar { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 46px; height: 46px; border-radius: 9px; object-fit: cover; background: #e5e7eb; color: #475569; font-size: 19px; font-weight: 700; }
.avatar.big { width: 66px; height: 66px; font-size: 27px; }
.profile-head, .client-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.profile-head { flex-wrap: wrap; }
.profile-head h1 { font-size: 24px; margin: 0 0 6px; }
.profile-head .buttons { margin-left: auto; }
.client-top h3 { margin: 0 0 4px; }
.profile-details { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.profile-details dt { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.profile-details dd { margin: 0; font-size: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 5px 8px; background: #d1fae5; color: #047857; border-radius: 7px; font-size: 12px; font-weight: 600; }
.badge.neutral { background: #f3f4f6; color: var(--muted); }
.back { min-height: 40px; padding: 6px 0; margin-bottom: 10px; color: var(--primary); font-size: 15px; }
.note { padding: 12px; margin: 14px 0; border: 1px solid var(--line); border-radius: 9px; background: #f9fafb; font-size: 14px; line-height: 1.5; color: #4b5563; overflow-wrap: anywhere; }
.note.warning, .status-strip { color: #92400e; background: #fef3c7; border-color: #fde68a; }
.note ul { padding-left: 20px; }
.status-strip { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 10px 14px; font-size: 14px; }
.status-strip .button { font-size: 14px; }
.footer-note { margin: 18px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.settings-grid, .grid-main { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.settings-grid .panel { margin: 0; }
.settings-grid p { font-size: 15px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.stat { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.stat .value { display: block; margin: 12px 0 6px; font-size: 30px; font-weight: 700; }
.stat p { margin: 0; color: var(--muted); font-size: 13px; }
.stat .stat-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13px; color: var(--muted); }
.list-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 0; text-align: left; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row strong { display: block; font-size: 16px; overflow-wrap: anywhere; }
.list-row small { display: block; margin-top: 4px; }
.time-block { flex-shrink: 0; width: 48px; font-size: 16px; font-weight: 700; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.empty h3 { margin-bottom: 8px; color: var(--ink); }
.empty p { margin-bottom: 16px; font-size: 15px; }
.empty .empty-icon { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 12px; background: #dbeafe; color: var(--primary); }
.empty.large { padding: 42px 16px; }
.help-card { background: #eff6ff; }
.help-card h2 { font-size: 24px; }
.help-card p { color: #475569; }
.mini-chart { width: 100%; height: 170px; overflow: visible; }
.chart-wrap { padding: 20px 12px 12px; }
.client-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.client-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-align: left; }
.client-card p { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.client-card .badge { margin-top: 12px; }
.native-client-card.client-card { padding: 0; text-align: center; }
.exercise-placeholder { display: flex; align-items: center; justify-content: center; height: 136px; margin-bottom: 12px; border-radius: 10px; background: #f3f4f6; color: #94a3b8; }
.exercise-placeholder .icon { width: 42px; height: 42px; }
.exercise-card h3 { margin: 10px 0; }
.exercise-card .buttons { margin-top: 14px; gap: 6px; }
.exercise-card .button { padding: 9px 10px; font-size: 14px; }
.legacy-json { max-height: 50vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }

/* Calendar hooks/classes are unchanged, including the full-width daily mode. */
.calendar-toolbar { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.calendar-period { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.calendar-period h2 { min-width: 0; margin: 0; text-align: center; font-size: 20px; overflow-wrap: anywhere; }
.calendar-arrow { flex-shrink: 0; width: 44px; padding: 8px; font-size: 23px; }
.calendar-controls { display: flex; align-items: flex-end; justify-content: flex-end; flex-wrap: wrap; gap: 10px; width: 100%; }
.calendar-date-picker { margin-right: auto; }
.calendar-date-picker input { max-width: 190px; }
.calendar-mode { display: flex; gap: 6px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 8px; }
.calendar .day { min-width: 0; min-height: 220px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.calendar .day.is-today { border-color: #60a5fa; background: #eff6ff; }
.day-header { padding: 4px 0 12px; }
.day-header h3 { margin: 0 0 7px; font-size: 14px; font-weight: 500; color: var(--muted); }
.day-header time { font-size: 19px; font-weight: 700; }
.day-appointments .appointment { display: block; width: 100%; padding: 10px 8px; margin: 7px 0; border-radius: 8px; background: #dbeafe; color: #1e3a8a; text-align: left; font-size: 14px; overflow-wrap: anywhere; }
.appointment span { display: block; }
.appointment-time { font-size: 13px; font-weight: 700; }
.appointment-clients { margin-top: 6px; line-height: 1.35; }
.appointment-note { margin-top: 6px; color: #475569; font-size: 12px; line-height: 1.4; }
.calendar-empty { width: 100%; min-height: 60px; padding: 10px 0; color: var(--muted); font-size: 14px; }
.calendar-empty span { display: block; padding: 4px 0; }
.appointment-form .form-heading { display: none; }
.client-picker { padding: 0; border: 0; margin: 18px 0; }
.client-picker legend { margin-bottom: 9px; font-size: 15px; font-weight: 600; }
.client-options { display: grid; gap: 12px; max-height: 210px; overflow-y: auto; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.client-option { display: flex; align-items: center; gap: 9px; min-width: 0; }
.client-option span { min-width: 0; overflow-wrap: anywhere; }
.client-option small { display: block; }
.client-option.is-archived { opacity: .65; }
.appointment-form .form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.form-actions .danger { margin-right: auto; }

/* Dialogs and feedback remain in the original shared DOM containers. */
dialog { width: calc(100% - 28px); max-width: 600px; max-height: 90vh; max-height: 90dvh; overflow: auto; padding: 22px; border: 0; border-radius: 14px; color: var(--ink); background: #fff; box-shadow: 0 20px 70px #0f172a40; }
dialog::backdrop { background: #0f172a80; }
dialog h2 { margin-bottom: 18px; }
dialog .dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
dialog .dialog-top h2 { margin: 0; font-size: 22px; }
dialog .dialog-top button { flex-shrink: 0; width: 40px; height: 40px; padding: 0; font-size: 28px; color: var(--muted); }
#message { display: none; position: fixed; z-index: 30; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 28px); padding: 13px 18px; border-radius: 10px; background: var(--header); color: #fff; box-shadow: 0 5px 20px #0f172a30; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
#message.show { display: block; }
.startup { max-width: 480px; margin: 12vh auto; padding: 24px; }
.startup .brand-mark { margin-bottom: 18px; }
.brand-mark { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 10px; background: var(--primary); color: #fff; font-size: 28px; font-weight: 700; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); }
.only-mobile { display: none; }
/* Fallback for any secondary page retaining the prior shell wrappers. */
.layout { min-height: 100vh; }
.content { min-width: 0; }
.main { width: 100%; max-width: 1100px; margin: 0 auto; padding: 14px 14px 28px; }
.topbar:not(.native-header) { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 58px; padding: 0 14px; background: var(--header); color: #fff; }
.topbar:not(.native-header) .eyebrow { color: #fff; }
.top-right { display: flex; align-items: center; gap: 12px; font-size: 13px; }

@media (max-width: 1000px) {
  .calendar-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .workout-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .native-main, .main { padding: 12px 12px calc(24px + env(safe-area-inset-bottom)); }
  .grid-main, .settings-grid { grid-template-columns: 1fr; }
  .workout-grid { gap: 14px; }
  .panel { padding: 14px; }
  .page-head { align-items: flex-start; }
  .page-head h1 { font-size: 24px; }
  .page-head p { font-size: 14px; }
  .page-head > .button { max-width: 48%; }
  .stats { gap: 8px; }
  .stat { padding: 12px 9px; }
  .stat .value { font-size: 27px; }
  .stat .stat-top, .stat p { font-size: 12px; }
  .stat .stat-top .icon { display: none; }
  .profile-head .buttons { width: 100%; margin: 0; }
  .profile-details { grid-template-columns: 1fr; }
  .client-card .client-top { flex-wrap: wrap; }
  .calendar-grid { grid-template-columns: 1fr; }
  .calendar .day { min-height: 100px; }
  .day-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 8px; }
  .day-header h3 { margin: 0; }
  .day-header time { font-size: 17px; }
  .calendar-period h2 { font-size: 16px; }
  .calendar-date-picker { width: 100%; margin: 0; }
  .calendar-date-picker input { max-width: none; }
  .calendar-controls { justify-content: flex-start; }
  .day-appointments .appointment { padding: 12px; }
  .top-right .date { display: none; }
  .only-mobile { display: block; }
  .exercise-card .buttons { flex-direction: column; align-items: stretch; }
  dialog { padding: 19px; }
}
@media (max-width: 360px) {
  .native-header { gap: 6px; }
  .native-title { font-size: 21px; }
  .native-client-grid, .native-muscle-grid, .native-machine-grid { gap: 10px; }
  .native-tabs button, .tabs button { padding: 10px 9px; font-size: 14px; }
  .native-home-actions .button { padding: 10px 8px; font-size: 15px; }
  .set-entry, .set-fields, .native-saved-row { gap: 5px; }
  .set-fields label { font-size: 12px; }
  .rest-timer { gap: 7px; padding: 10px; }
  .rest-timer .timer-value { min-width: 62px; font-size: 28px; }
  .rest-timer .button { padding: 8px; font-size: 14px; }
  .form-grid { gap: 10px; }
  .panel-head { flex-wrap: wrap; }
}
.calendar-grid.calendar-grid--day { grid-template-columns: 1fr; }
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* Coach 0.4: the four supplied Android reference screens, without OS chrome. */
[hidden] { display: none !important; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.native-header { display:grid; grid-template-columns:auto minmax(0,1fr) 38px; column-gap:10px; height:58px; padding:0 14px; }
.native-header.without-back { grid-template-columns:minmax(0,1fr) 38px; }
.native-header.without-back .native-header-left { display:none; }
.native-title { width:100%; padding:0; text-align:center; font-size:28px; font-weight:750; line-height:1.12; }
.native-header.without-back .native-title { text-align:left; }
.native-back { min-width:0; min-height:40px; height:auto; padding:7px 12px; font-size:20px; font-weight:750; border-radius:8px; }
.native-gear { width:38px; height:42px; margin:0; }
.native-gear .icon { width:31px; height:31px; stroke-width:1.8; }
.native-main { max-width:780px; }
.native-primary { min-width:0; }
.native-primary + .native-tools, .native-bottom-tools { margin-top:26px; }
.people-intro { font-size:22px; line-height:1.22; font-weight:750; color:#4b5563; margin:2px 0 16px; }
.native-client-grid { gap:12px; }
.native-client-card.client-card { position:relative; border-radius:12px; box-shadow:none; overflow:hidden; }
.person-open { display:block; width:100%; padding:0; text-align:center; }
.person-photo { display:block; width:100%; height:150px; object-fit:cover; background:#e2e8f0; }
.person-name { padding:10px 5px 13px; min-height:59px; font-size:32px; line-height:1.08; font-weight:850; color:#171e27; }
.person-profile { position:absolute; right:8px; top:8px; width:38px; height:38px; border:0; border-radius:10px; background:white; box-shadow:0 2px 5px #0004; font-size:29px; line-height:1; padding:2px; }
.trial-status { margin:0 0 10px; padding:9px 8px; border:1px solid #bfdbfe; border-radius:10px; background:#eff6ff; color:#1e40af; font-size:20px; font-weight:800; line-height:1.25; text-align:center; }
.native-muscle-grid { gap:8px; }
.muscle-card { height:88px; min-height:88px; padding:6px 5px; box-shadow:none; display:grid; align-content:center; justify-items:center; gap:3px; }
.muscle-card h3 { font-size:31px; line-height:1.05; font-weight:850; color:#171e27; }
.muscle-card p { margin:0; font-size:17px; line-height:1.05; color:#737373; }
.muscle-add { font-size:23px; font-weight:800; margin-top:14px; padding:14px 9px; min-height:56px; border-radius:10px; }
.native-machine-grid { gap:12px; }
.machine-card { height:198px; min-height:198px; padding:4px; border-radius:12px; box-shadow:none; }
.machine-card .machine-photo, .machine-card .exercise-placeholder { height:136px; min-height:136px; margin:0 0 5px; border-radius:9px; object-fit:cover; background:#e2e8f0; }
.machine-card .exercise-placeholder { display:flex; color:#6b7280; font-size:20px; font-weight:400; }
.machine-label { display:flex; align-items:center; justify-content:center; width:100%; height:49px; min-height:49px; padding:0 3px; overflow:hidden; font-size:32px; font-weight:850; line-height:1.08; overflow-wrap:break-word; }
.machine-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:14px; }
.machine-actions .button { min-height:84px; padding:14px 9px; border-radius:10px; font-size:26px; font-weight:800; }
.button.slate { background:#475569; color:#fff; }
.native-main[data-workout-step="detail"] { padding:8px 10px 24px; }
.detail-top { grid-template-columns:minmax(0,44fr) minmax(0,56fr); gap:6px; margin:0 0 4px; }
.machine-photo-wrap { position:relative; min-width:0; height:126px; }
.detail-top .machine-photo { height:126px; min-height:126px; object-fit:cover; border:0; border-radius:12px; background:#e2e8f0; }
.detail-top .exercise-placeholder { color:#6b7280; font-size:20px; font-weight:400; }
.photo-edit { position:absolute; right:6px; bottom:6px; width:38px; min-height:32px; padding:4px; border-radius:8px; background:#334155e6; color:white; font-size:21px; }
.machine-settings { position:relative; height:150px; padding:6px 0; margin:0; }
.machine-settings textarea { width:100%; height:138px; min-height:132px; margin:0; padding:11px 9px; resize:none; border:1px solid #e5e7eb; border-radius:10px; background:#f8fafc; font-size:21px; font-weight:750; line-height:1.16; }
.machine-settings .note-save { position:absolute; top:10px; right:5px; width:auto; min-height:29px; margin:0; padding:4px 8px; font-size:14px; border-radius:7px; opacity:0; pointer-events:none; }
.machine-settings:focus-within .note-save,.machine-settings.has-draft .note-save { opacity:1; pointer-events:auto; }
.machine-settings:focus-within textarea,.machine-settings.has-draft textarea { padding-top:40px; border-color:#2563eb; }
.native-workout .workout-panel { padding:7px; margin:0; border-radius:12px; }
.previous-heading { display:flex; align-items:center; justify-content:space-between; font-size:20px; line-height:1.2; font-weight:850; color:#4b5563; margin:1px 0 10px; }
.previous-heading > span:first-child { margin-right:10px; }
.previous-heading > span:last-child { white-space:nowrap; }
.record-row { display:grid; grid-template-columns:minmax(0,1fr) 38px; gap:8px; align-items:center; margin:3px 0 7px; }
.record-row strong { color:#b45309; font-size:23px; font-weight:850; line-height:1.2; }
.chart-mini { width:38px; height:34px; padding:0; border:1px solid #bfdbfe; border-radius:8px; background:#eff6ff; font-size:27px; line-height:1; }
.native-row-head,.native-saved-row { grid-template-columns:1.38fr 1.02fr .82fr 52px; gap:6px; }
.native-row-head { font-size:17px; font-weight:800; line-height:1.1; margin:0 0 5px; color:#6b7280; }
.native-set-form .set-entry { grid-template-columns:minmax(0,1fr) 52px; gap:6px; margin:0 0 4px; }
.native-set-form .set-fields { grid-template-columns:1.38fr 1.02fr .82fr; gap:6px; }
.native-set-form .set-fields label { display:block; }
form.native-set-form .set-fields input[name], #set-form .set-fields input { height:58px; min-height:58px; margin:0; padding:2px; border:2px solid #e5e7eb; border-radius:11px; background:#f8fafc; color:#000; font-size:38px; font-weight:900; line-height:1; text-align:center; }
.native-set-form .set-ok { width:52px; min-width:52px; height:58px; min-height:58px; border-radius:11px; background:#dbeafe; color:#1d4ed8; font-size:28px; font-weight:900; }
.native-saved-row { margin:0 0 4px; }
.native-saved-row > span { height:58px; padding:2px; border:2px solid #e5e7eb; border-radius:11px; font-size:36px; font-weight:900; background:#f8fafc; color:#000; }
.native-saved-row > button { width:52px; height:58px; border-radius:11px; font-size:28px; }
.add-row { display:block; width:100%; min-height:49px; padding:8px; border:2px dashed #94a3b8; border-radius:10px; background:#f8fafc; color:#000; font-size:25px; font-weight:800; }
.native-workout .compact-timer { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:8px; margin:0 0 8px; padding:6px 8px; }
.compact-timer .timer-value { font-size:23px; min-width:60px; color:#1d4ed8; }
.compact-timer small { font-size:11px; }
.compact-timer .button { min-height:32px; padding:5px 8px; font-size:14px; }
.workout-help { margin-top:18px; }
.native-tools { border:1px solid var(--line); border-radius:10px; background:#fff; padding:0; }
.native-tools > summary { min-height:44px; align-items:center; padding:10px 12px; font-size:17px; }
.native-menu-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; padding:0 10px 10px; }
.native-tools .toolbar { padding:12px; margin:0; border-top:1px solid var(--line); }
.home-settings { width:100%; margin-top:10px; }
@media(max-width:390px){
 .native-row-head,.native-saved-row { grid-template-columns:1.32fr .98fr .78fr 48px; gap:5px; }
 .native-set-form .set-entry { grid-template-columns:minmax(0,1fr) 48px; gap:5px; }
 .native-set-form .set-fields { grid-template-columns:1.32fr .98fr .78fr; gap:5px; }
 .native-set-form .set-ok,.native-saved-row > button { width:48px; min-width:48px; }
 .detail-top { grid-template-columns:minmax(0,42fr) minmax(0,58fr); }
 .previous-heading { font-size:18px; }
 .record-row strong { font-size:21px; }
 .native-row-head { font-size:16px; }
}
@media(max-width:350px){
 .native-title { font-size:24px; }
 .native-back { font-size:17px; padding:7px 9px; }
 .person-name { font-size:28px; }
 .people-intro { font-size:20px; }
 .muscle-add { font-size:20px; }
 .trial-status { font-size:18px; }
 .previous-heading { font-size:15px; }
 .record-row strong { font-size:18px; }
 form.native-set-form .set-fields input[name],#set-form .set-fields input { font-size:32px; }
 .native-row-head { font-size:14px; }
 .detail-top .exercise-placeholder { font-size:16px; }
}

.native-main[data-view="client"] > .native-primary { min-height:calc(100vh - 66px); }
.native-workout-tools { padding:0 12px 12px; }
.native-workout-tools p { font-size:14px; margin:0 0 10px; }

.reference-icon { display:inline-block; vertical-align:middle; width:100%; height:100%; }
.person-profile .reference-icon { width:31px; height:34px; }
.native-gear .reference-icon { width:31px; height:31px; }
.photo-edit .reference-icon { width:28px; height:23px; }
.chart-mini .reference-icon { width:36px; height:33px; }
.record-row strong > .reference-icon { width:22px; height:28px; margin-right:3px; }
