@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Manrope:wght@400;500;600;700;800&display=swap');

*{box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}

:root{
  /* Brand palette */
  --navy:#0B2545;
  --navy2:#12365f;
  --navy3:#06192f;
  --accent:#079669;
  --accent2:#047857;
  --aqua:#5BC0BE;
  --surface:#F5F7FA;
  --surface2:#EEF3F7;
  --card:#FFFFFF;
  --ink:#102033;
  --ink2:#18293d;
  --ink3:#24364b;
  --mid:#46566a;
  --muted:#6B7280;
  --faint:#9AA5B3;
  --border:#E3E8EF;
  --border2:#CBD5E1;

  /* Semantic states */
  --ok:#079669;
  --ok-bg:#E8F7F1;
  --ok-line:#A7E4D0;
  --warn:#C47A00;
  --warn-bg:#FFF7E6;
  --warn-line:#F7D27D;
  --bad:#D14343;
  --bad-bg:#FDECEC;
  --bad-line:#F5B5B5;
  --info:#0E7490;
  --info-bg:#EAF8FA;
  --info-line:#A9E0E3;

  /* Typography */
  --sans:'Inter','Manrope',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --serif:var(--sans);
  --mono:var(--sans);

  /* Radius, shadow, rhythm */
  --r-xs:8px;
  --r-sm:12px;
  --r:16px;
  --r-lg:18px;
  --r-xl:22px;
  --shadow-xs:0 1px 2px rgba(11,37,69,.06);
  --shadow-sm:0 8px 22px rgba(11,37,69,.07);
  --shadow-md:0 18px 44px rgba(11,37,69,.10);
  --shadow-lg:0 28px 70px rgba(11,37,69,.14);
  --ring:0 0 0 4px rgba(91,192,190,.22);
  --container:1120px;
  --sidebar-w:256px;
}

html,body{
  min-height:100%;
  font-family:var(--sans);
  background:var(--surface);
  color:var(--ink);
  font-size:14px;
  line-height:1.5;
  font-variant-numeric:normal;
  font-feature-settings:"zero" 0;
}

body{
  min-width:320px;
  overflow-x:hidden;
  accent-color:var(--accent);
}

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

body,
button,
input,
select,
textarea,
table,
.btn,
.tag,
.badge,
.kpi-card,
.dashboard-kpi-card,
.archive-kpi-card,
.result-shell,
.sidebar,
.topbar{
  font-family:var(--sans);
  font-variant-numeric:normal;
  font-feature-settings:"zero" 0;
}

button,input,select,textarea{font:inherit}
button{border:none}
a{color:var(--accent);text-underline-offset:3px}
::selection{background:rgba(91,192,190,.26);color:var(--navy)}

.kpi-value,
.dashboard-kpi-card strong,
.dashboard-list-row em,
.result-score-center #score-num,
.result-score-comparison strong,
.result-goal-score strong,
.archive-kpi-card strong,
.archive-score-badge,
.archive-detail-score strong,
.archive-history-row strong,
.patient-folder-score strong,
.patient-timeline-main strong,
.patient-chart-bar span,
.result-measurement-value,
#stats-kpi,
#score-num{
  font-family:var(--sans);
  font-variant-numeric:normal;
  font-feature-settings:"zero" 0;
  letter-spacing:0;
}

/* App Shell */
body #s-login{
  position:relative;
  align-items:center;
  justify-content:center;
  padding:2rem;
  overflow:hidden;
  background:
    linear-gradient(145deg, #06192f 0%, var(--navy) 48%, #12365f 100%);
}

body #s-login::before{
  content:'';
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(120deg, rgba(91,192,190,.12), transparent 34%),
    linear-gradient(300deg, rgba(7,150,105,.12), transparent 40%);
  opacity:.85;
}

body .login-glow{
  display:none;
}

body .login-card{
  position:relative;
  z-index:1;
  width:min(468px,calc(100vw - 32px));
  overflow:hidden;
  border:1px solid rgba(255,255,255,.16);
  border-radius:30px;
  background:rgba(255,255,255,.94);
  box-shadow:0 34px 90px rgba(3,17,34,.32);
  -webkit-backdrop-filter:blur(18px);
  backdrop-filter:blur(18px);
}

body .lc-head{
  position:relative;
  overflow:hidden;
  background:
    linear-gradient(145deg, rgba(6,25,47,.98), rgba(11,37,69,.96)),
    linear-gradient(90deg, rgba(91,192,190,.12), rgba(7,150,105,.10));
  padding:2.25rem 2.35rem 2rem;
}

body .lc-head::after{
  display:none;
}

body .lc-accent{
  height:4px;
  background:linear-gradient(90deg,var(--aqua),var(--accent));
}

body .login-brand{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.8rem;
  margin-bottom:1.65rem;
}

body .login-logo{
  width:204px;
  height:auto;
  display:block;
  object-fit:contain;
}

body .lc-logo-name,
body .lc-title,
body .tb-title,
body .ph h1{
  font-family:var(--sans);
}

body .lc-logo-name{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:3px 8px;
  border:1px solid rgba(91,192,190,.20);
  border-radius:999px;
  background:rgba(255,255,255,.06);
  color:rgba(255,255,255,.68);
  font-size:10px;
  font-weight:850;
  line-height:1;
  text-transform:uppercase;
  letter-spacing:.06em;
}

body .lc-title{
  color:#fff;
  font-size:34px;
  font-weight:850;
  line-height:1.06;
  letter-spacing:0;
  margin-bottom:.45rem;
}

body .lc-sub{
  max-width:340px;
  color:rgba(255,255,255,.82);
  font-size:14.5px;
  font-weight:650;
  line-height:1.55;
}

body .login-microcopy{
  max-width:350px;
  margin-top:.65rem;
  color:rgba(255,255,255,.58);
  font-size:12.5px;
  line-height:1.65;
}

body .lc-body{
  padding:2rem 2.35rem 2.25rem;
  background:linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,252,.96));
}

body .role-toggle{
  gap:6px;
  padding:5px;
  margin-bottom:1.35rem;
  border:1px solid rgba(203,213,225,.85);
  border-radius:18px;
  background:#EEF4F7;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.65);
}

body .rt-btn{
  min-height:42px;
  border-radius:14px;
  color:var(--muted);
  font-size:12.5px;
  font-weight:800;
  transition:background .18s ease,color .18s ease,box-shadow .18s ease,transform .18s ease;
}

body .rt-btn:hover{
  color:var(--navy);
  background:rgba(255,255,255,.58);
}

body .rt-btn.on{
  color:var(--navy);
  background:#fff;
  box-shadow:0 10px 22px rgba(11,37,69,.10);
}

body .login-field{
  margin-bottom:1rem;
}

body .login-field label{
  color:var(--mid);
  font-size:11px;
  font-weight:850;
  letter-spacing:.04em;
}

body .login-input-wrap{
  min-height:48px;
  display:flex;
  align-items:center;
  gap:.7rem;
  border:1px solid var(--border);
  border-radius:16px;
  background:#fff;
  padding:0 .9rem;
  box-shadow:var(--shadow-xs);
  transition:border-color .18s ease,box-shadow .18s ease,background .18s ease;
}

body .login-input-wrap:focus-within{
  border-color:var(--aqua);
  box-shadow:var(--ring);
  background:#fff;
}

body .login-input-wrap i{
  color:var(--muted);
  font-size:17px;
  flex-shrink:0;
}

body .login-input-wrap:focus-within i{
  color:var(--accent);
}

body .login-input-wrap input{
  min-height:46px;
  width:100%;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  color:var(--ink);
  font-size:14px;
}

body .login-input-wrap input:focus{
  box-shadow:none;
  outline:none;
}

body .login-submit{
  width:100%;
  min-height:48px;
  justify-content:center;
  margin-top:.25rem;
  border-radius:16px;
  font-size:14px;
  font-weight:850;
  box-shadow:0 16px 30px rgba(7,150,105,.24);
}

body .login-submit:hover{
  box-shadow:0 18px 34px rgba(7,150,105,.30);
}

body .login-links{
  margin-top:1rem;
  text-align:center;
  color:var(--faint);
  font-size:11.5px;
}

body .login-links a{
  color:var(--navy);
  text-decoration:none;
  font-weight:750;
}

body .login-links a:hover{
  color:var(--accent);
}

body .l-alert{
  border-radius:14px;
  font-weight:700;
}

body #s-app{
  background:var(--surface);
}

body .sidebar{
  width:var(--sidebar-w);
  background:var(--navy);
  border-right:1px solid rgba(255,255,255,.08);
  box-shadow:12px 0 32px rgba(11,37,69,.10);
}

body .sb-logo{
  padding:1.45rem 1.2rem 1.25rem;
  border-bottom:1px solid rgba(255,255,255,.10);
}

body .sb-logo-row{
  width:100%;
  display:flex;
  align-items:center;
  gap:.75rem;
  padding:.25rem;
  margin:-.25rem;
  border:0;
  border-radius:16px;
  background:transparent;
  color:#fff;
  text-align:left;
  cursor:pointer;
  transition:background .18s ease, transform .18s ease;
}

body .sb-logo-row:hover,
body .sb-logo-row:focus-visible{
  background:rgba(255,255,255,.07);
}

body .sb-logo-row:focus-visible{
  outline:2px solid rgba(91,192,190,.75);
  outline-offset:3px;
}

body .sb-logo-icon{
  width:34px;
  height:34px;
  border-radius:12px;
  border-color:rgba(91,192,190,.28);
  background:rgba(255,255,255,.08);
}

body .sb-logo-text{
  font-family:var(--sans);
  font-size:14px;
  font-weight:700;
  letter-spacing:0;
}

body .sb-logo-text em{color:var(--aqua)}
body .sb-farm{margin-top:.75rem;color:rgba(255,255,255,.58)}

body .sb-nav{
  padding:1rem .85rem;
  scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,.25) transparent;
}

body .sb-cat{
  padding:.55rem .65rem .35rem;
  color:rgba(255,255,255,.38);
  letter-spacing:.11em;
}

body .sbi{
  min-height:40px;
  padding:.68rem .72rem;
  border-radius:14px;
  color:rgba(255,255,255,.66);
  font-size:13px;
  font-weight:500;
  gap:10px;
}

body .sbi i{
  width:20px;
  text-align:center;
  color:rgba(91,192,190,.78);
}

body .sbi:hover{
  background:rgba(255,255,255,.09);
  color:#fff;
}

body .sbi.active{
  background:rgba(91,192,190,.16);
  color:#fff;
  box-shadow:inset 3px 0 0 var(--aqua);
}

body .sbi.active i{color:var(--aqua)}

body .sb-foot{
  padding:1rem .9rem;
  border-top:1px solid rgba(255,255,255,.10);
}

body .sb-user{
  padding:.55rem;
  border-radius:16px;
  background:rgba(255,255,255,.07);
}

body .sb-av{
  width:34px;
  height:34px;
  background:rgba(91,192,190,.20);
  color:#fff;
}

body .sb-uname{font-size:12px;font-weight:650}
body .sb-urole{color:rgba(255,255,255,.50)}
body .sb-logout{color:rgba(255,255,255,.55)}
body .sb-logout:hover{color:#fff}

.sb-admin-actions{
  display:grid;
  gap:.45rem;
  margin-bottom:.75rem;
}

.sb-admin-action{
  width:100%;
  min-height:36px;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:.55rem;
  padding:0 .7rem;
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  background:rgba(255,255,255,.06);
  color:rgba(255,255,255,.76);
  font-size:12px;
  font-weight:750;
  cursor:pointer;
}

.sb-admin-action i{
  width:18px;
  text-align:center;
  color:rgba(91,192,190,.86);
  font-size:15px;
}

.sb-admin-action:hover{
  background:rgba(255,255,255,.10);
  color:#fff;
}

.sb-admin-action.danger i{
  color:#FCA5A5;
}

.sb-admin-action.danger:hover{
  border-color:rgba(252,165,165,.28);
  background:rgba(209,67,67,.16);
}

body .main{
  background:var(--surface);
}

body .topbar{
  height:68px;
  padding:0 1.75rem;
  background:rgba(255,255,255,.92);
  border-bottom:1px solid var(--border);
  box-shadow:var(--shadow-xs);
}

body .tb-title{
  font-size:15px;
  font-weight:750;
  color:var(--navy);
}

body .content{
  padding:1.75rem;
}

/* Page Header */
body .ph{
  max-width:var(--container);
  margin-bottom:1.4rem;
}

body .ph h1{
  font-size:28px;
  font-weight:800;
  line-height:1.15;
  color:var(--navy);
  letter-spacing:0;
  margin-bottom:.35rem;
}

body .ph p{
  max-width:680px;
  font-size:13.5px;
  color:var(--muted);
  line-height:1.7;
}

body h1,
body h2,
body h3,
body h4,
body .section-label,
body .field label,
body .btn,
body th,
body td{
  letter-spacing:0;
}

body .ph h1,
.dashboard-hero h1,
.result-patient-name,
.patient-folder-title h2{
  text-wrap:balance;
}

body .ph p,
.dashboard-hero p,
.journey-head p,
.result-conclusion p,
.result-empty span{
  text-wrap:pretty;
}

/* Cards */
body .card,
.panel{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--r-xl);
  padding:1.45rem;
  box-shadow:var(--shadow-sm);
}

body .card-sm,
.panel-sm{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--r-lg);
  padding:1rem 1.1rem;
  box-shadow:var(--shadow-xs);
}

body .card:hover,
body .card-sm:hover{
  border-color:#D5DEE8;
}

.card-flat{
  box-shadow:none;
  border-color:var(--border);
}

.card-accent{
  border-color:rgba(91,192,190,.40);
  box-shadow:0 18px 44px rgba(91,192,190,.12);
}

/* Section Labels */
.ui-icon{
  width:32px;
  height:32px;
  min-width:32px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface2);
  color:var(--navy);
  font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",system-ui,sans-serif;
  font-size:16px;
  font-style:normal;
  line-height:1;
}

.ui-icon.is-neutral{
  background:#F8FAFC;
  border-color:var(--border);
  color:var(--muted);
}

.ui-icon.is-active{
  background:rgba(91,192,190,.14);
  border-color:rgba(91,192,190,.34);
  color:var(--navy);
}

.ui-icon.is-complete{
  background:rgba(7,150,105,.12);
  border-color:rgba(7,150,105,.28);
  color:var(--ok);
}

body .section-label{
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:9px;
  margin-bottom:1rem;
}

body .section-label i,
body .section-label .ui-icon{
  width:26px;
  height:26px;
  min-width:26px;
  border-radius:10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:var(--info-bg);
  color:var(--info);
  font-size:14px;
  border:1px solid var(--info-line);
}

body .section-label::after{
  content:'';
  flex:1;
  height:1px;
  background:linear-gradient(90deg,var(--border),rgba(227,232,239,0));
}

