/* Método EP — Acompanhamento
   Identidade herdada da homepage: papel, tinta, verde-pinho.
   IBM Plex Mono só para números medidos (dor, adesão %, sessões). */

:root {
  /* Paleta da marca Escoliose Portugal (do logótipo) */
  --paper: #f6f7f5;
  --paper-pure: #ffffff;
  --ink: #24292e;          /* navy/charcoal do wordmark */
  --ink-soft: #55606a;
  --ink-faint: #8b949d;
  --pine: #337992;         /* azul-petróleo (primária) */
  --pine-deep: #285f73;
  --pine-tint: #e6eef2;
  --green: #718b5b;        /* verde-azeitona (secundária) */
  --green-tint: #eaf0e3;
  --gold: #c59035;         /* dourado (acento quente) */
  --gold-tint: #f6ecd8;
  --line: #e2e5e2;
  --danger: #b0503c;       /* terracota — sinal de dor (semântico) */
  --danger-tint: #f5e7e2;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(36, 41, 46, 0.05), 0 10px 28px rgba(36, 41, 46, 0.07);
  --display: "DM Serif Display", Georgia, "Times New Roman", serif;
  --text: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { min-height: 100dvh; }

h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: 0; line-height: 1.12; margin: 0; }
h3 { font-family: var(--text); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; margin: 0; }
h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
a { color: var(--pine); }

.num { font-family: var(--text); font-feature-settings: "tnum" 1; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

button {
  font-family: var(--text);
  font-size: 1rem;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, select, textarea {
  font-family: var(--text);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper-pure);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--pine);
  box-shadow: 0 0 0 3px var(--pine-tint);
}
textarea { resize: vertical; min-height: 72px; }
label { display: block; font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 6px; font-weight: 500; }
.field { margin-bottom: 16px; }
.field-row { display: flex; gap: 12px; }
.field-row > .field { flex: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--pine);
  color: #fff;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: background 0.15s ease, transform 0.05s ease;
  min-height: 48px;
}
.btn:active { transform: translateY(1px); }
.btn:hover { background: var(--pine-deep); }
.btn--block { width: 100%; }
.btn--ghost { background: transparent; color: var(--pine); border: 1px solid var(--line); }
.btn--ghost:hover { background: var(--pine-tint); }
.btn--subtle { background: transparent; color: var(--ink-soft); padding: 8px 10px; min-height: 0; }
.btn--subtle:hover { color: var(--ink); background: transparent; }
.btn--danger { background: transparent; color: var(--danger); border: 1px solid var(--danger-tint); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Layout shell ---------- */
.shell { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  padding: calc(var(--safe-top) + 14px) 20px 12px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.topbar .brand { display: flex; flex-direction: column; }
.topbar .brand .kicker { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--pine); }
.topbar .brand .who { font-family: var(--display); font-size: 1.15rem; }
.main { flex: 1; padding: 20px 20px 120px; }

/* ---------- Bottom nav ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px;
  display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--paper-pure) 92%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 8px 8px calc(var(--safe-bottom) + 8px);
  z-index: 20;
}
.tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 4px; color: var(--ink-faint); font-size: 0.68rem; font-weight: 500;
  border-radius: 8px;
}
.tabbar button .dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.tabbar button.active { color: var(--pine); }
.tabbar button.active .dot { background: var(--pine); }

/* ---------- Cards ---------- */
.card {
  background: var(--paper-pure);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card--flat { box-shadow: none; }
.card__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.card__title { font-family: var(--display); font-size: 1.15rem; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.small { font-size: 0.82rem; }
.tiny { font-size: 0.72rem; }
.hairline { height: 1px; background: var(--line); border: 0; margin: 14px 0; }
.stack > * + * { margin-top: 10px; }

/* ---------- Auth ---------- */
.auth { display: flex; flex-direction: column; min-height: 100dvh; justify-content: center; padding: 32px 24px calc(var(--safe-bottom) + 24px); max-width: 460px; margin: 0 auto; }
.auth__logo { margin: 0 auto 22px; }
.auth__logo-img { display: block; width: 260px; max-width: 78%; height: auto; margin: 0 auto 18px; }
.auth h1 { text-align: center; margin-bottom: 6px; }
.auth .sub { text-align: center; color: var(--ink-soft); margin-bottom: 28px; font-size: 0.95rem; }
.magic-box { background: var(--pine-tint); border: 1px dashed var(--pine); border-radius: var(--radius); padding: 16px; margin-top: 18px; }
.magic-box .lbl { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pine); margin-bottom: 8px; }

/* ---------- Exercise / log rows ---------- */
.ex {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper-pure); padding: 14px 16px; margin-bottom: 12px;
}
.ex.done { border-color: var(--pine); background: linear-gradient(0deg, var(--pine-tint), var(--paper-pure)); }
.ex__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ex__name { font-weight: 600; font-size: 1.02rem; }
.ex__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.chip { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-soft); background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 3px 10px; }
.chip--pine { color: var(--pine); border-color: color-mix(in srgb, var(--pine) 30%, var(--line)); background: var(--pine-tint); }
.ex__notes { margin-top: 8px; font-size: 0.86rem; color: var(--ink-soft); }
.ex__check {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; border: 1.5px solid var(--line);
  display: grid; place-items: center; background: var(--paper-pure); color: transparent;
}
.ex.done .ex__check { background: var(--pine); border-color: var(--pine); color: #fff; }

/* Detail form revealed after "done" */
.ex__detail { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }

/* ---------- 0-10 scale ---------- */
.scale { display: flex; flex-wrap: wrap; gap: 6px; }
.scale button {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.82rem; color: var(--ink-soft); background: var(--paper-pure);
}
.scale button.sel { background: var(--pine); color: #fff; border-color: var(--pine); }
.scale--pain button.sel { background: var(--danger); border-color: var(--danger); }
.scale .zero { color: var(--ink-faint); }

/* ---------- Stats / vitrine ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat {
  background: var(--paper-pure); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.stat .k { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.stat .v { font-family: var(--mono); font-size: 2rem; font-weight: 500; letter-spacing: -0.03em; margin-top: 4px; }
.stat .v small { font-size: 0.9rem; color: var(--ink-faint); }
.stat--pine { background: var(--pine); border-color: var(--pine); color: #fff; }
.stat--pine .k { color: rgba(255,255,255,0.7); }

.segmented { display: inline-flex; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 3px; gap: 2px; }
.segmented button { padding: 6px 14px; border-radius: 18px; font-size: 0.82rem; color: var(--ink-soft); font-family: var(--mono); }
.segmented button.sel { background: var(--pine); color: #fff; }

/* Before/after */
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ba figure { margin: 0; }
.ba img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: var(--radius-sm); background: var(--paper); border: 1px solid var(--line); display: block; }
.ba figcaption { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-soft); margin-top: 6px; text-align: center; }
.ba figcaption b { color: var(--ink); }

