:root {
  --navy: #123c69;
  --blue: #16609f;
  --blue-soft: #e9f3fb;
  --teal: #0f766e;
  --yellow: #ffe45c;
  --yellow-soft: #fff7c7;
  --ink: #172334;
  --muted: #657181;
  --line: #d7e0ea;
  --surface: #ffffff;
  --surface-2: #f5f8fb;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(18, 60, 105, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #eef3f7;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.phone {
  width: min(420px, calc(100vw - 24px));
  height: min(760px, calc(100vh - 24px));
  min-height: 640px;
  border: 1px solid rgba(18, 60, 105, 0.16);
  border-radius: 26px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.screen {
  position: relative;
  height: 100%;
  min-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(#f8fbfd, #edf5f7);
}

.screen.is-dark {
  background: linear-gradient(#f8fbfd, #edf5f7);
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 236px;
  background:
    linear-gradient(90deg, rgba(5, 27, 50, 0.76) 0%, rgba(5, 27, 50, 0.48) 54%, rgba(5, 27, 50, 0.3) 100%),
    linear-gradient(180deg, rgba(5, 27, 50, 0.18) 0%, rgba(5, 27, 50, 0.42) 100%),
    url("assets/siv-header-background.jpg") center 42% / cover no-repeat;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

#app {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 100%;
}

.view {
  min-height: 100%;
  padding: 58px 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.home {
  gap: 18px;
  text-align: left;
}

.auth-view {
  gap: 18px;
}

.auth-brand {
  margin-top: 40px;
}

.auth-card {
  width: 100%;
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(18, 60, 105, 0.12);
}

.auth-card h2 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.1;
}

.form-label {
  margin: 4px 0 -6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-field {
  width: 100%;
  min-height: 52px;
  border-radius: 12px;
  font-size: 18px;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.two-columns {
  grid-template-columns: 1fr 1fr;
}

.remember-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.remember-row input {
  width: 18px;
  height: 18px;
  margin-top: 0;
  accent-color: var(--blue);
}

.secondary-button {
  color: var(--navy);
  background: var(--blue-soft);
  box-shadow: none;
}

.admin-entry-button {
  color: var(--navy);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: none;
}

.auth-result p {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}

.muted-copy {
  color: var(--muted) !important;
  font-weight: 700;
}

.admin-view {
  padding-top: 42px;
}

.admin-card {
  margin-top: 0;
  width: min(1120px, calc(100vw - 32px));
  max-width: 1120px;
}

.admin-main-menu { display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:6px; border-radius:16px; background:var(--surface-2); }
.admin-main-tab { min-height:48px; border:0; border-radius:12px; color:var(--muted); background:transparent; font-size:15px; font-weight:900; cursor:pointer; }
.admin-main-tab.is-active { color:white; background:var(--navy); box-shadow:0 8px 18px rgba(9,38,80,.18); }
.admin-push-card { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px; border:1px solid #bfdbfe; border-radius:16px; background:#eff7ff; }
.admin-push-card > div { display:grid; gap:4px; }.admin-push-card strong { color:var(--navy); font-size:14px; }.admin-push-card span { color:var(--muted); font-size:12px; font-weight:700; }
.analytics-dashboard { display:grid; gap:18px; }
.analytics-toolbar { display:flex; align-items:end; justify-content:space-between; gap:16px; }
.analytics-toolbar label { display:grid; gap:6px; color:var(--muted); font-size:12px; font-weight:900; text-transform:uppercase; }
.analytics-period, .analytics-export-scope { min-width:180px; height:44px; box-shadow:none; }
.analytics-export-actions { display:flex; flex-wrap:wrap; gap:8px; }
.admin-small-button.export { min-height:42px; border:1px solid var(--line); color:var(--navy); background:white; }
.analytics-kpis { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.analytics-kpi { display:grid; gap:5px; padding:16px; border:1px solid #dbe8f0; border-radius:16px; background:linear-gradient(145deg,#fff,#eef7fc); }
.analytics-kpi span { color:var(--muted); font-size:12px; font-weight:900; text-transform:uppercase; }
.analytics-kpi strong { color:var(--navy); font-size:36px; line-height:1; }
.analytics-kpi small { color:var(--muted); font-weight:700; }
.analytics-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.analytics-card { min-width:0; padding:18px; border:1px solid var(--line); border-radius:18px; background:white; }
.analytics-card h3 { margin:0 0 16px; color:var(--navy); font-size:17px; }
.analytics-wide { grid-column:1 / -1; }
.analytics-ranking { display:grid; gap:10px; max-height:310px; overflow:auto; }
.ranking-row { display:grid; grid-template-columns:28px 1fr 36px; align-items:center; gap:10px; }
.ranking-position { display:grid; place-items:center; width:28px; height:28px; border-radius:50%; color:var(--navy); background:var(--blue-soft); font-size:12px; font-weight:900; }
.ranking-row > div { min-width:0; }
.ranking-row strong { display:block; overflow:hidden; color:var(--ink); font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.ranking-row i { display:block; height:6px; margin-top:5px; overflow:hidden; border-radius:999px; background:#edf2f5; }
.ranking-row i b { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--blue),#4ba3dc); }
.ranking-row em { color:var(--navy); font-style:normal; font-weight:900; text-align:right; }
.age-chart { display:flex; align-items:center; justify-content:center; gap:28px; min-height:190px; }
.age-ring { display:grid; place-content:center; width:145px; height:145px; border-radius:50%; background:radial-gradient(circle at center,white 54%,transparent 56%),conic-gradient(var(--blue) 0 var(--adult),var(--yellow) var(--adult) 100%); text-align:center; }
.age-ring strong { color:var(--navy); font-size:30px; }.age-ring span { color:var(--muted); font-size:11px; font-weight:800; }
.age-legend { display:grid; gap:12px; }.age-legend div { display:grid; grid-template-columns:12px 1fr auto; gap:8px; align-items:center; color:var(--ink); font-size:13px; }
.age-legend i { width:10px; height:10px; border-radius:50%; }.adult-dot{background:var(--blue)}.pediatric-dot{background:var(--yellow)}
.daily-chart { display:flex; align-items:end; gap:8px; min-height:170px; overflow-x:auto; padding:10px 2px 0; }
.daily-column { display:grid; justify-items:center; align-items:end; gap:5px; min-width:36px; height:155px; color:var(--muted); font-size:10px; font-weight:800; }
.daily-column i { width:24px; max-height:120px; border-radius:7px 7px 3px 3px; background:linear-gradient(180deg,#55a9df,var(--blue)); }
.daily-column small { white-space:nowrap; }.analytics-note { margin:0; color:var(--muted); font-size:11px; font-weight:700; text-align:right; }

@media (max-width: 720px) {
  .admin-card { width:calc(100vw - 20px); }
  .analytics-toolbar, .age-chart { align-items:stretch; flex-direction:column; }
  .analytics-kpis, .analytics-grid { grid-template-columns:1fr; }
  .analytics-wide { grid-column:auto; }
  .analytics-export-actions { display:grid; grid-template-columns:1fr 1fr; }
  .admin-push-card { align-items:stretch; flex-direction:column; }
}

.admin-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-title-row h2 {
  margin-bottom: 4px;
}

.admin-small-button {
  border: 0;
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--surface);
  background: var(--blue);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.admin-user-list {
  display: grid;
  gap: 12px;
  max-height: 430px;
  overflow: auto;
  padding-right: 2px;
}

.admin-user-list.compact {
  max-height: 320px;
}

.admin-user-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-tab {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  color: var(--ink);
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  cursor: pointer;
}

.admin-tab span {
  display: block;
  margin-top: 4px;
  color: var(--navy);
  font-size: 20px;
  line-height: 1;
}

.admin-tab.is-active {
  color: var(--surface);
  background: var(--blue);
  border-color: var(--blue);
}

.admin-tab.is-active span {
  color: var(--yellow);
}

.admin-browser {
  display: grid;
  gap: 10px;
}

.admin-filter-grid {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  background: var(--surface-2);
}

.admin-filter-field {
  height: 46px;
  min-height: 46px;
  font-size: 15px;
  box-shadow: none;
}

.admin-list-count {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-section {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.admin-section h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
}

.admin-active-list {
  display: grid;
  gap: 8px;
}

.active-user-line {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--blue-soft);
}

.active-user-line strong {
  color: var(--ink);
  font-size: 14px;
}

.active-user-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.report-card {
  display: grid;
  gap: 4px;
  min-height: 72px;
  border-radius: 12px;
  padding: 10px;
  background: var(--blue-soft);
}

.report-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.report-card strong {
  color: var(--navy);
  font-size: 28px;
  line-height: 1;
}

.report-list {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.report-list h4 {
  margin: 4px 0 2px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.report-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.admin-user-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.admin-user-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.admin-user-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.12;
}

.admin-user-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--navy);
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-aprovado {
  color: #14532d;
  background: #dcfce7;
}

.status-pendente {
  color: #854d0e;
  background: #fef3c7;
}

.status-recusado,
.status-bloqueado {
  color: #7f1d1d;
  background: #fee2e2;
}

.admin-user-meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

.admin-user-meta div {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 8px;
}

.admin-user-meta dt,
.admin-user-meta dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.25;
}

.admin-user-meta dt {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

.admin-user-meta dd {
  color: var(--ink);
  font-weight: 800;
}

.admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-action {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  padding: 8px;
  color: var(--surface);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.admin-action.approve {
  background: #15803d;
}

.admin-action.reject {
  background: #b45309;
}

.admin-action.block {
  background: #991b1b;
}

.admin-action.delete {
  color: var(--danger);
  background: #fee2e2;
}

.logout-button {
  position: absolute;
  top: 18px;
  right: 24px;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--surface);
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.brand {
  margin: 72px 0 0;
  color: var(--surface);
  font-size: 40px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0;
}

.brand strong {
  font-weight: 800;
}

.brand .accent {
  color: var(--yellow);
}

.subtitle {
  width: min(300px, 100%);
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  line-height: 1.35;
}

.prompt,
.screen-title {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: 0;
}

.home .prompt {
  margin-top: 18px;
}

.actions {
  width: 100%;
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.button {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--surface);
  background: var(--blue);
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(22, 96, 159, 0.16);
  cursor: pointer;
}

.button.primary-yellow {
  color: var(--navy);
  background: var(--yellow);
  box-shadow: 0 8px 18px rgba(178, 139, 0, 0.14);
}

.weight-choice {
  color: var(--navy);
  background: var(--blue-soft);
  border: 2px solid rgba(22, 96, 159, 0.24);
  box-shadow: 0 8px 18px rgba(18, 60, 105, 0.08);
}

.pediatric-restart {
  min-height: 56px;
  margin-top: clamp(46px, 8vh, 96px);
  margin-bottom: 18px;
  color: var(--navy);
  background: var(--yellow);
}

.button:active {
  transform: translateY(1px);
}

.menu-button {
  position: absolute;
  right: 22px;
  bottom: 22px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--navy);
  background: var(--surface);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.panel-view {
  gap: 22px;
  text-align: left;
}

.panel-view .screen-title {
  color: var(--yellow);
}

.panel-view .weight-title {
  margin-top: 118px;
}

.panel-view .spacer {
  display: none;
}

.panel-view .field-row {
  margin-top: 42px;
}

.panel-view .button[data-action="calculateWeight"] {
  margin-top: 70px;
}

.panel-view .button.primary-yellow {
  min-height: 56px;
  margin-top: auto;
}

.mascot,
.round-icon {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  margin-top: 54px;
  border: 0;
  border-radius: 18px;
  color: var(--navy);
  background: var(--yellow);
  font-size: 36px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(18, 60, 105, 0.14);
}

.field {
  width: 100%;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 16px;
  color: var(--ink);
  background: var(--surface);
  font-size: 22px;
  box-shadow: 0 4px 14px rgba(18, 60, 105, 0.08);
}

.field:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(22, 96, 159, 0.16);
}

.field-row {
  display: grid;
  gap: 8px;
}

.field-help {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.spacer {
  flex: 1;
}

.age-choice {
  gap: 18px;
}

.age-choice .prompt {
  margin-top: 18px;
}

.age-back {
  margin-top: 18px;
}

.age-entry {
  gap: 18px;
  padding: 58px 24px 24px;
  text-align: left;
}

.age-entry .screen-title {
  max-width: 310px;
  color: var(--surface);
  font-size: 28px;
}

.age-form {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 12px;
  align-items: center;
  margin-top: 30px;
}

.age-field {
  height: 62px;
  font-size: 22px;
}

.insert-button {
  min-height: 62px;
  font-size: 17px;
}

.age-help,
.estimate-error {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.estimate-error {
  color: var(--danger);
}

.estimated-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  color: var(--navy);
  font-size: 18px;
  font-weight: 800;
}

.estimated-weight {
  min-height: 58px;
  display: grid;
  place-items: center start;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 16px;
  color: var(--muted);
  background: var(--surface);
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(18, 60, 105, 0.08);
}

.protocol-view {
  gap: 14px;
  padding: 58px 18px 20px;
}

.protocol-title {
  margin: 14px 6px 8px;
  color: var(--surface);
  font-size: clamp(21px, 5.3vw, 26px);
  line-height: 1.05;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.protocol-title-accent {
  color: var(--yellow);
}

.protocol-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 22px;
}

.protocol-grid .button {
  min-height: 48px;
  border: 1px solid rgba(18, 60, 105, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
  line-height: 1.12;
  font-weight: 800;
  text-align: left;
  box-shadow: 0 6px 16px rgba(18, 60, 105, 0.08);
}

.protocol-grid .button:focus,
.protocol-grid .button:hover {
  color: var(--navy);
  outline: 2px solid rgba(22, 96, 159, 0.18);
}

.protocol-grid .button.danger-protocol {
  border-color: rgba(184, 28, 28, 0.22);
  color: #9f1d1d;
  background: #fff1f1;
}

.protocol-grid .button.danger-protocol:focus,
.protocol-grid .button.danger-protocol:hover {
  color: #7f1d1d;
  outline-color: rgba(184, 28, 28, 0.22);
}

.wide {
  grid-column: 1 / -1;
}

.weight-badge {
  order: -1;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 6px 0;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--navy);
  background: var(--yellow-soft);
  font-size: 15px;
  font-weight: 800;
}

.weight-badge strong {
  margin-left: auto;
  color: var(--ink);
  font-size: 22px;
}

.weight-badge span:last-child {
  color: var(--navy);
}

.pdf-view {
  gap: 10px;
  padding: 36px 14px 0;
  overflow: hidden;
}

.pdf-title {
  margin: 36px 6px 2px;
  color: var(--surface);
  font-size: clamp(21px, 5.3vw, 26px);
  line-height: 1.08;
  font-weight: 800;
}

.pdf-frame-wrap {
  height: clamp(500px, calc(100dvh - 218px), 760px);
  min-height: 500px;
  flex: 1 1 auto;
  overflow: auto;
  touch-action: pan-x pan-y pinch-zoom;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(18, 60, 105, 0.08);
  -webkit-overflow-scrolling: touch;
}

.pdf-frame {
  width: 100%;
  height: 100%;
  min-height: 500px;
  border: 0;
  background: var(--surface);
  touch-action: pan-x pan-y pinch-zoom;
}

.protocol-image-hint {
  margin: -1px 4px 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.protocol-image-shell {
  --protocol-zoom: 0.96;
  --protocol-base-width: 320px;
  --protocol-image-width: 307px;
  height: clamp(500px, calc(100dvh - 238px), 760px);
  min-height: 500px;
  flex: 1 1 auto;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(18, 60, 105, 0.08);
  -webkit-overflow-scrolling: touch;
  touch-action: none;
  overscroll-behavior: none;
}

.protocol-image-stage {
  display: grid;
  gap: 10px;
  justify-items: start;
  width: max(100%, calc(var(--protocol-image-width) + 24px));
  min-width: max-content;
  padding: 10px 12px;
  touch-action: none;
}

.protocol-page-image {
  width: var(--protocol-image-width);
  min-width: var(--protocol-image-width);
  max-width: none;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(18, 60, 105, 0.14);
}

@media (max-height: 760px) {
  .pdf-frame-wrap,
  .protocol-image-shell {
    height: calc(100dvh - 210px);
    min-height: 420px;
  }

  .pdf-frame {
    min-height: 420px;
  }
}

.detail-view {
  padding: 58px 18px 0;
}

.detail-content {
  width: 100%;
  padding-bottom: 72px;
  transition: filter 160ms ease, opacity 160ms ease;
}

.detail-content.is-blurred {
  filter: blur(5px);
  opacity: 0.32;
}

.detail-title {
  width: 100%;
  margin: 58px 0 8px;
  color: var(--surface);
  font-size: 26px;
  line-height: 1.08;
  text-align: left;
}

.detail-meta {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
}

.detail-meta .detail-weight {
  margin-bottom: 0;
}

.detail-weight {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 22px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--navy);
  background: var(--yellow-soft);
  font-size: 13px;
  font-weight: 800;
}

.detail-weight strong {
  color: var(--ink);
  font-size: 17px;
}

.protocol-notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--navy);
  background: var(--yellow-soft);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 900;
  text-align: center;
}

.divider {
  display: none;
}

.dose-list {
  width: 100%;
  display: grid;
  gap: 12px;
}

.choice-list {
  width: 100%;
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.choice-list .button {
  min-height: 68px;
  border: 2px solid var(--yellow);
  color: var(--yellow);
  background: var(--blue);
  line-height: 1.2;
}

.detail-action-list {
  width: 100%;
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
}

.detail-action-list-bottom {
  margin: 16px 0 0;
}

.detail-action-button {
  min-height: 56px;
  border: 2px solid var(--yellow);
  color: var(--yellow);
  background: var(--blue);
}

.detail-action-button.danger-detail-action {
  border-color: rgba(185, 28, 28, 0.28);
  color: #fff;
  background: linear-gradient(180deg, #c62828, #991b1b);
  box-shadow: 0 14px 28px rgba(185, 28, 28, 0.2);
}

.protocol-pdf-button {
  min-height: 52px;
  margin: 0 0 14px;
  border: 2px solid rgba(22, 96, 159, 0.28);
  color: var(--blue);
  background: var(--yellow-soft);
  box-shadow: 0 8px 18px rgba(18, 60, 105, 0.08);
}

.med-search {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--surface);
  font-size: 13px;
  font-weight: 900;
}

.med-search input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(18, 60, 105, 0.08);
  font: inherit;
  font-size: 15px;
  font-weight: 800;
}

.med-search input::placeholder {
  color: var(--muted);
  font-weight: 700;
}

.dose-section {
  margin: 16px 0 2px;
  color: var(--teal);
  font-size: 18px;
  line-height: 1.1;
  font-weight: 800;
}

.dose-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(18, 60, 105, 0.08);
}

.dose-row[hidden] {
  display: none;
}

.dose-variant {
  display: grid;
  gap: 12px;
}

.dose-variant + .dose-variant {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.drug-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.drug-name {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
  font-weight: 800;
  min-width: 0;
}

.drug-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.drug-context {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.validation-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 28px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.validation-protocol {
  color: #ffffff;
  background: #178d45;
  border: 1px solid #0f6e34;
}

.validation-mr {
  color: var(--blue);
  background: #fff3c4;
  border: 1px solid #f1cc44;
}

.dose-note {
  margin: -2px 2px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
  text-align: center;
}

.source-note {
  width: 100%;
  margin: -4px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(22, 96, 159, 0.14);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(232, 243, 252, 0.82);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 800;
  text-align: left;
}

.standalone-note {
  margin: 2px 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 700;
  text-align: center;
}

.drug-value,
.drug-volume {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--navy);
  background: var(--blue-soft);
  font-size: 22px;
  font-weight: 800;
  text-align: left;
}

.dose-label,
.volume-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.dose-label,
.volume-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.unit {
  margin-left: 4px;
  color: var(--muted);
  font-size: 15px;
}

.info-button {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  color: var(--surface);
  background: var(--teal);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.inline-action {
  min-height: 34px;
  border: 2px dashed var(--blue);
  border-radius: 9px;
  padding: 4px 9px;
  color: var(--blue);
  background: var(--surface);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.parkland-variant {
  gap: 14px;
}

.burn-open-button {
  width: 100%;
  min-height: 52px;
  border: 2px dashed var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 900;
}

.parkland-help {
  margin: -2px 2px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
}

.parkland-help strong {
  color: var(--blue);
  font-weight: 900;
}

.parkland-formula-card {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid rgba(31, 106, 165, 0.18);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(255, 232, 89, 0.22), rgba(231, 244, 251, 0.9));
  color: var(--navy);
}

.parkland-formula-card strong {
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.parkland-formula-card span {
  font-size: 15px;
  line-height: 1.25;
  font-weight: 950;
}


.burn-map-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.burn-map-title {
  color: var(--navy);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.burn-map-drawing {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: radial-gradient(circle at 50% 20%, #ffffff 0%, #f7fbfd 72%, #edf6f8 100%);
}

.burn-map-svg {
  display: block;
  width: 100%;
  height: auto;
}

.burn-svg-zone {
  fill: rgba(238, 248, 252, 0.96);
  stroke: rgba(31, 106, 165, 0.62);
  stroke-width: 1.45;
  cursor: pointer;
  transition: fill 0.15s ease, stroke 0.15s ease, filter 0.15s ease;
}

.burn-svg-zone:hover,
.burn-svg-zone:focus-visible {
  fill: rgba(255, 228, 92, 0.34);
  stroke: rgba(6, 33, 74, 0.88);
  outline: none;
}

.burn-svg-zone.is-selected {
  fill: rgba(255, 228, 92, 0.74);
  stroke: rgba(7, 129, 114, 0.95);
  stroke-width: 2.4;
  filter: drop-shadow(0 3px 4px rgba(7, 129, 114, 0.25));
}

.burn-map-shadow {
  fill: none;
  stroke: rgba(31, 106, 165, 0.22);
  stroke-width: 9;
  stroke-linecap: round;
  pointer-events: none;
}

.burn-map-line {
  fill: none;
  stroke: rgba(20, 32, 51, 0.50);
  stroke-width: 1.45;
  pointer-events: none;
}

.burn-map-line.detail {
  stroke: rgba(20, 32, 51, 0.32);
  stroke-width: 1.1;
}

.burn-map-line.dotted,
.burn-map-guide {
  stroke-dasharray: 4 4;
}

.burn-map-guide {
  stroke: rgba(101, 114, 134, 0.22);
  stroke-width: 1.3;
  pointer-events: none;
}

.burn-map-side-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.burn-map-note {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
  font-weight: 700;
  text-align: center;
}

.burn-selected {
  min-height: 32px;
  padding: 8px 10px;
  border-radius: 11px;
  color: var(--navy);
  background: var(--blue-soft);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 800;
}

.parkland-input-row {
  display: grid;
  grid-template-columns: minmax(84px, 1fr) minmax(92px, 0.9fr);
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  padding: 10px;
  background: var(--blue-soft);
}

.parkland-input-row label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.parkland-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.parkland-actions .inline-action {
  width: 100%;
  min-height: 42px;
}

.burn-map-button {
  border: 2px dashed var(--blue);
  background: #ffffff;
  color: var(--blue);
  box-shadow: none;
}

.parkland-input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px 8px;
  color: var(--ink);
  background: var(--surface);
  font-size: 18px;
  font-weight: 800;
  text-align: center;
}

.parkland-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.parkland-box {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 5px;
  border-radius: 12px;
  padding: 10px 8px;
  color: var(--navy);
  background: var(--blue-soft);
  text-align: center;
}

.parkland-box span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.parkland-box strong {
  color: var(--navy);
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
}

.parkland-box small {
  color: var(--muted);
  font-size: 13px;
}

.parkland-box em {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  font-style: normal;
  font-weight: 800;
}

.cardioversion-card {
  width: 100%;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(18, 60, 105, 0.08);
}

.non-protocol-warning {
  margin: 8px 0 2px;
  padding: 12px 14px;
  border: 2px solid #b91c1c;
  border-radius: 14px;
  background: #fee2e2;
  color: #991b1b;
  text-align: center;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 950;
  letter-spacing: 0;
}

.cardioversion-label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.cardioversion-field {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface);
  font-size: 18px;
  font-weight: 800;
}

.cardioversion-result {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(185, 28, 28, 0.18);
  border-radius: 14px;
  background: #fff1f1;
  text-align: center;
}

.cardioversion-result span {
  color: #991b1b;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.cardioversion-result strong {
  color: #7f1d1d;
  font-size: 30px;
  line-height: 1.05;
}

.shock-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 800;
  text-align: center;
}

.ecg-panel,
.ecg-result {
  width: 100%;
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(18, 60, 105, 0.08);
}

.ecg-upload {
  display: grid;
  gap: 5px;
  min-height: 96px;
  place-items: center;
  border: 2px dashed var(--blue);
  border-radius: 12px;
  padding: 16px;
  color: var(--blue);
  background: var(--blue-soft);
  text-align: center;
  cursor: pointer;
}

.ecg-source-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ecg-source-button {
  min-height: 52px;
  display: grid;
  place-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  color: #fff;
  background: var(--blue);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
}

.ecg-source-button.secondary {
  color: var(--blue);
  background: var(--yellow);
}

.ecg-upload-title {
  font-size: 18px;
  font-weight: 900;
}

.ecg-upload-sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
}

.ecg-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ecg-preview {
  min-height: 170px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  color: var(--muted);
  background: #edf5f7;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.ecg-preview img {
  width: 100%;
  height: 100%;
  max-height: 260px;
  object-fit: contain;
  background: var(--ink);
}

.ecg-quality-check {
  display: grid;
  gap: 9px;
  padding: 12px;
  border-radius: 12px;
  background: #f7fbfc;
  border: 1px solid var(--line);
}

.ecg-quality-check strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.ecg-quality-check label {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 800;
}

.ecg-quality-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
}

.ecg-warning {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 800;
  text-align: center;
}

.ecg-result h3 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.15;
  text-align: center;
}

.ecg-result p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 700;
  text-align: center;
}

.ecg-result ul {
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 800;
}

.ecg-analysis-grid {
  display: grid;
  gap: 10px;
}

.ecg-analysis-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  background: var(--blue-soft);
  text-align: left;
}

.ecg-analysis-card strong {
  color: var(--blue);
  font-size: 13px;
  line-height: 1.2;
  text-transform: uppercase;
}

.ecg-analysis-card p {
  text-align: left;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.ecg-warning-strong {
  padding: 10px;
  border-radius: 10px;
  background: #fff7d5;
  color: var(--ink);
}

.info-modal,
.age-modal {
  position: fixed;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 24, 38, 0.5);
  backdrop-filter: blur(5px) saturate(0.92);
}

.info-card,
.age-card {
  width: min(390px, calc(100% - 30px));
  display: grid;
  align-content: center;
  justify-items: stretch;
  gap: 16px;
  padding: 22px 22px 20px;
  border: 1px solid rgba(211, 224, 235, 0.95);
  border-radius: 24px;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 229, 86, 0.26), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 251, 255, 0.98) 100%);
  box-shadow: 0 24px 58px rgba(4, 20, 34, 0.32), 0 10px 22px rgba(26, 105, 170, 0.12);
  text-align: center;
}

.info-card {
  min-height: 176px;
}

.age-card {
  width: min(410px, calc(100% - 30px));
}

.age-card h3 {
  margin: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(207, 220, 232, 0.8);
  color: var(--ink);
  font-size: 24px;
  text-align: left;
}

.age-modal-message {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 800;
  text-align: left;
}

.modal-age-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.modal-age-row p {
  grid-column: 1 / -1;
  margin: -2px 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.modal-age-field {
  height: 52px;
  font-size: 18px;
}

.modal-insert {
  min-height: 52px;
  border-radius: 14px;
  padding: 8px;
  font-size: 14px;
  box-shadow: 0 8px 18px rgba(26, 105, 170, 0.18);
}

.modal-error {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.info-kicker {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 14px;
  border-radius: 999px;
  background: #fff6c8;
  color: var(--blue);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255, 214, 64, 0.65);
}

.info-body {
  width: 100%;
  display: grid;
  gap: 10px;
}

.info-title {
  margin: 0;
  color: var(--blue);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 950;
}

.info-message {
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--blue-soft);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.34;
  font-weight: 900;
}

.info-message-mixed {
  display: grid;
  gap: 4px;
}

.info-message-mixed span {
  font-weight: 500;
}

.info-list {
  width: 100%;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.info-list li {
  position: relative;
  padding: 10px 12px 10px 30px;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.28;
  font-weight: 850;
  text-align: left;
}

.info-list li::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  transform: translateY(-50%);
}

.info-close {
  justify-self: center;
  min-width: 156px;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  color: var(--surface);
  background: linear-gradient(180deg, #1f78bb 0%, var(--blue) 100%);
  font-size: 16px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 12px 20px rgba(26, 105, 170, 0.24);
}

.detail-note {
  width: 100%;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  line-height: 1.4;
  box-shadow: 0 8px 18px rgba(18, 60, 105, 0.08);
}

.footer-actions {
  width: 100%;
  margin-top: auto;
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 18px 0 18px;
  background: var(--app-bg);
  box-shadow: 0 -34px 0 var(--app-bg);
  isolation: isolate;
}

.footer-actions::before {
  content: "";
  position: absolute;
  inset: -34px -18px 0;
  z-index: 0;
  background: var(--app-bg);
  pointer-events: none;
}

.footer-actions > * {
  position: relative;
  z-index: 1;
}

.sticky-action {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: auto;
  margin-bottom: 0;
  box-shadow: none;
}

.view > .sticky-action {
  align-self: stretch;
  margin-top: auto !important;
  outline: 18px solid var(--app-bg);
}

.home > .age-back,
.home > .pediatric-restart {
  margin-top: auto !important;
}

.detail-view > .footer-actions,
.pdf-view > .footer-actions,
.reference-view > .footer-actions {
  margin-top: auto !important;
}

.age-select {
  width: 100%;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface);
  font-size: 17px;
}

@media (min-width: 431px) {
  .phone {
    border: 10px solid #263744;
  }
}

@media (max-width: 430px) {
  .shell {
    padding: 0;
  }

  .phone {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .screen::before {
    height: 188px;
  }

  .view {
    padding: 46px 18px 16px;
  }

  .auth-view {
    gap: 14px;
  }

  .brand {
    margin-top: 54px;
    font-size: 34px;
  }

  .auth-brand {
    margin-top: 34px;
  }

  .auth-card {
    gap: 10px;
    margin-top: 6px;
    padding: 14px;
    border-radius: 14px;
  }

  .auth-card h2 {
    font-size: 24px;
  }

  .form-label {
    font-size: 12px;
  }

  .auth-field,
  .field {
    height: 50px;
    min-height: 50px;
    border-radius: 11px;
    padding: 0 14px;
    font-size: 17px;
  }

  .two-columns {
    gap: 8px;
  }

  .button {
    min-height: 52px;
    border-radius: 12px;
    font-size: 16px;
  }

  .signup-view .auth-brand {
    margin-top: 26px;
  }

  .signup-view .auth-card {
    gap: 9px;
    padding: 14px;
  }

  .signup-view .auth-card h2 {
    font-size: 24px;
  }

  .signup-view .field-help {
    font-size: 12px;
    line-height: 1.25;
  }

  .admin-view {
    padding-top: 34px;
  }

  .admin-title-row {
    align-items: center;
  }

  .admin-section h3 {
    font-size: 16px;
  }

  .admin-user-tabs {
    grid-template-columns: 1fr;
  }

  .admin-user-list {
    max-height: 360px;
  }

  .admin-user-card {
    padding: 12px;
  }

  .admin-user-header {
    display: grid;
  }

  .status-pill {
    width: max-content;
  }
}

.reference-view {
  padding-top: 58px;
}

.reference-view .detail-content {
  padding-bottom: 22px;
}

.reference-view .detail-title {
  margin-bottom: 14px;
}

.reference-card {
  width: 100%;
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(22, 96, 159, 0.14);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 255, 0.96));
  box-shadow: 0 18px 40px rgba(18, 60, 105, 0.15);
}

.reference-summary {
  display: grid;
  gap: 4px;
  padding: 15px 16px;
  border-radius: 18px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 225, 85, 0.18), transparent 38%),
    linear-gradient(135deg, var(--navy), #1f6da7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 10px 22px rgba(11, 55, 97, 0.18);
}

.reference-summary span {
  font-size: 11px;
  line-height: 1.1;
  font-weight: 950;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.74);
}

.reference-summary strong {
  font-size: 20px;
  line-height: 1.15;
  font-weight: 950;
}

.reference-summary small {
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 800;
}

.reference-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(22, 96, 159, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.reference-section-title {
  display: grid;
  gap: 6px;
}

.reference-section-title span {
  width: max-content;
  padding: 5px 10px;
  border: 1px solid rgba(255, 204, 51, 0.66);
  border-radius: 999px;
  background: rgba(255, 238, 150, 0.42);
  color: var(--navy);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reference-section-title h3,
.reference-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.12;
  font-weight: 950;
}

.reference-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
  font-weight: 800;
}

.reference-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.reference-item {
  position: relative;
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 13px 14px 13px 16px;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(180deg, #eef8ff, #e4f1fb);
  border: 1px solid rgba(22, 96, 159, 0.13);
  box-shadow: inset 4px 0 0 rgba(255, 204, 51, 0.95), 0 7px 15px rgba(18, 60, 105, 0.06);
}

.reference-item::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
}

.reference-item.is-wide {
  grid-column: 1 / -1;
  min-height: 72px;
}

.reference-item span {
  position: relative;
  z-index: 1;
  color: #6a788a;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 950;
  text-transform: none;
  letter-spacing: -0.01em;
}

.reference-item strong {
  position: relative;
  z-index: 1;
  color: var(--navy);
  font-size: 15px;
  line-height: 1.25;
  font-weight: 850;
  letter-spacing: -0.01em;
}


.reference-item strong .bp-normal,
.bp-normal {
  display: block;
  color: #15803d !important;
  font-weight: 950;
}

.reference-item strong .bp-low,
.bp-low {
  display: block;
  margin-top: 2px;
  color: #b91c1c !important;
  font-weight: 950;
}

.reference-view .reference-grid {
  grid-template-columns: 1fr;
}

.reference-view .reference-item.is-wide {
  grid-column: auto;
}

.reference-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.reference-empty {
  gap: 14px;
}

.reference-footer {
  position: static;
  padding: 0;
  margin-top: 18px;
  background: transparent;
  box-shadow: none;
}

.reference-footer::before {
  display: none;
}

.protocol-grid .button.reference-protocol {
  border-color: rgba(15, 118, 110, 0.24);
  background: linear-gradient(180deg, #f1fdf7, #e2f8eb);
  color: #14532d;
}

@media (max-width: 430px) {
  .reference-card {
    padding: 16px;
    border-radius: 20px;
  }

  .reference-summary strong {
    font-size: 18px;
  }

  .reference-section {
    padding: 12px;
  }

  .reference-grid {
    gap: 9px;
  }

  .reference-item {
    min-height: 74px;
    padding: 12px 12px 12px 14px;
  }

  .reference-item span {
    font-size: 16px;
  }

  .reference-item strong {
    font-size: 14px;
  }

  .reference-actions {
    grid-template-columns: 1fr;
  }
}


.ecg-manual-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 22px rgba(18, 60, 105, 0.08);
}

.ecg-manual-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 950;
}

