/* ═══════════════════════════════════════════════════════════════
   SELKO HEP BUILDER — Stylesheet
   Fonts: Montserrat (headings/buttons/nav) + Inter (body/labels)
   Palette:
     --teal-dark:  #154C47  primary, nav, buttons
     --orange-red: #F44B1A  destructive actions
     --amber:      #F7941D  badges, highlights
     --teal-light: #47B9B7  accents, tags, secondary text
     --white:      #ffffff
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --teal-dark:   #154C47;
  --teal-mid:    #1a6059;
  --teal-light:  #47B9B7;
  --teal-bg:     #e8f4f3;
  --orange-red:  #F44B1A;
  --orange-dark: #d43a10;
  --amber:       #F7941D;
  --amber-dark:  #d97e0f;
  --white:       #ffffff;
  --bg:          #ffffff;
  --surface:     #f7f8f8;
  --border:      #e5e7eb;
  --border-mid:  #d1d5db;
  --text:        #111827;
  --text-mid:    #374151;
  --text-muted:  #6b7280;
  --danger:      #F44B1A;
  --danger-bg:   #fff0ed;
  --danger-border: #fbc8bb;
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
  --shadow:      0 2px 10px rgba(0,0,0,0.10);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.16);
  --header-h:    60px;
  --float-h:     72px;
  --font-head:   'Montserrat', sans-serif;
  --font-body:   'Inter', sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }
ul { list-style: none; }

/* ── Screens ──────────────────────────────────────────────────── */
.screen { display: none; }
.screen.active { display: flex; flex-direction: column; min-height: 100vh; }

/* authenticated screens sit below the fixed header */
.app-screen.active {
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ── Gradient header ──────────────────────────────────────────── */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: linear-gradient(to right, #154C47 0%, #F7941D 68%, #F44B1A 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.18);
  border-radius: var(--radius-sm);
  padding: 8px;
  flex-shrink: 0;
}

.hamburger {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

/* logo cluster — right side toward the orange */
.header-logo-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-icon {
  height: 32px;
  width: 32px;
  object-fit: contain;
  background: rgba(255,255,255,0.14);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.header-wordmark {
  font-family: var(--font-head);
  font-size: 21px;
  font-weight: 700;
  color: #0e2a5e;
  letter-spacing: -0.5px;
  text-shadow: 0 1px 3px rgba(255,255,255,0.55);
}

/* ── Side nav drawer ──────────────────────────────────────────── */
.side-nav {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
}

.side-nav.open { display: block; }

.nav-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}

.nav-panel {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 260px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
}

.side-nav.open .nav-panel { transform: translateX(0); }

.nav-header {
  background: linear-gradient(to right, #154C47 0%, #F7941D 68%, #F44B1A 100%);
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
}

.nav-icon {
  height: 30px;
  width: 30px;
  object-fit: contain;
  background: rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 2px;
}

.nav-wordmark {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: #0e2a5e;
  text-shadow: 0 1px 3px rgba(255,255,255,0.5);
}

.nav-list { padding: 12px 0; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  transition: background 0.12s;
}

.nav-item:hover, .nav-item:focus {
  background: var(--teal-bg);
  color: var(--teal-dark);
  outline: none;
}

.nav-icon-wrap { font-size: 17px; }

.nav-user {
  padding: 14px 20px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ── Screen body / scroll area ────────────────────────────────── */
.screen-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px calc(var(--float-h) + 20px);
}

/* screens with no floating button */
.screen-body.no-float { padding-bottom: 24px; }

/* ── Floating action bar (current program button) ─────────────── */
.float-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 12px 16px;
  background: var(--white);
  border-top: 1px solid var(--border);
  z-index: 100;
}

/* ── LOGIN / PATIENT SCREENS (centered card layout) ──────────── */
.login-wrap, .patient-wrap {
  max-width: 380px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

.login-logo, .patient-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.login-icon { height: 38px; width: 38px; object-fit: contain; }
.login-wordmark, .patient-logo .login-wordmark {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 700;
  color: var(--teal-dark);
  letter-spacing: -0.5px;
}

.login-title, .patient-title {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--teal-dark);
  text-align: center;
  margin-bottom: 6px;
}

.login-sub, .patient-sub {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
}

.patient-footer {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: auto;
  padding-top: 32px;
  line-height: 1.5;
}

/* ── Forms ────────────────────────────────────────────────────── */
.form-group {
  width: 100%;
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.form-input:focus {
  border-color: var(--teal-dark);
  box-shadow: 0 0 0 3px rgba(21,76,71,0.10);
}

.form-input::placeholder { color: var(--text-muted); }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: background 0.14s, transform 0.1s, box-shadow 0.14s;
  border: none;
  outline: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--teal-dark);
  color: var(--white);
}
.btn-primary:hover { background: var(--teal-mid); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border-mid);
}
.btn-secondary:hover { background: var(--teal-bg); color: var(--teal-dark); }

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1.5px solid var(--danger-border);
}
.btn-danger:hover { background: var(--danger); color: var(--white); }