/* Buttons */
body .btn,
.button{
  min-height:42px;
  border-radius:14px;
  border:1px solid transparent;
  padding:.7rem 1.05rem;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-family:var(--sans);
  font-size:13px;
  font-weight:700;
  line-height:1;
  text-decoration:none;
  cursor:pointer;
  transition:transform .16s ease,box-shadow .16s ease,background .16s ease,border-color .16s ease,color .16s ease;
}

body .btn:hover,
.button:hover{
  transform:translateY(-1px);
}

body .btn:active,
.button:active{
  transform:translateY(0);
}

body .btn:focus-visible,
.button:focus-visible{
  outline:none;
  box-shadow:var(--ring);
}

body .btn:disabled,
.button:disabled{
  opacity:.48;
  pointer-events:none;
}

body .btn i,
.button i{font-size:16px}

body .btn-green,
.button-primary{
  color:#fff;
  background:var(--accent);
  border-color:var(--accent);
  box-shadow:0 10px 22px rgba(7,150,105,.20);
}

body .btn-green:hover,
.button-primary:hover{
  background:var(--accent2);
  border-color:var(--accent2);
}

body .btn-dark,
.button-dark{
  color:#fff;
  background:var(--navy);
  border-color:var(--navy);
  box-shadow:0 10px 24px rgba(11,37,69,.22);
}

body .btn-dark:hover,
.button-dark:hover{
  background:var(--navy2);
  border-color:var(--navy2);
}

body .btn-ghost,
.button-ghost{
  color:var(--ink);
  background:#fff;
  border-color:var(--border);
  box-shadow:var(--shadow-xs);
}

body .btn-ghost:hover,
.button-ghost:hover{
  color:var(--navy);
  border-color:var(--border2);
  box-shadow:var(--shadow-sm);
}

body .btn-menu{
  width:42px;
  height:42px;
  border-radius:14px;
  background:#fff;
  border:1px solid var(--border);
  color:var(--navy);
  box-shadow:var(--shadow-xs);
}

body .btn-menu:hover{
  background:var(--surface2);
}

/* Forms */
body .field{
  display:flex;
  flex-direction:column;
  gap:.45rem;
}

body .field label{
  font-size:11px;
  font-weight:750;
  text-transform:uppercase;
  letter-spacing:.07em;
  color:var(--muted);
}

body .field input,
body .field select,
body .field textarea,
.input,
.select,
.textarea{
  width:100%;
  min-height:44px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  color:var(--ink);
  outline:none;
  padding:.78rem .95rem;
  font-family:var(--sans);
  font-size:14px;
  line-height:1.35;
  box-shadow:var(--shadow-xs);
  transition:border-color .16s ease,box-shadow .16s ease,background .16s ease;
}

body .field input::placeholder,
body .field textarea::placeholder,
.input::placeholder,
.textarea::placeholder{
  color:var(--faint);
}

body .field input:focus,
body .field select:focus,
body .field textarea:focus,
.input:focus,
.select:focus,
.textarea:focus{
  border-color:var(--aqua);
  background:#fff;
  box-shadow:var(--ring);
}

body .field textarea,
.textarea{
  min-height:112px;
  resize:vertical;
  line-height:1.6;
}

body .input-with-unit{
  position:relative;
  display:flex;
  align-items:center;
}

body .input-with-unit input{
  padding-right:2.5rem;
}

body .input-with-unit span{
  position:absolute;
  right:.95rem;
  color:var(--muted);
  font-size:13px;
  font-weight:800;
  pointer-events:none;
}

body input[readonly],
body textarea[readonly]{
  background:var(--surface2) !important;
  color:var(--mid) !important;
}

body input[type='checkbox'],
body input[type='radio']{
  accent-color:var(--accent);
}

body .field.login-field .login-input-wrap > input,
body .field.login-field .login-input-wrap > input:hover,
body .field.login-field .login-input-wrap > input:focus,
body .field.login-field .login-input-wrap > input:active,
body .field.login-field .login-input-wrap > input:-webkit-autofill{
  width:100%;
  min-height:46px;
  padding:0;
  border:0;
  border-radius:0;
  outline:0;
  background:transparent;
  box-shadow:none;
  color:var(--ink);
  font:inherit;
  appearance:none;
  -webkit-appearance:none;
}

body .field.login-field .login-input-wrap > input:-webkit-autofill{
  -webkit-text-fill-color:var(--ink);
  transition:background-color 9999s ease-in-out 0s;
}

/* Step / Wizard */
.stepper,
.wizard{
  display:flex;
  align-items:center;
  gap:.75rem;
}

.step{
  display:flex;
  align-items:center;
  gap:.55rem;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}

.step-index{
  width:28px;
  height:28px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#fff;
  border:1px solid var(--border);
  color:var(--muted);
}

.step.is-active .step-index,
.step.active .step-index{
  background:var(--accent);
  border-color:var(--accent);
  color:#fff;
  box-shadow:0 8px 18px rgba(7,150,105,.20);
}

.step.is-complete .step-index,
.step.complete .step-index{
  background:var(--navy);
  border-color:var(--navy);
  color:#fff;
}

body div:has(> #q-progress-bar){
  height:8px !important;
  border-radius:999px !important;
  background:#DCE6EF !important;
  box-shadow:inset 0 1px 2px rgba(11,37,69,.08);
}

body #q-progress-bar,
.progress-bar{
  height:100%;
  border-radius:999px !important;
  background:linear-gradient(90deg,var(--aqua),var(--accent)) !important;
  box-shadow:0 6px 14px rgba(7,150,105,.22);
}

.progress{
  height:8px;
  overflow:hidden;
  border-radius:999px;
  background:#DCE6EF;
  box-shadow:inset 0 1px 2px rgba(11,37,69,.08);
}

/* Questionnaire Choices */
body .q-option{
  min-height:54px;
  padding:.85rem 1rem;
  border:1px solid var(--border);
  border-radius:16px;
  background:#fff;
  color:var(--ink);
  font-size:13.5px;
  font-weight:500;
  box-shadow:var(--shadow-xs);
}

body .q-option:hover{
  border-color:var(--aqua);
  color:var(--navy);
  background:#F9FCFD;
  box-shadow:var(--shadow-sm);
}

body .q-option.selected{
  border-color:rgba(7,150,105,.45);
  background:var(--ok-bg);
  color:var(--accent2);
  box-shadow:0 12px 26px rgba(7,150,105,.13);
}

body .q-option .q-idx{
  width:28px;
  height:28px;
  border:1px solid var(--border);
  background:var(--surface);
  color:var(--muted);
}

body .q-option.selected .q-idx{
  background:var(--accent);
  border-color:var(--accent);
  color:#fff;
}

/* Badges and KPI */
body .tag,
.badge{
  display:inline-flex;
  align-items:center;
  gap:5px;
  min-height:24px;
  padding:4px 10px;
  border-radius:999px;
  font-size:10.5px;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
  border:1px solid transparent;
}

body .tag-ok,
.badge-ok{
  background:var(--ok-bg);
  color:var(--ok);
  border-color:var(--ok-line);
}

body .tag-warn,
.badge-warn{
  background:var(--warn-bg);
  color:var(--warn);
  border-color:var(--warn-line);
}

body .tag-good,
.badge-good{
  background:#FEF9C3;
  color:#A16207;
  border-color:#FDE68A;
}

body .tag-bad,
.badge-bad{
  background:var(--bad-bg);
  color:var(--bad);
  border-color:var(--bad-line);
}

body .tag-na,
.badge-muted{
  background:var(--surface2);
  color:var(--muted);
  border-color:var(--border);
}

.kpi-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:1rem;
}

.kpi-card,
body #stats-kpi > .card-sm{
  position:relative;
  overflow:hidden;
  min-height:112px;
  border-radius:20px;
  background:#fff;
  border:1px solid var(--border);
  box-shadow:var(--shadow-sm);
}

.kpi-card::before,
body #stats-kpi > .card-sm::before{
  content:'';
  position:absolute;
  inset:0 0 auto;
  height:4px;
  background:linear-gradient(90deg,var(--aqua),var(--accent));
}

.kpi-value{
  font-family:var(--mono);
  font-size:30px;
  font-weight:800;
  color:var(--navy);
  line-height:1;
}

.kpi-label{
  margin-top:.45rem;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}

/* Tables */
body table,
.data-table{
  width:100%;
  border-collapse:separate !important;
  border-spacing:0;
  background:#fff;
}

body thead tr,
.data-table thead tr{
  background:var(--surface2) !important;
}

body th,
.data-table th{
  padding:.9rem 1rem !important;
  color:var(--muted) !important;
  font-size:11px !important;
  font-weight:800 !important;
  text-transform:uppercase;
  letter-spacing:.07em;
  border-bottom:1px solid var(--border);
}

body td,
.data-table td{
  padding:1rem !important;
  color:var(--ink);
  border-bottom:1px solid var(--border);
  vertical-align:middle;
}

body tbody tr{
  transition:background .16s ease;
}

body tbody tr:hover{
  background:#F9FCFD;
}

body tbody tr:last-child td{
  border-bottom:none;
}

/* Utility Components */
.toolbar{
  display:flex;
  align-items:center;
  gap:.75rem;
  flex-wrap:wrap;
}

.empty-state{
  padding:2.25rem;
  text-align:center;
  color:var(--muted);
}

.divider{
  height:1px;
  background:var(--border);
  margin:1rem 0;
}

body .chip{
  min-height:36px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--mid);
  font-weight:650;
  box-shadow:var(--shadow-xs);
}

body .chip:hover{
  border-color:var(--aqua);
  color:var(--navy);
}

body .chip.on{
  background:var(--navy);
  border-color:var(--navy);
  color:#fff;
}

/* Notification Center */
.notification-wrap{
  position:relative;
}

.notification-button{
  position:relative;
  width:40px;
  height:40px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  color:var(--navy);
  box-shadow:var(--shadow-xs);
  cursor:pointer;
  transition:background .18s ease,border-color .18s ease,box-shadow .18s ease,transform .18s ease;
}

.notification-button:hover,
.notification-button.is-open{
  background:#F8FCFB;
  border-color:rgba(91,192,190,.42);
  box-shadow:var(--shadow-sm);
  transform:translateY(-1px);
}

.notification-button span{
  font-size:17px;
  line-height:1;
}

.notification-button em{
  position:absolute;
  top:-5px;
  right:-5px;
  min-width:18px;
  height:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 5px;
  border:2px solid #fff;
  border-radius:999px;
  background:var(--accent);
  color:#fff;
  font-size:10px;
  font-style:normal;
  font-weight:850;
  line-height:1;
}

.notification-panel{
  position:absolute;
  top:calc(100% + 10px);
  right:0;
  z-index:80;
  width:min(360px,calc(100vw - 32px));
  display:none;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:20px;
  background:#fff;
  box-shadow:0 24px 70px rgba(11,37,69,.16);
}

.notification-panel.open{
  display:block;
}

.notification-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  padding:1rem 1rem .8rem;
  border-bottom:1px solid var(--border);
  background:linear-gradient(180deg,#fff,#F8FAFC);
}

.notification-head strong,
.notification-head span{
  display:block;
}

.notification-head strong{
  color:var(--navy);
  font-size:14px;
  font-weight:850;
}

.notification-head span{
  margin-top:2px;
  color:var(--muted);
  font-size:11.5px;
  font-weight:700;
}

.notification-head button{
  padding:.35rem .55rem;
  border:1px solid var(--border);
  border-radius:999px;
  background:#fff;
  color:var(--accent);
  font-size:11px;
  font-weight:850;
  white-space:nowrap;
  cursor:pointer;
}

.notification-list{
  max-height:340px;
  overflow:auto;
  padding:.45rem;
}

.notification-item{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:.7rem;
  padding:.75rem;
  border-radius:16px;
}

.notification-item + .notification-item{
  margin-top:.2rem;
}

.notification-item.is-unread{
  background:rgba(91,192,190,.10);
}

.notification-item-icon{
  width:30px;
  height:30px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--border);
  border-radius:11px;
  background:var(--surface2);
  font-size:14px;
}

.notification-item strong,
.notification-item span{
  display:block;
}

.notification-item strong{
  color:var(--ink);
  font-size:12.5px;
  font-weight:850;
}

.notification-item span{
  margin-top:2px;
  color:var(--muted);
  font-size:11.5px;
  line-height:1.45;
}

.notification-empty{
  padding:1.4rem;
  color:var(--muted);
  text-align:center;
  font-size:12.5px;
  font-weight:700;
}

/* Longevity Check 2.0 Shell */
.sb-primary-nav,
.sb-check-nav{
  flex:1;
}

.sb-check-card{
  margin:.35rem .45rem 1rem;
  padding:.9rem;
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  background:rgba(255,255,255,.07);
}

.sb-check-card span,
.sb-check-card em{
  display:block;
  color:rgba(255,255,255,.48);
  font-size:10.5px;
  font-style:normal;
  font-weight:700;
}

.sb-check-card strong{
  display:block;
  margin:.2rem 0;
  color:#fff;
  font-size:13px;
  line-height:1.25;
}

body .check-step-link{
  position:relative;
  padding-left:.9rem;
}

body .check-step-link::before{
  content:'';
  position:absolute;
  left:5px;
  top:0;
  bottom:-1px;
  width:1px;
  background:rgba(255,255,255,.10);
}

body .check-step-link i,
body .check-step-link .ui-icon{
  position:relative;
  z-index:1;
  width:26px;
  height:26px;
  min-width:26px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
  color:rgba(255,255,255,.78);
  font-size:14px;
}

body .check-step-link.complete{
  color:rgba(255,255,255,.86);
}

body .check-step-link.complete i,
body .check-step-link.complete .ui-icon{
  background:rgba(7,150,105,.25);
  border-color:rgba(140,232,202,.28);
  color:#8ce8ca;
}

body .check-step-link.complete::after{
  content:'\2713';
  margin-left:auto;
  color:#8ce8ca;
  font-size:12px;
  font-weight:850;
}

body .check-step-link.active{
  background:rgba(91,192,190,.18);
}

body .check-step-link.active .ui-icon{
  background:rgba(91,192,190,.22);
  border-color:rgba(91,192,190,.44);
  color:#fff;
}

.sb-back-btn{
  width:calc(100% - .9rem);
  margin:1rem .45rem 0;
  color:#fff !important;
  background:rgba(255,255,255,.08) !important;
  border-color:rgba(255,255,255,.12) !important;
}

.check-header{
  flex:1;
  min-width:0;
  align-items:center;
  justify-content:space-between;
  gap:1.25rem;
}

.check-header-main{
  min-width:0;
}

.check-header-main strong{
  display:block;
  color:var(--navy);
  font-size:14px;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.check-header-main span,
.check-header-progress span{
  color:var(--muted);
  font-size:11.5px;
  font-weight:700;
}

.check-header-progress{
  width:min(280px,35vw);
  display:flex;
  flex-direction:column;
  gap:.35rem;
}

.check-header-bar{
  height:7px;
  overflow:hidden;
  border-radius:999px;
  background:#DCE6EF;
}

.check-header-bar i{
  display:block;
  width:0;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,var(--aqua),var(--accent));
  transition:width .25s ease;
}

