:root {
  --brand-400: #2FC4BC;
  --brand-500: #16A9A3;
  --brand-600: #0F8C8C;
  --brand-700: #0B6E70;
  --ink-900: #0E2A2F;
  --ink-700: #234A50;
  --ink-500: #4F757C;
  --ink-300: #7F9DA4;
  --bg: #EEF4F5;
  --card: #FFFFFF;
  --line: #DEEAEC;
  --ok: #23834F;
  --warn: #9A6416;
  --bad: #B23A32;
  --info: #2A628F;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(14, 42, 47, .06);
  --shadow-md: 0 10px 30px rgba(14, 42, 47, .08);
  --sidebar-w: clamp(196px, 15vw, 244px);
  --nav-gap: clamp(1px, .3vh, 4px);
  --nav-pad-y: clamp(6px, .85vh, 10px);
  --nav-link-min: 34px;
  --nav-link-max: 52px;
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; min-width: 0; }

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: clip;
}

@supports not (overflow-x: clip) {
  html, body { overflow-x: visible; }
}

body {
  background: var(--bg);
  color: var(--ink-900);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg, video, iframe, canvas { max-width: 100%; }

a { color: var(--brand-600); }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 60;
  background: var(--brand-600); color: #fff; padding: 10px 16px; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: 4px;
}