.btn-full { width: 100%; }

.btn-link {
  background: none;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-head);
  padding: 10px 0;
  text-align: center;
  width: 100%;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-link:hover { color: var(--teal-mid); }

/* current program floating button */
.current-program-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: 14px;
}

/* ── Badge ────────────────────────────────────────────────────── */
.badge {
  background: var(--amber);
  color: var(--white);
  border-radius: 50%;
  min-width: 24px;
  height: 24px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-head);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.badge[data-count="0"] { opacity: 0.5; }

/* ── Alerts ───────────────────────────────────────────────────── */
.alert {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.alert-success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* ── HIPAA notice ─────────────────────────────────────────────── */
.hipaa-notice {
  background: #fff0ed;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ── Search bar ───────────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--header-h);
  z-index: 50;
}

.search-icon { font-size: 18px; flex-shrink: 0; }

.search-input {
  flex: 1;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s;
}

.search-input:focus {
  border-color: var(--teal-dark);
  background: var(--white);
}

.search-clear {
  font-size: 14px;
  color: var(--text-muted);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
}

.search-clear:hover { background: var(--surface); }

/* ── Exercise grid ────────────────────────────────────────────── */
.exercise-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 14px 16px calc(var(--float-h) + 16px);
}

.ex-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
}

.ex-card:hover { border-color: var(--teal-light); box-shadow: var(--shadow); }
.ex-card.selected { border-color: var(--teal-dark); border-width: 2px; }

.ex-card-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--surface);
  display: block;
}

.ex-card-img-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--teal-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--teal-light);
}

.ex-card-label {
  padding: 7px 8px 8px;
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  text-align: center;
}

/* selected checkmark badge */
.ex-card-check {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--teal-dark);
  color: var(--white);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.ex-card.selected .ex-card-check { display: flex; }

/* patient completion badge */
.ex-card-done {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #16a34a;
  color: var(--white);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 13px;
  display: none;
  align-items: center;
  justify-content: center;
}

.ex-card.done .ex-card-done { display: flex; }

/* compliance badge on program list item */
.compliance-badge {
  background: var(--amber);
  color: var(--white);
  border-radius: 50%;
  min-width: 26px;
  height: 26px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-head);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  flex-shrink: 0;
}

/* ── Exercise popup ───────────────────────────────────────────── */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.38);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.popup-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  width: 100%;
  max-width: 320px;
  box-shadow: var(--shadow-lg);
}

.popup-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 14px;
}

.popup-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--white);
  margin-bottom: 10px;
  transition: background 0.12s, border-color 0.12s;
}

.popup-btn:last-of-type { margin-bottom: 0; }
.popup-btn:hover { background: var(--teal-bg); border-color: var(--teal-light); color: var(--teal-dark); }

.popup-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 12px;
  text-align: center;
}

/* ── Exercise list (current program & detail view) ────────────── */
.exercise-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }

.ex-list-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.ex-list-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.ex-list-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--surface);
  flex-shrink: 0;
}

.ex-list-thumb-placeholder {
  width: 56px;
  height: 56px;
  background: var(--teal-bg);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  color: var(--teal-light);
}

.ex-list-info { flex: 1; min-width: 0; }

.ex-list-name {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.ex-list-params {
  font-size: 12px;
  color: var(--text-muted);
}

.ex-list-remove {
  color: var(--text-muted);
  font-size: 16px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.ex-list-remove:hover { background: var(--danger-bg); color: var(--danger); }

/* dropdowns row */
.ex-list-params-row {
  display: flex;
  gap: 8px;
  padding: 0 14px 12px;
  flex-wrap: wrap;
}

.param-select {
  flex: 1;
  min-width: 80px;
  padding: 6px 8px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  outline: none;
}

.param-select:focus { border-color: var(--teal-dark); }

/* comment box */
.ex-list-comment {
  padding: 0 14px 12px;
}

.ex-list-comment textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  resize: none;
  min-height: 60px;
  outline: none;
  font-family: var(--font-body);
}

.ex-list-comment textarea:focus { border-color: var(--teal-dark); }
.ex-list-comment textarea::placeholder { color: var(--text-muted); font-size: 12px; }

/* drag handle */
.drag-handle {
  color: var(--text-muted);
  font-size: 18px;
  cursor: grab;
  padding: 4px 6px;
  flex-shrink: 0;
}

.drag-handle:active { cursor: grabbing; }

/* ── Programs list ────────────────────────────────────────────── */
.programs-list { display: flex; flex-direction: column; gap: 10px; }

.programs-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 12px;
}

.program-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.13s, box-shadow 0.13s;
}

.program-item:hover { border-color: var(--teal-light); box-shadow: var(--shadow-sm); }

.program-item-info { flex: 1; min-width: 0; }