/* Dashboard */
.dashboard-shell{
  max-width:1320px;
  width:100%;
}

.dashboard-hero{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(280px,380px);
  gap:1rem;
  align-items:stretch;
  margin-bottom:1rem;
  padding:1.6rem;
  border-radius:26px;
  background:var(--navy);
  color:#fff;
  box-shadow:var(--shadow-lg);
}

.dashboard-eyebrow{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:5px 10px;
  margin-bottom:.9rem;
  border-radius:999px;
  color:var(--aqua);
  background:rgba(91,192,190,.14);
  border:1px solid rgba(91,192,190,.26);
  font-size:11px;
  font-weight:850;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.dashboard-hero h1{
  max-width:740px;
  font-size:clamp(32px,4vw,50px);
  line-height:1.02;
  font-weight:850;
  letter-spacing:0;
}

.dashboard-hero p{
  max-width:680px;
  margin-top:.85rem;
  color:rgba(255,255,255,.70);
  line-height:1.7;
}

.dashboard-hero-actions{
  display:flex;
  flex-wrap:wrap;
  gap:.75rem;
  margin-top:1.2rem;
}

.dashboard-follow-card{
  min-height:220px;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  padding:1.2rem;
  border-radius:22px;
  background:rgba(255,255,255,.09);
  border:1px solid rgba(255,255,255,.12);
}

.dashboard-follow-card span{
  color:var(--aqua);
  font-size:11px;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.dashboard-follow-card strong{
  margin-top:.35rem;
  color:#fff;
  font-size:24px;
  line-height:1.12;
}

.dashboard-kpi-grid{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:.85rem;
  margin-bottom:1rem;
}

.dashboard-kpi-card{
  min-height:126px;
  position:relative;
  overflow:hidden;
}

.dashboard-kpi-card i,
.dashboard-kpi-card .ui-icon{
  position:absolute;
  right:1rem;
  top:1rem;
  width:34px;
  height:34px;
  min-width:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:14px;
  background:var(--info-bg);
  border:1px solid var(--info-line);
  color:var(--info);
  font-size:17px;
}

.dashboard-kpi-card span,
.dashboard-kpi-card em{
  display:block;
  color:var(--muted);
  font-size:11.5px;
  font-style:normal;
  font-weight:750;
}

.dashboard-kpi-card strong{
  display:block;
  margin-top:2rem;
  color:var(--navy);
  font-family:var(--mono);
  font-size:28px;
  line-height:1;
}

.dashboard-kpi-card em{
  margin-top:.45rem;
  line-height:1.35;
}

.dashboard-grid{
  display:grid;
  grid-template-columns:repeat(12,minmax(0,1fr));
  gap:1rem;
}

.dashboard-panel{
  grid-column:span 5;
}

.dashboard-panel-wide{
  grid-column:span 7;
}

.dashboard-list{
  display:flex;
  flex-direction:column;
  gap:.6rem;
}

.dashboard-list-row{
  width:100%;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:.75rem;
  padding:.75rem;
  border:1px solid var(--border);
  border-radius:18px;
  background:#fff;
  color:var(--ink);
  text-align:left;
  cursor:pointer;
}

.dashboard-list-row:hover{
  border-color:var(--aqua);
  box-shadow:var(--shadow-sm);
}

.dashboard-list-row strong,
.dashboard-list-row span{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.dashboard-list-row strong{
  color:var(--ink);
  font-size:13px;
}

.dashboard-list-row span{
  margin-top:2px;
  color:var(--muted);
  font-size:11.5px;
}

.dashboard-list-row em{
  width:38px;
  height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  border:2px solid var(--border);
  color:var(--navy);
  font-family:var(--mono);
  font-size:11px;
  font-style:normal;
  font-weight:850;
}

.dashboard-patient-row{
  grid-template-columns:auto minmax(0,1fr) auto;
}

.dashboard-patient-main{
  min-width:0;
}

.dashboard-patient-outcome{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:.45rem;
  min-width:112px;
}

.dashboard-patient-outcome .archive-score-badge{
  width:38px;
  height:38px;
  flex:0 0 auto;
}

.dashboard-patient-outcome .tag{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  white-space:nowrap;
}

.dashboard-workflow{
  display:flex;
  flex-direction:column;
  gap:.7rem;
}

.dashboard-workflow div{
  display:flex;
  align-items:center;
  gap:.75rem;
  color:var(--mid);
  font-weight:700;
}

.dashboard-workflow span{
  width:30px;
  height:30px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:var(--ok-bg);
  color:var(--ok);
  font-weight:850;
}

/* Admin dashboard */
.admin-page-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
}

.admin-loading{
  padding:2rem;
  color:var(--muted);
  text-align:center;
  font-size:13px;
}

.admin-loading i{
  display:block;
  margin-bottom:.5rem;
  font-size:20px;
  animation:spin .8s linear infinite;
}

.admin-dashboard{
  display:grid;
  gap:1rem;
}

.admin-kpi-grid{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:.75rem;
}

.admin-kpi-grid + .admin-panel{
  margin-top:1.25rem;
}

.admin-kpi-card{
  position:relative;
  min-height:126px;
  padding:1rem;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:18px;
  background:#fff;
  box-shadow:var(--shadow-xs);
}

.admin-kpi-card i,
.admin-kpi-card .ui-icon{
  position:absolute;
  top:.9rem;
  right:.9rem;
  width:32px;
  height:32px;
  min-width:32px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:13px;
  background:var(--info-bg);
  border:1px solid var(--info-line);
  color:var(--info);
  font-size:16px;
}

.admin-kpi-card span,
.admin-kpi-card em{
  display:block;
  max-width:calc(100% - 38px);
  color:var(--muted);
  font-size:11px;
  font-style:normal;
  font-weight:800;
  line-height:1.25;
}

.admin-kpi-card strong{
  display:block;
  margin-top:1.65rem;
  color:var(--navy);
  font-family:var(--mono);
  font-size:27px;
  line-height:1;
}

.admin-kpi-card em{
  max-width:none;
  margin-top:.45rem;
  font-weight:700;
  line-height:1.35;
}

.admin-panel,
.admin-form-card{
  display:grid;
  gap:1rem;
}

.admin-panel-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
}

.admin-panel-head .section-label{
  margin-bottom:.35rem;
}

.admin-panel-head p{
  margin:0;
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
}

.admin-count{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:5px 10px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface);
  color:var(--mid);
  font-size:11px;
  font-weight:850;
  white-space:nowrap;
}

.admin-filters{
  display:grid;
  grid-template-columns:200px 240px minmax(240px,1fr);
  gap:.75rem;
  align-items:end;
}

.admin-search-field input{
  min-width:0;
}

.admin-table-wrap{
  overflow:auto;
  border:1px solid var(--border);
  border-radius:18px;
  background:#fff;
}

.admin-table{
  width:100%;
  min-width:1120px;
  border-collapse:separate;
  border-spacing:0;
}

.admin-table th,
.admin-table td{
  padding:.72rem .8rem;
  border-bottom:1px solid var(--border);
  color:var(--mid);
  font-size:12px;
  line-height:1.35;
  text-align:left;
  vertical-align:middle;
}

.admin-table th{
  position:sticky;
  top:0;
  z-index:1;
  background:#F8FAFC;
  color:var(--muted);
  font-size:10px;
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
}

.admin-table tbody tr:hover td{
  background:#FAFCFF;
}

.admin-table td strong{
  display:block;
  color:var(--ink);
  font-size:12.5px;
}

.admin-table .tag{
  white-space:nowrap;
}

.admin-num{
  color:var(--navy) !important;
  font-family:var(--mono);
  font-weight:850;
  text-align:center !important;
}

.admin-muted{
  color:var(--faint);
  font-size:12px;
}

.admin-progress{
  display:grid;
  min-width:96px;
  gap:.35rem;
}

.admin-progress strong{
  color:var(--navy);
  font-family:var(--mono);
  font-size:12px;
}

.admin-progress span{
  height:7px;
  overflow:hidden;
  border-radius:999px;
  background:#E5EDF5;
}

.admin-progress i{
  display:block;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,var(--aqua),var(--accent));
}

.admin-edit-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.35rem;
  min-height:34px;
  padding:0 .65rem;
  border:1px solid var(--border);
  border-radius:999px;
  background:#fff;
  color:var(--accent);
  font-size:11.5px;
  font-weight:850;
  cursor:pointer;
}

.admin-edit-btn:hover{
  border-color:rgba(7,150,105,.38);
  background:rgba(7,150,105,.08);
}

.admin-form-alert{
  display:flex;
  align-items:center;
  gap:.45rem;
  padding:.65rem .85rem;
  border-radius:14px;
  font-size:12.5px;
  line-height:1.35;
}

.admin-form-alert.ok{
  border:1px solid var(--ok-line);
  background:var(--ok-bg);
  color:var(--ok);
}

.admin-form-alert.bad{
  border:1px solid var(--bad-line);
  background:var(--bad-bg);
  color:var(--bad);
}

.admin-form-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:.85rem;
}

.admin-form-grid .field{
  margin:0;
}

.admin-notes-field{
  grid-column:span 2;
}

.required{
  color:var(--bad);
}

.admin-form-actions{
  display:flex;
  justify-content:flex-end;
}

@media (max-width:1280px){
  .admin-kpi-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .admin-filters{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .admin-form-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media (max-width:720px){
  .admin-page-head,
  .admin-panel-head{
    flex-direction:column;
    align-items:stretch;
  }

  .admin-kpi-grid,
  .admin-filters,
  .admin-form-grid{
    grid-template-columns:1fr;
  }

  .admin-notes-field{
    grid-column:auto;
  }

  .admin-form-actions .btn{
    width:100%;
    justify-content:center;
  }
}

/* Guided Check Pages */
.journey-page,
.questionnaire-shell,
.analysis-shell{
  max-width:1320px;
  width:100%;
}

.journey-head{
  max-width:900px;
}

.journey-step-pill{
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  min-height:30px;
  padding:6px 11px;
  margin-bottom:.75rem;
  border-radius:999px;
  background:var(--info-bg);
  color:var(--info);
  border:1px solid var(--info-line);
  font-size:11px;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.journey-step-pill .ui-icon{
  width:22px;
  height:22px;
  min-width:22px;
  border-radius:8px;
  background:rgba(255,255,255,.72);
  border-color:var(--info-line);
  font-size:13px;
}

.journey-layout{
  display:grid;
  grid-template-columns:minmax(0,780px) minmax(260px,360px);
  gap:1rem;
  align-items:start;
}

.journey-card{
  width:100%;
}

.journey-side{
  display:flex;
  flex-direction:column;
  gap:1rem;
}

.journey-tip i,
.journey-tip .ui-icon{
  width:36px;
  height:36px;
  min-width:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:14px;
  margin-bottom:.75rem;
  background:var(--info-bg);
  border:1px solid var(--info-line);
  color:var(--info);
  font-size:18px;
}

.journey-tip strong,
.journey-tip p{
  display:block;
}

.journey-tip strong{
  color:var(--navy);
  font-size:15px;
}

.journey-tip p{
  margin-top:.4rem;
  color:var(--muted);
  font-size:12.5px;
  line-height:1.6;
}

.form-grid{
  display:grid;
  gap:1rem;
  margin-bottom:1.1rem;
}

.form-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.form-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.form-grid.compact{gap:.75rem;margin-bottom:0}

.field label span{
  color:var(--bad);
}

.form-alert{
  align-items:center;
  gap:.55rem;
  padding:.75rem .9rem;
  margin-bottom:1rem;
  border:1px solid var(--bad-line);
  border-radius:14px;
  background:var(--bad-bg);
  color:var(--bad);
  font-size:12.5px;
  font-weight:700;
}

.form-actions{
  display:flex;
  justify-content:space-between;
  gap:.75rem;
  margin-top:1.25rem;
}

.journey-actions{
  max-width:1320px;
}

.lab-actions{
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  margin-top:1.6rem;
}

.lab-actions .btn-ghost{
  justify-self:start;
}

.lab-actions .btn-green{
  grid-column:2;
  justify-self:center;
}

.medical-grid,
.lab-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:1rem;
}

.biomarkers-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
  width:100%;
}

.medical-field-card,
.lab-card{
  padding:1.1rem;
  border:1px solid var(--border);
  border-radius:22px;
  background:#fff;
  box-shadow:var(--shadow-sm);
}

.medical-field-card.wide{
  grid-column:span 2;
}

.medical-card-head,
.lab-card-head{
  display:flex;
  align-items:flex-start;
  gap:.8rem;
  margin-bottom:1rem;
}

.medical-card-head i,
.medical-card-head .ui-icon,
.lab-card-head i,
.lab-card-head .ui-icon{
  width:36px;
  height:36px;
  min-width:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  border-radius:14px;
  background:var(--info-bg);
  border:1px solid var(--info-line);
  color:var(--info);
  font-size:18px;
}

.medical-card-head strong,
.medical-card-head span,
.lab-card-head strong,
.lab-card-head span{
  display:block;
}

.medical-card-head strong,
.lab-card-head strong{
  color:var(--navy);
  font-size:15px;
  line-height:1.2;
}

.medical-card-head span,
.lab-card-head span{
  margin-top:.25rem;
  color:var(--muted);
  font-size:11.5px;
  font-weight:750;
}

.medical-delta{
  margin-top:.65rem;
  font-size:12px;
  font-weight:800;
}

.lab-card{
  transition:border-color .16s ease,box-shadow .16s ease;
}

.lab-card.is-ok{border-color:var(--ok-line)}
.lab-card.is-warn{border-color:var(--warn-line)}
.lab-card.is-bad{border-color:var(--bad-line)}
.lab-card.is-ok .lab-card-head span{color:var(--ok)}
.lab-card.is-warn .lab-card-head span{color:var(--warn)}
.lab-card.is-bad .lab-card-head span{color:var(--bad)}

.clinical-chip-grid{
  display:flex;
  flex-wrap:wrap;
  gap:.55rem;
  margin-bottom:1.35rem;
}

/* Immersive Questionnaire */
.questionnaire-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  margin-bottom:1rem;
}

.questionnaire-top h1{
  color:var(--navy);
  font-size:clamp(28px,3vw,42px);
  line-height:1.08;
}

.questionnaire-top p{
  max-width:680px;
  margin-top:.45rem;
  color:var(--muted);
  line-height:1.7;
}

.questionnaire-time{
  min-width:190px;
  padding:.85rem 1rem;
  border:1px solid var(--border);
  border-radius:18px;
  background:#fff;
  box-shadow:var(--shadow-xs);
}

.questionnaire-time span,
.questionnaire-time strong{
  display:block;
}

.questionnaire-time span{
  color:var(--muted);
  font-size:11.5px;
  font-weight:750;
}

.questionnaire-time strong{
  margin-top:.25rem;
  color:var(--navy);
}

.questionnaire-card{
  max-width:920px;
  padding:1.5rem;
  border:1px solid var(--border);
  border-radius:26px;
  background:#fff;
  box-shadow:var(--shadow-md);
}

