:root {
  --petrol: #00445a;
  --petrol2: #07596c;
  --sage: #84a55f;
  --sage-soft: #eef4e9;
  --paper: #f8f9f6;
  --ink: #19343a;
  --muted: #788687;
  --line: #e2e7e3;
  --danger: #b74343;
  --danger-soft: #fff0ef;
  --peach: #e7c2a6;
  --shadow: 0 12px 28px rgba(21, 62, 70, 0.1);
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #e9ece8;
  color: var(--ink);
}
a {
  color: var(--petrol2);
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled,
input:disabled {
  cursor: wait;
  opacity: 0.68;
}
.legal-page {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: auto;
  padding: calc(26px + env(safe-area-inset-top)) 24px
    calc(48px + env(safe-area-inset-bottom));
  background: var(--paper);
  line-height: 1.65;
}
.legal-page > img {
  display: block;
  width: min(260px, 72vw);
  margin: 28px auto 36px;
}
.legal-page h1 {
  margin-bottom: 4px;
  font-family: Georgia, serif;
  font-size: clamp(30px, 7vw, 44px);
  color: var(--petrol);
}
.legal-page h2 {
  margin-top: 30px;
  font-size: 19px;
  color: var(--petrol);
}
.legal-page p,
.legal-page li {
  color: #455c60;
}
.legal-back {
  display: inline-block;
  font-weight: 700;
  text-decoration: none;
}
.primary-link {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--petrol);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.legal-date {
  margin-top: 0;
  color: var(--muted) !important;
  font-size: 13px;
}
.account-card {
  margin-top: 18px;
}
.account-card .account-email {
  overflow-wrap: anywhere;
  color: var(--muted);
}
.account-security {
  display: grid;
  gap: 9px;
}
.account-security .secondary {
  width: 100%;
}
.mfa-qr {
  display: block;
  width: min(240px, 76vw);
  margin: 18px auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}
.mfa-secret {
  display: grid;
  gap: 5px;
  margin: 0 0 16px;
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  background: var(--sage-soft);
}
.mfa-secret strong {
  overflow-wrap: anywhere;
  letter-spacing: 1px;
}
.mfa-inline-error {
  margin: 0 0 12px;
}
.account-links {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}
.account-links a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--petrol);
  font-weight: 700;
  text-decoration: none;
}
.danger-outline {
  width: 100%;
  min-height: 48px;
  border: 1px solid #e1b8b5;
  border-radius: 14px;
  background: white;
  color: var(--danger);
  font-weight: 700;
}
.consent-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.consent-row input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}
.role-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
}
.role-fieldset legend {
  margin-bottom: 10px;
  color: var(--ink);
  font-weight: 700;
}
.role-fieldset > p {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.role-option {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 11px;
  align-items: start;
  margin-bottom: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  cursor: pointer;
}
.role-option:has(input:checked) {
  border-color: var(--sage);
  box-shadow: 0 0 0 2px rgba(132, 165, 95, 0.2);
}
.role-option input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--sage);
}
.role-option span,
.role-option strong,
.role-option small {
  display: block;
}
.role-option small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}
.confirmation-email {
  display: block;
  margin: 8px 0 22px;
  overflow-wrap: anywhere;
  color: var(--petrol);
}
.auth-help {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}
.emergency-note {
  margin-top: 18px;
  border-color: #efd0cd;
  background: var(--danger-soft);
  color: #783c3c;
}
.splash {
  min-height: 100vh;
  display: grid;
  place-content: center;
  text-align: center;
  background: var(--paper);
}
.brand-mark {
  width: 62px;
  height: 62px;
  margin: auto;
  border-radius: 22px;
  background: white url("/assets/icon-192.svg") center/contain no-repeat;
  color: transparent;
  display: grid;
  place-items: center;
  font-size: 30px;
  box-shadow: none;
}
.splash-logo {
  width: min(78vw, 360px);
  height: auto;
}
.splash h1 {
  font-family: Georgia, serif;
  margin: 18px 0 5px;
}
.splash p {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 11px;
  color: var(--sage);
}
.shell {
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: auto;
  background: var(--paper);
  position: relative;
  padding: calc(18px + env(safe-area-inset-top)) 22px
    calc(92px + env(safe-area-inset-bottom));
  box-shadow: 0 0 42px rgba(0, 0, 0, 0.09);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.top-actions {
  display: flex;
  gap: 7px;
}
.sync-banner {
  width: 100%;
  display: grid;
  gap: 2px;
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 0;
  border-radius: 13px;
  text-align: left;
  color: #664f20;
  background: #fff2c9;
}
.sync-banner.offline {
  color: #713d3d;
  background: var(--danger-soft);
}
.sync-banner strong {
  font-size: 12px;
}
.sync-banner span {
  font-size: 11px;
  line-height: 1.4;
}
.notification-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 12px;
}
.notification-card {
  width: 100%;
  display: grid;
  grid-template-columns: 9px 1fr;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: left;
  color: var(--ink);
  background: white;
}
.notification-card.unread {
  border-color: #bcd4aa;
  background: #f6faf2;
}
.notification-card.urgent {
  border-left: 4px solid var(--danger);
}
.notification-card.read {
  opacity: 0.72;
}
.notification-card p {
  margin: 5px 0 7px;
  color: var(--muted);
  line-height: 1.4;
}
.notification-card small {
  color: var(--muted);
}
.notification-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: transparent;
}
.notification-card.unread .notification-dot {
  background: var(--sage);
}
.notification-center {
  min-height: min(72vh, 650px);
}
.notification-summary {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border-radius: 16px;
  color: white;
  background: linear-gradient(135deg, var(--petrol), #1d6770);
}
.notification-summary strong {
  font-size: 26px;
}
.notification-summary span {
  font-size: 12px;
  opacity: 0.82;
}
.notification-summary .text-btn {
  margin-left: auto;
  color: white;
}
.notification-filters {
  display: flex;
  gap: 7px;
  margin-bottom: 14px;
  overflow-x: auto;
}
.notification-filters button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: white;
  font-size: 11px;
  font-weight: 800;
}
.notification-filters button.active {
  border-color: var(--petrol);
  color: white;
  background: var(--petrol);
}
.notification-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  background: var(--sage-soft);
  font-size: 11px;
}
.notification-status.error {
  justify-content: space-between;
  color: var(--danger);
  background: var(--danger-soft);
}
.loading-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sage);
  animation: pulse 1s infinite alternate;
}
@keyframes pulse {
  to { opacity: 0.25; }
}
.notification-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.notification-meta b {
  color: var(--sage);
}
.notification-meta em {
  color: var(--muted);
  font-style: normal;
}
.notification-list {
  max-height: 46vh;
  overflow-y: auto;
}
.read-all {
  width: 100%;
  margin-top: 14px;
}
.inline-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 11px;
  line-height: 1.4;
}
.inline-error .text-btn {
  flex: 0 0 auto;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-symbol {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: white url("/assets/icon-192.svg") center/contain no-repeat;
  color: transparent;
  display: grid;
  place-items: center;
  font-size: 20px;
}
.logo strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 20px;
}
.logo small {
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #8d978f;
  font-size: 8px;
}
.icon-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #edf1ef;
  color: var(--petrol);
  font-size: 19px;
  position: relative;
}
.badge {
  position: absolute;
  right: 4px;
  top: 3px;
  background: var(--danger);
  color: #fff;
  border-radius: 20px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  font-size: 10px;
  display: grid;
  place-items: center;
}
.hero {
  background: var(--petrol);
  color: #fff;
  border-radius: 26px;
  padding: 22px;
  margin-bottom: 30px;
  box-shadow: 0 18px 28px rgba(17, 63, 73, 0.2);
}
.status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #dce8e4;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.dot {
  width: 9px;
  height: 9px;
  background: #75c582;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}