.shell { display: flex; min-height: 100vh; min-height: 100dvh; width: 100%; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--card);
  border-right: 1px solid var(--line);
  padding: clamp(12px, 1.6vh, 20px) 12px clamp(10px, 1.4vh, 16px);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.2vh, 16px);
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.brand {
  display: flex; align-items: center; gap: 10px; padding: 0 4px;
  text-decoration: none; color: inherit; flex: 0 0 auto;
}
.brand-mark {
  width: clamp(30px, 3.4vh, 38px); height: clamp(30px, 3.4vh, 38px);
  display: grid; place-items: center; flex: 0 0 auto;
  border-radius: 11px; color: #fff;
  background: linear-gradient(140deg, var(--brand-400), var(--brand-600));
}
.brand-mark--plain { background: rgba(255, 255, 255, .18); }
.brand-mark svg { width: 58%; height: 58%; }
.brand-text { font-weight: 700; font-size: clamp(15px, 1.7vh, 18px); color: var(--ink-900); white-space: nowrap; }
.brand-text em { font-style: normal; color: var(--brand-600); }
.brand-text--light { color: #fff; }
.brand-text--light em { color: #DFF6F5; }

.nav { display: flex; flex-direction: column; gap: var(--nav-gap); }
.nav-main {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  overscroll-behavior: contain; scrollbar-width: thin;
  justify-content: space-between;
}
.nav-main .nav-link {
  flex: 1 1 auto;
  min-height: var(--nav-link-min);
  max-height: var(--nav-link-max);
}
.nav-main::-webkit-scrollbar { width: 6px; }
.nav-main::-webkit-scrollbar-thumb { background: #D3E4E6; border-radius: 99px; }
.nav-foot { flex: 0 0 auto; border-top: 1px solid var(--line); padding-top: clamp(6px, .9vh, 11px); }

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: var(--nav-pad-y) 11px; border-radius: var(--radius-sm);
  color: var(--ink-700); text-decoration: none; font-weight: 500;
  font-size: clamp(13px, 1.42vh, 14.2px); line-height: 1.25;
  transition: background .16s ease, color .16s ease;
}
.nav-link:hover { background: #F1F8F8; color: var(--brand-700); }
.nav-link.is-active {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff; box-shadow: var(--shadow-sm);
}
.nav-icon { display: grid; place-items: center; width: 19px; height: 19px; flex: 0 0 19px; }
.nav-icon svg { width: 100%; height: 100%; }
.nav-text { min-width: 0; }

.nav-scrim {
  display: none; position: fixed; inset: 0; z-index: 25;
  background: rgba(14, 42, 47, .42); border: 0; cursor: pointer;
}

.content { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 13px clamp(14px, 2vw, 26px); background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 12;
}
.page-title { font-size: clamp(16px, 1.9vh, 18px); margin: 0; font-weight: 600; flex: 1 1 auto; min-width: 0; }
.who { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.who-text { text-align: right; line-height: 1.25; }
.who-text strong { display: block; font-size: 14px; }
.who-text span { font-size: 12px; color: var(--ink-500); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 36px;
  background: linear-gradient(140deg, var(--brand-400), var(--brand-600)); color: #fff; font-weight: 700;
}

.nav-toggle {
  display: none; flex-direction: column; gap: 4px; cursor: pointer;
  padding: 8px; background: none; border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.nav-toggle span { width: 18px; height: 2px; background: var(--ink-700); border-radius: 2px; }

.main {
  padding: clamp(16px, 2.2vh, 24px) clamp(14px, 2vw, 26px) clamp(26px, 4vh, 40px);
  display: flex; flex-direction: column; gap: clamp(14px, 2vh, 20px);
  flex: 1 1 auto; min-width: 0;
}

.flash-area:empty { display: none; }
.flash-area { display: flex; flex-direction: column; gap: 10px; }

.banner {
  border-radius: var(--radius-lg);
  background: linear-gradient(118deg, var(--brand-400) 0%, var(--brand-600) 58%, var(--brand-700) 100%);
  color: #fff; padding: clamp(18px, 2.6vh, 26px) clamp(20px, 2vw, 28px);
  display: flex; align-items: center; justify-content: space-between; gap: 22px;
  box-shadow: var(--shadow-md); overflow: hidden;
}
.banner-copy { min-width: 0; }
.banner-eyebrow { margin: 0 0 6px; font-size: 12px; letter-spacing: .09em; text-transform: uppercase; opacity: .85; }
.banner h2 { margin: 0; font-size: clamp(19px, 2.6vh, 25px); font-weight: 700; line-height: 1.2; }
.banner-sub { margin: 8px 0 0; opacity: .92; font-size: 14px; max-width: 62ch; }
.banner-art { position: relative; width: clamp(120px, 16vw, 220px); height: 60px; flex: 0 0 auto; opacity: .85; }
.banner-art svg { width: 100%; height: 100%; fill: none; stroke: rgba(255,255,255,.9); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pulse-dot {
  position: absolute; right: 6px; top: 22px; width: 10px; height: 10px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,.7); animation: pulse 2.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,.6); }
  70% { box-shadow: 0 0 0 14px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

.grid { display: grid; gap: 16px; min-width: 0; }
.grid > * { min-width: 0; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 186px), 1fr)); }
.grid--split { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 258px), 1fr)); }
.grid--roles { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid--form { grid-template-columns: repeat(auto-fit, minmax(min(100%, 216px), 1fr)); gap: 14px; }

.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 15px 17px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand-500); }
.stat--amber::after { background: var(--warn); }
.stat--rose::after { background: var(--bad); }
.stat--green::after { background: var(--ok); }
.stat-label { margin: 0; font-size: 12.5px; color: var(--ink-500); text-transform: uppercase; letter-spacing: .06em; }
.stat-value { margin: 6px 0 0; font-size: clamp(23px, 3.2vh, 30px); font-weight: 700; line-height: 1; }
.stat-sub { margin: 6px 0 0; font-size: 12.6px; color: var(--ink-500); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); overflow: hidden; min-width: 0;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 17px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.card-head h3 { margin: 0; font-size: 15.5px; font-weight: 600; }
.card-head p { margin: 2px 0 0; font-size: 12.8px; color: var(--ink-500); }
.card-body { padding: 17px; min-width: 0; }
.card-body--flush { padding: 0; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600)); color: #fff;
  padding: 9px 16px; border-radius: 999px; font: inherit; font-weight: 600; font-size: 14px;
  text-decoration: none; transition: transform .12s ease, box-shadow .16s ease;
}
.btn:hover { box-shadow: 0 6px 16px rgba(15,140,140,.28); transform: translateY(-1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--ghost { background: #fff; color: var(--brand-700); border: 1px solid var(--line); }
.btn--ghost:hover { box-shadow: var(--shadow-sm); }
.btn--sm { padding: 6px 13px; font-size: 13px; }

.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-600); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn--danger { color: var(--bad); }
.inline-form { display: inline; }

input, select, textarea {
  width: 100%; font: inherit; color: var(--ink-900);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 11px; background: #fff;
}
textarea { min-height: 88px; resize: vertical; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-700); }
label.field span.hint { font-weight: 500; color: var(--ink-500); font-size: 12px; }
.field-wide { grid-column: 1 / -1; }
.field-row { display: flex; justify-content: flex-end; margin: -6px 0 14px; font-size: 13.4px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px; margin: 0 0 16px; min-width: 0; }
legend { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--brand-700); padding: 0 6px; }
.checkline { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; }
.checkline input { width: 17px; height: 17px; flex: 0 0 17px; }