.questionnaire-progress-row{
  display:grid;
  grid-template-columns:auto minmax(180px,1fr);
  gap:1rem;
  align-items:center;
  margin-bottom:1.2rem;
}

.questionnaire-progress-row span{
  color:var(--accent);
  font-size:12px;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.questionnaire-progress{
  height:10px;
}

.questionnaire-card h2{
  max-width:820px;
  color:var(--ink);
  font-size:clamp(24px,3vw,36px);
  line-height:1.18;
  font-weight:850;
  margin-bottom:1.25rem;
}

.questionnaire-options{
  display:grid;
  gap:.75rem;
}

body .questionnaire-options .q-option{
  min-height:68px;
  padding:1rem 1.05rem;
  border-radius:20px;
  font-size:14.5px;
}

/* Analysis */
.analysis-shell{
  min-height:calc(100vh - 130px);
  display:flex;
  align-items:center;
  justify-content:center;
}

.analysis-card{
  width:min(760px,100%);
  padding:2rem;
  border:1px solid var(--border);
  border-radius:30px;
  background:#fff;
  box-shadow:var(--shadow-lg);
  text-align:center;
}

.analysis-eyebrow{
  color:var(--accent);
  font-size:11px;
  font-weight:850;
  letter-spacing:.1em;
  text-transform:uppercase;
}

.analysis-card h1{
  max-width:620px;
  margin:.45rem auto .65rem;
  color:var(--navy);
  font-size:clamp(28px,4vw,44px);
  line-height:1.08;
}

.analysis-card p{
  max-width:560px;
  margin:0 auto 1.4rem;
  color:var(--muted);
  line-height:1.7;
}

.analysis-steps{
  display:grid;
  gap:.55rem;
  margin:1.2rem auto;
  text-align:left;
}

.analysis-step{
  display:flex;
  align-items:center;
  gap:.75rem;
  padding:.8rem .9rem;
  border:1px solid var(--border);
  border-radius:16px;
  color:var(--muted);
  font-weight:750;
}

.analysis-step span,
.analysis-step .ui-icon{
  width:26px;
  height:26px;
  min-width:26px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:#fff;
  border:1px solid var(--border);
  color:var(--navy);
  font-size:14px;
}

.analysis-step.active{
  border-color:var(--aqua);
  color:var(--navy);
  background:#F9FCFD;
}

.analysis-step.active .ui-icon{
  background:rgba(91,192,190,.14);
  border-color:rgba(91,192,190,.34);
}

.analysis-step.complete{
  border-color:var(--ok-line);
  color:var(--ok);
  background:var(--ok-bg);
}

.analysis-step.complete span,
.analysis-step.complete .ui-icon{
  background:var(--ok);
  border-color:var(--ok);
  color:#fff;
}

.analysis-progress{
  height:10px;
  overflow:hidden;
  border-radius:999px;
  background:#DCE6EF;
}

.analysis-progress i{
  display:block;
  width:0;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,var(--aqua),var(--accent));
  transition:width .28s ease;
}

.analysis-status{
  margin-top:.85rem;
  color:var(--muted);
  font-size:12.5px;
  font-weight:750;
}

/* Result Dashboard */
.result-loader{
  min-height:420px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:1.25rem;
  max-width:var(--container);
}

.result-loader-panel{
  width:min(520px,100%);
  padding:1.5rem;
  border:1px solid var(--border);
  border-radius:24px;
  background:#fff;
  box-shadow:var(--shadow-md);
}

.result-loader-title{
  font-size:15px;
  font-weight:750;
  color:var(--ink);
  text-align:center;
  margin-bottom:.25rem;
}

.result-loader-msg{
  font-size:12.5px;
  color:var(--muted);
  text-align:center;
}

.result-loader-checklist{
  display:grid;
  gap:.55rem;
  margin-top:1rem;
}

.result-loader-checklist div{
  display:flex;
  align-items:center;
  gap:.6rem;
  padding:.65rem .75rem;
  border:1px solid var(--border);
  border-radius:14px;
  color:var(--mid);
  font-size:12.5px;
  font-weight:750;
}

.result-loader-checklist i{
  color:var(--accent);
}

.result-loader-checklist .ui-icon{
  width:24px;
  height:24px;
  min-width:24px;
  border-radius:9px;
  font-size:13px;
}

.result-loader-checklist .ti-loader{
  animation:spin .8s linear infinite;
  color:var(--aqua);
}

.result-shell{
  max-width:1320px;
  width:100%;
}

.result-progress-strip{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(132px,1fr));
  gap:.75rem;
  margin-bottom:1rem;
}

.result-return-bar{
  align-items:center;
  justify-content:space-between;
  gap:.7rem;
  margin:0 0 1rem;
  padding:.7rem;
  border:1px solid var(--border);
  border-radius:18px;
  background:#fff;
  box-shadow:var(--shadow-xs);
}

.result-return-bar .btn{
  min-height:38px;
}

.result-step{
  min-height:56px;
  display:flex;
  align-items:center;
  gap:.7rem;
  padding:.8rem .95rem;
  border:1px solid var(--border);
  border-radius:18px;
  background:#fff;
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  box-shadow:var(--shadow-xs);
}

.result-step span{
  width:28px;
  height:28px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  background:var(--ok-bg);
  color:var(--ok);
  border:1px solid var(--ok-line);
}

.result-step.complete{
  color:var(--navy);
}

.result-hero-card{
  position:relative;
  overflow:visible;
  display:grid;
  grid-template-columns:minmax(460px,1fr) minmax(0,1fr);
  gap:2rem;
  align-items:stretch;
  min-height:360px;
  padding:0;
  margin-bottom:1.25rem;
  border-radius:0;
  background:transparent;
  border:0;
  box-shadow:none;
}

.result-hero-content{
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:2rem;
  border:1px solid var(--border);
  border-radius:26px;
  background:#fff;
  box-shadow:var(--shadow-md);
}

.result-eyebrow{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:5px 10px;
  border-radius:999px;
  background:var(--info-bg);
  border:1px solid var(--info-line);
  color:var(--info);
  font-size:11px;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.08em;
  margin-bottom:1rem;
}

.result-patient-name{
  max-width:820px;
  color:var(--navy);
  font-size:clamp(28px,3.3vw,46px);
  line-height:1.02;
  font-weight:850;
  letter-spacing:0;
  margin-bottom:.85rem;
}

.result-patient-subtitle{
  margin-top:-.35rem;
  margin-bottom:.85rem;
  color:var(--muted);
  font-size:16px;
  font-weight:700;
}

.result-hero-summary{
  margin:.35rem 0 1rem;
  padding:1rem;
  border:1px solid rgba(91,192,190,.30);
  border-radius:18px;
  background:linear-gradient(180deg,#F8FCFD,#fff);
}

.result-hero-summary .section-label{
  margin-bottom:.55rem;
}

.result-profile-summary{
  max-width:none;
  margin:0 0 1rem;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  color:var(--ink);
  box-shadow:none;
}

.result-profile-summary[hidden]{
  display:none;
}

.result-profile-summary strong{
  display:none;
}

.result-profile-summary p{
  margin:0;
  font-size:15px;
  line-height:1.65;
}

.result-hero-details{
  display:grid;
  grid-template-columns:repeat(5,minmax(108px,1fr));
  gap:.65rem;
  max-width:920px;
  margin-top:auto;
}

.result-hero-details div{
  min-width:0;
  padding:.7rem .8rem;
  border:1px solid var(--border);
  border-radius:16px;
  background:var(--surface);
}

.result-hero-details span,
.result-hero-details strong{
  display:block;
}

.result-hero-details span{
  color:var(--muted);
  font-size:10px;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.result-hero-details strong{
  margin-top:.25rem;
  color:var(--ink);
  font-size:13px;
  line-height:1.25;
}

.result-patient-meta{
  display:flex;
  flex-wrap:wrap;
  gap:.55rem;
  color:rgba(255,255,255,.72);
  font-size:13.5px;
}

.result-patient-meta span{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:5px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
}

.result-patient-meta span:empty,
.result-patient-meta span[hidden]{
  display:none;
}

.result-score-comparison{
  flex-wrap:wrap;
  align-items:center;
  gap:.55rem;
  margin-top:.9rem;
  color:var(--muted);
  font-size:12.5px;
}

.result-score-comparison span{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  min-height:30px;
  padding:5px 10px;
  border-radius:999px;
  background:var(--surface);
  border:1px solid var(--border);
}

.result-score-comparison strong{
  color:var(--ink);
  font-family:var(--mono);
}

.result-score-comparison .is-positive{color:#8ce8ca}
.result-score-comparison .is-negative{color:#fecaca}

.result-score-comparison em{
  color:var(--muted);
  font-style:normal;
}

.result-hero-footer{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.8rem;
  margin-top:1.25rem;
}

.result-status-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:7px 14px;
  border-radius:999px;
  font-size:12px;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.06em;
  background:rgba(7,150,105,.18);
  color:#6ee7b7;
  border:1px solid rgba(7,150,105,.32);
}

.result-hero-note{
  color:rgba(255,255,255,.78);
  font-size:13px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.result-score-panel{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:1.15rem;
  min-width:0;
  min-height:360px;
  padding:2rem;
  border-radius:26px;
  background:var(--navy);
  border:1px solid rgba(255,255,255,.10);
  box-shadow:var(--shadow-lg);
  color:#fff;
  text-align:center;
}

.result-score-title{
  display:grid;
  gap:.25rem;
}

.result-score-title span{
  color:var(--aqua);
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.09em;
}

.result-score-title strong{
  color:#fff;
  font-size:20px;
  line-height:1.2;
}

.result-score-ring{
  position:relative;
  width:220px;
  height:220px;
  border-radius:50%;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
}

.result-score-ring svg{
  width:100%;
  height:100%;
  transform:rotate(-90deg);
  overflow:visible;
}

.result-score-ring circle{
  transition:stroke-dashoffset .55s ease,stroke .2s ease;
}

.result-score-center{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}

.result-score-center #score-num{
  font-family:var(--mono);
  font-size:58px;
  font-weight:850;
  color:#fff;
  line-height:1;
}

.result-score-center span{
  margin-top:.2rem;
  color:rgba(255,255,255,.58);
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.1em;
}

.result-grid{
  display:grid;
  grid-template-columns:repeat(12,minmax(0,1fr));
  gap:1.25rem;
  align-items:start;
}

.result-report-flow{
  display:grid;
  gap:1rem;
}

.result-health-disclaimer{
  margin-top:1rem;
  padding:.85rem 1rem;
  border-top:1px solid var(--border);
  color:var(--muted);
  font-size:11.5px;
  line-height:1.55;
}

.result-main{
  grid-column:span 8;
  display:flex;
  flex-direction:column;
  gap:1rem;
  min-width:0;
}

.result-aside{
  grid-column:span 4;
  display:flex;
  flex-direction:column;
  gap:1rem;
  min-width:0;
}

.result-section-card,
.result-side-card{
  width:100%;
}

.result-note-card{
  display:none;
  border-color:var(--warn-line);
  background:var(--warn-bg);
}

.result-kpi-grid{
  display:block;
  width:100%;
}

.result-check-table-wrap{
  width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

.result-check-table{
  width:100%;
  min-width:640px;
  border-collapse:separate;
  border-spacing:0 .55rem;
}

.result-check-table th{
  padding:0 .85rem .15rem;
  color:var(--muted);
  font-size:10.5px;
  font-weight:900;
  text-align:left;
  text-transform:uppercase;
  letter-spacing:.06em;
}

.result-check-table td{
  padding:.8rem .85rem;
  background:var(--surface);
  color:var(--ink);
  font-size:13px;
  border-top:1px solid var(--border);
  border-bottom:1px solid var(--border);
}

.result-check-table td:first-child{
  border-left:1px solid var(--border);
  border-radius:14px 0 0 14px;
  font-weight:850;
}

.result-check-table td:last-child{
  border-right:1px solid var(--border);
  border-radius:0 14px 14px 0;
}

.result-check-table .tag{
  white-space:nowrap;
}

.result-insight-columns,
.result-planning-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:1rem;
  align-items:stretch;
}

.result-lifestyle-grid{
  display:flex;
  flex-direction:column;
  gap:.8rem;
}

.result-insight-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:.75rem;
}

.result-insight-card{
  display:flex;
  align-items:flex-start;
  gap:.85rem;
  min-height:86px;
  padding:1rem;
  border:1px solid var(--border);
  border-radius:18px;
  background:var(--surface);
}

.result-insight-card i,
.result-insight-card .ui-icon{
  width:36px;
  height:36px;
  min-width:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  border-radius:14px;
  background:var(--info-bg);
  border:1px solid var(--info-line);
  color:var(--info);
  font-size:18px;
}

.result-insight-card strong,
.result-insight-card span{
  display:block;
}

.result-insight-card strong{
  color:var(--ink);
  font-size:13.5px;
  line-height:1.25;
}

.result-insight-card span{
  margin-top:.3rem;
  color:var(--muted);
  font-size:12.5px;
  line-height:1.45;
}

.result-insight-card.is-ok{
  background:var(--ok-bg);
  border-color:var(--ok-line);
}

.result-insight-card.is-ok i,
.result-insight-card.is-ok .ui-icon{
  background:#fff;
  border-color:var(--ok-line);
  color:var(--ok);
}

.result-insight-card.is-warn{
  background:var(--warn-bg);
  border-color:var(--warn-line);
}

.result-insight-card.is-warn i,
.result-insight-card.is-warn .ui-icon{
  background:#fff;
  border-color:var(--warn-line);
  color:var(--warn);
}

.result-insight-card.is-bad{
  background:var(--bad-bg);
  border-color:var(--bad-line);
}

.result-insight-card.is-bad i,
.result-insight-card.is-bad .ui-icon{
  background:#fff;
  border-color:var(--bad-line);
  color:var(--bad);
}

.result-goal-card{
  border-color:rgba(91,192,190,.45);
}

.result-goal-box{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:center;
  gap:1rem;
  padding:1.2rem;
  border-radius:18px;
  background:var(--navy);
  color:#fff;
}

.result-goal-score{
  min-width:138px;
  display:grid;
  grid-template-columns:auto auto;
  align-items:end;
  gap:.15rem .35rem;
  padding:.85rem 1rem;
  border-radius:18px;
  background:rgba(255,255,255,.09);
  border:1px solid rgba(255,255,255,.12);
}

.result-goal-score span{
  grid-column:1/-1;
  color:var(--aqua);
  font-size:10.5px;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.result-goal-score strong{
  font-family:var(--mono);
  font-size:40px;
}

.result-goal-score em{
  margin-bottom:.35rem;
  color:rgba(255,255,255,.62);
  font-style:normal;
  font-weight:800;
}

.result-goal-box strong{
  font-size:17px;
  line-height:1.25;
}

.result-goal-box span{
  color:rgba(255,255,255,.70);
  line-height:1.65;
}

.result-lifestyle-card,
.result-measurement-card{
  display:flex;
  align-items:center;
  gap:.85rem;
  min-width:0;
}

.result-lifestyle-card i,
.result-lifestyle-card .ui-icon,
.result-measurement-icon{
  width:30px;
  height:30px;
  min-width:30px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  background:var(--surface2);
  border:1px solid var(--border);
  color:var(--info);
  font-size:16px;
}

.result-lifestyle-bar{
  display:grid;
  gap:.45rem;
}

.result-lifestyle-bar-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
}

.result-lifestyle-bar-head span{
  color:var(--ink);
  font-size:13px;
  font-weight:850;
}

.result-lifestyle-bar-head strong{
  color:var(--muted);
  font-size:11.5px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.result-lifestyle-track{
  height:8px;
  overflow:hidden;
  border-radius:999px;
  background:#DCE6EF;
}

.result-lifestyle-track i{
  display:block;
  height:100%;
  border-radius:inherit;
  background:var(--border2);
}

.result-lifestyle-track i.is-ok{background:var(--accent)}
.result-lifestyle-track i.is-warn{background:var(--warn)}
.result-lifestyle-track i.is-bad{background:var(--bad)}
.result-lifestyle-track i.is-neutral{background:var(--aqua)}

.result-lifestyle-title{
  color:var(--ink);
  font-size:13.5px;
  font-weight:800;
  line-height:1.25;
}

.result-sintesi{
  font-size:14px;
  color:var(--mid);
  line-height:1.8;
}

.result-conclusion-card{
  border-color:rgba(91,192,190,.45);
  box-shadow:var(--shadow-md);
}

.result-conclusion p{
  margin-bottom:1rem;
  color:var(--ink);
  font-size:15px;
  line-height:1.7;
}

.result-conclusion em{
  display:block;
  margin-top:.9rem;
  color:var(--faint);
  font-size:11px;
  line-height:1.5;
}

.result-conclusion-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:.65rem;
}

.result-conclusion-grid div,
.result-evolution-box div,
.result-followup-box div{
  padding:.85rem;
  border:1px solid var(--border);
  border-radius:16px;
  background:var(--surface);
}

.result-conclusion-grid span,
.result-evolution-box span,
.result-followup-box span{
  display:block;
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.05em;
}

.result-conclusion-grid strong,
.result-evolution-box strong,
.result-followup-box strong{
  display:block;
  margin-top:.3rem;
  color:var(--navy);
  font-size:13px;
  line-height:1.35;
}

.result-priorities-card,
.result-actions-card,
.result-consultation-card{
  border-color:rgba(91,192,190,.30);
}

.result-priority-list,
.result-action-list{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:.75rem;
}

.result-priority-card,
.result-action-card{
  display:grid;
  grid-template-columns:38px minmax(0,1fr);
  gap:.8rem;
  align-items:flex-start;
  min-width:0;
  min-height:112px;
  padding:1rem;
  border:1px solid var(--border);
  border-radius:18px;
  background:var(--surface);
}

.result-priority-card>span,
.result-action-card>span{
  width:38px;
  height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:14px;
  background:var(--info-bg);
  border:1px solid var(--info-line);
  color:var(--info);
  font-size:14px;
  font-weight:900;
}

.result-priority-card.is-warn>span{background:var(--warn-bg);border-color:var(--warn-line);color:var(--warn)}
.result-priority-card.is-bad>span{background:var(--bad-bg);border-color:var(--bad-line);color:var(--bad)}
.result-priority-card.is-ok>span,
.result-action-card>span{background:var(--ok-bg);border-color:var(--ok-line);color:var(--ok)}

.result-priority-card strong,
.result-action-card strong{
  display:block;
  color:var(--ink);
  font-size:14px;
  line-height:1.25;
}

.result-priority-card em,
.result-action-card em{
  display:block;
  margin-top:.35rem;
  color:var(--muted);
  font-size:12.5px;
  font-style:normal;
  line-height:1.45;
}

.result-consultation-box{
  display:grid;
  gap:.8rem;
}

.result-consultation-badge{
  width:fit-content;
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:5px 10px;
  border:1px solid rgba(7,150,105,.28);
  border-radius:999px;
  font-size:11px;
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
}

.result-consultation-box p{
  margin:0;
  color:var(--mid);
  font-size:13px;
  line-height:1.55;
}

.result-consultation-tags{
  display:flex;
  flex-wrap:wrap;
  gap:.45rem;
}

.result-consultation-tags span{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:5px 9px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface);
  color:var(--navy);
  font-size:11px;
  font-weight:850;
}

.result-evolution-box,
.result-followup-box{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:.75rem;
}

.result-products-grid{
  display:grid;
  gap:1rem;
  overflow:visible;
}

.result-protocol-item{
  display:grid;
  grid-template-columns:minmax(0,1.08fr) minmax(280px,.92fr);
  gap:1rem 1.15rem;
  align-items:stretch;
  padding:1.1rem;
  border:1px solid var(--border);
  border-radius:18px;
  background:#fff;
  box-shadow:var(--shadow-xs);
  overflow:visible;
  break-inside:avoid;
  page-break-inside:avoid;
}

.result-protocol-head{
  grid-column:1 / -1;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:1rem;
  padding-bottom:0;
  border-bottom:0;
}

.result-protocol-head span,
.result-protocol-label,
.result-protocol-subtitle{
  color:var(--muted);
  font-size:10.5px;
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
}

.result-protocol-head span{
  display:inline-flex;
  align-items:center;
  width:fit-content;
  min-height:28px;
  padding:5px 9px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface);
}