.caregiver {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 18px;
}
.avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--peach);
  display: grid;
  place-items: center;
  font-weight: 700;
}
.caregiver-info {
  flex: 1;
}
.caregiver-info strong {
  display: block;
}
.caregiver-info small {
  opacity: 0.7;
}
.white-btn {
  border: 0;
  border-radius: 13px;
  background: #fff;
  color: var(--petrol);
  padding: 13px 15px;
  font-weight: 700;
  font-size: 12px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 26px 2px 14px;
}
.section-head h2 {
  font-size: 20px;
  margin: 0;
  font-weight: 600;
}
.text-btn {
  border: 0;
  background: transparent;
  color: #728460;
  font-weight: 700;
  font-size: 12px;
}
.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  min-height: 132px;
  box-shadow: 0 4px 10px rgba(18, 63, 73, 0.05);
}
.metric-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #f8e9e8;
  color: #cb6d6d;
  margin-bottom: 11px;
}
.metric:nth-child(2) .metric-icon {
  background: #faf3df;
  color: #c8a557;
}
.metric:nth-child(3) .metric-icon {
  background: var(--sage-soft);
  color: var(--sage);
}
.metric:nth-child(4) .metric-icon {
  background: #f6eeea;
  color: #bc5b4c;
}
.metric label {
  display: block;
  color: #85908e;
  font-size: 12px;
}
.metric strong {
  display: block;
  font-size: 21px;
  margin: 6px 0;
}
.metric small {
  color: #8b9694;
  font-size: 11px;
}
.feed {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
}
.feed-item {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid #edf0ed;
  align-items: center;
}
.feed-item:last-child {
  border: 0;
}
.feed-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--sage-soft);
  display: grid;
  place-items: center;
}
.feed-item strong {
  display: block;
  font-size: 13px;
}
.feed-item p {
  margin: 3px 0 0;
  color: #889390;
  font-size: 11px;
}
.feed-item time {
  font-size: 11px;
  color: #97a09f;
}
.incident {
  background: var(--danger-soft);
  border-color: #efcbc7;
}
.incident .feed-icon {
  background: #f7d6d2;
  color: var(--danger);
}
.incident strong {
  color: #8e2929;
}
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 520px);
  height: calc(72px + env(safe-area-inset-bottom));
  padding: 8px 14px env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 8;
}
.nav-btn {
  border: 0;
  background: transparent;
  color: #9ba4a2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
}
.nav-btn span {
  font-size: 22px;
  line-height: 28px;
}
.nav-btn.active {
  color: var(--petrol);
  font-weight: 700;
}
.page-title {
  font-size: 27px;
  margin: 8px 0 5px;
}
.subtitle {
  color: var(--muted);
  margin: 0 0 22px;
}
.primary,
.secondary,
.danger-btn {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 15px 17px;
  font-weight: 750;
}
.primary {
  background: var(--petrol);
  color: #fff;
}
.secondary {
  background: var(--sage-soft);
  color: var(--petrol);
}
.danger-btn {
  background: var(--danger);
  color: #fff;
}
.stack {
  display: grid;
  gap: 12px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 4px 12px rgba(18, 63, 73, 0.05);
}
.card h3 {
  margin: 0 0 10px;
}
.card p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 13px;
}
.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}
.field label {
  font-size: 12px;
  font-weight: 700;
  color: #596866;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid #d8dedb;
  border-radius: 13px;
  padding: 13px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px #e8efe4;
}
.field textarea {
  min-height: 90px;
  resize: vertical;
}
.auth {
  min-height: 100dvh;
  padding: calc(38px + env(safe-area-inset-top)) 24px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(100%, 520px);
  margin: auto;
  background: var(--paper);
}
.auth-logo {
  text-align: center;
  margin-bottom: 34px;
}
.auth-logo .brand-mark {
  width: 72px;
  height: 72px;
}
.auth h1 {
  font-family: Georgia, serif;
  margin: 14px 0 3px;
}
.auth p {
  color: var(--muted);
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #ebefec;
  padding: 4px;
  border-radius: 14px;
  margin: 20px 0;
}
.tabs button {
  border: 0;
  background: transparent;
  padding: 10px;
  border-radius: 11px;
  color: var(--muted);
}
.tabs button.active {
  background: white;
  color: var(--petrol);
  font-weight: 700;
}
.notice {
  background: #fff6df;
  border: 1px solid #f0dda4;
  border-radius: 14px;
  padding: 12px;
  font-size: 12px;
  color: #725f2c;
  margin: 14px 0;
}
.role-pill {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 20px;
  background: var(--sage-soft);
  font-size: 11px;
  font-weight: 700;
  color: #55704b;
}
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}
.quick {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 17px;
  padding: 15px;
  text-align: left;
  color: var(--ink);
}
.quick strong {
  display: block;
  margin-top: 7px;
}
.modal-wrap {
  position: fixed;
  inset: 0;
  background: rgba(11, 32, 36, 0.48);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 20;
}
.modal {
  width: min(100%, 520px);
  max-height: 88vh;
  overflow: auto;
  background: var(--paper);
  border-radius: 28px 28px 0 0;
  padding: 24px 22px calc(26px + env(safe-area-inset-bottom));
  animation: up 0.24s ease;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-head h2 {
  margin: 0;
}
.close {
  border: 0;
  background: #e9eeeb;
  width: 38px;
  height: 38px;
  border-radius: 50%;
}
.incident-types {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.incident-types button {
  border: 1px solid #e4c3bf;
  background: #fff;
  border-radius: 15px;
  padding: 13px;
  color: #7f3333;
}
.incident-types button.selected {
  background: var(--danger);
  color: white;
}
.empty {
  text-align: center;
  padding: 28px;
  color: var(--muted);
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 95px;
  transform: translate(-50%, 18px);
  background: #173d45;
  color: white;
  padding: 12px 18px;
  border-radius: 14px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  z-index: 50;
  font-size: 13px;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
@keyframes up {
  from {
    transform: translateY(40px);
    opacity: 0.5;
  }
}
@media (min-width: 700px) {
  body {
    padding: 24px;
  }
  .shell,
  .auth {
    border-radius: 34px;
    min-height: calc(100dvh - 48px);
    overflow: hidden;
  }
  .bottom-nav {
    bottom: 24px;
    border-radius: 0 0 34px 34px;
  }
}
.utility-actions {
  margin-top: 12px;
}
.incident-photo {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 14px;
  margin-top: 10px;
}
.medication-card {
  border-left: 4px solid #d8dedb;
}
.medication-card.administered {
  border-left-color: var(--sage);
}
.medication-card.skipped {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}
.medication-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}
.medication-time {
  font-size: 20px;
  font-weight: 800;
  color: var(--petrol);
}
.medication-status {
  border-radius: 20px;
  padding: 6px 9px;
  font-size: 10px;
  font-weight: 800;
  background: #edf1ef;
  color: var(--muted);
}
.medication-status.administered {
  background: var(--sage-soft);
  color: #55704b;
}
.medication-status.skipped {
  background: #f7d6d2;
  color: var(--danger);
}
.medication-note {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  font-size: 12px;
}
.chat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 42vh;
  overflow-y: auto;
  margin-bottom: 18px;
}
.chat-message {
  width: 88%;
  padding: 10px 12px;
  border-radius: 14px 14px 14px 4px;
  background: var(--soft);
}
.chat-message.mine {
  align-self: flex-end;
  background: #dceee7;
  border-radius: 14px 14px 4px 14px;
}
.chat-message p {
  margin: 4px 0;
}
.schedule-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.schedule-card {
  border-left: 4px solid #d8dedb;
}
.schedule-card.confirmed {
  border-left-color: #d5a448;
}
.schedule-card.in_progress {
  border-left-color: var(--sage);
  background: #f6faf2;
}
.schedule-card.completed {
  border-left-color: var(--petrol2);
}
.schedule-card.cancelled {
  opacity: 0.65;
}
.schedule-action,
.schedule-cancel {
  width: 100%;
  margin-top: 13px;
}
.handover-note {
  margin-top: 13px;
  padding: 12px;
  border-radius: 12px;
  background: var(--sage-soft);
}
.handover-note strong {
  color: var(--petrol);
  font-size: 12px;
}
.handover-note p {
  margin: 5px 0 0;
  font-size: 12px;
  white-space: pre-line;
}
.audit-list {
  margin-top: 14px;
}
.audit-list .card h3 {
  margin: 9px 0 5px;
}
.manage-access-btn {
  width: 100%;
}
.access-card .secondary {
  margin-top: 12px;
}
.protected-access {
  color: var(--sage);
  font-size: 12px;
  margin: 10px 0 0;
}
.invite-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}
.invite-card strong {
  letter-spacing: 2px;
  color: var(--petrol);
}
.patient-summary small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}
.care-plan .card h3 {
  color: var(--petrol);
  margin-bottom: 7px;
}
.care-plan .card p {
  white-space: pre-line;
}
.highlight-card {
  border-left: 4px solid var(--sage);
  background: var(--sage-soft);
}
.alert-card {
  border-left: 4px solid #d5a448;
}
.care-plan-modal {
  max-height: 92dvh;
  overflow-y: auto;
}
.care-plan-modal textarea {
  min-height: 82px;
}
.agenda-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px 16px;
  background: var(--petrol);
  color: white;
  border-radius: 22px;
  padding: 18px;
  margin: 14px 0 18px;
  box-shadow: var(--shadow);
}
.agenda-progress strong,
.agenda-progress span {
  display: block;
}
.agenda-progress strong {
  font-size: 20px;
}
.agenda-progress span {
  color: #dce8e4;
  font-size: 12px;
  margin-top: 3px;
}
.agenda-progress > b {
  font-size: 22px;
}
.progress-track {
  grid-column: 1 / -1;
  height: 7px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
}
.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #9dc47a;
}
.task-list {
  display: grid;
  gap: 12px;
}
.task-card {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 13px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 15px;
  box-shadow: 0 4px 10px rgba(18, 63, 73, 0.05);
}
.task-card.completed {
  border-color: #bcd4aa;
  background: #f6faf2;
}
.task-card.skipped {
  border-color: #e9c3c0;
  background: #fff8f7;
}
.task-time {
  color: var(--petrol);
  font-weight: 800;
  font-size: 16px;
  padding-top: 3px;
}
.task-body h3 {
  margin: 9px 0 5px;
  font-size: 16px;
}
.task-body p {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 9px;
  white-space: pre-line;
}
.task-pending {
  color: #9a8460;
}
.task-result {
  display: grid;
  gap: 3px;
  font-size: 12px;
  color: var(--sage);
}
.task-result.skipped {
  color: var(--danger);
}
.task-result small {
  color: var(--muted);
}
.task-actions {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 8px;
  margin-top: 13px;
}
.task-check,
.task-skip {
  border: 0;
  border-radius: 12px;
  padding: 11px 8px;
  font-size: 11px;
  font-weight: 800;
}
.task-check {
  color: white;
  background: var(--sage);
}
.task-skip {
  color: var(--danger);
  background: var(--danger-soft);
}
.task-edit {
  margin-top: 11px;
  padding: 0;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.day-picker {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.day-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.day-chip span {
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: white;
  font-size: 10px;
  font-weight: 700;
}
.day-chip input:checked + span {
  color: white;
  background: var(--petrol);
  border-color: var(--petrol);
}
.deactivate-task {
  width: 100%;
  margin-top: 10px;
  color: var(--danger);
}
.task-confirm {
  margin-bottom: 16px;
}
.eyebrow {
  display: block;
  color: var(--sage);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.4px;
  margin-bottom: 5px;
}
.admin-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 16px;
  color: white;
  background: linear-gradient(135deg, var(--petrol), #1d6770);
  border-radius: 24px;
  padding: 22px 20px;
  margin: 12px 0 18px;
  box-shadow: var(--shadow);
}
.admin-hero div {
  grid-row: 1 / 3;
}
.admin-hero h1 {
  margin: 0 0 5px;
  font-size: 25px;
}
.admin-hero p {
  max-width: 255px;
  margin: 0;
  color: #dcebe9;
  font-size: 13px;
  line-height: 1.45;
}
.admin-hero > strong {
  align-self: end;
  font-size: 30px;
  line-height: 1;
  text-align: center;
}
.admin-hero > small {
  align-self: start;
  color: #dcebe9;
  font-size: 10px;
  text-align: center;
}
.admin-quick-actions .quick {
  align-content: center;
  min-height: 92px;
}
.quick small {
  display: block;
  width: 100%;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}
.patient-card-head,
.access-card-head,
.audit-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.patient-card-head h2 {
  margin: 10px 0 4px;
}
.patient-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.icon-btn.soft {
  flex: 0 0 auto;
  color: var(--petrol);
  background: var(--sage-soft);
}
.admin-card-actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.admin-card-actions .secondary {
  margin: 0;
}
.invite-role-grid {
  display: grid;
  gap: 9px;
}
.role-option.compact {
  margin: 0;
}
.invite-success {
  text-align: center;
}
.invite-success .modal-head,
.invite-success .notice {
  text-align: left;
}
.success-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 8px auto 14px;
  border-radius: 50%;
  color: white;
  background: var(--sage);
  font-size: 28px;
  font-weight: 900;
}
.invite-code {
  display: grid;
  gap: 5px;
  width: 100%;
  margin: 18px 0;
  padding: 18px;
  border: 1px dashed var(--sage);
  border-radius: 18px;
  color: var(--petrol);
  background: var(--sage-soft);
}
.invite-code strong {
  font-size: 26px;
  letter-spacing: 4px;
}
.invite-code small {
  color: var(--muted);
}
.access-status {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 800;
}
.access-status.active {
  color: #3e6a37;
  background: #edf6e8;
}
.access-status.inactive {
  color: var(--danger);
  background: var(--danger-soft);
}
.access-card.inactive,
.invite-card.inactive {
  opacity: 0.68;
}
.access-card h3 {
  margin: 12px 0 4px;
}
.access-card p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
}
.access-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.access-actions .secondary,
.access-actions .danger-outline {
  margin: 0;
}
.invite-card .danger-outline {
  grid-column: 1 / -1;
  margin-top: 3px;
}
.audit-card-head time {
  color: var(--muted);
  font-size: 10px;
}
.audit-reason {
  display: grid;
  gap: 3px;
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--sage-soft);
  font-size: 12px;
}
.audit-reason strong {
  color: var(--petrol);
}
@media (max-width: 390px) {
  .form-row,
  .access-actions {
    grid-template-columns: 1fr;
  }
}