.ecg-manual-panel p {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 800;
}

.ecg-manual-status {
  padding: 14px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 900;
  text-align: center;
}

.ecg-manual-status.neutral {
  border: 1px solid rgba(26, 105, 170, 0.22);
  color: var(--blue);
  background: rgba(232, 243, 252, 0.84);
}

.ecg-manual-status.warning {
  border: 1px solid rgba(185, 28, 28, 0.24);
  color: #b91c1c;
  background: #fff1f1;
}

.ecg-lead-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 2px solid var(--ink);
  background: var(--ink);
  gap: 2px;
}

.ecg-lead-button {
  min-height: 70px;
  border: 0;
  color: #111827;
  background: #ffffff;
  font-size: 27px;
  font-weight: 950;
  cursor: pointer;
}

.ecg-lead-button.active,
.ecg-lead-button.altered {
  color: var(--navy);
  background: #e6f4f2;
  box-shadow: inset 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.ecg-criteria-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(26, 105, 170, 0.24);
  border-radius: 18px;
  background: rgba(232, 243, 252, 0.7);
}

.ecg-criteria-kicker {
  color: var(--blue);
  font-size: 12px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ecg-criteria-card h3 {
  color: var(--navy);
  font-size: 34px;
}

.ecg-manual-check {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
  font-weight: 900;
}

.ecg-manual-check input {
  width: 24px;
  height: 24px;
  accent-color: var(--blue);
}


/* Restored ECG derivation analyzer styles */
.ecg-panel,
.ecg-result {
  width: 100%;
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(18, 60, 105, 0.08);
}

.ecg-patient-panel h3,
.ecg-leads-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
}