.result-protocol-head h3{
  margin:0;
  color:var(--navy);
  font-size:18px;
  line-height:1.2;
}

.result-protocol-main{
  display:grid;
  grid-template-columns:176px minmax(0,1fr);
  gap:1.25rem;
  align-items:center;
  min-width:0;
  min-height:190px;
}

.result-protocol-pack{
  width:176px;
  height:190px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--border);
  border-radius:16px;
  background:linear-gradient(180deg,#fff,#F8FAFC);
  overflow:hidden;
}

.result-protocol-pack img{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  padding:.55rem;
}

.result-protocol-body{
  min-width:0;
}

.result-protocol-body h4{
  margin:.2rem 0 0;
  color:var(--ink);
  font-size:22px;
  line-height:1.18;
}

.result-protocol-body p{
  margin:.55rem 0 0;
  max-width:46ch;
  color:var(--mid);
  font-size:13.5px;
  line-height:1.58;
}

.result-protocol-alternatives{
  display:grid;
  grid-template-rows:auto 1fr;
  gap:.7rem;
  min-width:0;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
}

.result-protocol-alt-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:.7rem;
  align-items:stretch;
}

.result-protocol-alt-card{
  display:grid;
  grid-template-rows:94px auto;
  gap:.55rem;
  align-content:start;
  min-width:0;
  min-height:142px;
  padding:.65rem;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  box-shadow:var(--shadow-xs);
}

.result-protocol-alt-card strong{
  color:var(--ink);
  font-size:12px;
  line-height:1.22;
  text-align:center;
}

.result-protocol-alt-pack{
  width:100%;
  height:94px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  overflow:hidden;
}

.result-protocol-alt-pack img{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  padding:.25rem;
}

.result-protocol-pack .product-pack-placeholder,
.result-protocol-alt-pack .product-pack-placeholder,
.patient-product-pack .product-pack-placeholder{
  width:30px;
  height:30px;
  min-width:30px;
  display:none;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  background:var(--surface2);
  border:1px solid var(--border);
  color:var(--accent);
  font-size:15px;
}

.result-protocol-pack.is-missing .product-pack-placeholder,
.result-protocol-alt-pack.is-missing .product-pack-placeholder,
.patient-product-pack.is-missing .product-pack-placeholder,
.product-pack-placeholder.is-visible{
  display:flex;
}

@media (max-width: 1180px){
  .result-protocol-item{
    grid-template-columns:1fr;
  }
}

.result-muted-line{
  display:flex;
  align-items:center;
  gap:.5rem;
  padding:.85rem 0;
  color:var(--muted);
  font-size:12.5px;
}

.result-muted-line .ui-icon{
  width:26px;
  height:26px;
  min-width:26px;
  border-radius:10px;
  font-size:13px;
}

.result-questionnaire-list{
  display:grid;
  gap:.9rem;
}

.result-questionnaire-group{
  display:grid;
  gap:.55rem;
}

.result-questionnaire-group-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  padding:.2rem .1rem;
}

.result-questionnaire-group-head span{
  color:var(--navy);
  font-size:12px;
  font-weight:900;
}

.result-questionnaire-group-head em{
  color:var(--muted);
  font-size:11px;
  font-style:normal;
  font-weight:800;
}

.result-questionnaire-group-list{
  display:grid;
  gap:.55rem;
}

.result-questionnaire-item{
  display:grid;
  gap:.25rem;
  padding:.85rem;
  border:1px solid var(--border);
  border-radius:16px;
  background:var(--surface);
}

.result-questionnaire-item-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.65rem;
}

.result-question-code{
  color:var(--accent);
  font-size:10.5px;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.result-question-badge{
  display:inline-flex;
  align-items:center;
  min-height:22px;
  padding:.18rem .48rem;
  border-radius:999px;
  font-size:10px;
  font-weight:900;
  white-space:nowrap;
}

.result-question-badge.ok{
  background:rgba(7,150,105,.10);
  color:var(--accent);
}

.result-question-badge.warn{
  background:rgba(245,158,11,.13);
  color:#a16207;
}

.result-question-badge.bad{
  background:rgba(220,38,38,.10);
  color:#b91c1c;
}

.result-question-badge.neutral{
  background:var(--surface2);
  color:var(--muted);
}

.result-questionnaire-item strong{
  color:var(--ink);
  font-size:13px;
  line-height:1.35;
}

.result-questionnaire-item em{
  color:var(--muted);
  font-size:12px;
  font-style:normal;
  line-height:1.45;
}

.result-questionnaire-tools{
  display:flex;
  justify-content:flex-end;
}

.result-questionnaire-tools button{
  border:1px solid var(--border);
  border-radius:999px;
  background:#fff;
  color:var(--accent);
  padding:.45rem .75rem;
  font-size:12px;
  font-weight:850;
  cursor:pointer;
}

.result-questionnaire-list.is-compressed .result-questionnaire-item.is-extra{
  display:none;
}

.result-observations-box{
  padding:1rem;
  border:1px solid rgba(91,192,190,.32);
  border-radius:18px;
  background:linear-gradient(135deg, rgba(91,192,190,.10), rgba(7,150,105,.06));
  color:var(--mid);
  font-size:13px;
  line-height:1.65;
}

.result-observations-box p{
  margin:0;
}

.result-followup-card{
  border-color:rgba(7,150,105,.28);
}

.result-followup-actions{
  display:flex;
  flex-wrap:wrap;
  gap:.75rem;
  margin-top:1rem;
}

.followup-modal{
  position:fixed;
  inset:0;
  z-index:80;
  display:none;
  align-items:center;
  justify-content:center;
  padding:1rem;
  background:rgba(11,37,69,.28);
  backdrop-filter:blur(8px);
}

.followup-modal.open{
  display:flex;
}

.followup-modal-card{
  position:relative;
  width:min(420px,100%);
  padding:1.25rem;
  border:1px solid var(--border);
  border-radius:22px;
  background:#fff;
  box-shadow:var(--shadow-lg);
}

.followup-modal-card p{
  margin:.35rem 0 1rem;
  color:var(--muted);
  font-size:13px;
  line-height:1.55;
}

.followup-modal-context{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.65rem;
  margin:.85rem 0 1rem;
}

.followup-modal-context div{
  padding:.75rem;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--surface2);
}

.followup-modal-context span{
  display:block;
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.followup-modal-context strong{
  display:block;
  margin-top:.25rem;
  color:var(--text);
  font-size:14px;
  line-height:1.25;
}

.followup-reminder-options{
  display:flex;
  gap:.6rem;
  margin:.85rem 0 1rem;
}

.followup-reminder-options:empty{
  display:none;
}

.followup-reminder-options button{
  flex:1;
  min-height:42px;
  border:1px solid var(--border);
  border-radius:999px;
  background:#fff;
  color:var(--mid);
  font-weight:850;
  cursor:pointer;
  transition:.18s ease;
}

.followup-reminder-options button:hover,
.followup-reminder-options button.active{
  border-color:rgba(7,150,105,.42);
  background:rgba(7,150,105,.10);
  color:var(--accent);
}

.followup-modal-feedback{
  display:none;
  margin:.7rem 0 0;
  padding:.7rem .8rem;
  border:1px solid rgba(202,138,4,.22);
  border-radius:12px;
  background:rgba(245,158,11,.10);
  color:#9a6400;
  font-size:12.5px;
  font-weight:800;
}

.followup-modal-close{
  position:absolute;
  top:.85rem;
  right:.85rem;
  width:34px;
  height:34px;
  border:1px solid var(--border);
  border-radius:50%;
  background:#fff;
  color:var(--navy);
  font-size:20px;
  line-height:1;
}

.followup-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:.65rem;
  margin-top:1rem;
}

@media (max-width:560px){
  .followup-modal-context{
    grid-template-columns:1fr;
  }

  .followup-reminder-options{
    flex-direction:column;
  }
}

.result-actions{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(130px,1fr));
  gap:.75rem;
}

body .result-action-btn{
  min-height:62px;
  flex-direction:column;
  gap:.45rem;
  border-radius:18px;
  white-space:normal;
}

body .result-action-btn i{
  font-size:22px;
}

body .result-action-primary{
  box-shadow:0 14px 30px rgba(11,37,69,.24);
}

.result-fact-list,
.result-measurement-list,
.result-next-list,
.result-quick-actions{
  display:flex;
  flex-direction:column;
  gap:.7rem;
}

.result-fact{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.8rem;
  padding:.78rem 0;
  border-bottom:1px solid var(--border);
}

.result-fact:last-child{
  border-bottom:none;
}

.result-fact span:first-child{
  color:var(--muted);
  font-size:12px;
  font-weight:750;
}

.result-fact span:last-child{
  color:var(--ink);
  text-align:right;
  font-size:12.5px;
  font-weight:850;
}

.result-measurement-card{
  padding:.85rem;
  border:1px solid var(--border);
  border-radius:18px;
  background:#fff;
}

.result-measurement-value{
  color:var(--ink);
  font-size:13px;
  font-weight:850;
}

.result-measurement-label{
  color:var(--muted);
  font-size:11.5px;
  font-weight:700;
  margin-top:2px;
}

.result-next-list div{
  display:flex;
  align-items:center;
  gap:.75rem;
  color:var(--mid);
  font-size:12.5px;
  font-weight:650;
}

.result-next-list span{
  width:28px;
  height:28px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  background:var(--surface2);
  color:var(--navy);
  font-size:12px;
  font-weight:850;
}

.result-quick-actions .btn{
  width:100%;
  justify-content:flex-start;
}

.result-empty{
  min-height:150px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  gap:.35rem;
  padding:1.3rem;
  border:1px dashed var(--border2);
  border-radius:20px;
  background:var(--surface);
  color:var(--muted);
}