/* Desktop portal experience — v1.5.6 */
@media (min-width: 960px) {
  html,
  body {
    background:
      radial-gradient(circle at 12% 18%, rgba(132, 165, 95, 0.10), transparent 28%),
      radial-gradient(circle at 88% 12%, rgba(0, 68, 90, 0.08), transparent 30%),
      #eef1ed;
  }

  body {
    padding: 28px;
  }

  .auth {
    position: relative;
    width: min(100%, 1080px);
    min-height: calc(100dvh - 56px);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(390px, 0.95fr);
    align-content: center;
    column-gap: 0;
    padding: 0;
    border-radius: 34px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 26px 70px rgba(20, 57, 64, 0.13);
  }

  .auth::before {
    content: "Acompanhe o cuidado com mais clareza, segurança e proximidade.";
    grid-column: 1;
    grid-row: 1 / span 20;
    align-self: stretch;
    display: flex;
    align-items: flex-end;
    min-height: calc(100dvh - 56px);
    padding: 58px;
    font-family: Georgia, serif;
    font-size: clamp(36px, 4vw, 58px);
    line-height: 1.04;
    color: #fff;
    background:
      linear-gradient(180deg, rgba(0, 68, 90, 0.05), rgba(0, 68, 90, 0.88)),
      radial-gradient(circle at 68% 24%, rgba(132, 165, 95, 0.72), transparent 32%),
      linear-gradient(135deg, #0b5a6d 0%, #003d50 62%, #173f46 100%);
  }

  .auth > * {
    grid-column: 2;
    width: min(100%, 420px);
    margin-left: auto;
    margin-right: auto;
  }

  .auth-logo {
    margin-top: 54px;
    margin-bottom: 24px;
  }

  .auth-logo .brand-mark {
    width: 82px;
    height: 82px;
  }

  .auth h1 {
    font-size: 34px;
  }

  .auth .tabs {
    margin-top: 10px;
  }

  .auth form,
  .auth .notice,
  .auth .auth-help,
  .auth > .primary,
  .auth > .secondary,
  .auth > .text-btn {
    width: min(calc(100% - 56px), 420px);
  }

  .auth .emergency-note {
    margin-bottom: 48px;
  }

  .shell {
    width: min(100%, 1180px);
    min-height: calc(100dvh - 56px);
    padding: 30px 34px 48px 246px;
    border-radius: 34px;
    overflow: hidden;
    box-shadow: 0 26px 70px rgba(20, 57, 64, 0.12);
  }

  .shell > .topbar,
  .shell > .sync-banner,
  .shell > section,
  .shell > .hero,
  .shell > .quick-actions,
  .shell > .utility-panel,
  .shell > .section-head,
  .shell > .stack,
  .shell > .feed,
  .shell > .metric-grid,
  .shell > .card,
  .shell > h1,
  .shell > p {
    max-width: 100%;
  }

  .bottom-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    transform: none;
    width: 208px;
    height: 100%;
    padding: 34px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    justify-content: flex-start;
    border-top: 0;
    border-right: 1px solid var(--line);
    border-radius: 34px 0 0 34px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(18px);
  }

  .bottom-nav::before {
    content: "Coração de Anjo";
    display: block;
    margin: 4px 12px 22px;
    padding-top: 58px;
    font-family: Georgia, serif;
    font-size: 19px;
    font-weight: 700;
    color: var(--petrol);
    background: url('/assets/icon-192.svg') left top / 46px 46px no-repeat;
  }

  .nav-btn {
    min-height: 54px;
    padding: 10px 12px;
    border-radius: 14px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    font-size: 13px;
    text-align: left;
  }

  .nav-btn span {
    width: 28px;
    font-size: 21px;
    text-align: center;
  }

  .nav-btn.active {
    background: var(--sage-soft);
  }

  .metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .quick-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-quick-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stack {
    gap: 14px;
  }

  .modal-wrap {
    align-items: center;
    padding: 28px;
  }

  .modal {
    width: min(100%, 720px);
    max-height: calc(100vh - 56px);
    border-radius: 28px;
    padding: 28px;
  }
}