/* ---------- Calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { font-family: var(--mono); font-size: 0.6rem; text-transform: uppercase; color: var(--ink-faint); text-align: center; letter-spacing: 0.08em; }
.cal .day {
  aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 0.8rem; color: var(--ink-soft);
  border: 1px solid transparent; position: relative;
}
.cal .day.blank { visibility: hidden; }
.cal .day.today { border-color: var(--pine); font-weight: 500; }
.cal .day.full { background: var(--pine); color: #fff; }
.cal .day.partial { background: var(--pine-tint); color: var(--pine-deep); }
.cal .day.future { color: var(--ink-faint); opacity: 0.5; }

/* ---------- Pain chart ---------- */
.chart { width: 100%; overflow-x: auto; }
.chart svg { display: block; width: 100%; height: auto; }

/* ---------- Empty / notice ---------- */
.notice {
  background: var(--pine-tint); border: 1px solid color-mix(in srgb, var(--pine) 25%, var(--line));
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px;
  font-size: 0.9rem; color: var(--pine-deep);
}
.notice--warn { background: #fbf4e7; border-color: #e7d5ab; color: #6b5320; }
.empty { text-align: center; color: var(--ink-faint); padding: 40px 20px; }
.empty h3 { color: var(--ink-soft); margin-bottom: 6px; }

/* ---------- List rows (physio) ---------- */
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper-pure); margin-bottom: 10px; width: 100%; text-align: left;
}
.row:hover { border-color: var(--pine); }
.row__main { min-width: 0; }
.row__name { font-weight: 600; }
.row__sub { font-size: 0.8rem; color: var(--ink-faint); }
.row__meta { flex-shrink: 0; text-align: right; }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(20,25,23,0.4); z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0; opacity: 0; transition: opacity 0.15s ease;
}
.modal-back.open { opacity: 1; }
.modal {
  background: var(--paper); width: 100%; max-width: 560px;
  border-radius: 20px 20px 0 0; padding: 20px 20px calc(var(--safe-bottom) + 24px);
  max-height: 92dvh; overflow-y: auto; transform: translateY(20px); transition: transform 0.18s ease;
}
.modal-back.open .modal { transform: translateY(0); }
.modal__grip { width: 40px; height: 4px; background: var(--line); border-radius: 3px; margin: 0 auto 16px; }
.modal h2 { margin-bottom: 14px; }