.result-empty.compact{
  min-height:118px;
}

.result-empty.full{
  grid-column:1/-1;
}

.result-empty i,
.result-empty .ui-icon{
  width:34px;
  height:34px;
  min-width:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-bottom:.15rem;
  border-radius:13px;
  background:var(--surface2);
  border:1px solid var(--border);
  color:var(--info);
  font-size:17px;
}

.result-empty strong{
  color:var(--ink);
  font-size:14px;
  font-weight:850;
}

.result-empty span{
  max-width:320px;
  color:var(--muted);
  font-size:12.5px;
  line-height:1.5;
}

/* Archive Dashboard */
.archive-shell{
  max-width:1320px;
  width:100%;
}

.archive-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
}

.archive-kpi-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:.85rem;
  margin-bottom:1rem;
}

.archive-kpi-card{
  position:relative;
  min-height:116px;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  overflow:hidden;
}

.archive-kpi-card::before{
  content:'';
  position:absolute;
  inset:0 0 auto;
  height:4px;
  background:linear-gradient(90deg,var(--aqua),var(--accent));
}

.archive-kpi-card i,
.archive-kpi-card .ui-icon{
  position:absolute;
  top:1rem;
  right:1rem;
  width:34px;
  height:34px;
  min-width:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:14px;
  background:var(--info-bg);
  border:1px solid var(--info-line);
  color:var(--info);
  font-size:17px;
}

.archive-kpi-card span{
  color:var(--muted);
  font-size:12px;
  font-weight:750;
}

.archive-kpi-card strong{
  margin-top:.35rem;
  color:var(--navy);
  font-family:var(--mono);
  font-size:28px;
  font-weight:850;
  line-height:1;
}

.archive-filters{
  display:grid;
  grid-template-columns:minmax(260px,1.6fr) repeat(4,minmax(120px,1fr)) auto;
  gap:.75rem;
  align-items:center;
  margin-bottom:1rem;
}

.archive-filters input,
.archive-filters select{
  min-height:44px;
  width:100%;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  color:var(--ink);
  padding:.72rem .9rem;
  outline:none;
  box-shadow:var(--shadow-xs);
}

.archive-filters input:focus,
.archive-filters select:focus{
  border-color:var(--aqua);
  box-shadow:var(--ring);
}

.archive-search{
  position:relative;
}

.archive-search i{
  position:absolute;
  left:.9rem;
  top:50%;
  transform:translateY(-50%);
  color:var(--muted);
  font-size:17px;
  pointer-events:none;
}

.archive-search input{
  padding-left:2.45rem;
}

.archive-check-filter{
  min-height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:.45rem;
  padding:.72rem .9rem;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  color:var(--mid);
  font-size:12.5px;
  font-weight:750;
  white-space:nowrap;
  box-shadow:var(--shadow-xs);
}

.archive-table-card{
  padding:0;
  overflow:visible;
  max-width:100%;
}

.archive-loading,
.archive-empty{
  min-height:230px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:.5rem;
  color:var(--muted);
  text-align:center;
  padding:2rem;
}

.archive-loading i{
  animation:spin .8s linear infinite;
  font-size:24px;
  color:var(--accent);
}

.archive-empty i,
.archive-empty .ui-icon{
  width:36px;
  height:36px;
  min-width:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:14px;
  background:var(--info-bg);
  border:1px solid var(--info-line);
  color:var(--info);
  font-size:17px;
}

.archive-empty strong{
  color:var(--ink);
  font-size:15px;
  font-weight:850;
}

.archive-table{
  overflow:visible;
  width:100%;
  table-layout:auto;
}

.archive-table th:last-child,
.archive-table td:last-child{
  text-align:right;
  width:132px;
  white-space:nowrap;
}

.archive-row{
  position:relative;
}

.archive-row:hover{
  background:#F9FCFD;
}

.archive-patient-cell{
  display:flex;
  align-items:center;
  gap:.85rem;
  min-width:240px;
}

.archive-avatar{
  width:42px;
  height:42px;
  border-radius:15px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  background:var(--navy);
  color:#fff;
  font-weight:850;
  font-size:12px;
  letter-spacing:.02em;
}

.archive-avatar.large{
  width:58px;
  height:58px;
  border-radius:20px;
  font-size:16px;
}

.archive-patient-name{
  display:block;
  padding:0;
  border:none;
  background:transparent;
  color:var(--ink);
  font-size:13.5px;
  font-weight:850;
  text-align:left;
  cursor:pointer;
}

.archive-patient-name:hover{
  color:var(--accent);
}

.archive-patient-meta,
.archive-sub,
.archive-note{
  margin-top:3px;
  color:var(--muted);
  font-size:11.5px;
  line-height:1.45;
}

.archive-note{
  max-width:260px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.archive-date{
  color:var(--ink);
  font-size:13px;
  font-weight:800;
}

.archive-score-badge{
  width:46px;
  height:46px;
  border:3px solid currentColor;
  border-radius:50%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-family:var(--mono);
  font-size:12px;
  font-weight:850;
}

.archive-history-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:28px;
  padding:5px 10px;
  border-radius:999px;
  background:var(--surface2);
  color:var(--navy);
  font-size:11.5px;
  font-weight:800;
}

.archive-actions{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:flex-end;
  gap:.35rem;
}

.archive-icon-btn{
  width:36px;
  height:36px;
  min-width:36px;
  border-radius:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#fff;
  border:1px solid var(--border);
  color:var(--navy);
  cursor:pointer;
  box-shadow:var(--shadow-xs);
  line-height:1;
  padding:0;
  transition:background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.archive-icon-btn:hover{
  border-color:var(--aqua);
  color:var(--accent);
  background:#f8fcfb;
  box-shadow:0 12px 24px rgba(11,37,69,.08);
  transform:translateY(-1px);
}

.archive-icon-btn:focus-visible{
  outline:3px solid rgba(91,192,190,.28);
  outline-offset:2px;
}

.archive-icon-btn i{
  display:block;
  width:1em;
  height:1em;
  font-size:17px;
  line-height:1;
}

.archive-action-svg{
  width:18px;
  height:18px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
  pointer-events:none;
}

.archive-action-glyph{
  width:18px;
  height:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:currentColor;
  font-size:23px;
  font-weight:850;
  line-height:1;
  transform:translateY(-2px);
  pointer-events:none;
}

.archive-action-menu{
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  z-index:40;
  width:218px;
  display:none;
  flex-direction:column;
  padding:.4rem;
  border:1px solid var(--border);
  border-radius:16px;
  background:#fff;
  box-shadow:var(--shadow-lg);
}

.archive-action-menu.open{
  display:flex;
}

.archive-action-menu button{
  width:100%;
  min-height:36px;
  display:flex;
  align-items:center;
  gap:.55rem;
  padding:.55rem .65rem;
  border-radius:11px;
  background:transparent;
  color:var(--ink);
  font-size:12.5px;
  font-weight:750;
  text-align:left;
  cursor:pointer;
  border:0;
}

.archive-action-menu button i,
.archive-menu-icon{
  width:18px;
  min-width:18px;
  height:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  line-height:1;
  text-align:center;
  color:var(--muted);
}

.archive-action-menu button:hover{
  background:var(--surface2);
}

.archive-action-menu button:hover .archive-menu-icon{
  color:var(--accent);
}

.archive-action-menu button.danger{
  color:var(--bad);
}

.archive-action-menu button.danger i,
.archive-action-menu button.danger .archive-menu-icon{
  color:var(--bad);
}

.archive-count{
  margin-top:.85rem;
  color:var(--muted);
  text-align:center;
  font-size:12px;
  font-weight:650;
}

.archive-detail-overlay{
  position:fixed;
  inset:0;
  display:none;
  background:rgba(11,37,69,.34);
  z-index:120;
}

.archive-detail-overlay.open{
  display:block;
}

.archive-detail-panel{
  position:fixed;
  top:0;
  right:0;
  width:min(1040px,100vw);
  height:100vh;
  z-index:121;
  overflow-y:auto;
  transform:translateX(100%);
  transition:transform .24s ease;
  padding:1.25rem;
  background:var(--surface);
  box-shadow:-18px 0 54px rgba(11,37,69,.20);
}

.archive-detail-panel.open{
  transform:translateX(0);
}

.archive-detail-empty{
  height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:.45rem;
  color:var(--muted);
  text-align:center;
}

.archive-detail-empty i,
.archive-detail-empty .ui-icon{
  width:36px;
  height:36px;
  min-width:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--info-line);
  border-radius:14px;
  background:var(--info-bg);
  font-size:17px;
  color:var(--aqua);
}

.archive-detail-head,
.archive-detail-score,
.archive-detail-section{
  background:#fff;
  border:1px solid var(--border);
  border-radius:22px;
  box-shadow:var(--shadow-sm);
}

.archive-detail-head{
  position:relative;
  display:flex;
  align-items:center;
  gap:1rem;
  padding:1.2rem;
  margin-bottom:1rem;
}

.archive-detail-head h2{
  color:var(--navy);
  font-size:22px;
  line-height:1.15;
}

.archive-detail-kicker{
  display:inline-flex;
  margin-bottom:.2rem;
  color:var(--accent);
  font-size:10.5px;
  font-weight:850;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.archive-detail-head p{
  margin-top:.35rem;
  color:var(--muted);
  font-size:12.5px;
}

.archive-detail-close{
  position:absolute;
  top:.75rem;
  right:.75rem;
  width:34px;
  height:34px;
  border-radius:12px;
  background:var(--surface2);
  color:var(--navy);
  cursor:pointer;
}

.archive-detail-score{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding:1rem 1.1rem;
  margin-bottom:1rem;
}

.archive-detail-score span{
  color:var(--muted);
  font-size:11.5px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.06em;
}

.archive-detail-score strong{
  display:block;
  margin-top:.25rem;
  font-family:var(--mono);
  font-size:34px;
  line-height:1;
}

.archive-detail-score small{
  display:block;
  margin-top:.3rem;
  color:var(--muted);
  font-size:11.5px;
  font-weight:750;
}

.archive-detail-actions{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.65rem;
  margin-bottom:1rem;
}

.archive-detail-actions .btn{
  justify-content:center;
}

.archive-detail-section{
  padding:1rem;
  margin-bottom:1rem;
}

.archive-detail-section h3{
  margin-bottom:.75rem;
  color:var(--navy);
  font-size:13px;
  font-weight:850;
}

.archive-facts{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.65rem;
}

.archive-facts div,
.archive-mini-card,
.archive-muted-box,
.archive-note-card,
.archive-product-row{
  border:1px solid var(--border);
  border-radius:16px;
  background:var(--surface);
}

.archive-facts div{
  padding:.75rem;
}

.archive-facts span{
  display:block;
  color:var(--muted);
  font-size:11px;
  font-weight:750;
}

.archive-facts strong{
  display:block;
  margin-top:.25rem;
  color:var(--ink);
  font-size:13px;
  font-weight:850;
  overflow-wrap:anywhere;
}

.archive-history-list{
  display:flex;
  flex-direction:column;
  gap:.5rem;
}

.archive-history-row{
  width:100%;
  display:grid;
  grid-template-columns:1fr auto auto;
  gap:.65rem;
  align-items:center;
  padding:.75rem;
  border:1px solid var(--border);
  border-radius:16px;
  background:#fff;
  color:var(--ink);
  text-align:left;
  cursor:pointer;
}

.archive-history-row:hover{
  border-color:var(--aqua);
}

.archive-history-row span{
  color:var(--muted);
  font-size:12px;
}

.archive-history-row strong{
  color:var(--navy);
  font-family:var(--mono);
}

.archive-history-row em{
  color:var(--muted);
  font-style:normal;
  font-size:11px;
  font-weight:800;
}

.archive-mini-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.6rem;
}

.archive-mini-card,
.archive-muted-box{
  padding:.75rem;
}

.archive-mini-card strong{
  display:block;
  margin-bottom:.4rem;
  color:var(--ink);
  font-size:12px;
}

.archive-muted-box{
  grid-column:1/-1;
  color:var(--muted);
  font-size:12.5px;
  line-height:1.55;
}

.archive-note-card{
  padding:.75rem;
  margin-bottom:.55rem;
}

.archive-note-card strong,
.archive-note-card span{
  display:block;
}

.archive-note-card strong{
  color:var(--navy);
  font-size:12px;
}

.archive-note-card span{
  margin-top:.25rem;
  color:var(--mid);
  font-size:12.5px;
  line-height:1.55;
}

.archive-product-row{
  display:flex;
  align-items:flex-start;
  gap:.7rem;
  padding:.75rem;
  margin-bottom:.55rem;
}

.archive-product-row i{
  width:32px;
  height:32px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  border-radius:12px;
  background:var(--navy);
  color:#fff;
}

.archive-product-row strong,
.archive-product-row span{
  display:block;
}

.archive-product-row strong{
  color:var(--ink);
  font-size:12.5px;
}

.archive-product-row span{
  margin-top:.25rem;
  color:var(--muted);
  font-size:12px;
  line-height:1.45;
}

.patient-folder-hero{
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:1rem;
  padding:1.25rem;
  margin-bottom:1rem;
  border:1px solid rgba(91,192,190,.28);
  border-radius:24px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(245,247,250,.92)),
    radial-gradient(circle at top right, rgba(91,192,190,.18), transparent 38%);
  box-shadow:var(--shadow-md);
}

.patient-overview-card{
  display:block;
  padding:1.15rem;
}

.patient-path-status{
  width:fit-content;
  max-width:calc(100% - 46px);
  display:flex;
  align-items:center;
  gap:.55rem;
  margin:0 2.85rem 1rem auto;
  padding:.55rem .75rem;
  border:1px solid var(--border);
  border-radius:999px;
  background:rgba(255,255,255,.86);
  box-shadow:var(--shadow-xs);
}

.patient-path-status > span{
  font-size:12px;
  line-height:1;
}

.patient-path-status strong,
.patient-path-status em{
  display:block;
  line-height:1.2;
}

.patient-path-status strong{
  color:var(--navy);
  font-size:12px;
  font-weight:850;
}

.patient-path-status em{
  margin-top:1px;
  color:var(--muted);
  font-size:11px;
  font-style:normal;
  font-weight:700;
}

.patient-path-status.is-up{
  border-color:var(--ok-line);
  background:var(--ok-bg);
}

.patient-path-status.is-stable,
.patient-path-status.is-first{
  border-color:rgba(91,192,190,.32);
  background:var(--info-bg);
}

.patient-path-status.is-down,
.patient-path-status.is-attention{
  border-color:var(--bad-line);
  background:var(--bad-bg);
}

.patient-overview-grid{
  display:grid;
  grid-template-columns:1.25fr 1fr 1fr 1fr;
  gap:.85rem;
}

.patient-overview-block{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:.75rem;
  padding:1rem;
  border:1px solid var(--border);
  border-radius:20px;
  background:rgba(255,255,255,.84);
  box-shadow:var(--shadow-xs);
}