/* PWA install experience — v1.6.0 */
.pwa-install {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 30px;
  gap: 12px;
  align-items: center;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid #dbe7d2;
  border-radius: 18px;
  background: linear-gradient(135deg, #f7faf4, #eef4e9);
}
.pwa-install > img { width: 54px; height: 54px; border-radius: 14px; box-shadow: 0 8px 18px rgba(21,62,70,.12); }
.pwa-install strong { display:block; color:var(--petrol); font-size:14px; }
.pwa-install p { margin:4px 0 10px; color:#5f7071; font-size:12px; line-height:1.4; }
.pwa-install-btn { min-height:36px; padding:7px 12px; border:0; border-radius:10px; background:var(--petrol); color:#fff; font-size:12px; font-weight:800; }
.pwa-dismiss { align-self:start; width:30px; height:30px; border:0; border-radius:50%; background:transparent; color:#778586; font-size:22px; line-height:1; }
.install-help { text-align:center; }
.install-help-icon { width:86px; height:86px; margin:8px auto 12px; border-radius:22px; box-shadow:var(--shadow); }
.install-steps { display:grid; gap:10px; margin:20px 0; text-align:left; }
.install-steps > div { display:grid; grid-template-columns:34px 1fr; gap:12px; align-items:center; padding:12px; border:1px solid var(--line); border-radius:14px; background:#fff; }
.install-steps b { display:grid; place-items:center; width:32px; height:32px; border-radius:50%; background:var(--sage-soft); color:var(--petrol); }
.install-steps span { color:#455c60; font-size:13px; line-height:1.4; }
@media (min-width:960px) { .auth .pwa-install { display:none; } .shell > .pwa-install { display:none; } }