.password-wrap { position: relative; display: block; width: 100%; }
.password-wrap input { padding-right: 44px; }
.password-toggle {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 30px; display: grid; place-items: center;
  background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer;
  color: var(--ink-500); padding: 0;
}
.password-toggle:hover { color: var(--brand-700); background: #F1F8F8; }
.password-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.table-wrap { overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 15px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); background: #F7FBFB; font-weight: 600; }
tbody tr:hover { background: #F8FCFC; }
tbody tr:last-child td { border-bottom: 0; }
td.actions { white-space: nowrap; vertical-align: middle; }
td.actions > *,
td.actions > form {
  display: inline-flex; vertical-align: middle; margin: 2px 6px 2px 0;
}
td.actions > *:last-child { margin-right: 0; }
td.actions a,
td.actions .link-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; text-decoration: none; font-size: 13px; font-weight: 600;
  line-height: 1.2; color: var(--brand-700); white-space: nowrap;
}
td.actions a:hover,
td.actions .link-btn:hover { background: #F1F8F8; border-color: #C9E2E2; }
td.actions .link-btn--danger { color: var(--bad); border-color: #F0D2CF; }
td.actions .link-btn--danger:hover { background: #FDF1EF; border-color: #E7BCB7; }
.empty-row td { text-align: center; padding: 32px 16px; color: var(--ink-500); }
.empty-row p { margin: 0 0 12px; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap;
}
.badge--ok { background: #E7F6EE; color: var(--ok); border-color: #C7E9D6; }
.badge--warn { background: #FDF2E0; color: var(--warn); border-color: #F4E0BC; }
.badge--bad { background: #FDECEA; color: var(--bad); border-color: #F5CFCB; }
.badge--info { background: #E9F2FA; color: var(--info); border-color: #CFE2F2; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid; }
.alert--success { background: #E7F6EE; border-color: #C7E9D6; color: var(--ok); }
.alert--error { background: #FDECEA; border-color: #F5CFCB; color: var(--bad); }
.alert--info { background: #E9F2FA; border-color: #CFE2F2; color: var(--info); }

.media-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0E2A2F; border-radius: var(--radius-md); overflow: hidden; }
.media-frame iframe, .media-frame video, .media-frame img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.media-frame--image img { object-fit: contain; background: #F1F7F7; }
.media-frame--empty { display: grid; place-items: center; background: #F1F7F7; color: var(--ink-500); }
.media-frame--empty p { margin: 0; padding: 0 20px; text-align: center; font-size: 13.5px; }
.media-frame.is-loading::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, #E7EFF0 25%, #F3F8F9 37%, #E7EFF0 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite;
}
.media-frame.is-loading::after {
  content: ""; position: absolute; z-index: 2; left: 50%; top: 50%;
  width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
  border: 2.5px solid rgba(15,140,140,.25); border-top-color: var(--brand-600);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.exercise-card { display: flex; flex-direction: column; }
.exercise-card .card-body { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.exercise-card h4 { margin: 0; font-size: 15.5px; }
.exercise-card p.desc { margin: 0; font-size: 13.4px; color: var(--ink-500); }
.meta-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; padding-top: 6px; }
.meta-chip { font-size: 12px; background: #F1F7F7; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; color: var(--ink-700); }

.pain-scale { display: flex; align-items: center; gap: 9px; min-width: 128px; }
.pain-track { flex: 1; height: 7px; border-radius: 99px; background: #E8F0F1; overflow: hidden; }
.pain-fill { display: block; height: 100%; border-radius: 99px; }
.pain-fill.low { background: var(--ok); }
.pain-fill.mid { background: var(--warn); }
.pain-fill.high { background: var(--bad); }
.pain-num { font-weight: 700; font-size: 13px; width: 34px; }

.trend { display: flex; align-items: flex-end; gap: 5px; height: 74px; }
.trend-bar { flex: 1; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, var(--brand-400), var(--brand-600)); min-height: 5px; }
.trend-bar.high { background: linear-gradient(180deg, #ED8279, var(--bad)); }
.trend-bar.mid { background: linear-gradient(180deg, #F0BC72, var(--warn)); }

.list-plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list-plain li { padding: 11px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.list-plain li:last-child { border-bottom: 0; }
.list-plain strong { font-size: 14px; font-weight: 600; }
.list-plain span.sub { display: block; font-size: 12.6px; color: var(--ink-500); }

.pager { display: flex; gap: 6px; padding: 14px 17px; flex-wrap: wrap; }
.pager a { padding: 5px 11px; border-radius: var(--radius-sm); border: 1px solid var(--line); text-decoration: none; color: var(--ink-700); font-size: 13.5px; }
.pager a.is-current { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

.foot { padding: 15px clamp(14px, 2vw, 26px); display: flex; justify-content: space-between; gap: 12px; color: var(--ink-300); font-size: 12.6px; border-top: 1px solid var(--line); flex-wrap: wrap; }

.skeleton { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.sk-line { display: block; height: 13px; border-radius: 6px; background: linear-gradient(90deg, #E7EFF0 25%, #F3F8F9 37%, #E7EFF0 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.sk-line--title { height: 18px; width: 42%; }
.sk-line:nth-child(3) { width: 88%; }
.sk-line:nth-child(4) { width: 74%; }
.sk-line:nth-child(5) { width: 81%; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.route-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 70; pointer-events: none; opacity: 0; transition: opacity .2s ease; }
.route-progress.is-active { opacity: 1; }
.route-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-400), var(--brand-600)); transition: width .3s ease; }

.auth-page { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
.auth-art {
  background: linear-gradient(150deg, var(--brand-400), var(--brand-600) 55%, var(--brand-700));
  color: #fff; padding: clamp(30px, 5vh, 52px) clamp(26px, 4vw, 56px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 22px;
}
.auth-art h1 { font-size: clamp(23px, 3.4vh, 33px); margin: 18px 0 12px; line-height: 1.18; max-width: 15ch; }
.auth-art p { max-width: 42ch; opacity: .92; margin: 0; }
.auth-points { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 12px; }
.auth-points li { display: flex; gap: 11px; align-items: flex-start; font-size: 14.4px; }
.auth-points svg { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 2px; }
.auth-foot { margin: 0; font-size: 12.6px; opacity: .78; }
.auth-form-wrap { display: grid; place-items: center; padding: clamp(24px, 4vh, 40px) 20px; background: var(--bg); }
.auth-card { width: min(410px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(22px, 3vh, 30px); box-shadow: var(--shadow-md); }
.auth-card h2 { margin: 0 0 6px; font-size: 22px; }
.auth-card .lede { margin: 0 0 20px; color: var(--ink-500); font-size: 14px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .btn { width: 100%; }
.auth-note { margin-top: 18px; font-size: 12.6px; color: var(--ink-500); border-top: 1px solid var(--line); padding-top: 14px; }

.landing { background: var(--card); }
.landing-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 14px clamp(16px, 4vw, 54px); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(255, 255, 255, .93); backdrop-filter: blur(8px); z-index: 20;
}
.landing-nav { display: flex; align-items: center; gap: clamp(12px, 2vw, 26px); }
.landing-nav a { color: var(--ink-700); text-decoration: none; font-weight: 500; font-size: 14px; }
.landing-nav a.btn { color: #fff; }
.landing-nav a:not(.btn):hover { color: var(--brand-700); }

.hero {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(26px, 4vw, 52px); align-items: center;
  padding: clamp(34px, 7vh, 74px) clamp(16px, 4vw, 54px);
  background: linear-gradient(170deg, #F5FBFB 0%, var(--card) 62%);
}
.eyebrow { margin: 0 0 12px; font-size: 12px; letter-spacing: .11em; text-transform: uppercase; color: var(--brand-600); font-weight: 700; }
.hero h1 { margin: 0 0 16px; font-size: clamp(28px, 4.6vw, 46px); line-height: 1.1; letter-spacing: -.015em; max-width: 17ch; }
.hero-lede { margin: 0 0 24px; font-size: clamp(15px, 1.2vw, 17px); color: var(--ink-500); max-width: 54ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { margin: 16px 0 0; font-size: 13px; color: var(--ink-500); }

.hero-panel { display: flex; justify-content: center; }
.hero-card {
  width: min(100%, 380px); background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.hero-card-head { display: flex; align-items: center; gap: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-500); font-weight: 600; }
.hero-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-500); box-shadow: 0 0 0 0 rgba(22,169,163,.6); animation: pulse 2.6s infinite; }
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.hero-row strong { display: block; font-size: 14px; }
.hero-row span { font-size: 12.6px; color: var(--ink-500); }
.hero-trend { display: flex; align-items: flex-end; gap: 6px; height: 70px; }
.hero-caption { margin: 0; font-size: 12.6px; color: var(--ink-500); }

.band { padding: clamp(34px, 6vh, 68px) clamp(16px, 4vw, 54px); }
.band--tint { background: var(--bg); }
.band-head { max-width: 62ch; margin: 0 0 clamp(20px, 3vh, 32px); }
.band-head h2 { margin: 0 0 10px; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.01em; }
.band-head p { margin: 0; color: var(--ink-500); font-size: 15px; }

.feature-card .card-body { display: flex; flex-direction: column; gap: 9px; }
.feature-card h3, .role-card h3 { margin: 0; font-size: 16px; }
.feature-card p { margin: 0; font-size: 13.8px; color: var(--ink-500); }
.feature-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: #E8F5F5; color: var(--brand-700);
}
.feature-icon svg { width: 21px; height: 21px; }
.role-card .card-body { display: flex; flex-direction: column; gap: 10px; }
.role-card ul { margin: 0; padding-left: 18px; color: var(--ink-500); font-size: 13.8px; display: flex; flex-direction: column; gap: 6px; }

.cta-band { padding-top: 0; }
.cta-inner {
  background: linear-gradient(118deg, var(--brand-400), var(--brand-600) 58%, var(--brand-700));
  color: #fff; border-radius: var(--radius-lg); padding: clamp(24px, 4vh, 40px);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cta-inner h2 { margin: 0 0 8px; font-size: clamp(20px, 2.4vw, 27px); }
.cta-inner p { margin: 0; opacity: .92; max-width: 56ch; }
.cta-inner .btn { background: #fff; color: var(--brand-700); }

.landing-foot {
  padding: 20px clamp(16px, 4vw, 54px); border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--ink-300); font-size: 12.6px;
}

.print-only { display: none; }

@media (max-width: 1040px) {
  .grid--split { grid-template-columns: minmax(0, 1fr); }
  .auth-page { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-panel { order: -1; }
}

@media (max-width: 820px) {
  .sidebar {
    position: fixed; z-index: 30; left: 0; top: 0; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: var(--shadow-md); width: 264px; flex-basis: 264px;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .nav-scrim { display: block; }
  .nav-toggle { display: flex; }
  .banner { flex-direction: column; align-items: flex-start; }
  .banner-art { width: 100%; }
  .who-text { display: none; }
  .landing-nav a:not(.btn) { display: none; }
}

@media print {
  .sidebar, .topbar, .foot, .toolbar, .form-actions, .banner-art, .route-progress, .landing-bar { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #999; }
  .print-only { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: more) {
  :root { --line: #9FB8BC; --ink-500: #33555B; }
  .btn { box-shadow: none; }
}


.preloader {
  position: fixed; inset: 0; z-index: 90; background: var(--bg);
  display: flex; flex-direction: column; gap: 18px;
  padding: clamp(18px, 4vh, 42px) clamp(16px, 5vw, 60px);
  transition: opacity .32s ease, visibility .32s ease;
}
body.is-ready .preloader { opacity: 0; visibility: hidden; }

.preloader-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 6px; }
.preloader-mark {
  width: 38px; height: 38px; border-radius: 12px; flex: 0 0 38px;
  background: linear-gradient(140deg, var(--brand-400), var(--brand-600));
  display: grid; place-items: center; color: #fff;
  animation: breathe 1.9s ease-in-out infinite;
}
.preloader-mark svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.preloader-word { font-weight: 700; font-size: 18px; color: var(--ink-900); }
.preloader-word em { font-style: normal; color: var(--brand-600); }

@keyframes breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(22,169,163,.35); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 12px rgba(22,169,163,0); }
}

.sk { display: block; border-radius: 10px; background: linear-gradient(90deg, #E3EDEE 25%, #F2F8F9 37%, #E3EDEE 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.sk-banner { height: clamp(84px, 13vh, 118px); border-radius: 20px; }
.sk-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 168px), 1fr)); gap: 14px; }
.sk-stat { height: clamp(74px, 11vh, 96px); border-radius: 14px; }
.sk-panel { flex: 1; min-height: 160px; border-radius: 14px; }

@media (prefers-reduced-motion: reduce) {
  .sk, .preloader-mark { animation: none; }
}

.avatar--photo { padding: 0; overflow: hidden; object-fit: cover; background: transparent; }

.banner--art { align-items: stretch; }
.banner-photo { width: clamp(130px, 20vw, 230px); height: auto; flex: 0 0 auto; align-self: center; }

.patient-skin { --bg: #F2F8F8; }
.patient-skin .banner { background: linear-gradient(118deg, #3ACFC6, #12898C); }
.patient-skin .nav-link.is-active { background: #E2F5F4; }

.soft-card { border-radius: var(--radius-lg); }
.empty-note { text-align: center; padding: 22px 12px; color: var(--ink-500); }
.empty-note p { margin: 0 0 12px; }
.muted-note { margin: 0 0 12px; color: var(--ink-500); font-size: 13.6px; }
.readonly-note { margin: 6px 0 0; padding: 10px 12px; background: #F1F7F7; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13.6px; }
.hint { display: block; font-size: 12.4px; color: var(--ink-500); font-weight: 400; margin-top: 4px; }

.quick-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 232px), 1fr)); gap: 14px; margin-bottom: 16px; }
.quick-tile { display: flex; gap: 13px; align-items: flex-start; padding: 17px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); text-decoration: none; color: inherit; box-shadow: var(--shadow-sm); }
.quick-tile:hover { border-color: var(--brand-400); }
.quick-tile--lead { background: linear-gradient(126deg, #16A9A3, #0B6E70); color: #fff; border-color: transparent; }
.quick-tile--lead .quick-icon { background: rgba(255,255,255,.2); color: #fff; }
.quick-tile--lead .quick-text span { color: rgba(255,255,255,.86); }
.quick-icon { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 13px; display: grid; place-items: center; background: #E4F4F3; color: var(--brand-600); }
.quick-icon svg { width: 21px; height: 21px; }
.quick-text strong { display: block; font-size: 15px; margin-bottom: 3px; }
.quick-text span { font-size: 13px; color: var(--ink-500); line-height: 1.45; }

.trend-caption { margin: 12px 0 0; font-size: 13px; color: var(--ink-500); }
.next-visit { padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.next-visit-day { margin: 0; font-size: 27px; font-weight: 700; color: var(--brand-700); line-height: 1; }
.next-visit-time { margin: 4px 0 0; font-size: 13.4px; color: var(--ink-500); }
.next-visit-who { margin: 6px 0 0; font-size: 14px; }

.pain-step { padding: 20px 0; border-bottom: 1px solid var(--line); }
.pain-step:last-of-type { border-bottom: 0; }
.pain-step h4 { margin: 0 0 6px; font-size: 16px; }
.step-hint { margin: 0 0 14px; font-size: 13.2px; color: var(--ink-500); }

.scale-wrap { max-width: 520px; }
.pain-range { -webkit-appearance: none; appearance: none; width: 100%; height: 12px; border-radius: 99px; background: linear-gradient(90deg, var(--brand-500) var(--fill, 30%), #E3EDEE var(--fill, 30%)); outline: none; }
.scale-wrap[data-band="mid"] .pain-range { background: linear-gradient(90deg, #E8A93C var(--fill), #E3EDEE var(--fill)); }
.scale-wrap[data-band="high"] .pain-range { background: linear-gradient(90deg, #C9483E var(--fill), #E3EDEE var(--fill)); }
.pain-range::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 3px solid var(--brand-600); box-shadow: var(--shadow-md); cursor: pointer; }
.pain-range::-moz-range-thumb { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 3px solid var(--brand-600); cursor: pointer; }
.pain-range:focus-visible { box-shadow: 0 0 0 3px rgba(15,140,140,.3); }
.scale-ticks { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--ink-300); }
.scale-readout { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 0; }
.scale-number { font-size: 34px; font-weight: 700; color: var(--brand-700); line-height: 1; }
.scale-word { font-size: 15px; color: var(--ink-500); }

.bodymap { max-width: 430px; }
.bodymap-toggle { display: inline-flex; gap: 4px; padding: 4px; background: #E9F2F2; border-radius: 999px; margin-bottom: 12px; }
.tab-btn { border: 0; background: none; padding: 7px 20px; border-radius: 999px; font: inherit; font-size: 13.6px; font-weight: 600; color: var(--ink-500); cursor: pointer; }
.tab-btn.is-active { background: #fff; color: var(--brand-700); box-shadow: var(--shadow-sm); }
.bodymap-svg { width: 100%; max-width: 300px; height: auto; display: block; margin: 0 auto; }
.bodymap-outline { fill: #EAF4F4; stroke: #CBE2E3; stroke-width: 1.5; }
.bodymap-hits .hit { fill: transparent; stroke: transparent; stroke-width: 1.5; cursor: pointer; transition: fill .15s ease; }
.bodymap-hits .hit:hover { fill: rgba(47,196,188,.32); stroke: var(--brand-500); }
.bodymap-hits .hit:focus-visible { outline: none; fill: rgba(47,196,188,.32); stroke: var(--brand-700); stroke-width: 2.4; }
.bodymap-hits .hit.is-selected { fill: rgba(178,58,50,.42); stroke: var(--bad); stroke-width: 2.2; }
.bodymap-readout { margin: 10px 0 0; text-align: center; font-size: 13.6px; font-weight: 600; color: var(--brand-700); }
.bodymap-readout.is-warning { color: var(--bad); }

.diary-sheet { background: repeating-linear-gradient(#FFFDF6, #FFFDF6 30px, #EDE7D4 31px); border: 1px solid #E3DCC6; border-radius: var(--radius-md); padding: 6px 16px 12px 46px; position: relative; }
.diary-sheet::before { content: ""; position: absolute; left: 28px; top: 0; bottom: 0; width: 1px; background: #E3B4AE; }
.diary-input { width: 100%; border: 0; background: transparent; resize: vertical; font: inherit; line-height: 31px; color: var(--ink-900); padding: 0; }
.diary-input:focus { outline: none; }

.diary-list { display: flex; flex-direction: column; gap: 14px; }
.diary-entry { border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; border-left: 5px solid var(--ok); }
.diary-entry--mid { border-left-color: var(--warn); }
.diary-entry--high { border-left-color: var(--bad); }
.diary-entry-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 13px 16px; background: #F7FBFB; border-bottom: 1px solid var(--line); }
.diary-date { margin: 0; font-weight: 600; font-size: 14.4px; }
.diary-time { margin: 2px 0 0; font-size: 12.6px; color: var(--ink-500); }
.diary-score { text-align: right; line-height: 1.1; }
.score-number { display: block; font-size: 25px; font-weight: 700; color: var(--brand-700); }
.score-of { font-size: 11.6px; color: var(--ink-500); }
.diary-entry-body { padding: 14px 16px; }
.diary-where { margin: 0 0 8px; font-weight: 600; font-size: 14px; }
.diary-where .sub { font-weight: 400; font-size: 12.6px; color: var(--ink-500); margin-left: 8px; }
.diary-text { margin: 0 0 10px; font-size: 14px; line-height: 1.6; color: var(--ink-700); }
.diary-actions { margin-top: 12px; }
.diary-source { margin: 10px 0 0; font-size: 12.4px; color: var(--ink-300); }

.progress-summary { display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap; }
.progress-headline { margin: 0; font-size: 19px; font-weight: 700; }
.progress-sub { margin: 4px 0 0; font-size: 13.4px; color: var(--ink-500); }
.progress-meter { flex: 1 1 200px; min-width: 160px; height: 11px; border-radius: 99px; background: #E3EDEE; overflow: hidden; }
.progress-fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand-400), var(--brand-600)); }

.assign-meta { margin: 6px 0 0; font-size: 12.6px; color: var(--ink-500); }
.nurse-note { margin: 8px 0 0; padding: 9px 12px; background: #F1F7F7; border-radius: var(--radius-sm); font-size: 13.2px; color: var(--ink-700); }
.assign-update { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.choice-set { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.choice-set legend { font-size: 13px; color: var(--ink-500); margin-bottom: 8px; padding: 0; }
.choice { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; font-size: 13.2px; cursor: pointer; }
.choice input { accent-color: var(--brand-600); }
.choice:has(input:checked) { border-color: var(--brand-500); background: #E7F5F4; color: var(--brand-700); font-weight: 600; }

.care-list { display: flex; flex-direction: column; gap: 16px; }
.care-record { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px; }
.care-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.care-date { margin: 0; font-weight: 600; font-size: 15px; }
.care-sub { margin: 3px 0 0; font-size: 13px; color: var(--ink-500); }
.care-vitals { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.vital { display: flex; flex-direction: column; padding: 9px 14px; background: #F1F7F7; border-radius: var(--radius-sm); min-width: 104px; }
.vital-label { font-size: 11.6px; color: var(--ink-500); }
.vital-value { font-size: 15px; font-weight: 700; color: var(--brand-700); }
.care-notes { margin: 0; display: grid; grid-template-columns: minmax(0, 170px) minmax(0, 1fr); gap: 8px 18px; }
.care-notes dt { font-size: 12.8px; color: var(--ink-500); }
.care-notes dd { margin: 0; font-size: 14px; line-height: 1.55; }

.next-card-body { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.next-date { width: 92px; height: 92px; flex: 0 0 92px; border-radius: 22px; background: linear-gradient(135deg, var(--brand-400), var(--brand-700)); color: #fff; display: grid; place-content: center; text-align: center; }
.next-day { display: block; font-size: 32px; font-weight: 700; line-height: 1; }
.next-month { display: block; font-size: 12.4px; opacity: .9; }
.next-detail h3 { margin: 0 0 4px; font-size: 15.5px; }
.next-when { margin: 0; font-size: 19px; font-weight: 700; color: var(--brand-700); }
.next-who { margin: 4px 0 0; font-size: 14px; }
.next-purpose, .next-contact { margin: 4px 0 0; font-size: 13.2px; color: var(--ink-500); }

.reminder-list { display: flex; flex-direction: column; gap: 13px; }
.reminder-item { display: flex; gap: 15px; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-md); border-left: 5px solid var(--brand-500); }
.reminder-item--medication { border-left-color: #7A5AB5; }
.reminder-item--appointment { border-left-color: var(--info); }
.reminder-item--exercise { border-left-color: var(--brand-600); }
.reminder-when { width: 62px; flex: 0 0 62px; text-align: center; }
.reminder-day { display: block; font-size: 23px; font-weight: 700; color: var(--brand-700); line-height: 1; }
.reminder-month { display: block; font-size: 12px; color: var(--ink-500); text-transform: uppercase; }
.reminder-time { display: block; font-size: 11.6px; color: var(--ink-300); margin-top: 5px; }
.reminder-body { flex: 1; min-width: 0; }
.reminder-title-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 3px; }
.reminder-title-row h4 { margin: 0; font-size: 15px; }
.reminder-type { margin: 0 0 6px; font-size: 12.6px; color: var(--ink-500); }
.reminder-desc { margin: 0 0 9px; font-size: 13.6px; line-height: 1.55; }
.reminder-countdown { margin: 0 0 9px; font-size: 12.6px; font-weight: 700; color: var(--brand-700); }
.reminder-hint { margin: 0; font-size: 12.8px; color: var(--ink-500); }
.reminder-action { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.reminder-stamp { margin: 6px 0 0; font-size: 12.2px; color: var(--ink-300); }

.emergency-card { border: 1px solid #F0C9C4; }
.emergency-list { list-style: none; margin: 0; padding: 0; }
.emergency-item { display: flex; gap: 14px; padding: 15px 17px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.emergency-item:last-child { border-bottom: 0; }
.emergency-item--emergency { background: #FEF5F4; }
.emergency-flag { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 11px; display: grid; place-items: center; background: #FBE0DD; color: var(--bad); }
.emergency-item--elevated .emergency-flag { background: #FCEFD9; color: var(--warn); }
.emergency-flag svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.emergency-body { flex: 1; min-width: 0; }
.emergency-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.emergency-reason { margin: 5px 0 0; font-size: 13.4px; font-weight: 600; color: var(--bad); }
.emergency-item--elevated .emergency-reason { color: var(--warn); }
.emergency-quote { margin: 6px 0 0; padding-left: 11px; border-left: 3px solid var(--line); font-size: 13.4px; color: var(--ink-700); font-style: italic; }
.emergency-meta { margin: 7px 0 0; font-size: 12.4px; color: var(--ink-500); }
.emergency-actions { display: flex; flex-direction: column; gap: 7px; flex: 0 0 auto; align-items: flex-end; }

.connect-state { display: flex; gap: 11px; align-items: center; margin-bottom: 12px; }
.connect-state strong { display: block; font-size: 14.4px; }
.connect-state span { font-size: 12.8px; color: var(--ink-500); }
.connect-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 11px; background: var(--ok); box-shadow: 0 0 0 4px rgba(35,131,79,.14); }
.detail-rows { margin-bottom: 18px; }
.detail-rows p { display: flex; justify-content: space-between; gap: 14px; margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.detail-rows p span { color: var(--ink-500); font-size: 13px; }

.filter-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 11px 17px; background: #F1F7F7; border-bottom: 1px solid var(--line); font-size: 13.2px; color: var(--ink-700); }
.filter-state strong { color: var(--brand-700); }

@media (max-width: 720px) {
  .care-notes { grid-template-columns: 1fr; gap: 3px 0; }
  .care-notes dd { margin-bottom: 10px; }
  .emergency-item { flex-wrap: wrap; }
  .emergency-actions { flex-direction: row; width: 100%; justify-content: flex-start; }
  .reminder-item { flex-direction: column; }
  .reminder-when { display: flex; gap: 8px; align-items: baseline; width: auto; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

.hero-panel { position: relative; flex-direction: column; gap: 18px; }
.hero-illustration { width: min(100%, 420px); height: auto; border-radius: var(--radius-lg); }
@media (max-width: 900px) { .hero-illustration { display: none; } }

.q-block { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 16px; margin: 0 0 13px; }
.q-block legend { padding: 0 7px; font-size: 13.4px; font-weight: 600; color: var(--ink-700); }
.q-options { display: flex; flex-wrap: wrap; gap: 8px; }
.bodymap-list { margin-top: 14px; }
.bodymap-list summary { cursor: pointer; font-size: 13.2px; color: var(--brand-700); font-weight: 600; }
.region-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.region-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 13px; font: inherit; font-size: 12.8px; color: var(--ink-700); cursor: pointer; }
.region-chip:hover { border-color: var(--brand-500); color: var(--brand-700); background: #F1F9F9; }