.ecg-sex-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ecg-sex-option {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--navy);
  background: #f7fbfc;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.ecg-sex-option input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--blue);
}

.ecg-manual-intro {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 800;
}

.ecg-bcre-button {
  min-height: 54px;
  border: 1px solid #f1b7b7;
  border-radius: 14px;
  color: var(--danger);
  background: #fff2f2;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(180, 35, 24, 0.08);
  cursor: pointer;
}

.ecg-bcre-button.is-active {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.ecg-lead-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 2px solid var(--ink);
  background: var(--surface);
}

.ecg-lead-button {
  min-height: 58px;
  border: 0;
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  color: #111;
  background: #fff;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}

.ecg-lead-button:nth-child(4n) {
  border-right: 0;
}

.ecg-lead-button:nth-last-child(-n + 4) {
  border-bottom: 0;
}

.ecg-lead-button:active {
  background: var(--blue-soft);
}

.ecg-lead-button.is-saved {
  color: var(--navy);
  background: #eaf7f4;
  box-shadow: inset 0 0 0 3px rgba(15, 118, 110, 0.22);
}

.ecg-lead-options {
  min-height: 72px;
  display: grid;
  align-items: center;
  padding: 12px;
  border: 1px solid #b8d9f2;
  border-radius: 14px;
  background: #f5fbff;
}

.ecg-lead-options > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 800;
  text-align: center;
}

