/* ECG Education — per-app supplement. Loaded AFTER shared.css; tokens only, no forks of shared rules. */

/* iOS zooms inputs below 16px — keep form controls at 16px on touch screens */
.field input, .field select, .field textarea, .btn { font-size: 16px; }
.field input, .field select { min-height: 44px; }
.btn { min-height: 44px; }
.btn--sm { min-height: 36px; font-size: 14px; }
.btn--block { width: 100%; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }

/* Mobile-first page rhythm */
.page-wrap { padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); max-width: 980px; }
.page-head { margin-bottom: 14px; }
.page-sub { margin: 0 0 14px; }
.app-nav { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
body { -webkit-text-size-adjust: 100%; }

/* ── Login ── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.login-card { width: 100%; max-width: 380px; text-align: center; padding: 28px 22px; }
.login-logo { border-radius: 14px; margin-bottom: 10px; }
.login-card .page-title { margin-bottom: 4px; }
.login-card .muted-text { margin: 0 0 20px; }
.sso-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 46px; box-sizing: border-box; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; background: #1e293b; color: #fff; font-size: 15px; font-weight: 700; text-decoration: none; margin-bottom: 12px; }
.local-form { text-align: left; display: grid; gap: 12px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--text-light); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border-soft); }
.muted-text { color: var(--text-muted); }
.form-msg[hidden] { display: none; }

/* ── Bottom tab bar (phones) ── */
.tabbar { display: none; }
@media (max-width: 760px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
    background: var(--surface); border-top: 1px solid var(--border-soft); box-shadow: 0 -2px 10px rgba(16,24,40,.06);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { flex: 1; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-muted); text-decoration: none; font-size: 11px; font-weight: 600; }
  .tabbar a[hidden] { display: none; }
  .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.active { color: var(--brand); }
  #logout { display: none; }
  .app-sidebar { padding-bottom: 80px; }
}
@media (min-width: 761px) { .page-wrap { padding: 24px 28px 64px; } }

/* ── Segmented control ── */
.seg { display: inline-flex; background: var(--surface-subtle); border: 1px solid var(--border-soft); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--text-mid); font: inherit; font-size: 14px; font-weight: 600; padding: 7px 16px; border-radius: 999px; min-height: 36px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }

/* ── Meetings list ── */
.day-head { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 18px 2px 8px; }
.day-head:first-of-type { margin-top: 4px; }
.meet { display: flex; gap: 12px; padding: 14px; margin-bottom: 10px; }
.meet-date { flex: 0 0 52px; text-align: center; background: var(--brand-soft); color: var(--brand); border-radius: var(--radius-sm); padding: 6px 0; align-self: flex-start; }
.meet-date b { display: block; font-size: 22px; line-height: 1.1; }
.meet-date span { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.meet-main { flex: 1; min-width: 0; }
.meet h3 { margin: 0 0 4px; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.meet-meta { color: var(--text-muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.meet-desc { margin: 8px 0 0; color: var(--text-mid); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.meet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.meet.past { opacity: .72; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-subtle); color: var(--text-mid); border: 1px solid var(--border-softer); }
.chip--live { background: rgba(16,185,129,.14); color: #047857; border-color: rgba(16,185,129,.35); }
.chip--cat { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-ring); }
.empty-state { text-align: center; color: var(--text-muted); padding: 36px 12px; }
.fab { position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 80; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font-size: 30px; line-height: 1; box-shadow: var(--shadow-lg); cursor: pointer; }
@media (min-width: 761px) { .fab { bottom: 28px; right: 28px; } }

/* ── Calendar ── */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-head h2 { flex: 1; margin: 0; font-size: 18px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; padding: 4px 0; }
.cal-day { aspect-ratio: 1 / 1; min-height: 44px; border: 0; background: var(--surface); border-radius: var(--radius-sm); color: var(--text); font: inherit; font-size: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; position: relative; }
.cal-day.out { opacity: .38; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--brand); font-weight: 700; }
.cal-day.sel { background: var(--brand); color: #fff; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.cal-day.sel .cal-dot { background: #fff; }
.cal-count { font-size: 10px; font-weight: 700; color: var(--brand); }
.cal-day.sel .cal-count { color: #fff; }

/* ── Files ── */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-bottom: 12px; font-size: 14px; }
.crumbs button { border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; padding: 6px 4px; min-height: 36px; cursor: pointer; }
.crumbs .sep { color: var(--text-light); }
.file { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 60px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); margin-bottom: 8px; color: var(--text); text-decoration: none; width: 100%; font: inherit; text-align: left; cursor: pointer; }
.file:hover { background: var(--surface-hover); }
.file-ico { flex: 0 0 36px; height: 36px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.file-ico.folder { background: rgba(245,158,11,.15); color: #b45309; font-size: 18px; }
.file-main { flex: 1; min-width: 0; }
.file-name { font-weight: 600; overflow-wrap: anywhere; }
.file-sub { font-size: 12px; color: var(--text-muted); }
.file-dl { flex: 0 0 auto; color: var(--brand); font-size: 20px; }
.banner { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.35); color: var(--text-mid); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 12px; }

/* ── Admin ── */
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border-softer); vertical-align: middle; white-space: nowrap; }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.row-form { display: grid; gap: 12px; }
@media (min-width: 640px) { .row-form.cols { grid-template-columns: 1fr 1fr; } }

/* ── Modal (bottom sheet on phones) ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 200; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); color: var(--text); border-radius: var(--radius); width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; padding: 20px; box-shadow: var(--shadow-lg); }
.modal h2 { margin: 0 0 14px; font-size: 18px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
@media (max-width: 760px) {
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { border-radius: 16px 16px 0 0; max-width: none; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1; }
}
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom)); background: #1e293b; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 300; max-width: 90vw; box-shadow: var(--shadow-lg); }
.toast[hidden] { display: none; }
[hidden] { display: none !important; }
.loading { text-align: center; color: var(--text-muted); padding: 40px 0; }