.program-item-name {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.program-item-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.program-item-arrow { color: var(--text-muted); font-size: 18px; flex-shrink: 0; }

/* ── Detail view ──────────────────────────────────────────────── */
.detail-program-name {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 16px;
  line-height: 1.3;
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

/* ── Back button ──────────────────────────────────────────────── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--teal-dark);
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  margin-bottom: 16px;
  text-decoration: none;
}

.back-btn:hover { color: var(--teal-mid); }

.screen-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

/* ── Home screen ──────────────────────────────────────────────── */
.home-body {
  padding: 32px 20px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-heading {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--teal-dark);
  text-align: center;
  margin-bottom: 4px;
}

.home-sub {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  color: var(--teal-light);
  text-align: center;
  margin-bottom: 6px;
}

.home-desc {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.6;
  max-width: 300px;
}

.quick-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  margin-bottom: 18px;
}

.quick-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 12px;
  text-align: center;
  background: var(--white);
  transition: border-color 0.13s, box-shadow 0.13s;
}

.quick-card:hover { border-color: var(--teal-light); box-shadow: var(--shadow-sm); }

.quick-card-icon { font-size: 26px; margin-bottom: 8px; }

.quick-card-label {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  color: var(--teal-dark);
  line-height: 1.4;
}

/* ── Modal overlays ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.42);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  width: 100%;
  max-width: 340px;
  box-shadow: var(--shadow-lg);
}

.modal-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 14px;
}

.modal-card p {
  font-size: 14px;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 18px;
}

.modal-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
  line-height: 1.5;
}

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

/* ── Previous program picker ──────────────────────────────────── */
.prev-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 14px;
}

.prev-item {
  padding: 11px 14px;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
}

.prev-item:hover { background: var(--teal-bg); border-color: var(--teal-light); color: var(--teal-dark); }

/* ── Patient code entry ───────────────────────────────────────── */
.code-inputs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.code-digit {
  width: 60px;
  height: 68px;
  text-align: center;
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;
  color: var(--teal-dark);
  border: 2px solid var(--border-mid);
  border-radius: var(--radius);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.code-digit:focus {
  border-color: var(--teal-dark);
  box-shadow: 0 0 0 3px rgba(21,76,71,0.12);
  background: var(--white);
}

/* ── Language toggle ──────────────────────────────────────────── */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

.lang-btn {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.12s, background 0.12s;
}

.lang-btn.active {
  color: var(--teal-dark);
  background: var(--teal-bg);
}

.lang-sep { color: var(--border-mid); font-size: 16px; }

/* ── Patient exercise view ────────────────────────────────────── */
.patient-screen { padding-bottom: 32px; }

.patient-grid { padding-bottom: 24px; }

.pt-ex-img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.pt-ex-video {
  width: 100%;
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}

.pt-params {
  background: var(--teal-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  color: var(--teal-dark);
  line-height: 1.8;
}

.pt-comments {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.65;
  margin-bottom: 24px;
  white-space: pre-wrap;
}

.btn-complete {
  display: block;
  width: 100%;
  padding: 14px;
  background: #16a34a;
  color: var(--white);
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  transition: background 0.13s, transform 0.1s;
  margin-bottom: 10px;
}

.btn-complete:hover { background: #15803d; }
.btn-complete:active { transform: scale(0.97); }

.complete-done {
  text-align: center;
  color: #16a34a;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  padding: 8px;
}

/* ── Empty state ──────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-icon { font-size: 40px; margin-bottom: 14px; }

.empty-state p {
  font-size: 14px;
  line-height: 1.6;
}

/* ── Toast ────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--float-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--teal-dark);
  color: var(--white);
  padding: 11px 20px;
  border-radius: 30px;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s;
}

.toast.hidden { display: none; }
.toast.fade-out { opacity: 0; }

/* ── Utility ──────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Rename input (inline edit on long-press) ─────────────────── */
.rename-input {
  border: 1.5px solid var(--teal-dark);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  width: 100%;
  outline: none;
  background: var(--white);
}

/* ── Photo/video upload area ──────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border-mid);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  margin-top: 8px;
  transition: border-color 0.13s;
}

.upload-area:hover { border-color: var(--teal-light); }

.upload-area p {
  font-size: 13px;
  color: var(--text-muted);
}

.upload-preview {
  width: 100%;
  border-radius: var(--radius-sm);
  margin-top: 10px;
}

/* ── Drag-and-drop reorder (SortableJS classes) ───────────────── */
.sortable-ghost { opacity: 0.4; }
.sortable-chosen { box-shadow: var(--shadow-lg); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 360px) {
  .exercise-grid { grid-template-columns: repeat(2, 1fr); }
  .code-digit { width: 52px; height: 60px; font-size: 24px; }
}

@media (min-width: 600px) {
  .login-wrap, .patient-wrap { padding-top: 80px; }
  .exercise-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Reduced motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