.ecg-lead-result {
  display: grid;
  gap: 12px;
}

.ecg-lead-result h4 {
  margin: 2px 0 0;
  color: var(--navy);
  font-size: 26px;
  line-height: 1;
}

.ecg-lead-kicker {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ecg-option-list {
  display: grid;
  gap: 9px;
}

.ecg-option-list label {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 9px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
  font-weight: 850;
}

.ecg-option-list input {
  width: 19px;
  height: 19px;
  margin: 0;
  accent-color: var(--blue);
}

.ecg-save-lead-button {
  min-height: 48px;
  font-size: 14px;
}

.ecg-save-status {
  min-height: 16px;
  margin: -4px 0 0;
  color: var(--teal);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 900;
  text-align: center;
}

.ecg-alert-zone {
  min-height: 0;
}

.ecg-analysis-modal {
  position: fixed;
  inset: 0;
  z-index: 7;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 35, 52, 0.48);
}

.ecg-analysis-modal-card {
  width: min(100%, 360px);
  display: grid;
  gap: 10px;
  padding: 22px 18px;
  border: 3px solid var(--danger);
  border-radius: 22px;
  color: var(--danger);
  background: #fff1f1;
  box-shadow: 0 24px 70px rgba(18, 35, 52, 0.35);
  text-align: center;
}

.ecg-analysis-modal-card strong {
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ecg-analysis-modal-card p {
  margin: 0;
  color: var(--danger);
  font-size: 20px;
  line-height: 1.25;
  font-weight: 950;
}

.ecg-analysis-modal-card.is-ok {
  border-color: var(--teal);
  color: var(--teal);
  background: #ecfaf7;
}

.ecg-analysis-modal-card.is-ok p {
  color: var(--teal);
  font-size: 16px;
}

.ecg-no-sca-alert {
  padding: 12px;
  border: 1px solid #9bd8cf;
  border-radius: 14px;
  color: var(--teal);
  background: #ecfaf7;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 900;
  text-align: center;
}


.ecg-manual-view .footer-actions {
  display: grid;
  gap: 22px;
  position: static;
  margin-top: 28px;
  padding: 0 0 28px;
}