.patient-overview-block.is-up,
.patient-overview-trend.is-up{
  border-color:var(--ok-line);
  background:linear-gradient(180deg,#fff,var(--ok-bg));
}

.patient-overview-trend.is-down{
  border-color:var(--bad-line);
  background:linear-gradient(180deg,#fff,var(--bad-bg));
}

.patient-overview-trend.is-stable,
.patient-overview-trend.is-first{
  border-color:rgba(91,192,190,.30);
  background:linear-gradient(180deg,#fff,var(--info-bg));
}

.patient-overview-label{
  color:var(--accent);
  font-size:10.5px;
  font-weight:850;
  letter-spacing:.06em;
  text-transform:uppercase;
}

.patient-overview-person{
  display:flex;
  align-items:center;
  gap:.85rem;
  min-width:0;
}

.patient-overview-person h2{
  color:var(--navy);
  font-size:24px;
  line-height:1.08;
}

.patient-overview-person p{
  margin-top:.25rem;
  color:var(--muted);
  font-size:12.5px;
  font-weight:750;
}

.patient-overview-contact,
.patient-overview-facts{
  display:grid;
  gap:.45rem;
}

.patient-overview-contact{
  grid-template-columns:1fr;
}

.patient-overview-facts{
  grid-template-columns:repeat(3,minmax(0,1fr));
}

.patient-overview-facts.single{
  grid-template-columns:1fr;
}

.patient-overview-contact div,
.patient-overview-facts div{
  min-width:0;
  padding:.65rem;
  border:1px solid var(--border);
  border-radius:14px;
  background:rgba(245,247,250,.72);
}

.patient-overview-contact span,
.patient-overview-facts span,
.patient-current-layout span{
  display:block;
  color:var(--muted);
  font-size:10.5px;
  font-weight:850;
  letter-spacing:.04em;
  text-transform:uppercase;
}

.patient-overview-contact strong,
.patient-overview-facts strong{
  display:block;
  margin-top:.2rem;
  color:var(--ink);
  font-size:12px;
  font-weight:850;
  overflow-wrap:anywhere;
}

.patient-current-layout{
  display:flex;
  align-items:center;
  gap:.9rem;
}

.patient-score-compact{
  position:relative;
  width:96px;
  height:96px;
  min-width:96px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:conic-gradient(var(--score-color) var(--score-angle), #DCE6EF 0);
  color:var(--navy);
  box-shadow:inset 0 0 0 1px rgba(11,37,69,.06);
}

.patient-score-compact::after{
  content:"";
  position:absolute;
  inset:9px;
  border-radius:999px;
  background:#fff;
  box-shadow:inset 0 0 0 1px rgba(11,37,69,.05);
}

.patient-score-compact span,
.patient-score-compact em{
  position:relative;
  z-index:1;
}

.patient-score-compact span{
  font-size:31px;
  font-weight:900;
  line-height:.95;
}

.patient-score-compact em{
  margin-top:2px;
  color:var(--muted);
  font-size:11px;
  font-style:normal;
  font-weight:850;
}

.patient-current-layout strong{
  display:block;
  margin-top:.15rem;
  color:var(--navy);
  font-size:28px;
  font-weight:900;
  line-height:1;
}

.patient-current-layout em{
  display:block;
  margin-top:.35rem;
  color:var(--muted);
  font-size:11.5px;
  font-style:normal;
  font-weight:700;
  line-height:1.35;
}

.patient-overview-current .tag{
  width:fit-content;
}

.patient-trend-main{
  display:flex;
  align-items:center;
  gap:.75rem;
}

.patient-trend-main > span{
  width:40px;
  height:40px;
  min-width:40px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--border);
  border-radius:15px;
  background:#fff;
  color:var(--navy);
  font-size:21px;
  font-weight:900;
}

.patient-overview-trend.is-up .patient-trend-main > span{color:var(--ok)}
.patient-overview-trend.is-down .patient-trend-main > span{color:var(--bad)}
.patient-overview-trend.is-stable .patient-trend-main > span,
.patient-overview-trend.is-first .patient-trend-main > span{color:var(--aqua)}

.patient-trend-main strong,
.patient-trend-main em{
  display:block;
}

.patient-trend-main strong{
  color:var(--ink);
  font-size:15px;
  font-weight:900;
}

.patient-trend-main em{
  margin-top:2px;
  color:var(--navy);
  font-size:18px;
  font-style:normal;
  font-weight:900;
}

.patient-overview-trend p{
  margin:0;
  color:var(--muted);
  font-size:12.5px;
  line-height:1.45;
}

.patient-progression{
  margin-top:auto;
  padding:.75rem;
  border:1px solid rgba(91,192,190,.28);
  border-radius:16px;
  background:#fff;
}

.patient-progression span,
.patient-progression strong,
.patient-progression em{
  display:block;
}

.patient-progression span{
  color:var(--muted);
  font-size:10.5px;
  font-weight:850;
  letter-spacing:.04em;
  text-transform:uppercase;
}

.patient-progression strong{
  margin-top:.2rem;
  color:var(--navy);
  font-size:20px;
  font-weight:900;
}

.patient-progression em{
  margin-top:.1rem;
  font-size:12px;
  font-style:normal;
  font-weight:850;
}

.patient-progression em.is-positive{color:var(--ok)}
.patient-progression em.is-negative{color:var(--bad)}

.patient-followup-status{
  display:grid;
  gap:.55rem;
}

.patient-followup-badge{
  width:fit-content;
  padding:.42rem .65rem;
  border-radius:999px;
  background:var(--surface2);
  color:var(--navy);
  font-size:11.5px;
  font-weight:900;
}

.patient-overview-followup.is-due .patient-followup-badge{
  background:var(--bad-bg);
  color:var(--bad);
}

.patient-overview-followup.is-planned .patient-followup-badge{
  background:var(--info-bg);
  color:var(--aqua);
}

.patient-overview-followup.is-done .patient-followup-badge{
  background:var(--ok-bg);
  color:var(--ok);
}

.patient-followup-status strong{
  color:var(--ink);
  font-size:16px;
  line-height:1.25;
}

.patient-folder-title{
  display:flex;
  align-items:center;
  gap:1rem;
  min-width:0;
}

.patient-folder-title h2{
  color:var(--navy);
  font-size:30px;
  line-height:1.05;
}

.patient-folder-title p{
  margin-top:.35rem;
  color:var(--muted);
  font-size:13px;
  font-weight:700;
}

.patient-folder-score{
  min-width:210px;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  justify-content:center;
  gap:.35rem;
  padding-right:2.8rem;
}

.patient-folder-score span:first-child{
  color:var(--muted);
  font-size:11px;
  font-weight:850;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.patient-folder-score strong{
  font-family:var(--mono);
  font-size:54px;
  line-height:.95;
}

.patient-folder-score em{
  color:var(--muted);
  font-size:12px;
  font-style:normal;
  font-weight:750;
}

.patient-folder-meta{
  grid-column:1/-1;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:.7rem;
}

.patient-folder-meta div{
  min-width:0;
  padding:.8rem;
  border:1px solid var(--border);
  border-radius:16px;
  background:rgba(255,255,255,.76);
}

.patient-folder-meta span,
.patient-followup-card span{
  display:block;
  color:var(--muted);
  font-size:10.5px;
  font-weight:850;
  letter-spacing:.06em;
  text-transform:uppercase;
}

.patient-folder-meta strong,
.patient-followup-card strong{
  display:block;
  margin-top:.28rem;
  color:var(--ink);
  font-size:13px;
  font-weight:850;
  overflow-wrap:anywhere;
}

.patient-folder-grid{
  display:grid;
  grid-template-columns:minmax(0,1.3fr) minmax(310px,.7fr);
  gap:1rem;
}

.patient-folder-section{
  min-width:0;
  padding:1rem;
  border:1px solid var(--border);
  border-radius:22px;
  background:#fff;
  box-shadow:var(--shadow-sm);
}

.patient-folder-main{
  grid-column:1;
}

.patient-section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:.8rem;
  margin-bottom:.9rem;
}

.patient-section-head span{
  display:block;
  margin-bottom:.18rem;
  color:var(--accent);
  font-size:10px;
  font-weight:850;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.patient-section-head h3{
  color:var(--navy);
  font-size:16px;
  line-height:1.15;
}

.patient-section-head em{
  padding:.28rem .55rem;
  border-radius:999px;
  background:var(--surface2);
  color:var(--muted);
  font-size:11px;
  font-style:normal;
  font-weight:850;
  white-space:nowrap;
}

.patient-timeline{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:.75rem;
}

.patient-timeline-item{
  position:relative;
  display:grid;
  grid-template-columns:24px minmax(0,1fr);
  gap:.7rem;
}

.patient-timeline-dot{
  width:14px;
  height:14px;
  margin:.95rem auto 0;
  border:3px solid #fff;
  border-radius:999px;
  background:var(--accent);
  box-shadow:0 0 0 4px rgba(7,150,105,.13);
  z-index:2;
}

.patient-timeline-line{
  position:absolute;
  left:11px;
  top:1.95rem;
  bottom:-1rem;
  width:2px;
  border-radius:999px;
  background:linear-gradient(180deg, rgba(7,150,105,.34), rgba(91,192,190,.14));
}

.patient-timeline-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:.8rem;
  align-items:center;
  padding:.9rem;
  border:1px solid var(--border);
  border-radius:18px;
  background:linear-gradient(180deg, #fff, var(--surface2));
  cursor:pointer;
  transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.patient-timeline-card:hover,
.patient-timeline-card:focus-visible{
  border-color:rgba(91,192,190,.62);
  box-shadow:var(--shadow-sm);
  outline:none;
  transform:translateY(-1px);
}

.patient-timeline-item.is-active .patient-timeline-dot{
  background:var(--aqua);
  box-shadow:0 0 0 5px rgba(91,192,190,.18);
}

.patient-timeline-item.is-active .patient-timeline-card{
  border-color:rgba(91,192,190,.68);
  background:linear-gradient(180deg, #fff, rgba(91,192,190,.10));
}

.patient-timeline-main span,
.patient-timeline-main strong,
.patient-timeline-main em{
  display:block;
}

.patient-timeline-main span{
  color:var(--muted);
  font-size:12px;
  font-weight:750;
}

.patient-timeline-main strong{
  margin-top:.25rem;
  color:var(--navy);
  font-family:var(--mono);
  font-size:22px;
}

.patient-timeline-main em{
  margin-top:.15rem;
  color:var(--accent);
  font-size:12px;
  font-style:normal;
  font-weight:850;
}

.patient-timeline-actions{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:.45rem;
}

.patient-timeline-actions button{
  min-height:34px;
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  padding:.45rem .6rem;
  border:1px solid var(--border);
  border-radius:11px;
  background:#fff;
  color:var(--ink);
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}

.patient-timeline-actions button:hover{
  border-color:rgba(91,192,190,.55);
  color:var(--accent);
}

.patient-chart{
  height:230px;
  display:flex;
  align-items:end;
  gap:.65rem;
  padding:1rem .8rem .8rem;
  border:1px solid var(--border);
  border-radius:18px;
  background:linear-gradient(180deg, var(--surface2), #fff);
}

.patient-chart-col{
  flex:1;
  min-width:44px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-end;
  gap:.45rem;
  height:100%;
}

.patient-chart-bar{
  position:relative;
  width:100%;
  max-width:42px;
  min-height:16px;
  border-radius:999px 999px 8px 8px;
  background:linear-gradient(180deg, var(--aqua), var(--accent));
  box-shadow:0 12px 24px rgba(7,150,105,.14);
}

.patient-chart-bar span{
  position:absolute;
  left:50%;
  top:-1.45rem;
  transform:translateX(-50%);
  color:var(--navy);
  font-family:var(--mono);
  font-size:12px;
  font-weight:850;
}

.patient-chart-col em{
  color:var(--muted);
  font-size:10px;
  font-style:normal;
  font-weight:750;
  text-align:center;
}

.patient-chart-placeholder{
  min-height:230px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:.45rem;
  padding:1.2rem;
  border:1px dashed rgba(91,192,190,.45);
  border-radius:18px;
  background:var(--surface2);
  color:var(--muted);
  text-align:center;
}

.patient-chart-placeholder i,
.patient-chart-placeholder .ui-icon{
  width:34px;
  height:34px;
  min-width:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--info-line);
  border-radius:13px;
  background:#fff;
  color:var(--accent);
  font-size:17px;
}

.patient-chart-placeholder strong{
  color:var(--navy);
  font-size:14px;
}

.patient-chart-placeholder span{
  max-width:280px;
  font-size:12.5px;
  line-height:1.5;
}

.patient-chart-legend{
  display:flex;
  flex-wrap:wrap;
  gap:.4rem;
  margin-top:.7rem;
}

.patient-chart-legend span{
  padding:.28rem .55rem;
  border-radius:999px;
  background:var(--surface2);
  color:var(--muted);
  font-size:10.5px;
  font-weight:800;
}

.patient-measure-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.55rem;
  margin-top:.8rem;
}

.patient-measure-grid div{
  min-width:0;
  padding:.65rem;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
}

.patient-measure-grid span{
  display:block;
  color:var(--muted);
  font-size:10.5px;
  font-weight:800;
}

.patient-measure-grid strong{
  display:block;
  margin-top:.22rem;
  color:var(--navy);
  font-size:13px;
  font-weight:850;
  overflow-wrap:anywhere;
}

.patient-products-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.75rem;
}

.patient-product-card{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:.85rem;
  align-items:center;
  padding:.85rem;
  border:1px solid var(--border);
  border-radius:18px;
  background:var(--surface2);
}

.patient-product-pack{
  width:56px;
  height:64px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  overflow:hidden;
  border:1px solid rgba(91,192,190,.24);
  border-radius:14px;
  background:#fff;
  color:var(--accent);
  box-shadow:var(--shadow-xs);
}

.patient-product-pack img{
  width:100%;
  height:100%;
  object-fit:contain;
  padding:.18rem;
}

.patient-product-body{
  min-width:0;
}

.patient-product-body strong,
.patient-product-body span,
.patient-product-body p{
  display:block;
}

.patient-product-body strong{
  color:var(--navy);
  font-size:13.5px;
  line-height:1.2;
}

.patient-product-body span{
  margin-top:.22rem;
  color:var(--muted);
  font-size:11px;
  font-weight:750;
}

.patient-product-body p{
  margin-top:.35rem;
  color:var(--mid);
  font-size:12px;
  line-height:1.45;
}

.patient-product-body small{
  display:block;
  margin-top:.35rem;
  color:var(--muted);
  font-size:11px;
  line-height:1.35;
}

.patient-followup-card{
  display:grid;
  gap:.6rem;
  padding:.9rem;
  border:1px solid rgba(7,150,105,.18);
  border-radius:18px;
  background:linear-gradient(135deg, rgba(7,150,105,.08), rgba(91,192,190,.08));
}

.patient-folder-actions,
.patient-quick-actions{
  display:grid;
  gap:.55rem;
  margin-top:.8rem;
}

.patient-folder-actions .btn,
.patient-quick-actions .btn{
  width:100%;
  justify-content:flex-start;
}

.patient-quick-actions .danger{
  border-color:rgba(220,38,38,.18);
  color:var(--bad);
}

.patient-notes-list{
  display:flex;
  flex-direction:column;
  gap:.65rem;
}

.patient-note-item{
  padding:.8rem;
  border:1px solid var(--border);
  border-radius:16px;
  background:var(--surface2);
}

.patient-note-item div{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
}

.patient-note-item strong{
  color:var(--navy);
  font-size:12px;
}

.patient-note-item span{
  color:var(--muted);
  font-size:11px;
  font-weight:750;
}

.patient-note-item p{
  margin-top:.45rem;
  color:var(--mid);
  font-size:12.5px;
  line-height:1.55;
}

.btn-sm{
  min-height:34px;
  padding:.45rem .7rem;
  border-radius:12px;
  font-size:12px;
}

.archive-modal{
  position:fixed;
  inset:0;
  z-index:140;
  align-items:center;
  justify-content:center;
  padding:1rem;
  background:rgba(11,37,69,.46);
}

.archive-modal-card{
  width:min(440px,100%);
  padding:1.4rem;
  border-radius:24px;
  background:#fff;
  border:1px solid var(--border);
  box-shadow:var(--shadow-lg);
  text-align:center;
}

.archive-modal-icon{
  width:36px;
  height:36px;
  min-width:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:14px;
  background:var(--bad-bg);
  border:1px solid var(--bad-line);
  color:var(--bad);
  font-size:17px;
  margin-bottom:.75rem;
}

.archive-modal-card h2{
  color:var(--navy);
  font-size:20px;
  line-height:1.2;
}

.archive-modal-card p{
  margin-top:.55rem;
  color:var(--muted);
  font-size:13px;
  line-height:1.55;
}

.archive-modal-actions{
  display:flex;
  justify-content:center;
  gap:.75rem;
  margin-top:1.1rem;
}

/* Animations */
.fade-in{animation:fi .28s ease both}
@keyframes fi{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes spin{to{transform:rotate(360deg)}}

/* Typography guards */
body .lc-logo-name,
body .lc-title,
body .sb-logo-text,
body .tb-title,
body .ph h1,
body .ph p,
body .section-label,
body .field label,
body .btn,
body .tag,
body .badge,
body th,
body td,
body .result-score-center span,
body .result-status-badge,
body .result-eyebrow,
body .patient-folder-score span:first-child,
body .patient-folder-meta span,
body .patient-overview-label,
body .patient-overview-contact span,
body .patient-overview-facts span,
body .patient-current-layout span,
body .patient-path-status strong,
body .patient-followup-card span{
  font-family:var(--sans);
  letter-spacing:0;
}

body .kpi-value,
body .dashboard-kpi-card strong,
body .archive-kpi-card strong,
body .result-score-center #score-num,
body .result-score-comparison strong,
body .result-goal-score strong,
body .archive-score-badge,
body .archive-detail-score strong,
body .archive-history-row strong,
body .patient-folder-score strong,
body .patient-score-compact span,
body .patient-current-layout strong,
body .patient-trend-main em,
body .patient-progression strong,
body .patient-timeline-main strong,
body .patient-chart-bar span,
body #stats-kpi{
  font-family:var(--sans);
  font-variant-numeric:normal;
  font-feature-settings:"zero" 0;
}

/* Responsive */
@media (max-width: 1440px){
  :root{
    --container:1080px;
  }

  body .content{
    padding:1.5rem;
  }

  .dashboard-shell,
  .archive-shell,
  .result-shell,
  .questionnaire-shell,
  .analysis-shell{
    max-width:1240px;
  }

  .dashboard-hero{
    padding:1.45rem;
  }

  .result-hero-card{
    gap:1.5rem;
  }
}

@media (max-width: 1200px){
  :root{
    --sidebar-w:236px;
  }

  body .content{
    padding:1.25rem;
  }

  body .ph h1{
    font-size:26px;
  }

  .dashboard-kpi-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .dashboard-grid{
    gap:.85rem;
  }

  .archive-filters{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .archive-search,
  .archive-check-filter{
    grid-column:auto;
  }

  .archive-table-card{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  .archive-table{
    min-width:980px;
  }

  .result-hero-card{
    grid-template-columns:minmax(420px,1fr) minmax(0,1fr);
    padding:0;
  }

  .result-hero-details{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .result-score-ring{width:200px;height:200px}
  .result-score-center #score-num{font-size:52px}

  .result-grid{
    gap:1rem;
  }

  .patient-folder-grid{
    grid-template-columns:minmax(0,1fr) minmax(280px,.72fr);
  }

  .patient-overview-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media (max-width: 1024px){
  :root{--sidebar-w:236px}
  body .content{padding:1.35rem}
  .kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dashboard-hero{grid-template-columns:1fr}
  .dashboard-kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .dashboard-panel,
  .dashboard-panel-wide{grid-column:span 12}
  .journey-layout{grid-template-columns:1fr}
  .medical-grid,
  .lab-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .archive-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .archive-filters{grid-template-columns:repeat(2,minmax(0,1fr))}
  .archive-search{grid-column:1/-1}
  .archive-table-card{overflow-x:auto}
  .archive-table{min-width:980px}
  .patient-folder-hero{grid-template-columns:1fr}
  .patient-overview-card{display:block}
  .patient-folder-score{align-items:flex-start;padding-right:0}
  .patient-folder-meta{grid-template-columns:repeat(2,minmax(0,1fr))}
  .patient-folder-grid{grid-template-columns:1fr}
  .patient-folder-main{grid-column:auto}
  .patient-products-grid{grid-template-columns:1fr}
  .result-hero-card{grid-template-columns:1fr;min-height:auto}
  .result-score-panel{justify-content:flex-start}
  .result-insight-columns,
  .result-planning-grid{grid-template-columns:1fr}
  .result-main,
  .result-aside{grid-column:span 12}
  .result-conclusion-grid,
  .result-evolution-box,
  .result-followup-box{grid-template-columns:repeat(2,minmax(0,1fr))}
  .result-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media (max-width: 992px){
  body .content{
    padding:1.15rem;
  }

  body .card{
    padding:1.2rem;
  }

  .dashboard-hero,
  .journey-layout,
  .result-hero-card,
  .patient-folder-hero,
  .patient-folder-grid{
    grid-template-columns:1fr;
  }

  .dashboard-panel,
  .dashboard-panel-wide,
  .result-main,
  .result-aside{
    grid-column:1/-1;
  }

  .dashboard-kpi-grid,
  .archive-kpi-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .medical-grid,
  .lab-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .medical-field-card.wide{
    grid-column:span 2;
  }

  .result-score-panel,
  .patient-folder-score{
    justify-content:flex-start;
    align-items:flex-start;
  }

  .result-products-grid,
  .patient-products-grid{
    grid-template-columns:1fr;
  }
}

@media (max-width: 768px){
  body #s-login{
    padding:1.25rem;
  }

  body .login-card{
    width:min(460px,100%);
    border-radius:26px;
  }

  body .lc-head{
    padding:1.8rem 1.65rem 1.55rem;
  }

  body .lc-body{
    padding:1.6rem 1.65rem 1.75rem;
  }

  body .login-logo{
    width:176px;
  }

  body .lc-title{
    font-size:30px;
  }

  body .sidebar{
    left:-280px;
    width:256px;
    box-shadow:none;
  }

  body .sidebar.open{
    left:0;
    box-shadow:12px 0 34px rgba(11,37,69,.22);
  }

  body .topbar{
    height:62px;
    padding:0 1rem;
  }

  .notification-panel{
    width:min(340px,calc(100vw - 24px));
  }

  body .content{padding:1rem}
  body .ph h1{font-size:23px}
  body .ph p{font-size:13px}
  body .card{padding:1.1rem;border-radius:20px}
  body .card-sm{padding:.9rem;border-radius:18px}
  body .btn{min-height:40px}
  body .q-option{min-height:50px;padding:.78rem .9rem}
  body #stats-kpi{grid-template-columns:repeat(2,minmax(0,1fr)) !important}
  .check-header{gap:.75rem}
  .check-header-progress{width:180px}
  .dashboard-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dashboard-hero{padding:1.2rem;border-radius:22px}
  .dashboard-hero h1{font-size:32px}
  .dashboard-follow-card{min-height:auto}
  .dashboard-patient-row{
    grid-template-columns:auto minmax(0,1fr);
  }
  .dashboard-patient-outcome{
    grid-column:2;
    justify-content:flex-start;
    min-width:0;
  }
  .form-grid.two,
  .form-grid.three{grid-template-columns:1fr}
  .medical-grid,
  .lab-grid{grid-template-columns:1fr}
  .lab-actions{
    grid-template-columns:1fr;
  }
  .lab-actions .btn-ghost,
  .lab-actions .btn-green{
    grid-column:auto;
    justify-self:stretch;
    justify-content:center;
    width:100%;
  }
  .medical-field-card.wide{grid-column:span 1}
  .questionnaire-top{flex-direction:column}
  .questionnaire-time{width:100%}
  .questionnaire-progress-row{grid-template-columns:1fr}
  .questionnaire-card{padding:1.1rem;border-radius:22px}
  .analysis-card{padding:1.25rem;border-radius:24px}
  .archive-head{flex-direction:column}
  .archive-head .btn{width:100%;justify-content:center}
  .archive-filters{grid-template-columns:1fr}
  .archive-check-filter{justify-content:flex-start}
  .archive-table{
    min-width:900px;
  }
  .archive-detail-panel{width:100vw;padding:1rem}
  .archive-detail-actions{grid-template-columns:1fr}
  .archive-facts,
  .archive-mini-grid{grid-template-columns:1fr}
  .patient-folder-hero{padding:1rem;border-radius:22px}
  .patient-path-status{
    width:100%;
    max-width:none;
    margin:0 0 .8rem;
  }
  .patient-overview-grid{grid-template-columns:1fr}
  .patient-overview-facts{grid-template-columns:1fr}
  .patient-overview-person{align-items:flex-start}
  .patient-folder-title{align-items:flex-start}
  .patient-folder-title h2{font-size:24px}
  .patient-folder-meta{grid-template-columns:1fr}
  .patient-measure-grid{grid-template-columns:1fr}
  .patient-timeline-card{grid-template-columns:1fr}
  .patient-timeline-actions{justify-content:flex-start}
  .patient-product-card{grid-template-columns:auto minmax(0,1fr)}
  .patient-product-card .tag{grid-column:2}
  .result-progress-strip{grid-template-columns:repeat(2,minmax(0,1fr))}
  .result-return-bar{flex-direction:column;align-items:stretch}
  .result-return-bar .btn{width:100%;justify-content:center}
  .result-hero-card{padding:0;border-radius:0}
  .result-patient-name{font-size:30px}
  .result-hero-details{grid-template-columns:1fr}
  .result-score-ring{width:176px;height:176px}
  .result-score-center #score-num{font-size:46px}
  .result-goal-box{grid-template-columns:1fr}
  .result-protocol-head{align-items:flex-start;flex-direction:column;gap:.35rem}
  .result-protocol-main{grid-template-columns:1fr}
  .result-protocol-pack{width:100%;height:188px}
  .result-protocol-alt-grid{grid-template-columns:1fr}
}

@media (max-width: 480px){
  body #s-login{
    padding:.85rem;
  }

  body .login-card{
    width:100%;
    border-radius:24px;
  }

  body .lc-head{
    padding:1.45rem 1.15rem 1.35rem;
  }

  body .lc-body{
    padding:1.25rem 1.15rem 1.35rem;
  }

  body .login-brand{
    gap:.7rem;
    margin-bottom:1.25rem;
  }

  body .login-logo{
    width:152px;
  }

  body .lc-title{
    font-size:27px;
  }

  body .lc-sub{
    font-size:13.5px;
  }

  body .login-microcopy{
    font-size:12px;
  }

  body .role-toggle{
    margin-bottom:1rem;
  }

  body .rt-btn{
    min-height:40px;
    font-size:12px;
  }

  body .login-input-wrap,
  body .login-submit{
    min-height:46px;
  }

  body .content{padding:.8rem}
  body .ph h1{font-size:21px}
  body .ph p{font-size:12.5px}
  body .card{padding:1rem}
  body .card .btn + .btn{margin-top:.45rem}
  body table{font-size:12px}
  body th,
  body td{padding:.8rem !important}
  body .topbar{padding:0 .75rem}
  body .tb-title{font-size:13px}
  .notification-button{
    width:38px;
    height:38px;
    border-radius:13px;
  }
  .notification-panel{
    position:fixed;
    top:64px;
    left:.75rem;
    right:.75rem;
    width:auto;
    max-width:none;
  }
  .check-header{
    flex-direction:column;
    align-items:flex-start;
    gap:.45rem;
  }
  .check-header-progress{width:100%}
  .dashboard-kpi-grid{grid-template-columns:1fr}
  .dashboard-hero h1{font-size:30px}
  .dashboard-hero-actions{flex-direction:column}
  .dashboard-hero-actions .btn,
  .form-actions .btn{width:100%}
  .form-actions{flex-direction:column}
  .archive-kpi-grid{grid-template-columns:1fr}
  .archive-table{
    min-width:840px;
  }
  .archive-actions{
    gap:.25rem;
  }
  .archive-icon-btn{
    width:34px;
    height:34px;
    min-width:34px;
  }
  .archive-modal-actions{flex-direction:column}
  .result-progress-strip{grid-template-columns:1fr}
  .result-conclusion-grid,
  .result-evolution-box,
  .result-followup-box{grid-template-columns:1fr}
  .result-actions{grid-template-columns:1fr}
  .result-patient-meta{flex-direction:column;align-items:flex-start}
  .result-hero-card{
    padding:0;
  }
  .result-score-ring{
    width:154px;
    height:154px;
  }
  .result-score-center #score-num{
    font-size:40px;
  }
}

@media print{
  .result-hero-card{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    gap:.8rem;
    break-inside:avoid;
    page-break-inside:avoid;
  }

  .result-score-panel,
  .result-hero-content,
  .result-section-card,
  .result-protocol-item{
    box-shadow:none !important;
    break-inside:avoid;
    page-break-inside:avoid;
  }

  .result-score-panel{
    min-height:auto;
    padding:1rem;
  }

  .result-score-ring{
    width:150px;
    height:150px;
  }

  .result-products-section,
  .result-products-grid{
    overflow:visible !important;
  }

  .result-protocol-item{
    grid-template-columns:1fr;
    gap:.75rem;
    margin-bottom:.8rem;
  }

  .result-protocol-main{
    grid-template-columns:132px minmax(0,1fr);
    min-height:auto;
  }

  .result-protocol-pack{
    width:132px;
    height:146px;
  }

  .result-protocol-alt-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .result-protocol-alt-card{
    min-height:118px;
    grid-template-rows:72px auto;
  }

  .result-protocol-alt-pack{
    height:72px;
  }

  .result-health-disclaimer{
    break-inside:avoid;
    page-break-inside:avoid;
  }
}