/* ---------- Misc ---------- */
.spacer { height: 8px; }
.center { text-align: center; }
.flex { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.pill-toggle { display: inline-flex; align-items: center; gap: 8px; }
.switch { width: 44px; height: 26px; border-radius: 20px; background: var(--line); position: relative; transition: background 0.15s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.switch.on { background: var(--pine); }
.switch.on::after { transform: translateX(18px); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 90px); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 24px; font-size: 0.88rem;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; z-index: 60; max-width: 88vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 480px) {
  .scale button { width: 38px; height: 38px; }
}

/* ============================================================
   Vitrine — "diário clínico editorial"
   ============================================================ */
.vitrine { display: flex; flex-direction: column; gap: 14px; }

.vit-head { position: relative; overflow: hidden; padding: 2px 2px 2px; }
.vit-head__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.vit-h1 { font-family: var(--display); font-size: 2.1rem; line-height: 1; margin-top: 2px; }
.vit-h2 { font-family: var(--display); font-size: 1.3rem; line-height: 1.1; }
.kicker--teal { color: var(--pine); }
.cobb-bg { position: absolute; top: -26px; right: -8px; width: 190px; height: 150px; pointer-events: none; }
.cobb-path { stroke-dasharray: 320; stroke-dashoffset: 320; animation: cobbDraw 1.7s ease forwards .15s; }
@keyframes cobbDraw { to { stroke-dashoffset: 0; } }

/* Hero adesão */
.vit-hero {
  display: flex; align-items: center; gap: 20px;
  background: linear-gradient(165deg, var(--pine-tint), var(--paper-pure) 70%);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.vit-hero__ring { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
.vit-ring-prog { transition: stroke-dashoffset 1.15s cubic-bezier(.22,1,.36,1); }
.vit-ring__overlay { position: absolute; inset: 0; display: grid; place-items: center; }
.vit-ring__val { display: flex; align-items: baseline; }
.vit-ring__val b { font-family: var(--display); font-size: 2.6rem; line-height: 1; color: var(--ink); }
.vit-ring__val i { font-style: normal; font-size: 1rem; color: var(--ink-faint); margin-left: 2px; }
.vit-hero__meta { min-width: 0; }
.vit-hero__line { margin-top: 8px; color: var(--ink-soft); font-size: 0.95rem; }

/* Duo: sequência + dor */
.vit-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vit-stat {
  background: var(--paper-pure); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px;
}
.vit-stat--green {
  background: linear-gradient(150deg, var(--green), #5d7749);
  border-color: transparent; color: #fff; box-shadow: 0 8px 22px rgba(93, 119, 73, 0.28);
}
.vit-stat--green .kicker, .vit-stat--green .vit-stat__foot { color: rgba(255,255,255,0.82); }
.vit-stat--green .vit-bignum b, .vit-stat--green .vit-bignum i { color: #fff; }
.vit-bignum { display: flex; align-items: baseline; gap: 3px; margin: 2px 0; }
.vit-bignum b { font-family: var(--display); font-size: 3rem; line-height: 0.95; color: var(--ink); }
.vit-bignum i { font-style: normal; font-size: 1rem; color: var(--ink-faint); }
.vit-stat__foot { font-size: 0.76rem; color: var(--ink-faint); }

/* Cartões (dor + antes/depois) */
.vit-card {
  background: var(--paper-pure); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.vit-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.vit-delta { display: inline-flex; align-items: center; gap: 5px; font-size: 0.82rem; font-weight: 600; padding: 4px 11px; border-radius: 20px; }
.vit-delta.is-good { color: #43603a; background: var(--green-tint); }
.vit-delta.is-bad { color: var(--danger); background: var(--danger-tint); }
.vit-tag { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.vit-chart { width: 100%; overflow-x: auto; }
.vit-chart svg { display: block; width: 100%; height: auto; }
.pain-area { opacity: 0; animation: fadeIn 1s ease forwards .5s; }
@keyframes fadeIn { to { opacity: 1; } }

/* Pôster antes/depois */
.poster { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.poster__fig { margin: 0; }
.poster__fig img {
  width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 12px;
  border: 1px solid var(--line); background: var(--paper); display: block;
}
.poster__fig figcaption { text-align: center; margin-top: 8px; font-weight: 600; font-size: 0.86rem; color: var(--ink); }
.poster__fig figcaption span { display: block; font-size: 0.72rem; font-weight: 500; color: var(--ink-faint); margin-top: 1px; }
.poster__seal {
  width: 56px; height: 56px; border-radius: 50%; z-index: 2;
  background: linear-gradient(135deg, var(--gold), #a9781f); color: #fff;
  display: grid; place-items: center; text-align: center; align-self: start; margin-top: 26%;
  box-shadow: 0 5px 14px rgba(169, 120, 31, 0.4); border: 2px solid var(--paper-pure);
}
.poster__seal span { font-family: var(--display); font-size: 1.3rem; line-height: 1; }
.poster__seal i { font-style: normal; font-size: 0.5rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.92; margin-top: 1px; }

.vit-empty { padding: 22px; text-align: center; color: var(--ink-faint); font-size: 0.9rem; background: var(--paper); border: 1px dashed var(--line); border-radius: 12px; }
.vit-foot { text-align: center; font-size: 0.78rem; color: var(--ink-faint); margin-top: 2px; }

/* Entrada em cascata */
.reveal { opacity: 0; animation: revealUp 0.55s cubic-bezier(.22,1,.36,1) forwards; animation-delay: var(--d, 0s); }
@keyframes revealUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; animation: none; }
  .cobb-path { stroke-dashoffset: 0; animation: none; }
  .pain-area { opacity: 1; animation: none; }
  .vit-ring-prog { transition: none; }
}

/* ============================================================
   Hoje — cabeçalho editorial + medidor 0–10
   ============================================================ */
.today-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.today-h1 { font-family: var(--display); font-size: 2rem; line-height: 1.05; margin-top: 3px; }
.today-tag {
  flex-shrink: 0; width: 56px; height: 56px; border-radius: 16px;
  display: flex; align-items: baseline; justify-content: center; gap: 1px;
  background: var(--pine-tint); color: var(--pine-deep);
  border: 1px solid color-mix(in srgb, var(--pine) 20%, var(--line));
}
.today-tag .num { font-family: var(--display); font-size: 1.7rem; line-height: 1; }
.today-tag i { font-style: normal; font-size: 0.82rem; opacity: 0.6; }
.today-tag.is-done { background: linear-gradient(150deg, var(--green), #5d7749); color: #fff; border-color: transparent; align-items: center; }
.today-note { text-align: center; font-size: 0.78rem; color: var(--ink-faint); margin-top: 12px; }

/* Medidor 0–10 */
.gauge { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.gauge:first-of-type { }
.gauge__head { display: flex; align-items: center; justify-content: space-between; }
.gauge__head label { margin: 0; font-size: 0.9rem; font-weight: 600; color: var(--ink-soft); }
.gauge__val { font-family: var(--display); font-size: 1.6rem; line-height: 1; color: var(--ink-faint); }
.gauge__val em { font-style: normal; font-size: 0.78rem; color: var(--ink-faint); margin-left: 1px; }
.gauge__val.is-low { color: var(--green); }
.gauge__val.is-mid { color: var(--gold); }
.gauge__val.is-high { color: var(--danger); }
.gauge__add {
  width: 100%; min-height: 46px; margin-top: 8px; border: 1px dashed var(--line);
  border-radius: var(--radius-sm); color: var(--ink-soft); font-weight: 500; background: var(--paper);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.gauge__add:hover { border-color: var(--pine); color: var(--pine); }
.gauge__clear { display: block; margin: 6px auto 0; font-size: 0.78rem; color: var(--ink-faint); min-height: 34px; }
.gauge__clear:hover { color: var(--ink-soft); }

.gauge__range {
  -webkit-appearance: none; appearance: none; box-sizing: border-box;
  width: 100%; height: 44px; padding: 17px 0; margin: 4px 0 0; background-clip: content-box;
  border-radius: 20px; outline: none; cursor: pointer;
  background: linear-gradient(90deg, #6fa06a 0%, var(--gold) 55%, var(--danger) 100%);
}
.gauge__range:focus-visible { box-shadow: 0 0 0 3px var(--pine-tint); }
.gauge__range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--pine); box-shadow: 0 2px 7px rgba(36,41,46,0.28); cursor: pointer;
}
.gauge__range::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--pine); box-shadow: 0 2px 7px rgba(36,41,46,0.28); cursor: pointer;
}

/* Pulso do check ao marcar feito */
.ex__check.just-done { animation: checkPop 0.42s cubic-bezier(.34,1.56,.64,1); }
@keyframes checkPop { 0% { transform: scale(1); } 35% { transform: scale(1.28); } 100% { transform: scale(1); } }

/* ============================================================
   Calendário — a coluna a formar-se
   ============================================================ */
.cal-wrap { display: flex; flex-direction: column; }

.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.cal-head__title { text-align: center; }
.cal-h1 { font-family: var(--display); font-size: 2rem; line-height: 1; margin-top: 2px; }
.cal-nav {
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  border: 1px solid var(--line); background: var(--paper-pure); color: var(--ink-soft);
  font-size: 1.35rem; line-height: 1; display: grid; place-items: center;
  transition: border-color .15s ease, color .15s ease;
}
.cal-nav:hover { border-color: var(--pine); color: var(--pine); }
.cal-nav:active { transform: scale(0.94); }

/* Resumo do mês */
.cal-summary {
  background: var(--paper-pure); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.cal-sum__row { display: flex; gap: 26px; }
.cal-sum b { font-family: var(--display); font-size: 2rem; line-height: 1; display: block; color: var(--ink); }
.cal-sum span { font-size: 0.74rem; color: var(--ink-faint); }
.cal-bar { height: 6px; border-radius: 6px; background: var(--pine-tint); margin-top: 14px; overflow: hidden; }
.cal-bar i { display: block; height: 100%; width: 0; border-radius: 6px;
  background: linear-gradient(90deg, var(--pine), var(--green));
  animation: barGrow 1.1s cubic-bezier(.22,1,.36,1) forwards .25s; }
@keyframes barGrow { from { width: 0; } to { width: var(--w, 0%); } }
.cal-bar__cap { font-size: 0.73rem; color: var(--ink-faint); margin-top: 7px; }
.cal-bar__cap b { color: var(--ink-soft); }

/* Grelha */
.cal-card { background: var(--paper-pure); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 14px; box-shadow: var(--shadow); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal .dow {
  font-family: var(--text); font-size: 0.62rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--ink-faint); text-align: center; padding-bottom: 6px;
}
.cal .day {
  position: relative; aspect-ratio: auto; min-height: 48px; border-radius: 13px;
  display: grid; place-items: center; border: 1px solid transparent;
  font-family: var(--display); font-size: 1.02rem; font-weight: 400;
  color: var(--ink-soft); background: var(--paper);
  transition: transform .12s ease;
}
.cal .day.blank { visibility: hidden; }
.cal button.day { cursor: pointer; }
.cal button.day:active { transform: scale(0.93); }
.cal .day.partial { background: var(--pine-tint); color: var(--pine-deep); }
.cal .day.full {
  background: linear-gradient(155deg, var(--pine), var(--pine-deep)); color: #fff;
  box-shadow: 0 4px 11px rgba(51, 121, 146, 0.30);
}
.cal .day.today { box-shadow: 0 0 0 2px var(--gold); font-weight: 400; border-color: transparent; }
.cal .day.today.full { box-shadow: 0 0 0 2px var(--gold), 0 4px 11px rgba(51, 121, 146, 0.30); }
.cal .day.future { color: var(--ink-faint); opacity: 0.4; background: transparent; }
/* Cadeia entre dias completos consecutivos — as vértebras a ligar */
.cal .day.link-right::after {
  content: ""; position: absolute; right: -6px; top: 50%; transform: translateY(-50%);
  width: 7px; height: 3px; border-radius: 2px; background: var(--pine); opacity: 0.55; z-index: 1;
}
/* Entrada em onda */
.cal .day:not(.blank) { opacity: 0; animation: dayPop .34s cubic-bezier(.34,1.56,.64,1) forwards; animation-delay: var(--dd, 0s); }
@keyframes dayPop { from { opacity: 0; transform: scale(0.78); } to { opacity: 1; transform: none; } }

.cal-legend { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 16px; font-size: 0.72rem; color: var(--ink-faint); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 14px; height: 14px; border-radius: 5px; display: inline-block; }
.cal-legend i.lg-full { background: linear-gradient(155deg, var(--pine), var(--pine-deep)); }
.cal-legend i.lg-partial { background: var(--pine-tint); }
.cal-legend i.lg-today { background: var(--paper); box-shadow: 0 0 0 2px var(--gold); }
.cal-hint { text-align: center; font-size: 0.75rem; color: var(--ink-faint); margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  .cal .day:not(.blank) { opacity: 1; animation: none; }
  .cal-bar i { animation: none; width: var(--w, 0%); }
}

/* ============================================================
   Plano — "a prescrição"
   ============================================================ */
.plan-head { margin-bottom: 16px; }
.plan-h1 { font-family: var(--display); font-size: 2.1rem; line-height: 1; margin-top: 2px; }

.plan-rhythm {
  background: linear-gradient(160deg, var(--pine-tint), var(--paper-pure) 72%);
  border: 1px solid color-mix(in srgb, var(--pine) 16%, var(--line));
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.plan-rhythm__num { display: flex; align-items: baseline; gap: 9px; }
.plan-rhythm__num b { font-family: var(--display); font-size: 2.6rem; line-height: 1; color: var(--pine-deep); font-variant-numeric: tabular-nums; }
.plan-rhythm__num i { font-style: normal; font-size: 0.82rem; color: var(--ink-soft); }
.plan-rhythm__line { margin-top: 8px; font-size: 0.82rem; color: var(--ink-soft); }
.plan-rhythm__line b { color: var(--ink); font-weight: 600; }

.rx-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.rx {
  display: flex; gap: 14px;
  background: var(--paper-pure); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.rx__no {
  flex-shrink: 0; font-family: var(--display); font-size: 1.5rem; line-height: 1;
  color: var(--pine); opacity: 0.34; font-variant-numeric: tabular-nums; padding-top: 2px;
}
.rx__body { flex: 1; min-width: 0; }
.rx__name { font-family: var(--display); font-size: 1.32rem; line-height: 1.14; }
.rx__facts { display: flex; flex-wrap: wrap; gap: 18px 28px; margin-top: 14px; }
.fact { min-width: 0; }
.fact__k { display: block; font-size: 0.62rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 7px; }
.fact__v { display: block; font-size: 0.84rem; color: var(--ink-soft); }
.fact__v b { color: var(--ink); font-weight: 600; }
.fact__v--serif { font-family: var(--display); font-size: 1.12rem; color: var(--ink); }

/* Sete contas = a semana */
.wk { display: flex; gap: 5px; margin-bottom: 7px; }
.wk__bead {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line);
  animation: beadIn .32s cubic-bezier(.34,1.56,.64,1) backwards; animation-delay: var(--dd, 0s);
}
.wk__bead.is-on { background: linear-gradient(150deg, var(--pine), var(--pine-deep)); border-color: transparent; box-shadow: 0 2px 5px rgba(51,121,146,0.30); }
@keyframes beadIn { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: none; } }

.rx__note {
  margin: 14px 0 0; padding: 2px 0 2px 14px; border-left: 2px solid var(--green);
  font-family: var(--display); font-size: 0.98rem; line-height: 1.45; color: var(--ink-soft);
}

/* Nota assinada da consulta */
.rx-note {
  margin-top: 18px; padding: 20px;
  background: var(--paper-pure); border: 1px solid var(--line);
  border-top: 3px solid var(--gold); border-radius: var(--radius); box-shadow: var(--shadow);
}
.rx-note__body { font-family: var(--display); font-size: 1.05rem; line-height: 1.5; margin-top: 10px; color: var(--ink); }
.rx-note__sign { display: flex; flex-direction: column; align-items: flex-end; margin-top: 18px; }
.rx-note__rule { width: 108px; height: 1px; background: var(--line); margin-bottom: 7px; }
.rx-note__sign span { font-size: 0.7rem; color: var(--ink-faint); text-align: right; }
.rx-note__sign i { display: block; font-style: normal; margin-top: 2px; }

/* ============================================================
   Perfil — identidade + escada das 10 sessões
   ============================================================ */
.prof-id {
  display: flex; align-items: center; gap: 16px;
  background: var(--paper-pure); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.prof-mono {
  flex-shrink: 0; width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--pine), var(--pine-deep)); color: #fff;
  font-family: var(--display); font-size: 1.5rem; line-height: 1;
  box-shadow: 0 5px 14px rgba(51,121,146,0.30);
}
.prof-id__meta { min-width: 0; }
.prof-name { font-family: var(--display); font-size: 1.42rem; line-height: 1.12; }
.prof-email { font-size: 0.8rem; color: var(--ink-faint); margin-top: 3px; overflow-wrap: anywhere; }

.prof-mile {
  background: linear-gradient(165deg, var(--pine-tint), var(--paper-pure) 72%);
  border: 1px solid color-mix(in srgb, var(--pine) 16%, var(--line));
  border-radius: var(--radius); padding: 18px 20px 20px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.prof-mile.is-due { background: linear-gradient(165deg, var(--gold-tint), var(--paper-pure) 72%); border-color: color-mix(in srgb, var(--gold) 34%, var(--line)); }
.prof-mile__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.prof-mile__num { display: flex; align-items: baseline; gap: 7px; }
.prof-mile__num b { font-family: var(--display); font-size: 2.2rem; line-height: 1; color: var(--pine-deep); font-variant-numeric: tabular-nums; }
.prof-mile.is-due .prof-mile__num b { color: var(--gold); }
.prof-mile__num i { font-style: normal; font-size: 0.78rem; color: var(--ink-soft); }
.prof-mile__line { margin-top: 14px; font-size: 0.8rem; color: var(--ink-soft); line-height: 1.45; }
.prof-mile__line b { color: var(--ink); font-weight: 600; }

/* Escada de 10 — a coluna a subir até ao registo fotográfico */
.lad { display: flex; align-items: center; gap: 6px; margin-top: 16px; }
.lad__bead {
  flex: 1; height: 12px; border-radius: 7px;
  background: var(--paper-pure); border: 1px solid var(--line);
  animation: beadIn .32s cubic-bezier(.34,1.56,.64,1) backwards; animation-delay: var(--dd, 0s);
}
.lad__bead.is-on { background: linear-gradient(150deg, var(--pine), var(--pine-deep)); border-color: transparent; box-shadow: 0 2px 6px rgba(51,121,146,0.26); }
.lad__bead.is-goal { flex: 0 0 22px; height: 16px; border-style: dashed; border-color: var(--gold); }
.lad__bead.is-goal.is-due, .lad__bead.is-goal.is-on {
  background: linear-gradient(150deg, var(--gold), #a97722); border-style: solid; border-color: transparent;
  box-shadow: 0 3px 9px rgba(197,144,53,0.38);
}

.prof-card {
  background: var(--paper-pure); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.prof-card__title { font-family: var(--display); font-size: 1.12rem; margin-bottom: 5px; }
.prof-consent { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 0.74rem; color: var(--ink-faint); }
.prof-consent.is-on { color: var(--green); }
.prof-consent b { color: inherit; }

.prof-tip {
  display: flex; align-items: center; gap: 14px;
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 18px; background: transparent;
}
.prof-tip p { font-size: 0.8rem; color: var(--ink-soft); }
.prof-tip svg { flex-shrink: 0; opacity: 0.75; }

@media (prefers-reduced-motion: reduce) {
  .wk__bead, .lad__bead { animation: none; }
}

/* Kicker editorial — sobrelinha curta antes dos títulos */
.kicker {
  display: block; font-size: 0.64rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-faint); font-weight: 600;
}
.kicker--teal { color: var(--pine); }

/* Nota da consulta: selo dourado em vez de bordo superior */
.rx-note { border-top: 1px solid var(--line); }
.rx-note::before {
  content: ""; display: block; width: 42px; height: 3px; border-radius: 2px;
  background: var(--gold); margin-bottom: 14px;
}

/* ============================================================
   Consultório — área da fisioterapeuta
   ============================================================ */
.btn--compact { padding: 9px 15px; min-height: 40px; font-size: 0.88rem; border-radius: 22px; }

/* Resumo (pacientes / fotos pendentes) */
.pro-summary { display: flex; gap: 12px; margin: 4px 0 18px; }
.pro-summary__stat {
  flex: 1; background: var(--paper-pure); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
}
.pro-summary__num b { font-family: var(--display); font-size: 1.9rem; line-height: 1; color: var(--pine-deep); font-variant-numeric: tabular-nums; }
.pro-summary__stat span { display: block; margin-top: 4px; font-size: 0.74rem; color: var(--ink-soft); }
.pro-summary__stat.is-due { background: linear-gradient(160deg, var(--gold-tint), var(--paper-pure) 72%); border-color: color-mix(in srgb, var(--gold) 30%, var(--line)); }
.pro-summary__stat.is-due .pro-summary__num b { color: var(--gold); }
.pro-summary__stat.is-ok .pro-summary__num b { color: var(--green); }

/* Lista de pacientes — cartões */
.pt-list { display: flex; flex-direction: column; gap: 10px; }
.pt-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--paper-pure); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 14px; box-shadow: var(--shadow);
  transition: border-color .15s, transform .05s;
}
.pt-card:hover { border-color: color-mix(in srgb, var(--pine) 40%, var(--line)); }
.pt-card:active { transform: scale(0.99); }
.pt-mono {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--pine), var(--pine-deep)); color: #fff;
  font-family: var(--display); font-size: 1.15rem; line-height: 1;
  box-shadow: 0 3px 9px rgba(51,121,146,0.28);
}
.pt-card__body { flex: 1; min-width: 0; }
.pt-card__name { font-weight: 600; font-size: 1.02rem; }
.pt-card__sub { font-size: 0.78rem; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-card__meta { flex-shrink: 0; text-align: right; }
.pt-card__num b { font-family: var(--display); font-size: 1.3rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.pt-card__num i { display: block; font-style: normal; font-size: 0.64rem; color: var(--ink-faint); }
.pt-card__chev { flex-shrink: 0; color: var(--ink-faint); }
.pt-flag {
  display: inline-block; margin-top: 6px; font-size: 0.68rem; font-weight: 600;
  color: var(--gold); background: var(--gold-tint);
  border-radius: 20px; padding: 2px 9px;
}
.pt-flag--soft { color: var(--ink-soft); background: var(--paper); border: 1px solid var(--line); }

/* Cabeçalho do detalhe do paciente */
.pt-detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.pt-mono--lg { width: 54px; height: 54px; font-size: 1.35rem; }
.pt-detail-head__meta { flex: 1; min-width: 0; }
.pt-detail-sub { font-size: 0.8rem; color: var(--ink-faint); margin-top: 2px; overflow-wrap: anywhere; }
.pt-codebtn {
  flex-shrink: 0; display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--pine); background: var(--pine-tint);
  border: 1px solid color-mix(in srgb, var(--pine) 22%, var(--line));
  border-radius: 14px; padding: 8px 12px; min-height: 48px; justify-content: center;
}
.pt-codebtn span { font-size: 0.64rem; font-weight: 600; letter-spacing: 0.04em; }
.pt-codebtn:hover { background: color-mix(in srgb, var(--pine) 14%, var(--paper-pure)); }
.pt-codebtn.is-loading { opacity: 0.5; }

/* Aviso de foto pendente (marca dourada) */
.pt-due {
  display: flex; gap: 14px; align-items: flex-start;
  background: linear-gradient(160deg, var(--gold-tint), var(--paper-pure) 74%);
  border: 1px solid color-mix(in srgb, var(--gold) 32%, var(--line));
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px; font-size: 0.86rem; color: var(--ink-soft);
}
.pt-due b { color: var(--ink); }
.pt-due__mark {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: linear-gradient(150deg, var(--gold), #a97722);
  color: #fff; font-family: var(--display); font-size: 1.1rem; box-shadow: 0 3px 9px rgba(197,144,53,0.34);
}

/* Navegação de secções (Plano / Consultas / Fotos / Vitrine) */
.sec-nav {
  display: flex; gap: 4px; margin-bottom: 18px; overflow-x: auto;
  border-bottom: 1px solid var(--line);
}
.sec-nav button {
  flex: 1; white-space: nowrap; padding: 10px 12px; min-height: 44px;
  color: var(--ink-soft); font-size: 0.86rem; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.sec-nav button.sel { color: var(--pine); border-bottom-color: var(--pine); font-weight: 600; }

.sec-head { margin-bottom: 14px; align-items: center; }
.sec-h2 { font-family: var(--display); font-size: 1.3rem; }
.rx__actions { display: flex; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }

/* Linha do tempo das consultas */
.tl { display: flex; flex-direction: column; }
.tl__item { display: flex; gap: 14px; }
.tl__rail { position: relative; flex-shrink: 0; display: flex; justify-content: center; width: 40px; }
.tl__rail::before {
  content: ""; position: absolute; top: 0; bottom: -0; left: 50%; transform: translateX(-50%);
  width: 2px; background: var(--line);
}
.tl__item:first-child .tl__rail::before { top: 20px; }
.tl__item:last-child .tl__rail::before { bottom: auto; height: 20px; }
.tl__bead {
  position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: var(--paper-pure);
  border: 2px solid var(--pine); color: var(--pine-deep);
  font-size: 0.9rem; box-shadow: 0 0 0 4px var(--paper);
}
.tl__bead.is-milestone { background: linear-gradient(150deg, var(--gold), #a97722); border-color: transparent; color: #fff; }
.tl__card { flex: 1; min-width: 0; background: var(--paper-pure); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.tl__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tl__sessao { font-weight: 600; font-size: 0.92rem; }
.tl__ms { font-size: 0.62rem; font-weight: 600; color: var(--gold); background: var(--gold-tint); border-radius: 12px; padding: 2px 7px; margin-left: 4px; }
.tl__notes { margin-top: 8px; font-size: 0.9rem; color: var(--ink-soft); line-height: 1.5; }

/* Grelha de fotos de postura */
.ph-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ph-frame { margin: 0; }
.ph-frame img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: var(--radius-sm); background: var(--paper); border: 1px solid var(--line); display: block; }
.ph-frame figcaption { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; gap: 8px; }
.ph-tag { font-family: var(--display); font-size: 0.92rem; }
.ph-del { font-size: 0.7rem; color: var(--danger); padding: 4px 6px; }
.ph-del:hover { text-decoration: underline; }

.pt-consent-gate {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--paper-pure); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 18px; color: var(--ink);
}
.pt-consent-gate svg { flex-shrink: 0; color: var(--gold); margin-top: 2px; }
.pt-consent-gate b { display: block; margin-bottom: 4px; }

/* Código de acesso gerado */
.code-show {
  font-size: 2.2rem; letter-spacing: 0.28em; text-align: center; font-weight: 600;
  color: var(--pine-deep); background: var(--pine-tint);
  border: 1px dashed var(--pine); border-radius: var(--radius);
  padding: 18px 12px; margin: 14px 0 10px;
}

@media (prefers-reduced-motion: reduce) {
  .pt-card, .pro-summary__stat { animation: none; }
}

/* Zona de risco (remover paciente — só admin) */
.danger-zone {
  margin-top: 28px; padding-top: 18px; border-top: 1px dashed var(--danger-tint);
}
.danger-zone__k {
  display: block; font-size: 0.62rem; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--danger); font-weight: 600; margin-bottom: 10px;
}
/* Botão de confirmação vermelho sólido (dentro do modal de remoção) */
.modal .btn--danger[data-action="confirm-del-patient"] {
  background: var(--danger); color: #fff; border-color: var(--danger);
}
.modal .btn--danger[data-action="confirm-del-patient"]:hover { background: #99422f; }
