/* Parvin design system
   Atkinson Hyperlegible Next for all interface text (built for legibility), Caveat only for the
   wordmark, berry as the brand colour (the --pine names are kept so nothing else has to change),
   and signal colours used only when they carry meaning: rose = overdue, marigold = due soon,
   sky = appointment, leaf = done. */

:root {
  --pine: #c9306b;
  --pine-deep: #a3245a;
  --pine-soft: #fbe4ec;
  --mist: #fff6f3;
  --paper: #ffffff;
  --ink: #1e1416;
  --sage: #6e5258;
  --line: #f2e1dc;
  --line-strong: #d9bfb7;
  --leaf: #23785a;
  --leaf-soft: #e2f2ea;
  --marigold: #8a5a00;
  --marigold-soft: #fbf0d5;
  --rose: #a8322c;
  --rose-soft: #fbe8e5;
  --sky: #245f93;
  --sky-soft: #e5eff8;
  --focus: #c9306b;
  --brand-dark: #1e1416;
  --brand-sunrise: #ff9a3c;
  --brand-rose: #ff4d6d;
  --font-brand: "Caveat", cursive;

  --font:
    "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI",
    sans-serif;
  --r-surface: 16px;
  --r-control: 10px;
  --sidebar: 248px;
  --topbar: 64px;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font: 400 17px/1.5 var(--font);
  color: var(--ink);
  background: var(--mist);
}
h1,
h2,
h3,
h4 {
  line-height: 1.2;
  margin: 0 0 0.4em;
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 {
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -0.02em;
}
h2 {
  font-size: 22px;
}
h3 {
  font-size: 18px;
}
h4 {
  font-size: 16px;
  margin-top: 1.2em;
}
p {
  margin: 0 0 0.8em;
}
a {
  color: var(--pine);
}
small {
  font-size: 14px;
}
.muted {
  color: var(--sage);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.ek-icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Form controls ---------- */
label {
  display: block;
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 14px;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  font: 400 16px/1.4 var(--font);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  padding: 11px 12px;
  min-height: 46px;
}
textarea {
  min-height: 96px;
  resize: vertical;
}
input[type="checkbox"],
input[type="radio"] {
  display: inline-block;
  width: 20px;
  height: 20px;
  min-height: 0;
  margin: 0 10px 0 0;
  vertical-align: middle;
  accent-color: var(--pine);
}
input[type="file"] {
  padding: 9px;
  background: var(--mist);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px #c9306b33;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: var(--r-surface);
  padding: 16px;
  margin: 18px 0;
}
legend {
  padding: 0 6px;
  font-weight: 700;
}

/* ---------- Buttons ---------- */
button {
  font: 600 16px/1.2 var(--font);
  color: inherit;
  cursor: pointer;
  border-radius: var(--r-control);
  border: 1px solid transparent;
  background: none;
  padding: 0;
}
button:disabled {
  opacity: 0.55;
  cursor: progress;
}
.primary,
.secondary,
.ek-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 18px;
  text-decoration: none;
}
.primary {
  background: var(--pine);
  color: #fff;
}
.primary:hover {
  background: var(--pine-deep);
}
.secondary {
  background: var(--paper);
  color: var(--pine);
  border-color: var(--line-strong);
}
.secondary:hover {
  background: var(--pine-soft);
}
.ek-link {
  color: var(--pine);
  font-weight: 700;
  padding: 6px 2px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
}
.actions label {
  margin: 0;
}

/* ---------- Sign-in ---------- */
#ekCloudCard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.ek-auth-brand {
  background: var(--brand-dark);
  color: #fff;
  padding: clamp(28px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
}
.ek-auth-brand h1 {
  font-size: clamp(34px, 5vw, 56px);
  max-width: 13ch;
  line-height: 1.05;
}
.ek-auth-brand p {
  max-width: 42ch;
  color: #e9dcdf;
  font-size: 19px;
}
.ek-auth-brand ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
  color: #f4ebed;
}
.ek-auth-brand li {
  display: flex;
  gap: 12px;
  align-items: center;
}
.ek-auth-form {
  padding: clamp(28px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}
.ek-auth-form h2 {
  font-size: 30px;
}
.ekPasswordWrap {
  position: relative;
}
.ekPasswordWrap input {
  padding-right: 76px;
}
.ekPasswordToggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  margin-top: 3px;
  padding: 8px 10px;
  color: var(--pine);
  font-size: 14px;
}
#cloudLoginFields {
  display: block;
}
#cloudSignIn {
  width: 100%;
}
#cloudStatus {
  min-height: 1.5em;
}
.ek-auth-note {
  font-size: 14px;
  color: var(--sage);
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 18px;
}

/* ---------- App shell ---------- */
.ek-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 34px;
  line-height: 1;
  color: #fff;
}
.ek-brand svg {
  width: 30px;
  height: 32px;
}
/* The logo is a link back to Today. */
a.ek-brand {
  text-decoration: none;
  cursor: pointer;
  border-radius: 10px;
}
a.ek-brand:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 2px;
}
#ekAppLayout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}
#ekDesktopNav {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--brand-dark);
  color: #e9dcdf;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#ekDesktopNav .ek-brand {
  padding: 4px 10px 22px;
}
.ek-nav-group {
  font-size: 13px;
  font-weight: 600;
  color: #c9b5b9;
  padding: 16px 10px 6px;
}
#ekDesktopNav button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  color: #f4ebed;
  font-weight: 600;
  font-size: 16px;
  border-radius: 10px;
}
#ekDesktopNav button:hover {
  background: #ffffff14;
}
#ekDesktopNav button.active {
  background: #fff;
  color: var(--pine);
}
.ek-nav-foot {
  margin-top: auto;
  padding: 18px 10px 4px;
  font-size: 13px;
  color: #c9b5b9;
}

.ek-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
#ekWelcomeBanner {
  position: sticky;
  top: 0;
  z-index: 5;
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 clamp(16px, 3vw, 36px);
  background: #fff6f3e6;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.ek-topbar-brand {
  display: none;
}
.ek-circle-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 700;
  min-width: 0;
}
.ek-circle-switch select {
  margin: 0;
  width: auto;
  max-width: 260px;
  min-height: 40px;
  padding: 7px 34px 7px 12px;
  font-weight: 700;
  border-color: transparent;
  background-color: transparent;
}
.ek-circle-switch select:hover {
  border-color: var(--line-strong);
  background-color: var(--paper);
}
.ek-topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ek-icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: var(--pine);
}
.ek-icon-button:hover {
  background: var(--pine-soft);
}
.ek-badge {
  position: absolute;
  top: 5px;
  right: 4px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--rose);
  color: #fff;
  font-size: 12px;
  line-height: 19px;
  font-weight: 700;
  text-align: center;
}
.ek-avatar-button {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--pine);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}

.shell {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 36px) clamp(16px, 3vw, 36px) 120px;
}
.section {
  display: none;
}
.section.active {
  display: block;
}
.ekBackBar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--sage);
}
.ekBackBar .secondary {
  min-height: 40px;
  padding: 8px 14px;
}

/* Page header inside a section */
.ek-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 18px;
}
.ek-page-head h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 32px);
}
.ek-page-head p {
  margin: 4px 0 0;
  color: var(--sage);
  max-width: 62ch;
}

/* ---------- Surfaces ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-surface);
  padding: clamp(18px, 2.4vw, 26px);
  margin-bottom: 18px;
}
.card .card {
  background: var(--mist);
  border-color: transparent;
}
.ekTaskHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 8px;
}
.ekTaskHeader h2 {
  margin: 0;
}
.note {
  background: var(--marigold-soft);
  color: #5d4300;
  border-radius: var(--r-control);
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 15px;
}
.result {
  white-space: pre-wrap;
  background: var(--leaf-soft);
  border-radius: var(--r-control);
  padding: 14px 16px;
  margin-top: 14px;
}
.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.pill,
.badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--pine-soft);
  color: var(--pine);
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 12px 0;
}
.metric {
  display: block;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}
.foot {
  text-align: center;
  font-size: 14px;
  color: var(--sage);
  padding: 4px 16px;
}
.ek-footnotes {
  padding: 8px 0 28px;
}
.ekRecordForm,
.ekMedicationEditor,
.ekContactEditor {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 18px;
}
.card.ekMedicationEditor,
.card.ekContactEditor,
#ekNewTaskForm {
  border-top: 1px solid var(--line);
  padding-top: clamp(18px, 2.4vw, 26px);
}
.ekMedFormHeader,
.ekContactFormHeading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ekMedFormHeader button,
.ekContactFormHeading button {
  width: 40px;
  height: 40px;
  font-size: 24px;
  color: var(--sage);
}

/* ---------- Today (home) ---------- */
.ek-today-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px 28px;
  margin: 6px 0 26px;
}
.ek-today-date {
  color: var(--sage);
  font-weight: 600;
  margin: 0 0 6px;
}
#ekTodaySummary {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  max-width: 30ch;
  margin: 0;
  text-wrap: balance;
}
.ek-today-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.ek-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-weight: 600;
  font-size: 15px;
  color: var(--sage);
}
.ek-stat strong {
  color: var(--ink);
  font-size: 17px;
}
.ek-stat.is-overdue strong {
  color: var(--rose);
}
.ek-stat:hover {
  border-color: var(--line-strong);
}

.ekRecipientCard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px 10px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  margin: 0;
}
.ekRecipientCard strong {
  display: block;
}
.ekRecipientCard p {
  margin: 0;
  font-size: 14px;
}
.ekRecipientCard .secondary {
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 999px;
}
.ekPortrait,
.ekRecipientPortrait {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: var(--pine-soft);
  color: var(--pine);
  font-weight: 700;
  overflow: hidden;
}
.ekPortrait img,
.ekRecipientPortrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ekRecipientPortrait {
  width: 96px;
  height: 96px;
  font-size: 30px;
}

.ekDashboardColumns {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: start;
}
.ek-list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}
.ek-list-head h2 {
  margin: 0;
}

/* Attention list (overdue, due today, refills, appointments) */
.ek-attention {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ek-attention-row {
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.ek-attention li:last-child .ek-attention-row {
  border-bottom: 0;
}
.ek-attention-row::before {
  content: "";
  align-self: stretch;
  border-radius: 6px;
  background: var(--line-strong);
}
.ek-attention-row.is-overdue::before {
  background: var(--rose);
}
.ek-attention-row.is-soon::before {
  background: #d79a19;
}
.ek-attention-row.is-appointment::before {
  background: var(--sky);
}
.ek-attention-row.is-refill::before {
  background: #d79a19;
}
.ek-attention-row:hover {
  background: var(--mist);
}
.ek-attention-title {
  font-weight: 700;
  display: block;
}
.ek-attention-meta {
  color: var(--sage);
  font-size: 15px;
  font-weight: 400;
}
.ek-when {
  font-size: 14px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--mist);
  color: var(--sage);
  white-space: nowrap;
}
.is-overdue .ek-when {
  background: var(--rose-soft);
  color: var(--rose);
}
.is-soon .ek-when,
.is-refill .ek-when {
  background: var(--marigold-soft);
  color: var(--marigold);
}
.is-appointment .ek-when {
  background: var(--sky-soft);
  color: var(--sky);
}
.ek-empty {
  color: var(--sage);
  padding: 10px 0 4px;
}

#ekMyTasks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ekMyTaskLink {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--mist);
  font-weight: 600;
}
.ekMyTaskLink:hover {
  border-color: var(--pine);
}

.ekUpcomingRow {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.ekUpcomingRow:last-child {
  border-bottom: 0;
}
.ekUpcomingRow:hover {
  background: var(--mist);
}
.ekUpcomingIcon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--pine-soft);
  color: var(--pine);
}
.ekUpcomingTitle {
  display: block;
  font-weight: 700;
}
.ekUpcomingAssignee {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sage);
  font-size: 14px;
  font-weight: 400;
  margin-top: 2px;
}
.ekUpcomingAvatar,
.ekAvatar {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--pine-soft);
  color: var(--pine);
  font-size: 11px;
  font-weight: 700;
  flex: none;
}
.ekUpcomingAvatar img,
.ekAvatar img,
.ekMemberPhoto {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ekUpcomingBadge {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--sky-soft);
  color: var(--sky);
  white-space: nowrap;
}
.ekUpcomingBadge.late {
  background: var(--rose-soft);
  color: var(--rose);
}
.ekUpcomingBadge.today {
  background: var(--marigold-soft);
  color: var(--marigold);
}

.ekQuickActions h2 {
  margin-bottom: 10px;
}
.ekQuickActions button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 6px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
}
.ekQuickActions button:last-child {
  border-bottom: 0;
}
.ekQuickActions button:hover {
  color: var(--pine);
  background: var(--mist);
}
.ekQuickLabel {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ekQuickIcon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--pine-soft);
  color: var(--pine);
}
.ekQuickArrow {
  color: var(--sage);
}
.ek-invite-card {
  background: var(--pine);
  color: #ffe9ee;
  border-color: var(--pine);
}
.ek-invite-card h2 {
  color: #fff;
}
.ek-invite-card .secondary {
  background: #fff;
  border-color: #fff;
}
.ekFeedbackPrompt {
  background: transparent;
  border-style: dashed;
}

/* Suggestions */
#ekHomeAgentRecommendations .item,
#cloudPriorityList .item {
  width: 100%;
  text-align: left;
  border-radius: 0;
  font-weight: 600;
}
.ekAgentSuggestion {
  border: 1px solid var(--line);
  border-radius: var(--r-surface);
  padding: 18px;
  margin: 12px 0;
}
.ekAgentSuggestion h3 {
  margin: 6px 0;
}
.ekEyebrow {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  color: var(--pine);
}
.ekAgentSource {
  font-size: 14px;
  color: var(--sage);
  margin-bottom: 12px;
}
.ekAgentGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ekAgentGrid > div {
  padding: 14px;
  border-radius: var(--r-control);
  background: var(--mist);
}
.ekAgentGrid small {
  display: block;
  color: var(--sage);
  margin-top: 4px;
}

/* ---------- Tasks ---------- */
.ekActionRow {
  border-bottom: 1px solid var(--line);
  padding: 0;
}
.ekTaskOpen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title chev" "type chev" "meta chev";
  width: 100%;
  text-align: left;
  padding: 14px 6px;
  border-radius: 0;
  gap: 2px 12px;
}
.ekTaskOpen strong {
  grid-area: title;
}
.ekTaskOpen small {
  grid-area: meta;
  color: var(--sage);
  font-weight: 400;
}
.ekTaskChevron {
  grid-area: chev;
  align-self: center;
  font-size: 24px;
  color: var(--sage);
}
.ekTaskOpen:hover {
  background: var(--mist);
}
.ekDetailField {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.ekDetailField strong {
  display: block;
  font-size: 14px;
  color: var(--sage);
}
.ekDetailField p {
  margin: 2px 0 0;
  white-space: pre-wrap;
}

/* ---------- Medications ---------- */
#cloudMedList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.ekMedRow {
  border: 1px solid var(--line);
  border-radius: var(--r-surface);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ekMedHeading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.ekMedHeading strong {
  font-size: 18px;
}
.ekMedStatus {
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.ekActive {
  background: var(--leaf-soft);
  color: var(--leaf);
}
.ekInactive {
  background: var(--mist);
  color: var(--sage);
}
.ekMedSupply {
  color: var(--sage);
  font-size: 15px;
}
.ekMedGauge {
  height: 10px;
  border-radius: 999px;
  /* The empty part of the bar is the supply already used, so it needs to be visible. */
  background: var(--line-strong);
  overflow: hidden;
}
.ekMedGaugeFill {
  height: 100%;
  border-radius: 999px;
}
.ekMedGaugeScale {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: -2px;
  font-size: 13px;
  color: var(--sage);
}
.ekMedActions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.ekMedActions button {
  flex: 1;
  min-height: 42px;
  padding: 8px 12px;
}
.ekMedInline {
  display: flex;
  gap: 10px;
}
.ekMedInline select {
  width: 120px;
}
.ekMedTwo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.ekShortField {
  max-width: 200px;
}
.ekMedDoseGroup {
  margin: 0 0 14px;
}
.ekMedDoseLabel {
  display: block;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
}
.ekMedDose {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ekMedDose input {
  width: 96px;
}
.ekMedDose select {
  width: auto;
  min-width: 110px;
}
.ekMedDosePer {
  font-weight: 600;
  color: var(--sage);
}
.ekMedDoseHint {
  display: block;
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 400;
}
.ekMedQtyRow {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ekMedDose > *,
.ekMedQtyRow > * {
  margin-top: 0;
  margin-bottom: 0;
}

/* ---------- Calendar ---------- */
.ek-cal-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 12px;
}
.ek-cal-controls strong {
  font-size: 20px;
  margin-right: auto;
  order: -1;
}
.ek-cal-controls .secondary {
  min-height: 40px;
  padding: 7px 12px;
}
.ekCalendarGrid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  overflow: hidden;
}
.ekCalendarWeekday {
  background: var(--mist);
  padding: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--sage);
}
.ekCalendarDay {
  background: var(--paper);
  min-height: 104px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.ekCalendarDay.other {
  background: #fffaf8;
}
.ekCalendarDay b {
  font-size: 14px;
  color: var(--sage);
}
.ekCalendarDay.today b {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--pine);
  color: #fff;
}
.ekCalendarDay small {
  font-size: 12px;
  line-height: 1.3;
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--sky-soft);
  color: var(--sky);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#ekCalendarAgenda {
  margin-top: 22px;
}
.ekCalendarAgendaItem {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 6px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-weight: 400;
}
.ekCalendarAgendaItem:hover {
  background: var(--mist);
}

/* ---------- Documents ---------- */
.ekDocGroup h3 {
  font-size: 16px;
  color: var(--sage);
  margin: 18px 0 4px;
}
.ekDocRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.ekDocRowName strong {
  display: block;
}
.ekDocRowName small {
  color: var(--sage);
}
.ekDocActions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.ekDocActions button {
  min-height: 40px;
  padding: 7px 14px;
}

/* ---------- Team & contacts ---------- */
.ekMemberItem,
.ekContactItem {
  border-bottom: 1px solid var(--line);
}
.ekTeamMember {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  cursor: pointer;
  list-style: none;
}
.ekTeamMember::-webkit-details-marker,
.ekContactItem summary::-webkit-details-marker {
  display: none;
}
.ekTeamMember .ekAvatar {
  width: 44px;
  height: 44px;
  font-size: 16px;
}
.ekTeamMember small {
  display: block;
  color: var(--sage);
  text-transform: capitalize;
}
.ekPhotoUpload {
  font-size: 14px;
  color: var(--pine);
  cursor: pointer;
  margin: 0;
}
.ekContactItem summary {
  padding: 14px 4px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.ekContactDetails {
  padding: 0 4px 16px;
}
.ekContactDetails p {
  margin: 4px 0;
}
.ekContactDetails > button {
  margin-top: 10px;
}
.ekMemberContactForm {
  margin-top: 12px;
}
.ekContactToggle {
  display: flex;
  align-items: center;
  font-weight: 600;
}
.ekContactRepeat {
  margin: 4px 0 14px;
}
.ekContactRepeat h4 {
  margin: 6px 0 8px;
  font-size: 15px;
}
.ekContactFieldRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px 40px;
  gap: 8px;
  margin-bottom: 8px;
}
.ekContactFieldRow input,
.ekContactFieldRow select {
  margin: 0;
}
.ekContactRemove {
  font-size: 22px;
  color: var(--sage);
}
.ekContactAddRow {
  color: var(--pine);
  padding: 6px 0;
}
.ekPhotoUploadButton {
  display: inline-flex;
  color: var(--pine);
  cursor: pointer;
  font-size: 15px;
}
.ekRecipientIdentity {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 14px;
}
.ek-overview {
  background: var(--mist);
  border-radius: var(--r-surface);
  padding: 18px 20px;
  margin: 18px 0;
}
.ek-overview p {
  margin: 4px 0;
}
#recipient fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}
#recipient input[type="date"][data-recipient-field] {
  max-width: 240px;
}
#recipient textarea[data-recipient-field] {
  min-height: 76px;
}

/* ---------- Feedback & menu ---------- */
.ekFeedbackRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title arrow" "sum arrow";
  width: 100%;
  text-align: left;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.ekFeedbackRow strong {
  grid-area: title;
}
.ekFeedbackRow span:not(.ekFeedbackArrow) {
  grid-area: sum;
  color: var(--sage);
  font-weight: 400;
}
.ekFeedbackArrow {
  grid-area: arrow;
  align-self: center;
  font-size: 22px;
  color: var(--sage);
}
.ekMenuList {
  display: grid;
  gap: 0;
  margin-top: 6px;
}
.ekMenuList button {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 4px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
}
.ekMenuList button span:last-child {
  margin-left: auto;
  color: var(--sage);
}
.ekMenuList button:hover {
  background: var(--mist);
}
.ek-account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.ek-account p {
  margin: 0 auto 0 0;
}

/* ---------- Mobile bottom tabs ---------- */
#ekBottomNav {
  display: none;
}
body:has(#ekAppLayout[hidden]) #ekBottomNav {
  display: none !important;
}

/* ---------- Doctor packet print ---------- */
#ekDoctorPacket {
  display: none;
}
@media print {
  body.ekDoctorPacketPrinting > *:not(#ekDoctorPacket) {
    display: none !important;
  }
  body.ekDoctorPacketPrinting {
    background: #fff !important;
    color: #1a3632 !important;
    margin: 0 !important;
  }
  body.ekDoctorPacketPrinting > #ekDoctorPacket {
    display: block !important;
    font:
      12pt Arial,
      sans-serif;
  }
  #ekDoctorPacket h1,
  #ekDoctorPacket h2 {
    color: #146e65;
    break-after: avoid;
  }
  #ekDoctorPacket h2 {
    font-size: 15pt;
    margin-top: 22px;
    border-bottom: 1px solid #cdded8;
    padding-bottom: 5px;
  }
  #ekDoctorPacket p {
    white-space: pre-wrap;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }
  @page {
    margin: 18mm;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .ekDashboardColumns {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 900px) {
  #ekCloudCard {
    grid-template-columns: 1fr;
  }
  .ek-auth-brand {
    gap: 18px;
    padding-bottom: 32px;
  }
  .ek-auth-brand ul {
    display: none;
  }
  #ekAppLayout {
    grid-template-columns: minmax(0, 1fr);
  }
  #ekDesktopNav {
    display: none;
  }
  .ek-topbar-brand {
    display: inline-flex;
    color: var(--pine);
  }
  .ek-topbar-brand .ek-brand-word {
    display: none;
  }
  #ekBottomNav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 10;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    background: var(--paper);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  #ekBottomNav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 2px;
    font-size: 12px;
    font-weight: 600;
    color: var(--sage);
  }
  #ekBottomNav button.active {
    color: var(--pine);
  }
  #ekBottomNav .ek-icon {
    width: 24px;
    height: 24px;
  }
  .ek-today-head {
    align-items: stretch;
  }
  .ekRecipientCard {
    width: 100%;
    border-radius: var(--r-surface);
  }
  .ekRecipientCard .secondary {
    margin-left: auto;
  }
}
@media (max-width: 640px) {
  body {
    font-size: 16px;
  }
  .two,
  .ekMedTwo,
  .grid,
  #recipient fieldset,
  .ekAgentGrid {
    grid-template-columns: 1fr;
  }
  .card {
    border-radius: 14px;
  }
  .ekTaskHeader {
    flex-direction: column;
  }
  .ekCalendarDay {
    min-height: 58px;
    padding: 4px;
  }
  .ekCalendarDay small {
    font-size: 0;
    padding: 0;
    height: 6px;
    width: 6px;
    border-radius: 999px;
    background: var(--sky);
  }
  .ekCalendarDay small:last-child:not(:first-of-type) {
    font-size: 0;
  }
  .ekContactFieldRow {
    grid-template-columns: minmax(0, 1fr) 100px 36px;
  }
  .ek-circle-switch select {
    max-width: 52vw;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Desktop has the sidebar, so the in-page Back button is only needed on phones. */
@media (min-width: 901px) {
  .ekBackBar {
    display: none !important;
  }
}
@media (min-width: 1081px) {
  .ek-today-head {
    flex-wrap: nowrap;
    align-items: flex-start;
  }
  .ek-today-head .ekRecipientCard {
    margin-top: 30px;
    flex: none;
  }
}
.ekCalendarDay small.is-task {
  background: var(--mist);
  color: var(--ink);
}

/* ---------- Accounts & invites ---------- */
.ek-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 22px;
  border-radius: 12px;
  background: var(--pine-soft);
  align-self: flex-start;
}
.ek-tabs button {
  padding: 9px 16px;
  border-radius: 9px;
  color: var(--pine);
}
.ek-tabs button.active {
  background: var(--paper);
  box-shadow: 0 1px 2px #0c3a3826;
}
#ekForgotPassword {
  align-self: flex-start;
  font-weight: 600;
  font-size: 15px;
}
.ek-invite-welcome {
  background: var(--leaf-soft);
  color: var(--ink);
  border-radius: var(--r-control);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.ek-share input {
  font-size: 14px;
  color: var(--sage);
}
#ekInviteList h3 {
  margin-top: 20px;
  font-size: 16px;
}
.ek-dialog {
  border: 0;
  border-radius: var(--r-surface);
  padding: 26px;
  width: min(440px, calc(100vw - 32px));
  color: var(--ink);
}
.ek-dialog::backdrop {
  background: #0c3a3866;
}
/* Centered between 16px gutters and only as wide as its text, so a long message wraps across the
   screen as a rounded box (with left: 50% it could only use half the width, and the pill radius
   turned a wrapped message into a black circle). */
.ek-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 96px;
  margin: 0 auto;
  width: fit-content;
  max-width: 560px;
  box-sizing: border-box;
  z-index: 20;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 22px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
  box-shadow: 0 6px 24px #0003;
}
@media (min-width: 901px) {
  .ek-toast {
    bottom: 32px;
  }
}
#ekRemindersCard fieldset {
  display: block;
}
#ekRemindersCard fieldset label:last-child {
  max-width: 260px;
  margin-bottom: 0;
}
#ekPushStatus {
  font-weight: 600;
}

/* ---------- Scan a paper ---------- */
.ek-scan-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.ek-scan-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  padding: 26px 16px;
  margin: 0;
  border: 2px dashed var(--line-strong);
  border-radius: var(--r-surface);
  cursor: pointer;
  background: var(--mist);
}
.ek-scan-drop:hover,
.ek-scan-drop:focus-within {
  border-color: var(--pine);
  background: var(--pine-soft);
}
.ek-scan-drop .ek-icon {
  width: 30px;
  height: 30px;
  color: var(--pine);
  margin-bottom: 6px;
}
.ek-scan-drop span {
  font-weight: 400;
  font-size: 14px;
}
.ek-scan-preview {
  display: block;
  max-width: 100%;
  max-height: 340px;
  margin: 0 auto 18px;
  border-radius: var(--r-control);
  border: 1px solid var(--line);
}
.ek-scan-summary {
  font-size: 19px;
  font-weight: 600;
}
#ekScanResults h3 {
  margin-top: 22px;
}
.ek-scan-item {
  border: 1px solid var(--line);
  border-radius: var(--r-surface);
  padding: 16px;
  margin: 10px 0;
}
.ek-scan-item.is-skipped {
  opacity: 0.5;
}
.ek-scan-check {
  display: flex;
  align-items: center;
  font-weight: 700;
  color: var(--pine);
}
.ek-scan-item blockquote {
  margin: 4px 0 0;
  padding: 8px 12px;
  border-left: 3px solid var(--line-strong);
  color: var(--sage);
  font-size: 15px;
}
@media (max-width: 640px) {
  .ek-scan-pick {
    grid-template-columns: 1fr;
  }
}

/* Completed tasks, collapsed under the open ones */
.ek-completed {
  margin-top: 14px;
}
.ek-completed > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 6px;
  font-weight: 700;
  color: var(--sage);
  cursor: pointer;
  list-style: none;
  border-radius: var(--r-control);
}
.ek-completed > summary::-webkit-details-marker {
  display: none;
}
.ek-completed > summary::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.ek-completed[open] > summary::before {
  transform: rotate(45deg);
}
.ek-completed > summary:hover {
  background: var(--mist);
  color: var(--ink);
}
.ek-completed .ekTaskOpen strong {
  color: var(--sage);
  text-decoration: line-through;
  text-decoration-color: var(--line-strong);
}

/* Calendar items are buttons that open details */
.ekCalendarDay .ek-cal-item {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--sky-soft);
  color: var(--sky);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ekCalendarDay .ek-cal-item.is-task {
  background: var(--mist);
  color: var(--ink);
}
.ekCalendarDay .ek-cal-item:hover {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}
.ek-appt-when {
  font-size: 19px;
  font-weight: 600;
  color: var(--sky);
}
.ek-danger {
  color: var(--rose);
  border-color: #e7b9b4;
}
.ek-danger:hover {
  background: var(--rose-soft);
}
@media (max-width: 640px) {
  .ekCalendarDay .ek-cal-item {
    font-size: 0;
    padding: 0;
    height: 8px;
    width: 8px;
    border-radius: 999px;
    background: var(--sky);
  }
  .ekCalendarDay .ek-cal-item.is-task {
    background: var(--sage);
  }
}
.ek-examples {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 20px;
  border-style: dashed;
  background: transparent;
}
.ek-examples h2 {
  margin: 0 0 4px;
  font-size: 18px;
}
.ek-examples p,
.ek-examples .actions {
  margin: 0;
}
.ek-example-pill {
  background: var(--marigold-soft);
  color: var(--marigold);
  vertical-align: middle;
}
a.secondary,
a.primary {
  border: 1px solid var(--line-strong);
}
a.primary {
  border-color: var(--pine);
}

/* Sticky "unsaved changes" bar on long forms */
.ek-savebar {
  position: sticky;
  bottom: 16px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 10px 10px 10px 18px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 28px #0c3a3840;
}
.ek-savebar .primary {
  background: #fff;
  color: var(--pine);
}
@media (max-width: 900px) {
  .ek-savebar {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
}

/* Task status: one tap saves */
.ek-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 6px 0 4px;
}
.ek-status-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--sage);
  min-width: 52px;
}
.ek-status-picker {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: 12px;
  background: var(--mist);
  border: 1px solid var(--line);
}
.ek-status-picker button {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 9px;
  color: var(--sage);
  font-size: 15px;
}
.ek-status-picker button:hover {
  color: var(--ink);
  background: #ffffffb3;
}
.ek-status-picker button.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 3px #0c3a3826;
}
.ek-status-picker button[data-status="done"].active {
  background: var(--leaf);
  color: #fff;
}
.ek-status-picker button[data-status="in_progress"].active {
  background: var(--sky-soft);
  color: var(--sky);
}
#ekTaskStatusMessage:empty {
  display: none;
}
.ek-attention .card,
.ekDashboardMain > .card:first-child {
  scroll-margin-top: calc(var(--topbar) + 12px);
}

/* Care team member details */
.ek-member-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 18px;
  margin: 4px 0 14px;
}
.ek-member-facts dt {
  font-size: 14px;
  font-weight: 700;
  color: var(--sage);
}
.ek-member-facts dd {
  margin: 0;
  white-space: pre-wrap;
}
.ekMemberContactForm {
  margin-top: 6px;
  padding: 18px;
  border-radius: var(--r-surface);
  background: var(--mist);
}
.ek-field-hint {
  display: block;
  font-weight: 400;
  color: var(--sage);
  margin-top: 4px;
}
.ek-form-error {
  color: var(--rose);
  font-weight: 600;
  margin: 0;
}
.ek-form-error:empty {
  display: none;
}
[aria-invalid="true"] {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px #a8322c26;
}
.ekTeamMember .ekAvatar {
  position: relative;
}
@media (max-width: 640px) {
  .ek-member-facts {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .ek-member-facts dd {
    margin-bottom: 8px;
  }
}

/* Field problems, shown under the field (see assets/fields.js) */
.ek-field-error {
  display: block;
  margin-top: 6px;
  color: var(--rose);
  font-size: 14px;
  font-weight: 600;
}
.ekContactFieldRow .ek-field-error {
  grid-column: 1 / -1;
  margin-top: -2px;
}

/* ---------- Who's free (team availability) ---------- */
.ek-free {
  margin: 4px 0 16px;
}
.ek-free-head {
  margin-bottom: 6px;
}
.ek-free-scale {
  position: relative;
  height: 18px;
  margin-left: 32%;
  font-size: 12px;
  color: var(--sage);
}
.ek-free-scale span {
  position: absolute;
  transform: translateX(-50%);
}
.ek-free-list {
  display: grid;
  gap: 4px;
}
.ek-free-row {
  display: grid;
  grid-template-columns: 32% minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 6px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 400;
}
button.ek-free-row:hover {
  background: var(--mist);
}
.ek-free-row[aria-selected="true"] {
  background: var(--pine-soft);
  border-color: var(--pine);
}
.ek-free-who strong {
  display: block;
  font-size: 15px;
}
.ek-free-who small {
  color: var(--sage);
  font-size: 13px;
}
.ek-free-bar {
  position: relative;
  height: 22px;
  border-radius: 6px;
  background: var(--leaf-soft);
  overflow: hidden;
}
.ek-free-bar.is-unknown {
  background: repeating-linear-gradient(
    -45deg,
    var(--mist),
    var(--mist) 6px,
    #efe5e2 6px,
    #efe5e2 12px
  );
}
.ek-free-bar i,
.ek-free-legend i {
  position: absolute;
  top: 0;
  bottom: 0;
}
.ek-free-bar i.is-busy {
  background: #9e8a8e;
}
.ek-free-bar i.is-appt {
  background: var(--sky);
}
.ek-free-bar i.is-proposed {
  background: transparent;
  outline: 2px dashed var(--ink);
  outline-offset: -2px;
}
.ek-free-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 13px;
  color: var(--sage);
  margin: 8px 0 0;
}
.ek-free-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ek-free-legend i {
  position: static;
  display: inline-block;
  width: 14px;
  height: 10px;
  border-radius: 3px;
}
.ek-free-legend i.is-busy {
  background: #9e8a8e;
}
.ek-free-legend i.is-appt {
  background: var(--sky);
}
.ek-free-legend i.is-proposed {
  outline: 2px dashed var(--ink);
  outline-offset: -2px;
}
.ek-free-note,
.ek-free-tip {
  font-size: 14px;
  margin: 8px 0 0;
}
.ekCalendarDay {
  cursor: pointer;
}
.ekCalendarDay.is-selected {
  box-shadow: inset 0 0 0 2px var(--pine);
}
.ek-more summary {
  cursor: pointer;
  color: var(--pine);
  font-weight: 600;
  margin: 10px 0;
}
.ek-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Daily check-in ---------- */
.ek-checkin {
  border-color: #f2d3da;
  background: linear-gradient(180deg, #fff7f5, var(--paper));
}
.ek-checkin h2 {
  font-size: 21px;
  max-width: 40ch;
}
.ek-moods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}
.ek-mood {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
}
.ek-mood:hover,
.ek-mood.active {
  border-color: var(--pine);
  background: var(--pine-soft);
}
.ek-checkin-extra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}
.ek-checkin-extra input:not([type="checkbox"]) {
  flex: 1 1 320px;
  margin: 0;
}
.ek-checkin-extra label {
  margin: 0;
}
.ek-private {
  font-size: 14px;
  margin: 10px 0 0;
}
.ek-checkin-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ek-checkin-head .ek-link {
  margin-left: auto;
}
.ek-mood-pill {
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  background: var(--leaf-soft);
  color: var(--leaf);
}
.ek-mood-pill.is-tired,
.ek-mood-pill.is-overwhelmed {
  background: var(--marigold-soft);
  color: var(--marigold);
}
.ek-mood-pill.is-unwell {
  background: var(--rose-soft);
  color: var(--rose);
}
.ek-checkin-message {
  font-size: 18px;
  margin: 12px 0 8px;
}
.ek-insights {
  margin: 0 0 8px;
  padding-left: 20px;
  color: var(--sage);
}
.ek-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.ek-suggestion p {
  margin: 0;
}
.ek-suggestion .secondary {
  flex: none;
  min-height: 40px;
  padding: 8px 14px;
}
.ek-suggestion.is-done p {
  color: var(--sage);
  text-decoration: line-through;
}
.ek-team-notice {
  border-color: #f0d9a8;
  background: #fffaf0;
}
@media (max-width: 640px) {
  .ek-free-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .ek-free-scale {
    margin-left: 0;
  }
  .ek-suggestion {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Screenshots on feedback */
.ek-shots-field {
  margin: 4px 0 16px;
}
.ek-shots-label {
  display: block;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 8px;
}
.ek-shots {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.ek-shots:not(:empty) {
  margin-bottom: 10px;
}
.ek-shot {
  position: relative;
  margin: 0;
  width: 120px;
  height: 90px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--mist);
}
.ek-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ek-shot a:focus-visible {
  outline-offset: -3px;
}
.ek-shot-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #172b29cc;
  color: #fff;
  font-size: 18px;
  line-height: 1;
}
.ek-shot-add {
  display: inline-flex;
  width: auto;
  margin: 0 12px 0 0;
  cursor: pointer;
}
.ek-shot-add:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
label.ek-shot-add {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  font-weight: 600;
}

/* ---------- Access levels ---------- */
/* Hide what this person's level can't use (the database enforces the same rules). */
body:not([data-can~="family"]) [data-need~="family"],
body:not([data-can~="money"]) [data-need~="money"],
body:not([data-can~="docs"]) [data-need~="docs"],
body:not([data-can~="manage"]) [data-need~="manage"],
body:not([data-can~="work"]) [data-need~="work"] {
  display: none !important;
}
.ek-access-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}
.ek-access-row select {
  width: auto;
  margin: 0;
  min-height: 40px;
}
.ek-access-row .secondary {
  min-height: 40px;
  padding: 8px 14px;
}
.ek-level-pill {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  background: var(--pine-soft);
  color: var(--pine);
}
.ek-level-pill.is-professional {
  background: var(--sky-soft);
  color: var(--sky);
}
.ek-level-pill.is-viewer {
  background: var(--mist);
  color: var(--sage);
}
.ek-access-card {
  border-color: #f2d3da;
}
.ek-access-card h2 span {
  color: var(--pine);
}
label.ek-private-field::after {
  content: "Private: owner, coordinators and family caregivers only";
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--sage);
  margin-top: 4px;
}
input[readonly],
textarea[readonly] {
  background: var(--mist);
  border-color: var(--line);
}

/* ---------- Separate name and address boxes (assets/fields.js splitField) ---------- */
.ek-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 14px;
}
.ek-split {
  grid-column: 1 / -1;
  margin: 0 0 4px;
}
.ek-split-inline,
.ek-split-inline .ek-split-boxes {
  display: contents;
}
.ek-split-title {
  display: block;
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 6px;
}
.ek-split-boxes {
  display: grid;
  gap: 0 12px;
}
.ek-split-name .ek-split-boxes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ek-split-fullname .ek-split-boxes {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ek-split-address .ek-split-boxes {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.ek-split-address .ek-split-street {
  grid-column: span 4;
}
.ek-split-address .ek-split-unit {
  grid-column: span 2;
}
.ek-split-address .ek-split-city {
  grid-column: span 3;
}
.ek-split-address .ek-split-state {
  grid-column: span 1;
}
.ek-split-address .ek-split-zip {
  grid-column: span 2;
}
.ek-split:not(.ek-split-inline) .ek-split-boxes label {
  font-weight: 500;
  font-size: 14px;
  color: var(--sage);
  margin-bottom: 10px;
}
.ekContactFieldRow .ek-split {
  grid-column: auto;
  margin: 0;
}
.ekContactFieldRow.ek-has-split {
  align-items: start;
  padding: 10px 0 2px;
  border-top: 1px solid var(--line);
}
.ekContactFieldRow.ek-has-split > select,
.ekContactFieldRow.ek-has-split > .ekContactRemove {
  margin-top: 22px;
}
#recipient fieldset > .ek-split {
  grid-column: 1 / -1;
}

/* Denser forms: smaller boxes so more fits on screen */
.ek-compact label {
  font-size: 14px;
  margin-bottom: 10px;
}
.ek-compact input,
.ek-compact select,
.ek-compact textarea {
  min-height: 40px;
  padding: 8px 10px;
  margin-top: 4px;
  font-size: 15px;
}
.ek-compact input[type="checkbox"] {
  min-height: 0;
  padding: 0;
  margin-top: 0;
}
.ek-compact textarea {
  min-height: 60px;
}
@media (max-width: 900px) {
  .ek-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .ek-form-grid,
  .ek-split-fullname .ek-split-boxes,
  .ek-split-contactphone .ek-split-boxes {
    grid-template-columns: 1fr;
  }
  .ek-split-address .ek-split-street,
  .ek-split-address .ek-split-unit,
  .ek-split-address .ek-split-city {
    grid-column: span 6;
  }
  .ek-split-address .ek-split-state,
  .ek-split-address .ek-split-zip {
    grid-column: span 3;
  }
}
.ek-split-contactphone .ek-split-boxes {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}
.ek-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin: 4px 0 12px;
}
.ek-folder-tile {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  text-align: left;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-surface);
  background: var(--mist);
  font-weight: 400;
}
.ek-folder-tile .ek-icon {
  grid-row: span 2;
  width: 26px;
  height: 26px;
  color: var(--pine);
}
.ek-folder-tile strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ek-folder-tile small {
  color: var(--sage);
}
.ek-folder-tile:hover {
  border-color: var(--pine);
}
.ek-folder-new {
  background: transparent;
  border-style: dashed;
}
.ek-folder-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
  flex-wrap: wrap;
}
.ek-folder-form input {
  margin: 0;
  flex: 1 1 200px;
  min-height: 40px;
  padding: 8px 10px;
}
.ek-folder-form button,
.ek-doc-move select {
  min-height: 40px;
  padding: 7px 14px;
}
.ek-folder-inline {
  margin: 0;
}
.ek-folder-head {
  margin-bottom: 4px;
}
.ek-folder-back {
  color: var(--pine);
  padding: 4px 0;
  font-size: 15px;
}
.ek-folder-headrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ek-folder-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
}
.ek-folder-title .ek-icon {
  width: 26px;
  height: 26px;
  color: var(--pine);
}
.ek-folder-title small {
  font-size: 14px;
  font-weight: 400;
  color: var(--sage);
}
.ek-folder-actions {
  display: flex;
  gap: 8px;
}
.ek-folder-actions button {
  min-height: 38px;
  padding: 6px 12px;
}
.ek-folder-loose {
  font-size: 16px;
  margin: 18px 0 0;
}
.ek-doc-move select {
  margin: 0;
  width: auto;
  max-width: 180px;
}
@media (max-width: 640px) {
  .ekDocRow {
    flex-direction: column;
    align-items: stretch;
  }
  .ekDocActions {
    flex-wrap: wrap;
  }
}

/* ---------- Spending by month (assets/expense-chart.js) ---------- */
.ek-expense-chart {
  margin: 0 0 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.ek-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.ek-chart-head h2 {
  margin: 0;
}
.ek-chart-head p {
  margin: 4px 0 0;
}
.ek-range {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  overflow: hidden;
}
.ek-range button {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 0;
  color: var(--sage);
}
.ek-range button + button {
  border-left: 1px solid var(--line-strong);
}
.ek-range button[aria-pressed="true"] {
  background: var(--pine);
  color: #fff;
}
.ek-figs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 12px;
}
.ek-fig {
  background: var(--mist);
  border-radius: var(--r-control);
  padding: 12px 14px;
}
.ek-fig span,
.ek-fig small {
  display: block;
  color: var(--sage);
  font-size: 14px;
}
.ek-fig strong {
  display: block;
  font-size: 22px;
  font-weight: 650;
  margin: 2px 0;
  color: var(--ink);
}
.ek-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  list-style: none;
  padding: 0;
  margin: 8px 0 4px;
  font-size: 14px;
  color: var(--ink);
}
.ek-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ek-legend i,
.ek-tip-row i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}
.ek-chart-host {
  position: relative;
}
.ek-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.ek-chart-svg .ek-grid {
  stroke: #efe4e1;
  stroke-width: 1;
}
.ek-chart-svg .ek-axis {
  stroke: var(--line-strong);
  stroke-width: 1;
}
.ek-chart-svg .ek-tick {
  fill: var(--sage);
  font-size: 12px;
  font-family: var(--font);
}
.ek-chart-svg .ek-value {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
}
.ek-chart-svg .ek-hit {
  fill: transparent;
  cursor: pointer;
  outline: none;
}
.ek-chart-svg .ek-bar {
  transition: opacity 0.12s;
}
.ek-chart-svg:has(.ek-bar.is-active) .ek-bar:not(.is-active) {
  opacity: 0.45;
}
.ek-chart-svg .ek-line {
  fill: none;
  stroke: #2a78d6;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.ek-chart-svg .ek-area {
  fill: #2a78d6;
  opacity: 0.1;
}
.ek-chart-svg .ek-dot {
  fill: #2a78d6;
  stroke: var(--paper);
  stroke-width: 2;
}
.ek-chart-svg .ek-cross {
  stroke: var(--line-strong);
  stroke-width: 1;
}
.ek-chart-sub {
  font-size: 16px;
  margin: 18px 0 2px;
}
.ek-chart-note {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--sage);
}
.ek-chart-tip {
  position: absolute;
  z-index: 50;
  min-width: 190px;
  max-width: 260px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  box-shadow: 0 6px 20px #0f2a2722;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--ink);
  pointer-events: none;
}
.ek-chart-tip strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}
.ek-tip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}
.ek-tip-row span {
  flex: 1;
}
.ek-tip-row b {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.ek-tip-total {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 6px;
}
.ek-tip-muted {
  color: var(--sage);
}
.ek-chart-details {
  margin-top: 12px;
}
.ek-chart-details summary {
  cursor: pointer;
  color: var(--pine);
  font-weight: 600;
  font-size: 15px;
}
.ek-chart-table-wrap {
  overflow-x: auto;
  margin-top: 10px;
}
.ek-chart-table {
  border-collapse: collapse;
  font-size: 14px;
  min-width: 100%;
}
.ek-chart-table th,
.ek-chart-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ek-chart-table th:first-child,
.ek-chart-table thead th:first-child {
  text-align: left;
}
.ek-chart-table thead th {
  color: var(--sage);
  font-weight: 600;
}
.ek-expense-list-title {
  font-size: 16px;
  margin: 0 0 4px;
}
.ek-expense-row {
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.ek-expense-row .ek-expense-edit {
  float: right;
  margin-left: 12px;
  min-height: 36px;
  padding: 6px 14px;
}
.ek-expense-row::after {
  content: "";
  display: block;
  clear: both;
}
.ek-expense-row small {
  display: block;
  color: var(--sage);
  margin-top: 2px;
}
@media (max-width: 640px) {
  .ek-figs {
    grid-template-columns: 1fr 1fr;
  }
  .ek-figs .ek-fig:last-child {
    grid-column: 1 / -1;
  }
}

/* ---------- Pip, the morning helper (assets/helper.js) ---------- */
.ek-pip-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: min(460px, calc(100vw - 32px));
  animation: ek-pip-in 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.ek-pip-root[hidden] {
  display: none;
}
.ek-pip-root.is-leaving {
  animation: ek-pip-out 0.26s ease-in both;
}
@keyframes ek-pip-in {
  from {
    transform: translateY(140%) scale(0.6);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes ek-pip-out {
  to {
    transform: translateY(40px) scale(0.9);
    opacity: 0;
  }
}
.ek-pip {
  flex: none;
  width: 104px;
  height: 108px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 50%;
}
.ek-pip-art {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.ek-pip .pip-body {
  transform-origin: 60px 106px;
  animation: ek-pip-bob 2.8s ease-in-out infinite;
}
.ek-pip .pip-sprout {
  transform-origin: 60px 40px;
  animation: ek-pip-sway 3.2s ease-in-out infinite;
}
.ek-pip .pip-eyes {
  transform-origin: 60px 66px;
  animation: ek-pip-blink 4.6s infinite;
}
.ek-pip .pip-arm-right {
  transform-origin: 92px 74px;
}
.ek-pip.wave .pip-arm-right {
  animation: ek-pip-wave 0.5s ease-in-out 3;
}
.ek-pip .pip-mouth-open,
.ek-pip .pip-eyes-happy,
.ek-pip .pip-brows {
  opacity: 0;
}
.ek-pip .pip-mouth-open {
  transform-origin: 60px 82px;
}
.ek-pip.is-talking .pip-mouth-smile {
  opacity: 0;
}
.ek-pip.is-talking .pip-mouth-open {
  opacity: 1;
  animation: ek-pip-talk 0.28s ease-in-out infinite alternate;
}
.ek-pip[data-face="excited"] .pip-eyes {
  opacity: 0;
  animation: none;
}
.ek-pip[data-face="excited"] .pip-eyes-happy {
  opacity: 1;
}
.ek-pip[data-face="excited"] .pip-body {
  animation:
    ek-pip-hop 0.9s ease-in-out 2,
    ek-pip-bob 2.8s ease-in-out 1.8s infinite;
}
.ek-pip[data-face="gentle"] .pip-brows {
  opacity: 1;
  transform: translateY(1px);
}
.ek-pip[data-face="gentle"] .pip-sprout {
  animation-duration: 5s;
}
@keyframes ek-pip-bob {
  0%,
  100% {
    transform: translateY(0) scale(1, 1);
  }
  50% {
    transform: translateY(-3px) scale(1.02, 0.98);
  }
}
@keyframes ek-pip-hop {
  0%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-14px) scale(0.97, 1.04);
  }
  70% {
    transform: translateY(0) scale(1.05, 0.95);
  }
}
@keyframes ek-pip-sway {
  0%,
  100% {
    transform: rotate(-6deg);
  }
  50% {
    transform: rotate(6deg);
  }
}
@keyframes ek-pip-blink {
  0%,
  92%,
  100% {
    transform: scaleY(1);
  }
  95% {
    transform: scaleY(0.1);
  }
}
@keyframes ek-pip-wave {
  0%,
  100% {
    transform: rotate(0);
  }
  50% {
    transform: rotate(-38deg);
  }
}
@keyframes ek-pip-talk {
  from {
    transform: scaleY(0.35);
  }
  to {
    transform: scaleY(1);
  }
}
.ek-pip-bubble {
  position: relative;
  flex: 1;
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px 18px 6px 18px;
  box-shadow: 0 12px 34px #0c3a3829;
  padding: 10px 14px 14px;
  margin-bottom: 40px;
  /* A long hello (week, weather, tasks, buttons) scrolls inside instead of running off the top
     of the screen, where the close button would be out of reach. */
  max-height: calc(100vh - 110px);
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.ek-pip-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--pine);
  font-size: 14px;
}
.ek-pip-spacer {
  flex: 1;
}
.ek-pip-icon {
  min-height: 34px;
  min-width: 34px;
  padding: 2px 6px;
  font-size: 18px;
  line-height: 1;
  color: var(--sage);
}
.ek-pip-line {
  margin: 2px 0 10px;
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  min-height: 1.45em;
}
.ek-pip-hear {
  font-size: 14px;
  color: var(--pine);
  padding: 4px 0 8px;
}
.ek-pip-moods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ek-pip-mood {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 15px;
  background: var(--paper);
  transition: transform 0.12s;
}
.ek-pip-mood:hover {
  transform: translateY(-2px);
  border-color: var(--pine);
}
.ek-pip-mood span {
  font-size: 18px;
}
.ek-pip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.ek-pip-actions button {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 15px;
}
.ek-pip-note {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--sage);
}
.ek-pip-days {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
  margin: 2px 0 4px;
}
.ek-pip-day {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 2px;
  border-radius: 12px;
  background: var(--mist);
  font-size: 13px;
}
.ek-pip-day.is-clear,
.ek-pip-day.is-sunny {
  background: #fff6dc;
}
.ek-pip-day.is-showers,
.ek-pip-day.is-storm {
  background: #e7eef8;
}
.ek-pip-day-name {
  font-weight: 600;
  color: var(--ink);
}
.ek-pip-day-icon {
  font-size: 22px;
  line-height: 1.2;
}
.ek-pip-day-count {
  color: var(--sage);
  font-variant-numeric: tabular-nums;
}
.ek-pip-summon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding: 6px 12px;
  min-height: 36px;
  font-size: 14px;
  color: var(--pine);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}
@media (max-width: 640px) {
  .ek-pip-root {
    right: 8px;
    left: 8px;
    bottom: 76px;
    max-width: none;
  }
  .ek-pip {
    width: 78px;
    height: 82px;
  }
  .ek-pip-bubble {
    margin-bottom: 30px;
    /* Room for the top bar above and the tab bar below. */
    max-height: calc(100vh - 190px);
    max-height: calc(100dvh - 190px);
  }
  .ek-pip-line {
    font-size: 16px;
  }
  .ek-pip-day-icon {
    font-size: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ek-pip-root,
  .ek-pip *,
  .ek-pip-root.is-leaving {
    animation: none !important;
  }
}

/* ---------- Task types (assets/task-types.js) ---------- */
.ek-type-chip {
  display: inline-block;
  margin: 4px 0 2px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--mist);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}
.ekTaskOpen .ek-type-chip {
  grid-area: type;
  justify-self: start;
}
.ek-filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 12px;
  scrollbar-width: thin;
}
.ek-filter-bar[hidden] {
  display: none;
}
.ek-filter-chip {
  flex: none;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  background: var(--paper);
}
.ek-filter-chip[aria-pressed="true"] {
  background: var(--pine);
  border-color: var(--pine);
  color: #fff;
}
.ek-pip-name {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ek-pip-name input {
  margin: 0;
  flex: 1 1 160px;
  min-height: 40px;
  padding: 8px 10px;
}
.ek-pip-name button {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 15px;
}
.ek-push-right {
  margin-left: auto;
}

/* ---------- Calendar: "+N more" and the day list ---------- */
.ekCalendarDay .ek-cal-more {
  display: block;
  width: 100%;
  min-height: 0;
  margin-top: 2px;
  padding: 2px 4px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--pine);
  text-align: left;
}
.ekCalendarDay .ek-cal-more:hover {
  background: var(--pine-soft);
}
.ekCalendarDay {
  cursor: pointer;
}
.ek-day-list {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-surface);
  padding: 6px 14px 8px;
  background: var(--paper);
}
.ek-day-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ek-day-list-head h3 {
  margin: 8px 0;
  font-size: 16px;
}
.ek-day-list-close {
  font-size: 22px;
  min-height: 36px;
  min-width: 36px;
  color: var(--sage);
}
.ek-day-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 4px;
  border-top: 1px solid var(--line);
  border-radius: 0;
  font-weight: 400;
}
.ek-day-item:hover {
  background: var(--mist);
}
.ek-day-time {
  font-size: 14px;
  font-weight: 600;
  color: var(--sky);
}
.ek-day-item.is-task .ek-day-time {
  color: var(--sage);
}
.ek-day-text strong,
.ek-day-text small {
  display: block;
}
.ek-day-text small {
  color: var(--sage);
  margin-top: 2px;
}
@media (max-width: 640px) {
  .ekCalendarDay .ek-cal-more {
    font-size: 11px;
    padding: 0;
    text-align: center;
  }
  .ek-day-item {
    grid-template-columns: 64px minmax(0, 1fr) auto;
  }
}
.ek-day-chev {
  font-size: 22px;
  color: var(--sage);
}
.ek-pip-voice-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.ek-pip-voice-row label {
  flex: 1 1 240px;
  margin-bottom: 0;
}
.ek-pip-voice-row button {
  min-height: 46px;
}

/* ---------- Health check (assets/health.js) ---------- */
.ek-obs-from {
  background: var(--sky-soft);
  border-radius: var(--r-control);
  padding: 10px 12px;
  margin: 0 0 12px;
  font-size: 15px;
}
.ek-obs-from .ekContactToggle {
  margin: 6px 0 0;
  font-weight: 500;
}
.ek-obs-now {
  display: flex;
  align-items: flex-end;
  padding-bottom: 10px;
}
.ek-obs-now button {
  min-height: 40px;
  padding: 6px 14px;
}
.ek-obs-vitals-box {
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  padding: 8px 12px 0;
}
.ek-obs-vitals-box summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--pine);
  padding-bottom: 8px;
}
.ek-obs-photo-pick {
  margin: 4px 0 12px;
}
.ek-file-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin: 0;
  padding: 8px 14px;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  font-size: 15px;
  color: var(--pine);
}
.ek-obs-photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.ek-obs-photo-tile {
  position: relative;
  width: 84px;
  height: 84px;
}
.ek-obs-photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.ek-obs-photo-x {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 26px;
  height: 26px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  line-height: 1;
}
.ek-obs-day {
  margin: 4px 0 18px;
}
.ek-obs-day > summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  margin: 8px 0 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  list-style: none;
}
.ek-obs-day > summary::-webkit-details-marker {
  display: none;
}
.ek-obs-day > summary::after {
  content: "";
  align-self: center;
  margin-left: auto;
  margin-right: 6px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--sage);
  border-bottom: 2px solid var(--sage);
  transform: rotate(45deg);
  transition: transform 0.15s;
}
.ek-obs-day[open] > summary::after {
  transform: rotate(-135deg);
}
.ek-obs-day:not([open]) {
  margin-bottom: 4px;
}
.ek-obs-day > summary small {
  color: var(--sage);
  font-weight: 400;
  font-size: 14px;
}
.ek-obs {
  position: relative;
  margin: 0 0 10px 0;
  padding: 10px 14px 10px 16px;
  border-left: 3px solid var(--line-strong);
  border-radius: 0 var(--r-control) var(--r-control) 0;
  background: var(--mist);
}
.ek-obs-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.ek-obs-time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 68px;
}
.ek-obs .ek-type-chip {
  margin: 0;
  background: var(--paper);
}
.ek-obs h4 {
  margin: 6px 0 4px;
  font-size: 16px;
}
.ek-obs p {
  margin: 2px 0;
}
.ek-obs-vitals {
  font-weight: 600;
  color: var(--sky);
  font-variant-numeric: tabular-nums;
}
.ek-obs-meta {
  color: var(--sage);
  font-size: 14px;
}
.ek-obs-details {
  white-space: pre-wrap;
}
.ek-sev {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.ek-sev.is-mild {
  color: var(--leaf);
}
.ek-sev.is-moderate {
  color: var(--marigold);
  background: var(--marigold-soft);
}
.ek-sev.is-severe {
  color: var(--rose);
  background: var(--rose-soft);
}
.ek-sev.is-doctor {
  color: var(--sky);
  background: var(--sky-soft);
}
.ek-obs:has(.ek-sev.is-severe) {
  border-left-color: var(--rose);
}
.ek-obs:has(.ek-sev.is-moderate) {
  border-left-color: #d9a520;
}
.ek-obs-photos {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 2px;
}
.ek-obs-photos img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: block;
}
.ek-obs-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.ek-obs-foot small {
  color: var(--sage);
  flex: 1;
}
.ek-danger-text {
  color: var(--rose) !important;
}
#ekTaskToHealth .ek-icon {
  margin-right: 6px;
}
@media (max-width: 640px) {
  .ek-obs-photos img {
    width: 80px;
    height: 80px;
  }
}
.ek-whoami {
  border: 1px solid var(--marigold);
  background: var(--marigold-soft);
}
.ek-whoami h2 {
  margin-top: 0;
}
.ek-whoami-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Add Parvin to your calendar ---------- */
.ek-feed-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 4px 0 10px;
}
.ek-feed-url {
  margin: 0;
  font:
    400 13px/1.3 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  color: var(--sage);
}
.ek-feed-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.ek-feed-steps {
  margin: 10px 0 6px;
  padding-left: 20px;
  color: var(--ink);
  font-size: 15px;
}
.ek-feed-steps li {
  margin: 4px 0;
}
.ek-feed-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
#ekFeedBody label select {
  max-width: 340px;
}
.ekCalendarAgendaItem.is-finished,
.ekCalendarDay .ek-cal-item.is-finished {
  color: var(--sage);
  text-decoration: line-through;
  text-decoration-color: #9fb3ad;
}
.ekCalendarDay .ek-cal-item.is-finished {
  opacity: 0.75;
}
#ekCalendarAgenda h3 {
  margin: 18px 0 4px;
  font-size: 16px;
}
#ekCalendarAgenda .ek-completed {
  margin-top: 16px;
}
.ek-day-item.is-finished strong {
  color: var(--sage);
  text-decoration: line-through;
}

/* ---------- Calendar colors: appointments, tasks, overdue, done ---------- */
:root {
  --cal-appt: #1f63b5;
  --cal-appt-text: #ffffff;
  --cal-task-bg: #fff1d6;
  --cal-task-bar: #d98a00;
  --cal-task-text: #5c3a00;
  --cal-late-bg: #fde3e0;
  --cal-late-bar: #c8372d;
  --cal-late-text: #861b13;
  --cal-done-bg: #f3ecea;
  --cal-done-text: #7f6b6f;
}
.ek-cal-key {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  list-style: none;
  padding: 0;
  margin: 4px 0 10px;
  font-size: 13px;
  color: var(--ink);
}
.ek-cal-key li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ek-cal-key i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}
.ek-cal-key i.is-appointment {
  background: var(--cal-appt);
}
.ek-cal-key i.is-task {
  background: var(--cal-task-bg);
  box-shadow: inset 3px 0 0 var(--cal-task-bar);
}
.ek-cal-key i.is-overdue {
  background: var(--cal-late-bg);
  box-shadow: inset 3px 0 0 var(--cal-late-bar);
}
.ek-cal-key i.is-finished {
  background: var(--cal-done-bg);
  border: 1px solid #e8d9d5;
}
.ekCalendarDay.is-weekend:not(.other) {
  background: #fffcfb;
}
.ekCalendarDay.today {
  background: #fdeef2;
}
.ekCalendarDay .ek-cal-item {
  font-weight: 600;
  padding: 3px 6px 3px 8px;
}
.ekCalendarDay .ek-cal-item.is-appointment {
  background: var(--cal-appt);
  color: var(--cal-appt-text);
}
.ekCalendarDay .ek-cal-item.is-task {
  background: var(--cal-task-bg);
  color: var(--cal-task-text);
  box-shadow: inset 3px 0 0 var(--cal-task-bar);
}
.ekCalendarDay .ek-cal-item.is-task.is-high {
  font-weight: 700;
}
.ekCalendarDay .ek-cal-item.is-task.is-high::before {
  content: "! ";
}
.ekCalendarDay .ek-cal-item.is-overdue {
  background: var(--cal-late-bg);
  color: var(--cal-late-text);
  box-shadow: inset 3px 0 0 var(--cal-late-bar);
}
.ekCalendarDay .ek-cal-item.is-finished,
.ekCalendarDay .ek-cal-item.is-appointment.is-finished {
  background: var(--cal-done-bg);
  color: var(--cal-done-text);
  box-shadow: none;
  opacity: 1;
}
.ekCalendarDay .ek-cal-item:hover {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}
.ek-day-item.is-appointment .ek-day-time {
  color: var(--cal-appt);
}
.ek-day-item.is-task .ek-day-time {
  color: var(--cal-task-bar);
}
@media (max-width: 640px) {
  .ekCalendarDay .ek-cal-item,
  .ekCalendarDay .ek-cal-item.is-appointment {
    background: var(--cal-appt);
    box-shadow: none;
    width: 10px;
    height: 10px;
  }
  .ekCalendarDay .ek-cal-item.is-task {
    background: var(--cal-task-bar);
  }
  .ekCalendarDay .ek-cal-item.is-overdue {
    background: var(--cal-late-bar);
  }
  .ekCalendarDay .ek-cal-item.is-finished {
    background: #cbbab6;
  }
  .ekCalendarDay .ek-cal-item.is-task.is-high::before {
    content: none;
  }
}
@media (max-width: 640px) {
  .ek-cal-key i.is-task {
    background: var(--cal-task-bar);
  }
  .ek-cal-key i.is-overdue {
    background: var(--cal-late-bar);
  }
  .ek-cal-key i.is-finished {
    background: #cbbab6;
  }
}

/* ---------- Quick note (assets/quick-note.js) ---------- */
.ek-today-note label {
  margin-bottom: 6px;
}
.ek-today-note-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.ek-today-note-row textarea {
  margin: 0;
  min-height: 60px;
}
.ek-today-note .muted {
  margin: 6px 0 0;
  font-size: 14px;
}
.ek-note-actions {
  align-items: flex-end;
  margin-top: -4px;
}
.ek-note-lang {
  margin: 0;
  font-size: 14px;
}
.ek-note-lang select {
  min-height: 40px;
  padding: 6px 10px;
}
#ekNoteMic.is-listening {
  background: var(--rose-soft);
  color: var(--rose);
  border-color: var(--rose);
  animation: ek-pulse 1.4s ease-in-out infinite;
}
@keyframes ek-pulse {
  50% {
    box-shadow: 0 0 0 6px #a8322c22;
  }
}
#ekNoteResults h3 {
  margin: 18px 0 6px;
}
@media (max-width: 640px) {
  .ek-today-note-row {
    flex-direction: column;
    align-items: stretch;
  }
}
@media (prefers-reduced-motion: reduce) {
  #ekNoteMic.is-listening {
    animation: none;
  }
}

/* ---------- Tablet for Franca (assets/tablet.js) ---------- */
body.ek-tablet-on {
  overflow: hidden;
}
.ek-tablet {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: #fdf6f4;
  color: var(--ink);
  padding: max(16px, env(safe-area-inset-top)) 20px max(12px, env(safe-area-inset-bottom));
  overflow-y: auto;
  font-size: 22px;
}
.ek-tablet[hidden] {
  display: none;
}
.ek-tab-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.ek-tab-head h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.1;
}
.ek-tab-head p {
  margin: 6px 0 0;
  font-size: clamp(20px, 2.6vw, 26px);
  color: var(--sage);
}
.ek-tab-langs {
  display: flex;
  gap: 8px;
}
.ek-tab-langs button {
  min-height: 52px;
  padding: 8px 16px;
  font-size: 20px;
  border: 2px solid var(--line-strong);
  border-radius: 14px;
  background: var(--paper);
}
.ek-tab-langs button[aria-pressed="true"] {
  border-color: var(--pine);
  background: var(--pine);
  color: #fff;
}
.ek-tab-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 18px auto 0;
  width: 100%;
  max-width: 980px;
}
.ek-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 92px;
  padding: 14px 18px;
  border-radius: 22px;
  border: 2px solid var(--line-strong);
  background: var(--paper);
  font-size: clamp(22px, 2.8vw, 28px);
  font-weight: 700;
  color: var(--ink);
  box-shadow: 0 2px 0 #0c3a3814;
}
.ek-tab-btn b {
  font-size: 1.4em;
  line-height: 1;
}
.ek-tab-btn:active {
  transform: translateY(1px);
}
.ek-tab-btn.is-talk {
  width: min(100%, 560px);
  min-height: 120px;
  background: var(--pine);
  border-color: var(--pine);
  color: #fff;
  font-size: clamp(26px, 3.4vw, 34px);
}
.ek-tablet.is-listening .ek-tab-btn.is-talk {
  background: var(--rose);
  border-color: var(--rose);
  animation: ek-pulse 1.4s ease-in-out infinite;
}
.ek-tab-heard {
  min-height: 1.4em;
  margin: 0;
  font-style: italic;
  color: var(--sage);
  text-align: center;
}
.ek-tab-answer {
  width: 100%;
  min-height: 120px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 22px;
  padding: 18px 22px;
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.4;
}
.ek-tablet.is-speaking .ek-tab-answer {
  border-color: var(--pine);
}
.ek-tab-answer p {
  margin: 0;
}
/* Voice mode: the reply in the other language, smaller, under the spoken one. */
.ek-tab-answer .ek-tab-translation {
  margin-top: 10px;
  font-size: 0.72em;
  color: var(--sage);
}
/* While she talks, the button's glow follows her voice; while Parvin thinks, it dims. */
.ek-tablet.is-listening .ek-tab-btn.is-talk {
  box-shadow: 0 0 0 calc(var(--ek-level, 0) * 18px) rgba(255, 77, 109, 0.35);
}
.ek-tablet.is-thinking .ek-tab-btn.is-talk {
  opacity: 0.75;
  cursor: progress;
}
.ek-tab-hint {
  color: var(--sage);
}
.ek-tab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  width: 100%;
}
.ek-tab-btn.is-took {
  background: #e3f4ea;
  border-color: #8cc9a4;
}
.ek-tab-btn.is-help {
  background: #fde3e0;
  border-color: #e9a59e;
  color: #861b13;
}
.ek-tab-confirm {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}
.ek-tab-yes,
.ek-tab-no,
.ek-tab-call {
  min-height: 72px;
  min-width: 160px;
  padding: 10px 24px;
  border-radius: 18px;
  font-size: 26px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ek-tab-yes,
.ek-tab-call {
  background: var(--pine);
  color: #fff;
  border: 2px solid var(--pine);
}
.ek-tab-no {
  background: var(--paper);
  border: 2px solid var(--line-strong);
}
.ek-tab-exit {
  align-self: center;
  margin-top: 16px;
  min-height: 44px;
  padding: 6px 16px;
  font-size: 15px;
  color: var(--sage);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: transparent;
  position: relative;
  overflow: hidden;
  touch-action: none;
}
.ek-tab-exit.is-holding::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #13504e22;
  transform-origin: left;
  animation: ek-hold 2s linear forwards;
}
@keyframes ek-hold {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ek-tablet.is-listening .ek-tab-btn.is-talk {
    animation: none;
  }
}

/* ---------- Today, reorganized: note + quick add, check-in strip, one "your day" card ---------- */
#home .ek-today-head h1 {
  font-size: clamp(24px, 2.6vw, 32px);
}
.ek-today-note {
  padding-bottom: 14px;
}
.ek-today-note > label {
  font-size: 17px;
}
.ek-quick-add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.ek-quick-add-label {
  font-size: 14px;
  color: var(--sage);
  margin-right: 2px;
}
.ek-quick-add > button,
.ek-quick-more > summary {
  min-height: 36px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--mist);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.ek-quick-more > summary::-webkit-details-marker {
  display: none;
}
.ek-quick-add > button:hover,
.ek-quick-more > summary:hover {
  border-color: var(--pine);
}
.ek-quick-more {
  position: relative;
}
.ek-quick-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  display: grid;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  box-shadow: 0 10px 28px #0c3a3824;
}
.ek-quick-menu button {
  text-align: left;
  padding: 9px 10px;
  min-height: 40px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
}
.ek-quick-menu button:hover {
  background: var(--mist);
}
/* Check-in becomes a slim strip with Pip beside it */
.ek-checkin-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.ek-checkin-wrap > .ek-checkin {
  flex: 1;
  margin: 0;
}
.ek-checkin-wrap .ek-pip-summon {
  flex: none;
  width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  margin: 6px 0 0;
  justify-content: center;
  font-size: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
}
.ek-checkin-wrap:has(.ek-checkin[hidden]) .ek-pip-summon {
  display: none;
}
#ekCheckinCard {
  padding: 16px 20px;
}
#ekCheckinCard h2 {
  font-size: 18px;
  margin: 0 0 10px;
}
#ekCheckinCard .ek-moods {
  margin: 0;
}
.ek-checkin-more {
  margin-top: 10px;
}
.ek-checkin-more > summary {
  cursor: pointer;
  font-size: 14px;
  color: var(--pine);
  font-weight: 600;
}
.ek-checkin-more .ek-checkin-extra {
  margin-top: 8px;
}
/* Needs attention and Coming up: two cards, styled alike */
.ek-your-day h2 {
  font-size: 18px;
}
.ek-mine-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 10px;
}
.ek-mine-row[hidden] {
  display: none;
}
.ek-mine-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--sage);
}
.ek-mine-row #ekMyTasks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* "Yours": the next three of your tasks as a short list, one line each. */
.ek-mine-row {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}
.ek-mine-row #ekMyTasks {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0;
  min-width: 0;
}
.ek-mine-row .ekMyTaskLink {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  margin: 0;
  padding: 6px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}
.ek-mine-row .ekMyTaskLink:hover .ekMyTaskTitle {
  text-decoration: underline;
}
.ekMyTaskTitle {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ekMyTaskWhen {
  flex: none;
  font-size: 13px;
  color: var(--sage);
}
.ekMyTaskWhen.is-late {
  color: var(--rose);
  font-weight: 600;
}
.ek-mine-row .ekMyTaskMore {
  align-self: flex-start;
  margin-top: 2px;
  font-size: 14px;
}
.ek-your-day #ekUpcomingTasks {
  border: 0;
  padding: 0;
  box-shadow: none;
  background: none;
}
.ek-side-suggestions[hidden],
.ek-invite-card[hidden] {
  display: none;
}
@media (max-width: 640px) {
  .ek-quick-add-label {
    width: 100%;
  }
  .ek-checkin-wrap .ek-pip-summon {
    width: 40px;
    height: 40px;
    min-height: 40px;
    font-size: 20px;
  }
  .ek-quick-menu {
    left: auto;
    right: 0;
  }
}
#ekTodayNoteGo {
  white-space: nowrap;
}
.ek-checkin-wrap {
  margin-bottom: 18px;
}
#home .ek-team-notice {
  padding: 14px 20px;
}
#home .ek-team-notice h2 {
  font-size: 17px;
  margin: 0 0 4px;
}
#home .ek-team-notice p {
  margin: 2px 0;
  font-size: 15px;
}

/* ---------- Pilot results (assets/pilot.js) ---------- */
.ek-pilot-range {
  margin: 0 0 4px;
}
.ek-pilot-figs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.ek-pilot-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  list-style: none;
  padding: 0;
  margin: 4px 0 8px;
  font-size: 15px;
  color: var(--sage);
}
.ek-pilot-facts b {
  color: var(--ink);
}
.ek-pilot-team {
  display: grid;
  gap: 10px;
  margin: 6px 0 14px;
}
.ek-pilot-person {
  display: grid;
  grid-template-columns: minmax(90px, 160px) 1fr 40px;
  grid-template-areas: "name track count" ". sub sub";
  align-items: center;
  column-gap: 10px;
}
.ek-pilot-name {
  grid-area: name;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ek-pilot-track {
  grid-area: track;
  height: 14px;
  background: var(--mist);
  border-radius: 4px;
  overflow: hidden;
}
.ek-pilot-fill {
  display: block;
  height: 100%;
  background: #2a78d6;
  border-radius: 0 4px 4px 0;
}
.ek-pilot-count {
  grid-area: count;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.ek-pilot-person small {
  grid-area: sub;
  color: var(--sage);
  font-size: 13px;
}
.ek-pilot-note {
  font-size: 13px;
  margin-top: 12px;
}
#pilot .ek-page-head {
  align-items: flex-start;
}
@media (max-width: 640px) {
  .ek-pilot-figs {
    grid-template-columns: 1fr 1fr;
  }
}
@media print {
  /* Any page prints as just its content, full width (the sidebar's slot goes too). */
  #ekDesktopNav,
  #ekBottomNav,
  .ek-topbar,
  #ekWelcomeBanner,
  #ekBackBar,
  #ekPilotRange,
  #pilot .actions,
  .ek-pip-root,
  .ek-feedback-fab,
  .ek-toast {
    display: none !important;
  }
  #ekAppLayout {
    display: block !important;
  }
  .ek-main,
  .shell {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body {
    background: #fff !important;
  }
  .card {
    box-shadow: none !important;
    break-inside: avoid;
  }
  #pilot details {
    display: block;
  }
  @page {
    margin: 14mm;
  }
}

/* ---------- Settings & more: collapsible sections ---------- */
#menu .card[data-collapse] {
  padding-top: 6px;
  padding-bottom: 6px;
}
#menu .card[data-collapse] > h2 {
  margin: 0;
  font-size: inherit;
}
.ek-collapse-toggle {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "title chev" "summary chev";
  align-items: center;
  gap: 2px 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 0;
  text-align: left;
  border-radius: 0;
  background: none;
}
.ek-collapse-title {
  grid-area: title;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}
.ek-collapse-summary {
  grid-area: summary;
  font-size: 14px;
  font-weight: 400;
  color: var(--sage);
}
.ek-collapse-chevron {
  grid-area: chev;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--sage);
  border-bottom: 2px solid var(--sage);
  transform: rotate(45deg);
  transition: transform 0.15s;
  margin-right: 4px;
}
.card.is-open .ek-collapse-chevron {
  transform: rotate(-135deg);
}
.card.is-open .ek-collapse-summary {
  display: none;
}
.ek-collapse-toggle:hover .ek-collapse-title {
  color: var(--pine);
}
.ek-collapse-body {
  padding: 2px 0 14px;
}
.ek-collapse-body > :first-child {
  margin-top: 0;
}
#menu .card[data-collapse] {
  margin-bottom: 10px;
}
/* Care team → Invite someone: a closed section like a contact; tap the title to open it. */
.ek-invite-collapse > details > summary {
  list-style: none;
  cursor: pointer;
  min-height: 0;
  padding: 0;
}
.ek-invite-collapse > details > summary::-webkit-details-marker {
  display: none;
}
.ek-invite-collapse .ek-collapse-title {
  margin: 0;
}
.ek-invite-collapse > details[open] .ek-collapse-chevron {
  transform: rotate(-135deg);
}
.ek-invite-collapse > details[open] .ek-collapse-summary {
  display: none;
}
.ek-invite-collapse .ek-collapse-body {
  padding: 12px 0 0;
}
/* Name, relationship and access level side by side; stacked on phones. */
.ek-invite-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 16px;
  align-items: end;
}
.ek-invite-fields > * {
  min-width: 0;
}
.ek-invite-fields :is(input, select) {
  width: 100%;
}
@media (max-width: 640px) {
  .ek-invite-fields {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ek-collapse-chevron {
    transition: none;
  }
}

/* ---------- Discharge helper ---------- */
.ek-dc-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--sage);
}
.ek-dc-steps b {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--pine);
  color: #fff;
  font-size: 12px;
}
.ek-dc h2 {
  margin-bottom: 2px;
}
.ek-dc-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 16px;
}
.ek-dc-pages figure {
  position: relative;
  margin: 0;
  width: 96px;
}
.ek-dc-pages img {
  width: 96px;
  height: 124px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  display: block;
}
.ek-dc-pages figcaption {
  font-size: 12px;
  color: var(--sage);
  text-align: center;
  margin-top: 4px;
}
.ek-dc-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  line-height: 1;
}
.ek-dc-fine {
  font-size: 13px;
}
.ek-dc-keep {
  margin: 4px 0 12px;
}
.ek-scan-wide {
  grid-template-columns: 1fr;
}
#ekDcResults {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

#ekDcStatus:empty {
  display: none;
}

/* ---------- UI refresh (Oct 2026) ---------- */
/* Sidebar: tighter rows so every page fits on a laptop screen; Pilot results and Settings sit at
   the bottom, apart from the everyday pages. */
#ekDesktopNav {
  padding: 18px 12px 14px;
  gap: 1px;
}
#ekDesktopNav .ek-brand {
  padding: 2px 10px 16px;
}
#ekDesktopNav button {
  padding: 8px 12px;
  min-height: 40px;
  font-size: 15.5px;
}
.ek-nav-group {
  padding: 14px 12px 4px;
}
.ek-nav-bottom {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #ffffff22;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ek-nav-bottom + .ek-nav-foot {
  margin-top: 0;
  padding-top: 10px;
}
#ekDesktopNav button:focus-visible {
  outline: 3px solid #9fe0d4;
  outline-offset: -3px;
}

/* Quick add: line icons instead of emoji (emoji stay for categories only). */
.ek-quick-add > button,
.ek-quick-menu button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ek-quick-add .ek-icon,
.ek-quick-menu .ek-icon {
  width: 17px;
  height: 17px;
  color: var(--pine);
}
.ek-file-button .ek-icon {
  width: 18px;
  height: 18px;
}

/* Due dates in task lists: late in rose, today/tomorrow in marigold. */
.ek-due.is-late {
  color: var(--rose);
  font-weight: 700;
}
.ek-due.is-soon {
  color: var(--marigold);
  font-weight: 700;
}

/* Text size choice in Settings. */
.ek-text-size {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0 10px;
}
.ek-text-size button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 76px;
  font-weight: 600;
}
.ek-text-size button span {
  font-weight: 700;
  line-height: 1.1;
}
.ek-text-size button[aria-pressed="true"] {
  border-color: var(--pine);
  background: var(--pine-soft);
  box-shadow: inset 0 0 0 1px var(--pine);
}

/* Phones: page titles take less room so content starts higher. */
@media (max-width: 760px) {
  .ek-page-head {
    margin-bottom: 12px;
  }
  .ek-page-head h1 {
    font-size: 26px;
  }
  .ek-page-head p {
    font-size: 15.5px;
  }
}

/* ---------- Medicine safety check ---------- */
.ek-safety {
  margin-top: 16px;
}
.ek-safety-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px 20px;
}
.ek-safety-head > div {
  flex: 1 1 320px;
}
#ekSafetyStatus:empty {
  display: none;
}
#ekSafetyStatus {
  background: none;
  border: 0;
  padding: 0;
  margin: 8px 0 0;
  color: var(--sage);
  font-size: 14px;
}
.ek-safety-item {
  border: 1px solid var(--line);
  border-left: 5px solid var(--sky);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 10px 0;
}
.ek-safety-item > strong {
  display: block;
  margin-bottom: 4px;
}
.ek-safety-item p {
  margin: 4px 0;
}
.ek-safety-item blockquote {
  margin: 6px 0 8px;
  padding: 6px 12px;
  border-left: 3px solid var(--line-strong);
  color: var(--ink);
  background: var(--mist);
  border-radius: 0 8px 8px 0;
}
.ek-safety-item.is-warn {
  border-left-color: var(--marigold);
  background: var(--marigold-soft);
}
.ek-safety-item.is-alert {
  border-left-color: var(--rose);
  background: var(--rose-soft);
}
.ek-safety-item.is-ok {
  border-left-color: var(--leaf);
  background: var(--leaf-soft);
}
.ek-safety-task {
  margin-top: 6px;
  min-height: 38px;
  font-size: 15px;
}
.ek-safety-product {
  font-size: 13px;
}
.ek-safety-labels {
  margin: 8px 0 0;
  padding-left: 20px;
}
.ek-safety-boxed {
  color: var(--rose);
  font-weight: 600;
}
.ek-safety-more summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--pine);
  margin-top: 8px;
}
.ek-safety-fine {
  font-size: 13px;
  margin-top: 12px;
}

/* ---------- Dementia care: behavior log ---------- */
.ek-obs-behavior {
  margin: 4px 0 10px;
}
.ek-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.ek-chip-row .ek-filter-chip {
  font-size: 14px;
  min-height: 34px;
}
.ek-patterns h2 {
  margin-bottom: 2px;
}
.ek-pattern-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(2, minmax(0, 1fr));
  gap: 18px 28px;
  margin-top: 10px;
}
.ek-pattern-grid h3 {
  font-size: 16px;
  margin-bottom: 4px;
}
.ek-pattern-grid ul {
  margin: 0;
  padding-left: 18px;
}
.ek-pattern-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  align-items: end;
  height: 150px;
}
.ek-pattern-bar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  height: 100%;
}
.ek-pattern-bar i {
  align-self: end;
  width: 100%;
  max-width: 48px;
  min-height: 3px;
  border-radius: 6px 6px 0 0;
  background: var(--line-strong);
}
.ek-pattern-bar.is-peak i {
  background: var(--pine);
}
.ek-pattern-n {
  font-weight: 700;
  font-size: 15px;
}
.ek-pattern-bar small {
  color: var(--sage);
  font-size: 13px;
  margin-top: 4px;
}
@media (max-width: 760px) {
  .ek-pattern-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Dementia care: missing-person sheet ---------- */
.ek-mp {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow-y: auto;
  background: rgba(30, 20, 22, 0.55);
  padding: 24px 16px;
}
body.ek-mp-on {
  overflow: hidden;
}
.ek-mp-sheet,
.ek-mp-loading {
  max-width: 760px;
  margin: 0 auto;
  background: var(--paper);
  border-radius: var(--r-surface);
  padding: 22px 24px 26px;
}
.ek-mp-call {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--rose-soft);
  color: var(--rose);
}
.ek-mp-911 {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-control);
  background: var(--rose);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.ek-mp-sheet h1 {
  font-size: 30px;
  margin-bottom: 4px;
}
.ek-mp-sub {
  color: var(--ink);
  font-size: 18px;
}
.ek-mp-now {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin: 12px 0 16px;
  padding: 12px;
  border-radius: 12px;
  background: var(--marigold-soft);
}
.ek-mp-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: start;
}
.ek-mp-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
}
.ek-mp-photo.is-empty {
  aspect-ratio: auto;
  min-height: 120px;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  color: var(--sage);
  background: var(--mist);
  font-size: 15px;
}
.ek-mp-body dl {
  margin: 0;
}
.ek-mp-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.ek-mp-row dt {
  font-weight: 700;
}
.ek-mp-row dd {
  margin: 0;
  white-space: pre-line;
}
.ek-mp-row.only-print {
  display: none;
}
.ek-mp-contacts {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.ek-mp-contacts li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.ek-mp-contacts a {
  font-weight: 700;
  font-size: 18px;
}
.ek-mp-foot {
  font-weight: 700;
}
.ek-missing-item {
  color: var(--rose) !important;
}
@media (max-width: 640px) {
  .ek-mp {
    padding: 0;
  }
  .ek-mp-sheet {
    border-radius: 0;
    min-height: 100%;
    padding: 18px 16px 24px;
  }
  .ek-mp-now,
  .ek-mp-body,
  .ek-mp-row {
    grid-template-columns: 1fr;
  }
  .ek-mp-row {
    gap: 0;
  }
  .ek-mp-photo {
    max-width: 240px;
  }
}
@media print {
  body.ekMissingPrinting > *:not(#ekMissing) {
    display: none !important;
  }
  body.ekMissingPrinting .ek-mp {
    position: static;
    overflow: visible;
    background: #fff;
    padding: 0;
  }
  body.ekMissingPrinting .ek-mp-sheet {
    max-width: none;
    padding: 0;
  }
  body.ekMissingPrinting .no-print,
  body.ekMissingPrinting .ek-mp-call {
    display: none !important;
  }
  body.ekMissingPrinting .ek-mp-row.only-print {
    display: grid;
  }
  body.ekMissingPrinting .ek-mp-sheet h1 {
    font-size: 34pt;
  }
}

/* ---------- Dementia care: tablet family faces and simple mode ---------- */
.ek-tab-btn.is-family {
  background: #e8eefb;
  border-color: #a9bde6;
}
.ek-tab-faces {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.ek-tab-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fff;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
}
.ek-tab-face img,
.ek-tab-face b {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
}
.ek-tab-face b {
  display: grid;
  place-items: center;
  background: var(--pine-soft);
  color: var(--pine);
  font-size: 40px;
}
.ek-tab-face:focus-visible,
.ek-tab-face:hover {
  border-color: var(--pine);
}
.ek-tablet.is-simple #ekTabAppts,
.ek-tablet.is-simple #ekTabMeds,
.ek-tablet.is-simple #ekTabTook {
  display: none;
}
.ek-tablet.is-simple .ek-tab-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.ek-tablet.is-simple .ek-tab-btn {
  min-height: 150px;
  font-size: 30px;
}

/* ---------- Care profile: sections that fold open and shut ---------- */
.ek-section-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 0 -6px;
}
#recipient fieldset.ek-section {
  padding: 4px 16px 12px;
}
#recipient fieldset.ek-section > legend {
  /* Floating the legend puts it inside the box instead of on its border line. */
  float: left;
  grid-column: 1 / -1;
  width: 100%;
  padding: 0;
  margin: 0 0 4px;
}
.ek-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 6px;
  font: 700 17px/1.25 var(--font);
  color: var(--ink);
  text-align: left;
  background: none;
  border: 0;
  border-radius: var(--r-control);
}
.ek-section-toggle:hover {
  background: var(--pine-soft);
}
.ek-section-toggle:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.ek-section-title {
  flex: 1;
}
.ek-section-chevron {
  width: 10px;
  height: 10px;
  flex: none;
  border-right: 2.5px solid var(--pine);
  border-bottom: 2.5px solid var(--pine);
  transform: rotate(45deg);
  margin: 0 4px 4px;
  transition: transform 0.15s ease;
}
.ek-section.is-collapsed .ek-section-chevron {
  transform: rotate(-45deg);
  margin-bottom: 0;
}
.ek-section-count {
  font: 600 13px/1 var(--font);
  color: var(--sage);
  white-space: nowrap;
}
.ek-section-count.is-complete {
  color: var(--pine);
}
#recipient fieldset.ek-section.is-collapsed {
  padding-bottom: 4px;
  margin: 10px 0;
}
#recipient fieldset.ek-section.is-collapsed > :not(legend),
.ek-overview.ek-section.is-collapsed > :not(h3) {
  display: none;
}
.ek-overview.ek-section > h3 {
  margin: -8px -10px 0;
}
.ek-overview.ek-section:not(.is-collapsed) > h3 {
  margin-bottom: 6px;
}
@media print {
  #recipient .ek-section.is-collapsed > * {
    display: revert;
  }
  .ek-section-chevron,
  .ek-section-count,
  .ek-section-bar {
    display: none;
  }
}

/* ---------- Settings: delete my account ---------- */
.ek-delete-account {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.ek-delete-account summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--rose);
}
.ek-delete-account input {
  max-width: 240px;
}

/* ---------- Appointment: mark as done ---------- */
.ek-appt-done {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-surface);
  background: var(--mist);
}
#ekAppointmentDetailStatus:not([hidden]) {
  font-weight: 600;
}

/* ---------- Family updates and comments ---------- */
.ek-nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand-rose, #ff4d6d);
  color: #fff;
  font: 700 12px/20px var(--font);
  text-align: center;
}
#ekBottomNav button {
  position: relative;
}
#ekBottomNav .ek-nav-badge {
  position: absolute;
  top: 2px;
  left: calc(50% + 6px);
  margin: 0;
}
.ek-updates-card {
  padding: 0;
  overflow: hidden;
}
.ek-msg-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: min(62vh, 640px);
  overflow-y: auto;
  padding: 16px 18px 8px;
}
.ek-thread-slot .ek-msg-list {
  max-height: 360px;
  padding: 4px 0;
}
.ek-msg-heading {
  margin: 22px 0 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 17px;
}
.ek-msg-empty {
  text-align: center;
  padding: 18px 0;
}
.ek-msg {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
}
.ek-msg.mentions-me {
  background: var(--pine-soft);
}
.ek-avatar {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--brand-dark, #1e1416);
  color: #fff;
  font: 700 13px/1 var(--font);
}
.ek-msg.is-mine .ek-avatar {
  background: var(--pine);
}
.ek-msg-main {
  flex: 1;
  min-width: 0;
}
.ek-msg-meta {
  margin: 0;
  font-size: 13px;
  color: var(--sage);
}
.ek-msg-meta b {
  color: var(--ink);
}
.ek-msg-body {
  margin: 2px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.45;
}
.ek-mention {
  color: var(--pine);
  font-weight: 700;
}
.ek-msg-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}
.ek-msg:hover .ek-msg-actions,
.ek-msg:focus-within .ek-msg-actions {
  opacity: 1;
}
@media (hover: none) {
  .ek-msg-actions {
    opacity: 1;
  }
}
.ek-msg-actions .ek-link {
  font-size: 13px;
  padding: 2px 0;
}
.ek-msg-seen {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--sage);
}
.ek-msg-task {
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.ek-msg-task .actions {
  margin-top: 4px;
}
.ek-msg-task-done {
  margin: 0;
  color: var(--pine);
  font-weight: 600;
}
.ek-msg-composer {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.ek-thread-slot .ek-msg-composer {
  padding: 10px 0 0;
  background: none;
}
.ek-msg-inputwrap {
  position: relative;
  flex: 1;
}
.ek-msg-input {
  width: 100%;
  margin: 0;
  resize: vertical;
}
.ek-msg-send button {
  min-height: 46px;
}
.ek-msg-status:empty {
  display: none;
}
.ek-msg-status {
  padding: 0 18px 12px;
}
.ek-mention-picker {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 20;
  min-width: 220px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(30, 20, 22, 0.15);
  padding: 6px;
}
.ek-mention-picker button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: left;
  font-weight: 600;
}
.ek-mention-picker button:hover,
.ek-mention-picker button:focus {
  background: var(--pine-soft);
}
.ek-mention-picker .ek-avatar {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

/* ---------- Step-by-step directions ---------- */
.ek-steps ol {
  margin: 8px 0 10px;
  padding-left: 22px;
}
.ek-steps li {
  margin: 6px 0;
  line-height: 1.45;
}
.ek-steps-inner {
  margin: 8px 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.ek-steps-inner summary {
  cursor: pointer;
  font-weight: 600;
}

/* ---------- Permission for AI and voice ---------- */
.ek-ai-consent {
  max-width: 520px;
  border: 0;
  border-radius: 20px;
  padding: 24px 24px 18px;
  box-shadow: 0 24px 60px rgba(30, 20, 22, 0.3);
}
.ek-ai-consent::backdrop {
  background: rgba(30, 20, 22, 0.45);
}
.ek-ai-consent h2 {
  margin: 0 0 10px;
}
.ek-ai-consent p {
  margin: 0 0 10px;
  line-height: 1.5;
}
.ek-ai-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.ek-ai-row button {
  flex: none;
}

/* ---------- Settings: what was said to the tablet ---------- */
.ek-voice-history #ekVoiceHistoryList {
  max-height: 420px;
  overflow-y: auto;
}
.ek-vh-day {
  margin: 14px 0 4px;
  font-size: 14px;
  color: var(--sage);
}
.ek-vh-turn {
  padding: 8px 12px;
  margin: 6px 0;
  border-left: 3px solid var(--line-strong);
  background: var(--mist);
  border-radius: 0 10px 10px 0;
}
.ek-vh-turn.is-urgent {
  border-left-color: var(--rose);
}
.ek-vh-turn p {
  margin: 2px 0;
}
.ek-vh-meta {
  font-size: 12px;
  color: var(--sage);
}
.ek-vh-heard {
  font-style: italic;
}
.ek-vh-action {
  font-size: 13px;
  font-weight: 700;
  color: var(--pine);
}

/* ---------- Visit recorder ---------- */
.ek-visit:not(:empty) {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-surface);
  background: var(--mist);
}
.ek-visit h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
}
.ek-visit label {
  display: block;
  margin: 10px 0;
}
.ek-visit textarea {
  width: 100%;
}
.ek-visit-agree {
  font-weight: 600;
}
.ek-visit-time {
  font-variant-numeric: tabular-nums;
}
.ek-visit-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-rose, #e5484d);
  animation: ek-visit-pulse 1.4s ease-in-out infinite;
}
@keyframes ek-visit-pulse {
  50% {
    opacity: 0.25;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ek-visit-dot {
    animation: none;
  }
}
.ek-visit-live {
  min-height: 3em;
  color: var(--muted, inherit);
  overflow-wrap: anywhere;
}
.ek-visit-meds {
  margin: 12px 0;
}
.ek-visit-meds ul {
  margin: 6px 0;
  padding-left: 20px;
}
.ek-visit-differs {
  padding: 10px 12px;
  border: 1px solid #e0a63a;
  border-left-width: 4px;
  border-radius: 10px;
  background: #fff8ea;
}
.ek-visit-differs li {
  margin: 6px 0;
}
.ek-differs-line {
  display: block;
  overflow-wrap: anywhere;
}
.ek-differs-ask {
  font-style: italic;
}
@media (prefers-color-scheme: dark) {
  .ek-visit-differs {
    background: #3a2c10;
    border-color: #c98a1e;
  }
}
.ek-visit-label {
  display: block;
  margin-top: 12px;
}
.ek-visit-tasks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0;
}
.ek-visit-task {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}
.ek-visit-task input[type="date"] {
  width: 150px;
}
.ek-visit-task textarea {
  resize: none;
  overflow: hidden;
  line-height: 1.4;
}
.ek-visit-task .ek-visit-task-title {
  min-height: 40px;
}
.ek-visit-task .ek-visit-task-more {
  grid-column: 2 / -1;
  min-height: 32px;
  padding: 4px 10px;
  font-size: 13px;
  color: var(--sage);
}
@media (max-width: 520px) {
  .ek-visit-task {
    grid-template-columns: auto 1fr;
  }
  .ek-visit-task input[type="date"] {
    grid-column: 2;
    width: 100%;
  }
}
.ek-visit-warn {
  font-weight: 600;
}

/* Completed-on dates: as wide as a date, not the whole form */
#ekAppointmentDoneOn,
#ekEditTaskDone {
  width: auto;
  max-width: 11rem;
  display: block;
}

/* ---------- Bulk document upload ---------- */
.ek-bulk-zone {
  border: 2px dashed var(--line);
  border-radius: var(--r-surface);
  padding: 18px;
  text-align: center;
}
.ek-bulk-zone.over {
  border-color: var(--brand-rose, #c9306b);
  background: var(--mist);
}
.ek-bulk-zone .actions {
  justify-content: center;
}
.ek-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}
.ek-bulk-bar p {
  margin: 0;
  font-weight: 600;
}
.ek-bulk-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.ek-bulk-item {
  border: 1px solid var(--line);
  border-radius: var(--r-surface);
  padding: 10px 14px;
}
.ek-bulk-item summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex-wrap: wrap;
}
.ek-bulk-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.ek-bulk-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  background: var(--mist);
}
.ek-bulk-icon.ready {
  color: #1d7a3a;
}
.ek-bulk-icon.check,
.ek-bulk-icon.failed {
  color: #b42318;
}
.ek-bulk-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px 14px;
  margin-top: 10px;
}

/* ---------- Feedback: top-bar button and enhancement log ---------- */
.ek-feedback-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 12px;
  border: 1.5px solid var(--brand-rose, #c9306b);
  border-radius: 999px;
  background: transparent;
  color: var(--brand-rose, #c9306b);
  font: 600 13px/1 var(--font);
  cursor: pointer;
  white-space: nowrap;
}
.ek-feedback-pill:hover,
.ek-feedback-pill:focus-visible {
  background: var(--brand-rose, #c9306b);
  color: #fff;
}
.ek-feedback-pill .ek-icon {
  width: 16px;
  height: 16px;
}
/* Phones: a filled round button, so it stays noticeable without the word. */
@media (max-width: 430px) {
  .ek-feedback-pill span {
    display: none;
  }
  .ek-feedback-pill {
    width: 34px;
    padding: 0;
    justify-content: center;
  }
}
.ek-feedback-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: end;
}
.ek-feedback-meta label {
  flex: 0 1 auto;
  margin: 0;
}
.ek-feedback-meta select,
.ek-feedback-meta input {
  width: 100%;
}
.ek-feedback-meta .w-type {
  width: 8.5rem;
}
.ek-feedback-meta .w-priority {
  width: 7.5rem;
}
.ek-feedback-meta .w-status {
  width: 10.5rem;
}
.ek-feedback-meta .w-area {
  width: 11rem;
}
.ek-feedback-meta .w-person {
  width: 13rem;
}
@media (max-width: 520px) {
  .ek-feedback-meta .w-person,
  .ek-feedback-meta .w-area {
    width: 100%;
  }
}
.ek-feedback-filter {
  display: inline-flex;
  gap: 4px;
  margin: 4px 0 12px;
  padding: 3px;
  border-radius: 999px;
  background: var(--mist);
}
.ek-feedback-filter button {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 999px;
  font: 600 13px/1 var(--font);
  color: inherit;
  cursor: pointer;
}
.ek-feedback-filter button[aria-pressed="true"] {
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.ek-feedback-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: 8px;
  vertical-align: middle;
}
.ek-chip-mini {
  font: 600 11px/1 var(--font);
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--mist);
  color: var(--muted, #6e5258);
}
.ek-chip-mini.prio-high,
.ek-chip-mini.prio-urgent {
  background: #fbe3e6;
  color: #9b1c31;
}
.ek-chip-mini.prio-low {
  background: #eef1f4;
  color: #4b5563;
}

/* ---------- Field widths follow the content they hold ----------
   Every field is as wide as what goes in it, not the whole form: a date is a date wide, a
   dropdown fits its choices, a quantity fits a few digits. Long free text (titles, notes) keeps
   the full width, up to a readable line. Rules use :where() so they stay as weak as the base
   `input { width: 100% }` and any screen-specific layout above still wins.
   Building a new field: give text inputs a maxlength that matches the expected content
   (6 / 30 / 40 / 80 / 120 / 160+); the width follows it. See README "Building forms". */
input:where([type="date"]) {
  width: 11rem;
  max-width: 100%;
}
input:where([type="time"]) {
  width: 8.5rem;
  max-width: 100%;
}
input:where([type="datetime-local"]) {
  width: 15rem;
  max-width: 100%;
}
input:where([type="number"]) {
  width: 8rem;
  max-width: 100%;
}
input:where([data-money]) {
  width: 10rem;
  max-width: 100%;
}
input:where([type="tel"]) {
  width: 13rem;
  max-width: 100%;
}
input:where([type="email"], [type="password"]) {
  width: 22rem;
  max-width: 100%;
}
input:where([type="url"]) {
  width: 34rem;
  max-width: 100%;
}
input:where([type="file"]) {
  width: 18rem; /* the button plus a short file name */
  max-width: 100%;
}
select:where(:not([multiple])) {
  width: auto;
  min-width: min(9rem, 100%);
  max-width: 100%;
}
/* Text by expected length (maxlength). */
input:where(:not([type]), [type="text"], [type="search"]) {
  max-width: 40rem;
}
input:where([maxlength="1"], [maxlength="2"], [maxlength="3"], [maxlength="4"], [maxlength="5"], [maxlength="6"], [maxlength="8"], [maxlength="10"]) {
  width: 7rem;
}
input:where([maxlength="20"], [maxlength="24"], [maxlength="30"]) {
  width: 11rem;
}
input:where([maxlength="40"], [maxlength="50"]) {
  width: 17rem;
}
input:where([maxlength="60"], [maxlength="80"]) {
  width: 22rem;
}
input:where([maxlength="100"], [maxlength="120"]) {
  width: 26rem;
}
input:where([maxlength]) {
  max-width: 100%;
}
textarea {
  max-width: 48rem;
}
/* Fieldsets otherwise grow to their widest field and push past the card on phones. */
fieldset {
  min-width: 0;
}
/* Grid cells may shrink below a field's set width (the field then fills the cell). */
:where(fieldset, .two, .grid, .ek-form-grid, .ek-split-boxes, .ek-bulk-fields) > * {
  min-width: 0;
}
/* A row of fields at their natural widths, wrapping on narrow screens. */
.ek-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  align-items: end;
}
.ek-row > label {
  flex: 0 1 auto;
  min-width: 0;
}
.ek-row-part:not([hidden]) {
  display: contents;
}
/* Scan a paper: a plain text-style button ("Use a different photo") */
.ek-link-button {
  display: block;
  margin: -8px auto 14px;
  border: 0;
  background: none;
  color: var(--brand-rose, #c9306b);
  font: 600 14px/1.4 var(--font);
  text-decoration: underline;
  cursor: pointer;
}
@media (max-width: 560px) {
  .ek-scan-preview {
    max-height: 240px;
  }
}
/* Scan a paper: the chosen photos as tiles, with "Add another photo" */
.ek-scan-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 0 0 14px;
}
.ek-scan-thumb {
  position: relative;
  width: 132px;
  height: 160px;
  border-radius: var(--r-control);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--mist);
}
.ek-scan-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ek-scan-thumb button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: rgba(30, 20, 22, 0.75);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.ek-scan-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px dashed var(--brand-rose, #c9306b);
  color: var(--brand-rose, #c9306b);
  font: 600 14px/1.3 var(--font);
  text-align: center;
  padding: 10px;
  cursor: pointer;
}
.ek-scan-add .ek-icon {
  width: 26px;
  height: 26px;
}
@media (max-width: 560px) {
  .ek-scan-thumb {
    width: 92px;
    height: 116px;
  }
  .ek-scan-add {
    font-size: 12px;
  }
}

/* ---------- Add menu: one place to add anything ---------- */
/* Just a round "+" (the word "Add" was redundant); its name for screen readers is "Add something". */
.ek-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
}
.ek-add-button .ek-icon {
  width: 18px;
  height: 18px;
}
@media (max-width: 430px) {
  .ek-add-button {
    width: 34px;
    padding: 0;
    justify-content: center;
  }
  .ek-add-button span {
    display: none;
  }
}
.ek-add-dialog {
  width: min(560px, calc(100vw - 24px));
  padding: 20px;
}
.ek-add-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ek-add-head h2 {
  margin: 0;
}
.ek-add-group {
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--sage);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ek-add-list {
  display: grid;
  gap: 8px;
}
.ek-add-list button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.ek-add-list button:hover,
.ek-add-grid button:hover {
  border-color: var(--pine);
}
.ek-add-list strong {
  display: block;
  font-size: 15px;
}
.ek-add-list small {
  display: block;
  color: var(--sage);
  font-size: 13px;
  margin-top: 2px;
}
.ek-add-list .ek-icon,
.ek-add-grid .ek-icon {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--pine);
}
/* Three across on computers, two on phones; each label stays on one line. */
.ek-add-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 520px) {
  .ek-add-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.ek-add-grid button {
  min-width: 0;
  white-space: nowrap;
  font-size: 15px;
  display: flex;
  justify-content: flex-start;
  text-align: left;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

/* Settings & more: the page list is only for phones (the sidebar has these on bigger screens). */
@media (min-width: 901px) {
  .ek-phone-only {
    display: none !important;
  }
}
.ek-menu-pages .ekMenuList + .ekMenuList {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
@media (min-width: 901px) {
  .ek-menu-pages .ekMenuList + .ekMenuList {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
  }
}

/* The pilot note appears once: in the sidebar on bigger screens, at the end of Settings & more on
   phones, not under every page. */
body:not([data-page="menu"]) .ek-footnotes {
  display: none;
}
@media (min-width: 901px) {
  .ek-footnotes {
    display: none;
  }
  /* The sidebar shows where you are, so the Back bar is for phones. */
  #ekBackBar {
    display: none !important;
  }
}

/* ---------- Ask Parvin (Today) ---------- */
.ek-today-tabs {
  margin-bottom: 14px;
}
.ek-today-tabs button {
  padding: 7px 14px;
  font-weight: 600;
}
/* View-only members can't add things, so they only see Ask. */
body:not([data-can~="work"]) #ekTodayAsk {
  display: block !important;
}
.ek-ask .ek-today-note-row input {
  flex: 1;
  min-width: 0;
  max-width: none;
  width: auto;
}
.ek-ask-ideas {
  margin-top: 10px;
}
.ek-ask-answer {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--pine-soft);
}
.ek-ask-answer p {
  margin: 0;
}
.ek-ask-text {
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
}
.ek-ask-text.is-unsure {
  color: var(--sage);
}
.ek-ask-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
}
.ek-ask-source {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 13px;
}
.ek-ask-next {
  margin-top: 10px !important;
  font-weight: 600;
}
.ek-ask-note {
  margin-top: 10px !important;
  font-size: 12px;
}

/* Settings → Your account → Your name */
.ek-myname {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 12px;
  margin-bottom: 14px;
}
.ek-myname label {
  margin: 0;
}
.ek-myname .muted {
  flex-basis: 100%;
  margin: 0;
}

/* ---------- Doctor visit prep (appointment details) ---------- */
.ek-prep:not(:empty) {
  margin: 16px 0;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--pine-soft);
}
.ek-prep h3 {
  margin: 0 0 6px;
}
.ek-prep h4 {
  margin: 14px 0 4px;
  font-size: 15px;
}
.ek-prep ul {
  margin: 0;
  padding-left: 20px;
}
.ek-prep li {
  margin: 3px 0;
}
.ek-prep-purpose {
  font-size: 16px;
  margin: 0;
}

/* ---------- Weekly family digest (Today → This week) ---------- */
.ek-digest .ek-list-head .muted {
  font-size: 13px;
}
/* The summary itself (assets/digest-view.js): headline banner, tinted sections, thank-you chips. */
.ek-dg {
  display: grid;
  gap: 10px;
}
.ek-dg-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--pine);
}
.ek-dg-headline {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--pine-soft);
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.35;
}
.ek-dg-sec {
  padding: 10px 12px 10px 14px;
  border-radius: 12px;
  border-left: 4px solid var(--dg-line, var(--line-strong));
  background: var(--dg-bg, var(--mist));
}
.ek-dg-leaf {
  --dg-bg: var(--leaf-soft);
  --dg-line: var(--leaf);
}
.ek-dg-sky {
  --dg-bg: var(--sky-soft);
  --dg-line: var(--sky);
}
.ek-dg-marigold {
  --dg-bg: var(--marigold-soft);
  --dg-line: #d9a03a;
}
.ek-dg-rose {
  --dg-bg: var(--rose-soft);
  --dg-line: var(--rose);
}
.ek-dg-thanks {
  --dg-bg: #fff4dc;
  --dg-line: #e8b84a;
}
.ek-dg-sec h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.ek-dg-icon {
  font-size: 15px;
  line-height: 1;
}
svg.ek-dg-icon {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}
.ek-dg-count {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--sage);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.ek-dg-sec ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 5px;
}
.ek-dg-sec li {
  position: relative;
  padding-left: 14px;
  font-size: 14px;
  line-height: 1.4;
}
.ek-dg-sec li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--dg-line, var(--sage));
}
.ek-dg-helpers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ek-dg-helper {
  padding: 5px 10px;
  border-radius: 10px;
  background: var(--paper);
  font-size: 13px;
  line-height: 1.35;
}
/* A summary posted in Family updates gets the full width of the message. */
.ek-msg-main > .ek-dg {
  margin: 4px 0 2px;
  max-width: 560px;
}

/* Family updates: a message that reads like a to-do suggests making it a task. */
.ek-msg-suggest {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 3px 12px;
  border: 1px solid var(--pine);
  /* Rounded, not a pill: on a narrow phone the words can wrap to a second line. */
  border-radius: 16px;
  background: var(--paper);
  color: var(--pine);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.ek-msg-suggest:hover {
  background: var(--pine-soft);
}
.ek-msg-made {
  font-size: 13px;
  color: var(--leaf);
  font-weight: 600;
}

/* Language picker (sign-in screen and Settings) */
.ek-lang-pick select {
  width: 11rem;
  margin-top: 4px;
}
.ek-auth-form .ek-lang-pick {
  margin-top: 12px;
  font-size: 14px;
}
/* Medications → Plan a refill → Draft a refill request */
.ek-refill-draft:not(:empty) {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--pine-soft);
}
.ek-refill-draft h3 {
  margin: 0 0 8px;
}
.ek-refill-text {
  width: 100%;
  max-width: 40rem;
  font: inherit;
}
.ek-refill-script pre {
  white-space: pre-wrap;
  font: inherit;
  margin: 6px 0 0;
}

/* Set up from a form (assets/setup-form.js): each field sized to what goes in it */
.ek-setup-drop {
  margin: 8px 0 4px;
}
.ek-setup-why {
  margin: -4px 0 8px;
  font-size: 14px;
}
.ek-setup-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: flex-end;
}
.ek-setup-fields > label {
  margin: 0;
  flex: 0 1 auto;
}
.ek-setup-fields input,
.ek-setup-fields select,
.ek-setup-fields textarea {
  width: 100%;
}
.ek-setup-wide {
  flex-basis: 100% !important;
}
.ek-setup-name {
  width: 15rem;
  max-width: 100%;
}
.ek-setup-email {
  width: 16rem;
  max-width: 100%;
}
.ek-setup-short {
  width: 11rem;
}
.ek-setup-phone {
  width: 9.5rem;
}
.ek-setup-date {
  width: 10rem;
}
.ek-setup-time {
  width: 7.5rem;
}
.ek-setup-num {
  width: 7rem;
}
.ek-setup-invite {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line, #eadfe2);
}
.ek-setup-invite .actions {
  margin: 0;
}
#ekSetupResults .ek-hicon {
  margin-right: 0.45em;
}
/* Line icon before page titles and section headings (assets/heading-icons.js):
   the same icon set as the menu, sized to the heading's text. */
.ek-hicon {
  display: inline-block;
  margin-right: 0.45em;
  font-style: normal;
  font-weight: normal;
  line-height: 1;
}
svg.ek-hicon {
  width: 1em;
  height: 1em;
  vertical-align: -0.14em;
  color: var(--pine);
  stroke-width: 2;
}

/* Help (assets/help.js): "?" in the top bar and the how-to box */
.ek-help-button span {
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
}
.ek-help-dialog {
  width: min(520px, calc(100vw - 24px));
  max-height: min(86vh, 760px);
  padding: 20px;
}
.ek-help-form {
  display: flex;
  gap: 8px;
  margin: 12px 0 4px;
}
.ek-help-form input {
  flex: 1;
  min-width: 0;
}
.ek-help-form button {
  flex: none;
}
.ek-help-heading {
  margin: 10px 0 6px;
  font-weight: 700;
  font-size: 14px;
  color: var(--sage);
}
.ek-help-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ek-help-topic {
  border: 1px solid var(--line, #eadfe2);
  border-radius: 12px;
  padding: 10px 14px;
  background: #fff;
}
.ek-help-topic summary {
  cursor: pointer;
  font-weight: 600;
}
.ek-help-topic ol {
  margin: 8px 0;
  padding-left: 20px;
}
.ek-help-topic li {
  margin: 4px 0;
}
.ek-help-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ek-help-rate {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}
.ek-help-thumb {
  border: 1px solid var(--line, #eadfe2);
  background: #fff;
  border-radius: 999px;
  min-width: 40px;
  min-height: 36px;
  font-size: 16px;
  cursor: pointer;
}
.ek-help-foot {
  margin: 12px 0 0;
  font-size: 13px;
}
.ek-help-feedback {
  margin-top: 8px;
}
/* Phones: Feedback moves into Help (?) so the care circle name has room. */
@media (max-width: 480px) {
  #ekFeedbackButton {
    display: none;
  }
}
@media (min-width: 481px) {
  .ek-help-feedback {
    display: none;
  }
}

/* ---------- Expenses: deductible and prescription costs ---------- */
.ek-ded,
.ek-rx {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.ek-ded h2,
.ek-rx h2 {
  font-size: 18px;
  margin: 0 0 4px;
}
.ek-ded-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.ek-ded-meter {
  margin: 12px 0;
  max-width: 40rem;
}
.ek-ded-meter p {
  margin: 0 0 6px;
}
.ek-ded-bar {
  height: 12px;
  border-radius: 6px;
  background: var(--line);
  overflow: hidden;
}
.ek-ded-bar span {
  display: block;
  height: 100%;
  background: var(--pine);
  border-radius: 6px;
}
.ek-ded-meter.is-met .ek-ded-bar span {
  background: var(--leaf);
}
.ek-rx-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: 12px;
  margin-top: 12px;
}
.ek-rx-card {
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  padding: 12px 14px;
  background: var(--paper);
}
.ek-rx-card h3 {
  font-size: 16px;
  margin: 0 0 4px;
}
.ek-rx-card p {
  margin: 4px 0;
}
.ek-rx-flag {
  color: var(--marigold);
  background: var(--marigold-soft);
  border-radius: 8px;
  padding: 6px 8px;
}
.ek-rx-down {
  color: var(--leaf);
}
.ek-rx-compare a {
  color: var(--pine-deep);
}
.ek-rx-note {
  font-size: 14px;
  color: var(--sage);
  margin: 8px 0 0;
}
.ek-plan-read {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin: 8px 0 4px;
}
.ek-plan-read label {
  margin: 0;
  /* A long document name mustn't push the dropdown past the card on a phone. */
  min-width: 0;
  max-width: 100%;
}
.ek-plan-read-status {
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--sky-soft);
  color: var(--ink);
}
.ek-plan-read-status.is-warning {
  background: var(--marigold-soft);
  color: var(--marigold);
}
.ek-ded-details {
  margin: 8px 0 0;
  padding-left: 18px;
}
.ek-ded-details li {
  margin: 2px 0;
}

/* ---------- Medications drawn as prescription bottles ----------
   Small amber bottles, three to a row on a phone: a ridged child-proof cap, a body whose dark
   amber level is the supply left, and a white pharmacy label with the name, strength and days
   left. Tap a bottle for details; Refill sits underneath. */
#cloudMedList:has(.ek-bottle) {
  grid-template-columns: repeat(auto-fill, minmax(min(30%, 112px), 1fr));
  gap: 18px 12px;
  align-items: start;
}
.ekMedRow.ek-bottle {
  border: 0;
  padding: 0;
  gap: 0;
  background: none;
  width: 100%;
  max-width: 150px;
  justify-self: center;
}
/* A white push-and-turn cap, a little wider than the vial, with fine grip ridges, a shine
   across the top and a lip that casts a shadow onto the amber below. */
.ek-bottle-cap {
  position: relative;
  z-index: 2;
  height: 24px;
  margin: 0 3%;
  border: 1px solid #cdc4bf;
  border-radius: 7px 7px 4px 4px;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.95) 0 3px, transparent 7px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.1), transparent 14% 78%, rgba(0, 0, 0, 0.14)),
    repeating-linear-gradient(90deg, #fdfcfb 0 3px, #e9e3df 3px 4px);
  box-shadow:
    0 -1px 0 #fff inset,
    0 -4px 0 #ece6e2 inset,
    0 3px 3px -1px rgba(60, 30, 10, 0.35);
}
/* The vial: see-through amber plastic. The pills inside fill it to the supply left (::before),
   and a glossy, rounded shine sits on top of everything but the label (::after). */
.ek-bottle-body {
  position: relative;
  aspect-ratio: 0.6;
  display: flex;
  align-items: center;
  margin: 0 6%;
  border: 1px solid rgba(140, 70, 10, 0.55);
  border-top: 0;
  border-radius: 4px 4px 14px 14px / 4px 4px 10px 10px;
  padding: 0 7%;
  cursor: pointer;
  overflow: hidden;
  /* Empty amber plastic: light, a little deeper at the edges where you look through more of it. */
  background:
    linear-gradient(90deg, rgba(150, 70, 0, 0.28), transparent 22% 76%, rgba(120, 55, 0, 0.36)),
    linear-gradient(to bottom, #e6a85c, #f2c690 14%, #f0c086);
  box-shadow: 0 6px 8px -6px rgba(60, 30, 10, 0.45);
  transition: transform 0.12s;
}
.ek-bottle-body::before {
  /* The pills, seen through amber. */
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: calc(var(--level, 0) * 100%);
  background-color: #b0600f;
  /* Two loose layers of tablets and capsules at different spacings, so they don't line up. */
  background-image:
    radial-gradient(ellipse 9px 4px at 28% 30%, rgba(240, 192, 128, 0.95) 58%, rgba(240, 192, 128, 0) 72%),
    radial-gradient(ellipse 4.5px 8px at 76% 66%, rgba(226, 170, 100, 0.9) 58%, rgba(226, 170, 100, 0) 72%),
    radial-gradient(circle 4.5px at 52% 70%, rgba(236, 184, 116, 0.85) 58%, rgba(236, 184, 116, 0) 74%),
    radial-gradient(ellipse 8px 4px at 20% 82%, rgba(214, 152, 84, 0.85) 58%, rgba(214, 152, 84, 0) 72%);
  background-size: 27px 21px, 27px 21px, 37px 29px, 37px 29px;
  background-position: 0 0, 0 0, 9px 5px, 9px 5px;
  box-shadow: inset 0 8px 10px -6px rgba(255, 210, 150, 0.35);
  border-top: 1px solid rgba(255, 220, 170, 0.6);
}
.ek-bottle-body::after {
  /* Rounded plastic: a bright streak on the left, a soft one on the right, darker edges, and
     the thick ring at the neck under the cap. */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(110, 50, 0, 0.45) 0 5px, rgba(255, 230, 190, 0.5) 5px 7px, transparent 7px),
    linear-gradient(
      90deg,
      rgba(90, 40, 0, 0.3) 0,
      transparent 6%,
      rgba(255, 255, 255, 0.5) 10%,
      rgba(255, 255, 255, 0.18) 16%,
      transparent 24% 80%,
      rgba(255, 255, 255, 0.22) 86%,
      transparent 90%,
      rgba(90, 40, 0, 0.35) 100%
    );
}
.ek-bottle-body:hover {
  transform: translateY(-2px);
}
.ek-bottle-body:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.ek-bottle.is-low .ek-bottle-body {
  border-color: var(--rose);
  box-shadow: 0 0 0 2px var(--rose-soft);
}
.ek-bottle-label {
  position: relative;
  z-index: 1;
  width: 100%;
  background: var(--paper);
  border-radius: 4px;
  padding: 10px 6px 7px;
  box-shadow: 0 1px 2px rgba(30, 20, 22, 0.2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
/* The label wraps around the vial: its sides fall away into shadow, and a pharmacy barcode
   runs along the bottom. */
.ek-bottle-label {
  margin: 0 -7%;
  width: calc(100% + 14%);
  border-radius: 2px;
  padding: 10px 10% 16px;
  background:
    linear-gradient(90deg, rgba(60, 40, 30, 0.16), transparent 9% 91%, rgba(60, 40, 30, 0.2)),
    repeating-linear-gradient(90deg, #4a3a36 0 1px, transparent 1px 3px, #4a3a36 3px 5px, transparent 5px 6px, #4a3a36 6px 7px, transparent 7px 10px)
      bottom 5px left 10% / 46% 6px no-repeat,
    #fffdfa;
  box-shadow: 0 1px 2px rgba(60, 30, 10, 0.3);
}
.ek-bottle-label::before {
  /* The pharmacy's coloured stripe across the top of the label. */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-radius: 4px 4px 0 0;
  background: var(--pine);
}
.ek-bottle-rx {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 11px;
  color: var(--pine-deep);
  line-height: 1;
}
.ek-bottle .ekMedHeading {
  gap: 4px;
  align-items: flex-start;
}
.ek-bottle .ekMedHeading strong {
  font-size: 13px;
  line-height: 1.15;
  min-width: 0;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}
.ek-bottle.is-long-name .ekMedHeading strong {
  font-size: 11.5px;
}
.ek-bottle .ekMedStatus {
  position: absolute;
  top: 7px;
  right: 4px;
  flex: none;
  min-height: 0;
  padding: 0 2px;
  font-size: 9px;
  line-height: 1.4;
  border: 0;
  background: none;
}
.ek-bottle .ekMedStatus.ekInactive {
  font-size: 10px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--line);
  color: var(--sage);
}
.ek-bottle-strength {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
}
.ek-bottle-days {
  font-size: 11px;
  font-weight: 600;
  color: var(--leaf);
}
.ek-bottle.is-low .ek-bottle-days {
  color: var(--rose);
}
/* The long supply sentence, bar and counts: read by screen readers, shown by the amber level. */
.ek-bottle .ekMedSupply,
.ek-bottle .ekMedGauge,
.ek-bottle .ekMedGaugeScale {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.ek-bottle .ek-example-pill {
  display: block;
  width: fit-content;
  margin-top: 2px;
  font-size: 9px;
  padding: 0 5px;
}
.ek-bottle .ekMedActions {
  margin-top: 8px;
  flex-direction: column;
  gap: 4px;
}
.ek-bottle .ekMedActions button {
  min-height: 34px;
  padding: 4px 6px;
  font-size: 13px;
}
.ek-bottle .ekMedActions button.secondary {
  min-height: 26px;
  border: 0;
  background: none;
  text-decoration: underline;
  font-size: 12px;
}
.ek-bottle.is-inactive .ek-bottle-cap,
.ek-bottle.is-inactive .ek-bottle-body {
  filter: grayscale(0.85);
  opacity: 0.75;
}

/* ---------- Expenses: money module (tiles, attention, tabs, donut, bills, reports) ---------- */
.ek-money-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ek-bill-read {
  margin: 4px 0 12px;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-control);
  background: var(--mist);
}
.ek-bill-read label {
  margin: 0;
}
.ek-money-more {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  padding: 8px 12px;
}
.ek-money-more summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--pine-deep);
  min-height: 32px;
  display: flex;
  align-items: center;
}
.ek-money-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
  gap: 10px;
  margin: 4px 0 14px;
}
.ek-money-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--mist);
  color: var(--ink);
  font: inherit;
  min-height: 0;
}
button.ek-money-tile {
  cursor: pointer;
}
button.ek-money-tile:hover,
button.ek-money-tile:focus-visible {
  border-color: var(--pine);
  background: var(--pine-soft);
}
.ek-money-tile strong {
  font-size: 24px;
  line-height: 1.2;
}
/* Next year's forecast: the last column of the row, whatever else is showing. */
.ek-money-tile-last {
  grid-column-end: -1;
}
.ek-money-tile-label {
  font-size: 13px;
  color: var(--sage);
  font-weight: 600;
}
.ek-money-tile-note {
  font-size: 13px;
  color: var(--sage);
}
.ek-money-attention {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: var(--r-control);
  background: var(--paper);
  border: 1px solid var(--line);
}
.ek-money-attention h2 {
  font-size: 17px;
  margin: 0 0 6px;
}
.ek-money-attention ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ek-attn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.ek-attn:first-child {
  border-top: 0;
}
.ek-attn-icon {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
}
.ek-attn-serious .ek-attn-icon {
  background: var(--rose-soft);
  color: var(--rose);
}
.ek-attn-warning .ek-attn-icon {
  background: var(--marigold-soft);
  color: var(--marigold);
}
.ek-attn-text {
  flex: 1;
  min-width: 0;
}
.ek-attn button {
  flex: none;
  min-height: 36px;
  padding: 6px 14px;
}
.ek-money-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin: 4px 0 14px;
  scrollbar-width: none;
}
.ek-money-tabs button {
  flex: none;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 10px 12px;
  min-height: 44px;
  font: inherit;
  font-weight: 600;
  color: var(--sage);
  cursor: pointer;
}
.ek-money-tabs button[aria-selected="true"] {
  color: var(--pine-deep);
  border-bottom-color: var(--pine);
}
.ek-money-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 10px;
}
.ek-money-section-head h2,
.ek-money-section-head h3 {
  margin: 0;
  font-size: 18px;
}
.ek-money-section-head p {
  margin: 2px 0 0;
}
.ek-head-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.ek-seg {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
}
.ek-seg button {
  border: 0;
  border-radius: 0;
  background: var(--paper);
  padding: 6px 12px;
  min-height: 36px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.ek-seg button[aria-pressed="true"] {
  background: var(--pine);
  color: #fff;
}
.ek-donut-wrap {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}
.ek-donut-figure {
  position: relative;
  width: 200px;
  height: 200px;
  flex: none;
}
.ek-donut {
  width: 200px;
  height: 200px;
  display: block;
}
.ek-donut-arc {
  cursor: pointer;
  transition: stroke-width 0.12s;
}
.ek-donut-arc:hover,
.ek-donut-arc:focus {
  stroke-width: 36;
  outline: none;
}
.ek-donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
}
.ek-donut-center span {
  font-size: 13px;
  color: var(--sage);
}
.ek-donut-center strong {
  font-size: 22px;
}
.ek-chart-tip {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  background: var(--brand-dark);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(30, 20, 22, 0.25);
}
/* On the dark tooltip the usual muted colour is too faint to read. */
.ek-chart-tip .ek-tip-muted {
  color: rgba(255, 255, 255, 0.72);
}
.ek-donut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-width: min(100%, 16rem);
}
.ek-donut-legend button {
  width: 100%;
  display: grid;
  grid-template-columns: 14px 1fr auto 3.5rem;
  gap: 10px;
  align-items: center;
  padding: 8px 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
  font: inherit;
  text-align: left;
  min-height: 40px;
  cursor: pointer;
}
.ek-donut-legend button:hover {
  background: var(--mist);
}
.ek-donut-val {
  font-weight: 600;
}
.ek-donut-pct {
  color: var(--sage);
  text-align: right;
}
.ek-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
}
.ek-money-recent {
  margin-top: 18px;
}
/* Expenses → Overview → Latest: one collapsed line per expense, open for the full row. */
.ek-latest-item {
  border-bottom: 1px solid var(--line);
}
.ek-latest-item > summary {
  list-style: none;
  display: grid;
  grid-template-columns: 14px 1fr auto auto 18px;
  gap: 12px;
  align-items: center;
  padding: 10px 4px;
  min-height: 48px;
  cursor: pointer;
}
.ek-latest-item > summary::-webkit-details-marker {
  display: none;
}
.ek-latest-item > summary:hover {
  background: var(--mist);
}
.ek-latest-what {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ek-latest-what strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ek-latest-when {
  font-size: 13px;
  color: var(--sage);
}
.ek-latest-amount {
  text-align: right;
}
.ek-latest-chevron {
  width: 18px;
  height: 18px;
  color: var(--sage);
  transition: transform 0.15s;
}
.ek-latest-item[open] .ek-latest-chevron {
  transform: rotate(90deg);
}
.ek-latest-item > .ek-bill {
  padding: 4px 4px 12px 30px;
  border-bottom: 0;
}
.ek-latest-item > .ek-bill > .ek-bill-swatch,
.ek-latest-item .ek-bill-title,
.ek-latest-item .ek-bill-amount,
.ek-latest-item .ek-bill-side .ek-status {
  display: none;
}
.ek-latest-item > .ek-bill {
  grid-template-columns: 1fr auto;
}
@media (max-width: 560px) {
  .ek-latest-item > summary {
    grid-template-columns: 14px 1fr auto 18px;
  }
  .ek-latest-item > summary .ek-status {
    display: none;
  }
}
.ek-bill-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}
.ek-bill-filters input[type="search"] {
  width: 22rem;
}
.ek-chip-row,
.ek-select-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ek-bill-total {
  display: flex;
  gap: 6px;
  align-items: baseline;
  flex-wrap: wrap;
  margin: 4px 0 8px;
  color: var(--sage);
}
.ek-bill-total strong {
  color: var(--ink);
  font-size: 18px;
}
.ek-link {
  background: none;
  border: 0;
  padding: 0;
  min-height: 0;
  color: var(--pine-deep);
  text-decoration: underline;
  font: inherit;
  cursor: pointer;
}
.ek-bill {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.ek-bill-swatch {
  margin-top: 5px;
}
.ek-bill-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.ek-bill-title {
  overflow-wrap: anywhere;
}
.ek-bill-meta {
  font-size: 14px;
  color: var(--sage);
}
.ek-bill-flags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.ek-flag {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.ek-flag-serious {
  background: var(--rose-soft);
  color: var(--rose);
}
.ek-flag-info {
  background: var(--sky-soft);
  color: var(--sky);
}
.ek-bill-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.ek-bill-amount {
  font-size: 17px;
}
.ek-status {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--mist);
  color: var(--sage);
}
.ek-status-paid {
  background: var(--leaf-soft);
  color: var(--leaf);
}
.ek-status-overdue,
.ek-status-disputed {
  background: var(--rose-soft);
  color: var(--rose);
}
.ek-status-unpaid,
.ek-status-partially_paid,
.ek-status-pending {
  background: var(--marigold-soft);
  color: var(--marigold);
}
.ek-bill-side .ek-expense-edit {
  float: none;
  margin: 2px 0 0;
}
.ek-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 12px;
}
.ek-table th,
.ek-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
}
.ek-table th {
  font-size: 13px;
  color: var(--sage);
  font-weight: 600;
}
.ek-neg {
  color: var(--rose);
  font-weight: 600;
}
.ek-pos {
  color: var(--leaf);
  font-weight: 600;
}
.ek-good {
  color: var(--leaf);
  font-weight: 600;
}
.ek-settle {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.ek-settle li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.ek-money-accounts {
  margin-top: 16px;
}
.ek-account-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 10px;
}
.ek-account {
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  padding: 12px 14px;
}
.ek-account p {
  margin: 4px 0 8px;
}
.ek-account-actions {
  display: flex;
  gap: 14px;
  margin-top: 8px;
}
.ek-hbars {
  list-style: none;
  padding: 0;
  margin: 8px 0;
}
.ek-hbars button {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(6rem, 12rem) 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px 4px;
  border: 0;
  background: none;
  border-radius: 6px;
  font: inherit;
  text-align: left;
  min-height: 36px;
  cursor: pointer;
}
.ek-hbars button:hover,
.ek-hbars button:focus-visible {
  background: var(--mist);
}
.ek-hbar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ek-hbar-track {
  height: 14px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}
.ek-hbar-fill {
  display: block;
  height: 100%;
  background: var(--pine);
  border-radius: 0 4px 4px 0;
}
.ek-hbar-value {
  font-weight: 600;
  min-width: 5rem;
  text-align: right;
}
.ek-report-ask {
  padding: 12px 14px;
  border-radius: var(--r-control);
  background: var(--pine-soft);
  margin-bottom: 16px;
}
.ek-report-ask textarea {
  width: 100%;
  max-width: 40rem;
}
.ek-report-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.ek-report-card {
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--paper);
  font: inherit;
  cursor: pointer;
  min-height: 52px;
}
.ek-report-card:hover,
.ek-report-card:focus-visible {
  border-color: var(--pine);
  background: var(--pine-soft);
}
.ek-report-view {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
@media (max-width: 480px) {
  .ek-money-tiles {
    grid-template-columns: 1fr 1fr;
  }
  .ek-money-tile strong {
    font-size: 20px;
  }
  .ek-table {
    display: block;
    overflow-x: auto;
  }
  .ek-donut-wrap {
    justify-content: center;
  }
  .ek-hbars button {
    grid-template-columns: 1fr auto;
  }
  .ek-hbar-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

.ekMemberJoined {
  display: block;
  color: var(--sage);
  font-size: 13px;
}

/* ---------- Parvin, the care companion (replaces Pip) ---------- */
.ek-pip.ek-parvin {
  width: 88px;
  height: 88px;
}
.ek-parvin .parvin-ring {
  opacity: 0;
  transform-origin: 60px 60px;
}
.ek-parvin.is-talking .parvin-ring {
  animation: ek-parvin-talk 1.1s ease-in-out infinite;
}
@keyframes ek-parvin-talk {
  0%,
  100% {
    opacity: 0.15;
    transform: scale(0.96);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.03);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ek-parvin.is-talking .parvin-ring {
    animation: none;
    opacity: 0.45;
  }
}
.ek-parvin-plate {
  list-style: none;
  margin: 8px 0;
  padding: 0;
}
.ek-parvin-plate li {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 8px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.ek-parvin-plate small {
  color: var(--sage);
  white-space: nowrap;
}
.ek-parvin-ask {
  display: flex;
  gap: 8px;
  margin: 10px 0 4px;
}
.ek-parvin-ask input {
  flex: 1;
  min-width: 0;
  width: auto;
}
.ek-parvin-answer:empty {
  display: none;
}
.ek-wellness-choices {
  flex-wrap: wrap;
}
.ek-wellness-head {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.ek-wellness-head strong {
  font-size: 18px;
}
.ek-wellness-head > span {
  color: var(--sage);
}
.ek-wellness-trend {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 48px;
  margin-left: auto;
}
.ek-wellness-bar {
  width: 12px;
  border-radius: 4px 4px 0 0;
  background: var(--line-strong);
}
.ek-wellness-bar.is-now {
  background: var(--pine);
}
.ek-wellness-ideas {
  margin: 6px 0;
  padding-left: 18px;
}
.ek-wellness-ideas li {
  margin: 4px 0;
}
.ek-remove-row {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* Settings & more → Features: one row per optional part, with a switch. */
.ek-feature-list {
  display: grid;
  gap: 2px;
  margin: 12px 0 8px;
}
.ek-feature-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.ek-feature-row:last-child {
  border-bottom: 0;
}
.ek-feature-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.ek-feature-row small {
  color: var(--sage);
  font-weight: 400;
}
input.ek-switch {
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  flex: 0 0 auto;
  width: 46px;
  height: 28px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line-strong);
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}
input.ek-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
  transition: transform 0.15s;
}
input.ek-switch:checked {
  background: var(--pine);
}
input.ek-switch:checked::after {
  transform: translateX(18px);
}
input.ek-switch:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Containers left empty when features are off are hidden too (assets/features.js → tidy). */
.ek-tidy-hidden {
  display: none !important;
}
.ekDashboardColumns.ek-one-column {
  grid-template-columns: minmax(0, 1fr);
}

/* Settings & more → Arrange your screens */
.ek-arrange-title {
  margin: 16px 0 6px;
  font-size: 15px;
}
.ek-arrange-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 6px;
}
.ek-arrange-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
}
.ek-arrange-row > span {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}
.ek-arrange-row.is-dragging {
  border-color: var(--pine);
  box-shadow: 0 6px 18px rgb(30 20 22 / 0.18);
  position: relative;
  z-index: 1;
}
button.ek-arrange-handle {
  width: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sage);
  font-size: 22px;
  cursor: grab;
  touch-action: none;
}
.ek-arrange-row.is-dragging .ek-arrange-handle {
  cursor: grabbing;
}
button.ek-arrange-step {
  width: 40px;
  min-height: 40px;
  padding: 0;
  font-size: 13px;
}
button.ek-arrange-step:disabled {
  opacity: 0.35;
}
.ek-bottle .ekMedHeading {
  flex-wrap: wrap;
  padding-right: 8px;
}
.ek-bottle .ekMedStatus.ekInactive {
  position: static;
  order: -1;
}

/* Medicines page with many medicines: search, filters, sort, Shelf or List view (assets/meds-view.js). */
.ek-med-tools {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.ek-med-tools[hidden] {
  display: none;
}
.ek-med-tools-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ek-med-tools input[type="search"] {
  flex: 1 1 180px;
  margin: 0;
  min-height: 42px;
}
.ek-med-tools select {
  width: auto;
  margin: 0;
  min-height: 42px;
}
.ek-med-view {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
}
.ek-med-view button {
  min-height: 40px;
  padding: 6px 14px;
  border: 0;
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
}
.ek-med-view button[aria-pressed="true"] {
  background: var(--pine);
  color: #fff;
}
.ek-med-count {
  margin: 0;
  font-size: 14px;
}
.ek-med-empty {
  grid-column: 1 / -1;
  margin: 8px 0;
}
/* List view: one compact line per medicine, for families with dozens. */
#cloudMedList.is-list {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-surface);
  padding: 2px 12px;
}
#cloudMedList.is-list .ekMedRow.ek-bottle {
  max-width: none;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
#cloudMedList.is-list .ekMedRow.ek-bottle:last-child {
  border-bottom: 0;
}
#cloudMedList.is-list .ek-bottle-cap {
  display: none;
}
#cloudMedList.is-list .ek-bottle-body {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: visible;
  aspect-ratio: auto;
  padding: 0;
  border: 0;
  background: none;
  transform: none;
  box-shadow: none;
}
#cloudMedList.is-list .ek-bottle-label {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  grid-template-areas: "rx name days" "rx strength days";
  align-items: center;
  column-gap: 10px;
  row-gap: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  box-shadow: none;
  background: none;
}
#cloudMedList.is-list .ek-bottle-label::before,
#cloudMedList.is-list .ek-bottle-body::before,
#cloudMedList.is-list .ek-bottle-body::after {
  display: none;
}
/* A tiny amber bottle stands in for the Rx mark, filled to the supply left. */
#cloudMedList.is-list .ek-bottle-rx {
  grid-area: rx;
  width: 22px;
  height: 30px;
  border-radius: 4px 4px 6px 6px;
  border: 1px solid #a85f17;
  background: linear-gradient(to top, #c66f15 0 calc(var(--level, 0) * 100%), #f3cf9c calc(var(--level, 0) * 100%) 100%);
  color: transparent;
  overflow: hidden;
}
#cloudMedList.is-list .ek-bottle.is-low .ek-bottle-rx {
  border-color: var(--rose);
}
#cloudMedList.is-list .ekMedHeading {
  grid-area: name;
  padding: 0;
}
#cloudMedList.is-list .ekMedHeading strong,
#cloudMedList.is-list .ek-bottle.is-long-name .ekMedHeading strong {
  font-size: 15px;
}
#cloudMedList.is-list .ek-bottle .ekMedStatus {
  position: static;
}
#cloudMedList.is-list .ek-bottle-strength {
  grid-area: strength;
  font-weight: 400;
  color: var(--sage);
  font-size: 13px;
}
#cloudMedList.is-list .ek-bottle-days {
  grid-area: days;
  font-size: 13px;
  text-align: right;
}
#cloudMedList.is-list .ek-bottle .ekMedActions {
  margin: 0;
  flex-direction: row;
  flex: none;
}
#cloudMedList.is-list .ek-bottle .ekMedActions button.secondary {
  display: none;
}
#cloudMedList.is-list .ek-bottle .ekMedActions button {
  min-height: 34px;
  padding: 4px 12px;
}
#cloudMedList.is-list .ek-bottle .ekMedStatus.ekActive {
  display: none;
}
#cloudMedList.is-list .ek-bottle .ekMedHeading {
  justify-content: flex-start;
  gap: 2px 8px;
}
.ek-bottle.is-long-name .ekMedHeading strong {
  font-size: 11px;
}

/* Tutorials page, player and the "New to Parvin?" tip */
.ek-tut-groups {
  margin: 4px 0 18px;
}
.ek-tut-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 10px;
}
.ek-tut-group-head h2 {
  margin: 0;
  font-size: 18px;
}
.ek-tut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 12px;
}
button.ek-tut-card {
  display: flex;
  align-items: stretch;
  gap: 14px;
  width: 100%;
  padding: 10px;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-surface);
  color: var(--ink);
  font-weight: 400;
}
button.ek-tut-card:hover {
  border-color: var(--line-strong);
}
.ek-tut-thumb {
  position: relative;
  flex: 0 0 76px;
  height: 120px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--mist);
}
.ek-tut-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
.ek-tut-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgb(30 20 22 / 0.65);
  color: #fff;
  font-size: 13px;
  padding-left: 2px;
}
.ek-tut-len {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgb(30 20 22 / 0.7);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}
.ek-tut-text {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
}
.ek-tut-text small {
  color: var(--sage);
}
.ek-tut-seen {
  color: var(--leaf);
  font-size: 13px;
  font-weight: 600;
}
.ek-tut-dialog {
  width: min(440px, calc(100vw - 24px));
}
.ek-tut-video {
  display: block;
  width: 100%;
  max-height: min(70vh, 640px);
  aspect-ratio: 390 / 844;
  margin: 0 auto 10px;
  border-radius: 14px;
  background: var(--brand-dark);
  object-fit: contain;
}
.ek-tut-tip {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--pine-soft);
  border-color: transparent;
}
.ek-tut-tip > div {
  flex: 1;
}
.ek-tut-tip p {
  margin: 4px 0 10px;
}
.ek-tut-tip .actions {
  margin: 0;
}
.ek-tut-tip-icon {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--pine);
  color: #fff;
  padding-left: 3px;
}
.ek-help-videos {
  margin: 10px 0 0;
}
/* Prescription costs: one line per medicine, tap for details. */
.ek-rx-total {
  margin: 8px 0 0;
  font-weight: 600;
}
.ek-rx-list:has(.ek-rx-row) {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--paper);
  padding: 0 12px;
}
.ek-rx-row {
  border-bottom: 1px solid var(--line);
}
.ek-rx-row:last-child {
  border-bottom: 0;
}
.ek-rx-row summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 0;
  cursor: pointer;
  list-style: none;
}
.ek-rx-row summary::-webkit-details-marker {
  display: none;
}
.ek-rx-row summary::after {
  content: "›";
  color: var(--sage);
  font-size: 18px;
  transition: transform 0.15s;
}
.ek-rx-row[open] summary::after {
  transform: rotate(90deg);
}
.ek-rx-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}
.ek-rx-month {
  font-weight: 600;
  white-space: nowrap;
}
.ek-rx-up {
  font-size: 12px;
  font-weight: 700;
  color: var(--rose);
  white-space: nowrap;
}
.ek-rx-row > p,
.ek-rx-row > .ek-rx-compare,
.ek-rx-row > div {
  margin: 0 0 8px;
}
.ek-rx-row[open] {
  padding-bottom: 6px;
}

/* Parvin's week: real weather on top, busy dots below. */
.ek-pip-day-temp {
  display: grid;
  justify-items: center;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.ek-pip-day-temp b {
  font-size: 13px;
  color: var(--ink);
}
.ek-pip-day-temp small {
  font-size: 11px;
  color: var(--sage);
}
.ek-pip-days.has-weather {
  gap: 4px;
}
.ek-pip-days.has-weather .ek-pip-day {
  padding: 6px 0;
  min-width: 0;
}
.ek-pip-days.has-weather .ek-pip-day-name {
  font-size: 12px;
  white-space: nowrap;
}
.ek-pip-days.has-weather .ek-pip-day {
  background: var(--mist);
}
.ek-pip-busy {
  display: flex;
  gap: 2px;
  margin-top: 2px;
}
.ek-pip-busy i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-strong);
}
.ek-pip-busy i.on {
  background: var(--pine);
}
.ek-pip-week-key {
  margin: 2px 0 6px;
  font-size: 12px;
  color: var(--sage);
}

/* Everyone: several people cared for, on one page (everyone.js) */
.ek-every-legend { margin: 4px 0 12px; }
.ek-every-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line, #e6dde2); border-radius: 999px; font-weight: 600; }
.ek-who-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ek-every-body { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: start; }
.ek-every-card h2 { margin: 0 0 8px; font-size: 1.05rem; }
.ek-every-day { margin: 12px 0 4px; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted, #6b6066); }
.ek-every-row { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 9px 8px; border: 0; border-top: 1px solid var(--line, #eee5ea); background: none; color: inherit; font: inherit; cursor: pointer; border-radius: 8px; }
.ek-every-row:hover, .ek-every-row:focus-visible { background: var(--soft, #fbf3f6); }
.ek-every-who { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ek-every-what { display: grid; min-width: 0; }
.ek-every-what strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ek-every-row.is-late .ek-every-what small { color: #b3261e; }
.ek-bring { border: 1px solid var(--line, #e6dde2); border-radius: 10px; padding: 8px 12px; margin: 8px 0; }
.ek-bring legend { font-weight: 600; padding: 0 4px; }
.ek-bring p { margin: 2px 0 6px; font-size: .9rem; }
.ek-bring-list { display: grid; gap: 4px; max-height: 180px; overflow: auto; }
.ek-bring-list .ek-check-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; font-weight: 500; margin: 0; }
.ek-bring-list .ek-check-row span { display: grid; line-height: 1.25; }
.ek-bring-list .ek-check-row small { font-weight: 400; text-transform: capitalize; }
.ek-bring legend { max-width: 100%; }
@media (max-width: 520px) { .ek-every-row { grid-template-columns: 78px 1fr; } }

/* Quick setup (presets.js) */
.ek-preset-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin: 10px 0 6px; }
.ek-preset { display: grid; gap: 4px; align-content: start; text-align: left; padding: 12px 14px; border: 1.5px solid var(--line, #e6dde2); border-radius: 12px; background: var(--card, #fff); color: inherit; font: inherit; cursor: pointer; min-height: 88px; }
.ek-preset:hover, .ek-preset:focus-visible { border-color: var(--brand, #c9306b); }
.ek-preset strong { font-size: 1rem; }
.ek-preset span { font-size: .9rem; color: var(--muted, #6b6066); line-height: 1.35; }
.ek-preset.is-current { border-color: var(--brand, #c9306b); background: var(--soft, #fbf3f6); }
.ek-preset-tag { font-style: normal; font-size: .78rem; font-weight: 700; color: var(--brand, #c9306b); }
#ekPresetStatus .ek-link-button { background: none; border: 0; padding: 0; color: var(--brand, #c9306b); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
/* Suggestions as actions (actions.js) */
#ekAgentRecommendations { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
.ek-act { border: 1px solid var(--line, #e6dde2); border-radius: 12px; padding: 12px 14px; background: var(--card, #fff); display: grid; gap: 6px; }
.ek-act-head { display: flex; gap: 10px; align-items: flex-start; }
.ek-act-icon { font-size: 1.25rem; line-height: 1.4; flex: none; }
svg.ek-act-icon { width: 22px; height: 22px; margin-top: 2px; color: var(--pine); }
.ek-act h3 { margin: 0; font-size: 1rem; line-height: 1.35; }
.ek-act-what { margin: 0; color: var(--muted, #6b6066); font-size: .92rem; }
.ek-act-msg { margin: 2px 0; padding: 8px 10px; border-left: 3px solid var(--brand, #c9306b); background: var(--soft, #fbf3f6); border-radius: 0 8px 8px 0; font-size: .92rem; white-space: pre-wrap; }
.ek-act-why { margin: 0; font-size: .84rem; color: var(--muted, #6b6066); }
.ek-act-why span { font-weight: 600; }
.ek-act-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.ek-act-buttons button { min-height: 40px; }
.ek-act-buttons .ek-act-skip { margin: 0 0 0 auto; align-self: center; padding: 8px 4px !important; min-height: 0 !important; font-size: .92rem; }
.ek-act-edit { display: grid; gap: 6px; }
.ek-act-edit textarea { width: 100%; font: inherit; }
.ek-act-edit select { max-width: 100%; }
.ek-act-status { margin: 0; font-size: .9rem; color: var(--ok, #2e7d4f); font-weight: 600; }
.ek-act-status:empty { display: none; }
.ek-act.is-done { opacity: .85; }
.ek-act.is-compact { padding: 10px 12px; border-width: 1px; margin-top: 8px; }
.ek-act.is-compact .ek-act-buttons .secondary { display: none; }
#ekHomeAgentRecommendations .ek-act + .ek-act { margin-top: 8px; }

/* What Parvin remembers (memory.js) */
.ek-memory-list { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 4px; }
.ek-memory-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 4px 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line, #eee5ea); }
.ek-memory-row:first-child { border-top: 0; }
.ek-memory-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand, #c9306b); }
.ek-memory-src { font-size: .8rem; }
/* Each fact is one short line; tap it to read the whole thing (and where it came from). */
.ek-memory-line { grid-column: 2; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 0; margin: 0; padding: 4px 0; border: 0; background: none; box-shadow: none; color: inherit; font: inherit; font-weight: 500; text-align: left; cursor: pointer; }
.ek-memory-line::after { content: "›"; margin-left: auto; color: var(--brand, #c9306b); font-size: 18px; line-height: 1; transition: transform .15s; }
.ek-memory-row.is-open .ek-memory-line::after { transform: rotate(90deg); }
.ek-memory-short { min-width: 0; font-size: .95rem; line-height: 1.35; }
.ek-memory-line.is-whole::after { visibility: hidden; }
.ek-memory-more { grid-column: 2 / -1; padding: 0 0 6px; }
.ek-memory-more .ek-memory-text { margin: 0 0 2px; font-weight: 400; overflow-wrap: anywhere; }
.ek-memory-actions { grid-row: 1; grid-column: 3; display: flex; gap: 2px; }
.ek-memory-row .ek-memory-edit { grid-column: 1 / -1; width: 100%; }
.ek-memory-editbar { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.ek-memory-editbar button { width: auto; }
.ek-memory-add { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.ek-memory-add input { min-width: 0; }
.ek-memory-empty { padding: 4px 0; }

/* How will you help? (how-help.js) */
.ek-howhelp { max-width: 560px; }
.ek-howhelp-list { display: grid; gap: 8px; margin: 12px 0 8px; }
.ek-howhelp .ek-preset { min-height: 0; }
.ek-howhelp-foot { font-size: .88rem; margin: 4px 0 0; }
#ekHowHelpTitle:focus { outline: none; }

/* Text Parvin (text-parvin.js) */
.ek-textparvin-form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); align-items: end; }
.ek-textparvin-form input[type="tel"] { max-width: 220px; }
.ek-textparvin-code { display: grid; gap: 8px; grid-template-columns: minmax(0, 160px) auto; align-items: end; margin-top: 10px; }
.ek-textparvin-code input { letter-spacing: .2em; }
.ek-textparvin-linked { font-weight: 600; color: var(--ok, #2e7d4f); }
.ek-textparvin-number { font-weight: 700; }
.ek-textparvin-soon { padding: 8px 12px; border-radius: 10px; background: var(--soft, #fbf3f6); }
.ek-textparvin-examples { margin-top: 12px; display: grid; gap: 6px; justify-items: end; }
.ek-textparvin-ex-title { justify-self: start; margin: 0; font-weight: 600; font-size: .9rem; }
.ek-bubble { margin: 0; max-width: 85%; padding: 8px 12px; border-radius: 18px 18px 4px 18px; background: #2f7cf6; color: #fff; font-size: .92rem; line-height: 1.35; }

/* Setup help from Parvin (support-access.js) */
.ek-support-banner { margin: 0 0 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border: 1.5px solid #2f7cf6; background: #eef5ff; }
.ek-support-banner p { margin: 0; flex: 1 1 240px; }
.ek-support-icon { font-size: 1.4rem; }
.ek-support-points { margin: 8px 0 12px; padding-left: 1.2em; display: grid; gap: 4px; }
.ek-support-on { font-weight: 600; color: var(--ok, #2e7d4f); }

/* Your setup + Tell Parvin what to change (settings-chat.js) */
.ek-setup-card { border: 1.5px solid var(--brand, #c9306b); }
.ek-setup-card h2 { margin-top: 0; }
.ek-setup-summary { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 4px; color: var(--muted, #6b6066); font-size: .95rem; }
.ek-setup-summary li:first-child { color: var(--ink, #1e1416); font-weight: 600; }
.ek-setup-form label { display: block; font-weight: 700; margin-bottom: 6px; }
.ek-setup-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.ek-setup-row input { min-width: 0; font-size: 1rem; }
.ek-setup-try { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ek-setup-try .ek-chip { border: 1px solid var(--line, #e6dde2); background: var(--soft, #fbf3f6); color: var(--brand, #c9306b); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
.ek-setup-result { margin-top: 12px; }
.ek-setup-preview { border-radius: 12px; background: var(--soft, #fbf3f6); padding: 12px 14px; }
.ek-setup-lead { margin: 0 0 6px; font-weight: 600; }
.ek-setup-changes { margin: 0 0 10px; padding-left: 1.2em; display: grid; gap: 4px; }
.ek-setup-status { margin: 6px 0 0; font-weight: 600; color: var(--ok, #2e7d4f); }
/* "✓ Done. Undo" on one line (the link button is a centred block elsewhere); the padding only
   makes it easier to tap. */
.ek-setup-status .ek-link-button { display: inline; margin: 0; padding: 10px 4px; font-size: inherit; }
.ek-setup-status:empty { display: none; }
.ek-setup-question { font-weight: 600; }
.ek-all-settings { margin-top: 6px; }
.ek-all-settings > summary { cursor: pointer; list-style: none; display: grid; gap: 2px; padding: 14px 18px; border: 1px dashed var(--line, #e6dde2); border-radius: 14px; background: var(--card, #fff); }
.ek-all-settings > summary::-webkit-details-marker { display: none; }
.ek-all-settings > summary span { font-weight: 700; }
.ek-all-settings > summary span::after { content: " ▾"; color: var(--muted, #6b6066); }
.ek-all-settings[open] > summary span::after { content: " ▴"; }
.ek-all-settings > summary small { color: var(--muted, #6b6066); }
.ek-all-settings[open] > summary { margin-bottom: 12px; }
#ekAskAnswer .ek-setup-preview { margin-top: 4px; }

/* Parvin notices and offers (adapt.js) */
.ek-adapt-card { margin: 0 0 14px; display: flex; gap: 12px; align-items: flex-start; border: 1.5px dashed var(--brand, #c9306b); }
.ek-adapt-icon { font-size: 1.35rem; line-height: 1.4; }
.ek-adapt-body { flex: 1; }
.ek-adapt-text { margin: 0 0 8px; font-weight: 600; }
.ek-adapt-body .actions { margin: 0; }
.ek-adapt-status { margin: 4px 0 0; color: var(--ok, #2e7d4f); font-weight: 600; }
.ek-adapt-status:empty { display: none; }

/* One Parvin box (parvin-box.js) */
.ek-one-box #ekAskForm { display: none; }
.ek-one-box #ekTodayAsk { margin-top: 10px; }
.ek-one-box textarea#ekTodayNote { min-height: 64px; }
.ek-box-hint { margin: 6px 0 0; font-size: .86rem; }
.ek-box-echo { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin: 4px 0 6px; }
.ek-box-kind { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand, #c9306b); background: var(--soft, #fbf3f6); border-radius: 999px; padding: 2px 8px; }
.ek-box-kind:empty { display: none; }
.ek-box-said { color: var(--muted, #6b6066); font-style: italic; }
.ek-box-switch { margin: 6px 0 0; font-size: .88rem; }
.ek-box-switch .ek-link-button { display: inline; margin: 0; padding: 0; font-size: inherit; }
.ek-parvin-button { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--brand, #c9306b); color: var(--brand, #c9306b); background: var(--card, #fff); border-radius: 999px; padding: 6px 12px; font: inherit; font-weight: 700; cursor: pointer; }
.ek-parvin-button .ek-icon { width: 18px; height: 18px; }
@media (max-width: 520px) { .ek-parvin-button span { display: none; } .ek-parvin-button { padding: 7px; } }

/* Setup by conversation (assets/setup-talk.js): "Just tell Parvin" */
.ek-talk { border: 1.5px solid var(--pine-soft); }
.ek-talk-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ek-talk-head h2 { margin: 0; }
.ek-talk-count { font-size: .85rem; }
.ek-talk-log { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; max-height: 420px; overflow-y: auto; }
.ek-talk-bubble { margin: 0; padding: 10px 14px; border-radius: 16px; max-width: 85%; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.ek-talk-bubble.is-parvin { align-self: flex-start; background: var(--pine-soft); color: var(--ink); border-bottom-left-radius: 4px; }
.ek-talk-bubble.is-me { align-self: flex-end; background: var(--mist); border: 1px solid var(--line); border-bottom-right-radius: 4px; }
.ek-talk-reply textarea { width: 100%; font: inherit; min-height: 84px; resize: vertical; }
.ek-talk-reply .actions { align-items: center; }
#ekTalkMic { display: inline-flex; align-items: center; gap: 6px; }
#ekTalkMic .ek-icon { width: 18px; height: 18px; }
#ekTalkMic.is-listening { background: var(--pine); color: #fff; border-color: var(--pine); }
.ek-talk-finish { margin-top: 10px; align-items: center; }
.ek-setup-or { margin: 18px 4px 8px; color: var(--sage); font-weight: 600; }
.ek-talk .actions .ek-link-button { display: inline-block; margin: 0 4px; min-height: 44px; }

/* Several people on one appointment or task: "Also going: [+ John] [✓ Maria]" */
.ek-also {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: -4px 0 12px;
}
.ek-also-label {
  font-size: 0.9rem;
  color: var(--muted, #6b5b60);
}
.ek-also-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ek-also-chip {
  min-height: 36px;
  padding: 4px 12px;
  border: 1px solid var(--line, #e3c9cf);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.92rem;
  white-space: nowrap;
  cursor: pointer;
}
.ek-also-chip[aria-pressed="true"] {
  border-color: var(--brand, #c2185b);
  background: var(--brand-soft, #fbe4ec);
  color: var(--brand-ink, #8a1240);
  font-weight: 600;
}

/* ---------- Plan: Tasks and Calendar as one page ---------- */
/* One Plan tab: the To-do list is reached from inside Plan. */
#ekDesktopNav button[data-page="calendar"],
#ekBottomNav button[data-page="calendar"] {
  display: none !important;
}
.ek-plan-views {
  margin-bottom: 16px;
}
.ek-plan-views button {
  padding: 8px 14px;
  font-weight: 600;
  min-height: 40px;
}
.ek-plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
#carecalendar[data-plan-view="week"] .ek-plan-month,
#carecalendar[data-plan-view="month"] .ek-plan-week {
  display: none;
}
.ek-plan-day {
  padding: 4px 0 10px;
  border-bottom: 1px solid var(--line);
}
.ek-plan-day:last-of-type {
  border-bottom: 0;
}
.ek-plan-day-name {
  margin: 10px 0 6px;
  font-size: 1rem;
}
.ek-plan-day.is-today .ek-plan-day-name {
  color: var(--pine);
}
.ek-plan-day.is-overdue .ek-plan-day-name {
  color: var(--rose);
}
.ek-plan-day.is-empty .ek-plan-day-name {
  display: inline-block;
  margin-right: 10px;
}
.ek-plan-nothing {
  display: inline;
  margin: 0;
  font-size: 0.9rem;
}
.ek-plan-items {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ek-plan-item {
  display: grid;
  grid-template-columns: 4.6rem 1.4rem 1fr;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
}
.ek-plan-time {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ek-plan-kind {
  color: var(--sage);
  display: flex;
}
.ek-plan-item.is-appt .ek-plan-kind {
  color: var(--pine);
}
.ek-plan-open {
  display: block;
  min-width: 0;
  padding: 6px 4px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
}
.ek-plan-open:hover,
.ek-plan-open:focus-visible {
  background: var(--pine-soft);
}
.ek-plan-title {
  display: block;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.ek-plan-meta {
  display: block;
  font-size: 0.88rem;
  color: var(--sage);
  overflow-wrap: anywhere;
}
.ek-plan-item.is-high .ek-plan-title::after {
  content: " !";
  color: var(--rose);
}
.ek-plan-item.is-done .ek-plan-title {
  text-decoration: line-through;
  color: var(--sage);
  font-weight: 500;
}
.ek-plan-tick {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--paper);
  color: var(--paper);
  font-weight: 800;
  cursor: pointer;
}
.ek-plan-tick[aria-pressed="true"] {
  background: var(--pine);
  border-color: var(--pine);
}
.ek-plan-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}

/* ---------- Voice first: hold to talk ---------- */
.ek-talk-fab {
  position: fixed;
  right: 20px;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 60;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--pine);
  color: #fff;
  box-shadow: 0 6px 18px #5a10304d;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
}
.ek-talk-fab .ek-icon {
  width: 28px;
  height: 28px;
}
.ek-talk-fab:focus-visible {
  outline: 3px solid var(--marigold);
  outline-offset: 3px;
}
.ek-talk-fab.is-listening {
  transform: scale(1.12);
  animation: ek-talk-pulse 1.2s ease-in-out infinite;
}
@keyframes ek-talk-pulse {
  0%, 100% { box-shadow: 0 0 0 0 #c9306b66; }
  50% { box-shadow: 0 0 0 14px #c9306b00; }
}
@media (prefers-reduced-motion: reduce) {
  .ek-talk-fab.is-listening { animation: none; }
}
.ek-talk-sheet {
  position: fixed;
  left: 50%;
  bottom: calc(100px + env(safe-area-inset-bottom));
  z-index: 61;
  width: min(520px, calc(100vw - 32px));
  transform: translateX(-50%);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 10px 30px #1e141633;
}
.ek-talk-sheet[data-state="cancel"] {
  border-color: var(--rose);
}
.ek-talk-title {
  display: block;
  color: var(--pine);
}
.ek-talk-sheet[data-state="cancel"] .ek-talk-title {
  color: var(--rose);
}
.ek-talk-words {
  margin: 6px 0 0;
  font-size: 1.1rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
  max-height: 30vh;
  overflow: auto;
}
.ek-talk-words.is-empty {
  color: var(--sage);
  font-size: 1rem;
}
.ek-talk-hint {
  margin: 6px 0 0;
  font-size: 0.88rem;
}
.ek-talk-hint:empty {
  display: none;
}
/* Room at the bottom of each page so the button never covers the last item. */
body.has-talk-fab main {
  padding-bottom: 96px;
}
/* Not on the sign-in screen, the tablet or while printing. */
body:has(#ekAppLayout[hidden]) .ek-talk-fab,
body[data-page="tablet"] .ek-talk-fab {
  display: none !important;
}
@media print {
  .ek-talk-fab,
  .ek-talk-sheet {
    display: none !important;
  }
}
@media (max-width: 900px) {
  .ek-talk-fab {
    right: 14px;
    bottom: calc(80px + env(safe-area-inset-bottom));
    width: 58px;
    height: 58px;
  }
  .ek-talk-sheet {
    bottom: calc(150px + env(safe-area-inset-bottom));
  }
  /* Messages sit above the microphone button too, so a long one never runs under it. */
  body.has-talk-fab .ek-toast {
    bottom: calc(150px + env(safe-area-inset-bottom));
  }
}
.ek-plan-foot .ek-link-button {
  display: inline;
  margin: 0;
}

/* Setup by conversation: one-tap start and the optional "about you" */
.ek-who-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin: 8px 0 4px;
}
.ek-who-tile {
  min-height: 56px;
  padding: 10px 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.ek-who-tile:hover,
.ek-who-tile:focus-visible {
  border-color: var(--pine);
  background: var(--pine-soft);
}
.ek-about-chips {
  display: grid;
  gap: 8px;
  margin: 8px 0 10px;
}
.ek-about-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.ek-about-label {
  min-width: 7.5rem;
  font-size: 0.9rem;
  color: var(--sage);
}
/* "New to this? Try one:" under Tell Parvin anything */
.ek-box-tips {
  margin: 8px 0 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--marigold-soft);
}
.ek-box-tries {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}
.ek-box-tips p {
  margin: 6px 0;
  font-size: 0.88rem;
}
.ek-box-tips .ek-link-button {
  display: inline;
  margin: 0;
}

/* Private document folders */
.ek-folder-tile.is-private {
  background: var(--paper);
}
.ek-folder-tile.is-me {
  border-color: var(--line-strong);
}
.ek-folder-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  background: var(--sky-soft);
  color: var(--ink);
}
.ek-folder-badge.is-me {
  background: var(--marigold-soft);
}
.ek-folder-title .ek-folder-badge {
  margin-left: 8px;
  vertical-align: middle;
}
.ek-folder-see {
  max-width: 17rem;
}
.ek-folder-see-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 8px 0 4px;
  font-size: 0.92rem;
}
.ek-folder-ideas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 4px 0 12px;
}
.ek-folder-title {
  flex-wrap: wrap;
  row-gap: 4px;
}
.ek-folder-title > span:not(.ek-folder-badge) {
  white-space: nowrap;
}
.ek-folder-title .ek-folder-badge {
  margin-left: 0;
}
.ek-folder-title small {
  white-space: nowrap;
}

/* ---------- Today: "how is she right now?" ---------- */
.ek-now-card {
  flex-wrap: wrap;
  row-gap: 10px;
}
.ek-now-latest {
  max-width: 34rem;
  line-height: 1.4;
}
.ek-now-who {
  font-weight: 700;
  color: var(--ink);
}
.ek-now-said {
  font-style: italic;
}
.ek-now-when {
  white-space: nowrap;
}
.ek-now-actions,
.ek-attention-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}
.ek-attention-actions {
  padding: 0 0 12px 14px;
}
.ek-tap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 6px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.ek-tap:hover,
.ek-tap:focus-visible {
  border-color: var(--pine);
}
.ek-tap.is-primary {
  border-color: var(--pine);
  background: var(--pine);
  color: #fff;
}
.ek-tap.is-sos {
  border-color: var(--rose);
  color: var(--rose);
}
.ek-tap:disabled {
  opacity: 0.6;
}
/* The suggested questions: one scrolling line instead of a tall stack. */
.ek-one-box .ek-ask-ideas {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 4px;
}
.ek-one-box .ek-ask-ideas > * {
  flex: 0 0 auto;
}

/* ---------- Emergency info ---------- */
.ek-sos {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #1e141699;
}
.ek-sos-body {
  width: min(640px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--paper);
  border-top: 6px solid var(--rose);
}
.ek-sos-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.ek-sos-tag {
  font-weight: 800;
  color: var(--rose);
  letter-spacing: 0.02em;
}
.ek-sos-body h2 {
  margin: 8px 0 10px;
  font-size: 1.6rem;
}
.ek-sos-list {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 8px 12px;
  margin: 0 0 12px;
}
.ek-sos-row {
  display: contents;
}
.ek-sos-row dt {
  color: var(--sage);
  font-weight: 600;
}
.ek-sos-row dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.ek-sos-row.is-strong dd {
  font-weight: 800;
  color: var(--rose);
}
.ek-sos-body h3 {
  margin: 14px 0 6px;
  font-size: 1rem;
}
.ek-sos-calls {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ek-sos-calls li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.ek-sos-note {
  margin-top: 12px;
  font-size: 0.88rem;
}
@media (max-width: 560px) {
  .ek-sos-list {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .ek-sos-row dd {
    margin-bottom: 8px;
  }
}
@media print {
  body.ek-sos-open > *:not(.ek-sos) {
    display: none !important;
  }
  body.ek-sos-open .ek-sos {
    position: static;
    background: none;
    padding: 0;
  }
  body.ek-sos-open .ek-sos-body {
    max-height: none;
    border: 0;
  }
  body.ek-sos-open .ek-sos .actions,
  body.ek-sos-open .ek-sos-head button {
    display: none !important;
  }
}
/* The "right now" card: photo | name and latest update | Profile, then the actions underneath. */
.ekRecipientCard.ek-now-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px 12px;
  padding: 14px;
  border-radius: var(--r-surface, 18px);
}
.ekRecipientCard.ek-now-card .secondary {
  margin-left: 0;
  align-self: start;
}
.ekRecipientCard.ek-now-card .ek-now-actions {
  grid-column: 1 / -1;
}
@media (max-width: 640px) {
  .ekRecipientCard.ek-now-card .ek-now-actions .ek-tap {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
    padding: 6px 10px;
  }
}

/* "Same visit twice?" */
.ek-double-card {
  border: 1.5px solid #e0a63a;
  border-left-width: 5px;
  background: #fffaf0;
}
.ek-double-card h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}
.ek-double-item + .ek-double-item {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.ek-double-head {
  margin: 0 0 4px;
  font-weight: 700;
}
.ek-double-list {
  margin: 0 0 6px;
  padding-left: 18px;
}
.ek-double-list li {
  margin: 2px 0;
  overflow-wrap: anywhere;
}
.ek-double-nobody {
  color: var(--rose);
  font-weight: 600;
}
.ek-double-card .ek-attention-actions {
  padding: 4px 0 0;
}
.ek-double-undo {
  margin: 4px 0 0;
}
.ek-double-tag {
  color: #9a5b00;
  font-weight: 700;
}

/* Appointment offers waiting for an answer */
.ek-offer-card {
  border: 1.5px solid #6b8fd6;
  border-left-width: 5px;
  background: #f4f7ff;
}
.ek-offer-card h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}
.ek-offer-item + .ek-offer-item {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.ek-offer-head {
  margin: 0 0 4px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.ek-offer-ask {
  margin: 4px 0 6px;
  font-weight: 600;
}
.ek-offer-warn {
  margin: 4px 0;
  color: #9a5b00;
  font-weight: 600;
}
.ek-offer-note {
  margin: 4px 0;
  font-size: 0.92rem;
}
.ek-offer-tip {
  margin: 6px 0 0;
  font-size: 0.86rem;
}
.ek-offer-card .ek-attention-actions {
  padding: 0;
}
.ek-offer-item.is-expired .ek-offer-head {
  color: var(--sage);
}
.ek-offer-tag {
  color: #2f56a8;
  font-weight: 700;
}

/* ---------- Visit summary: colour-coded boxes (visit-view.js) ---------- */
.ek-vs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}
.ek-vs-sec {
  --vs-line: #9db8d6;
  --vs-bg: #f1f6fc;
  --vs-ink: #24507e;
  margin: 10px 0;
  padding: 12px 14px;
  border: 1px solid var(--vs-line);
  border-left-width: 5px;
  border-radius: 12px;
  background: var(--vs-bg);
}
.ek-vs .ek-vs-sec {
  margin: 0;
}
.ek-vs-sec.is-meds { --vs-line: #e2ad55; --vs-bg: #fff7ea; --vs-ink: #8a5a08; }
.ek-vs-sec.is-differs { --vs-line: #df8a80; --vs-bg: #fdf0ee; --vs-ink: #a1352a; }
.ek-vs-sec.is-next { --vs-line: #7fc0bb; --vs-bg: #ecf8f6; --vs-ink: #1f6c66; }
.ek-vs-sec.is-questions { --vs-line: #b6a0de; --vs-bg: #f5f1fc; --vs-ink: #5b3f96; }
.ek-vs-sec.is-tasks { --vs-line: #8fc5a0; --vs-bg: #eef8f1; --vs-ink: #2b6b40; }
.ek-vs-sec.is-words { --vs-line: #cfc8c4; --vs-bg: #f7f5f4; --vs-ink: #5e5552; }
.ek-vs-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--vs-ink);
}
.ek-vs-icon {
  font-size: 17px;
  line-height: 1;
}
.ek-vs-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.ek-vs-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ek-vs-sec.is-questions .ek-vs-list,
.ek-vs-sec.is-tasks .ek-vs-list {
  padding-left: 18px;
  list-style: disc;
  gap: 4px;
}
.ek-vs-list li {
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.ek-vs-med {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.ek-vs-detail {
  display: block;
  color: var(--sage);
  font-size: 14px;
}
.ek-vs-tag {
  flex: none;
  width: 84px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: #fff;
  background: #7a6f6b;
}
.ek-vs-tag.is-start { background: #2f7d4a; }
.ek-vs-tag.is-stop { background: #b4372b; }
.ek-vs-tag.is-dose { background: #b06d06; }
.ek-vs-tag.is-keep { background: #7a6f6b; }
.ek-vs-tag.is-unclear { background: #6c4bb0; }
.ek-vs-line {
  display: block;
}
.ek-vs-ask {
  font-style: italic;
  color: var(--vs-ink);
}
.ek-vs-sec .note {
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--sage);
  font-size: 13px;
}
.ek-vs-sec textarea {
  width: 100%;
  background: #fff;
}
.ek-vs-sec .ek-visit-tasks {
  margin: 8px 0;
}
.ek-vs-sec .ek-visit-task input:not([type="checkbox"]),
.ek-vs-sec .ek-visit-task textarea {
  background: #fff;
}
.ek-vs-sec details summary {
  cursor: pointer;
  color: var(--vs-ink);
  font-weight: 600;
}
.ek-vs-words {
  margin-top: 8px;
  max-height: 320px;
  overflow: auto;
  font-size: 14px;
}
.ek-vs-field > strong {
  display: block;
  margin-bottom: 4px;
}
.ek-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
@media (prefers-color-scheme: dark) {
  .ek-vs-sec { --vs-bg: #1d2a38; --vs-ink: #a9c7ea; }
  .ek-vs-sec.is-meds { --vs-bg: #33270f; --vs-ink: #f0c47a; }
  .ek-vs-sec.is-differs { --vs-bg: #3a1f1c; --vs-ink: #f2a59c; }
  .ek-vs-sec.is-next { --vs-bg: #15302d; --vs-ink: #92d6cf; }
  .ek-vs-sec.is-questions { --vs-bg: #2a2340; --vs-ink: #c8b6ef; }
  .ek-vs-sec.is-tasks { --vs-bg: #17301f; --vs-ink: #9fd6b1; }
  .ek-vs-sec.is-words { --vs-bg: #2a2726; --vs-ink: #cfc8c4; }
  .ek-vs-sec textarea,
  .ek-vs-sec .ek-visit-task input:not([type="checkbox"]),
.ek-vs-sec .ek-visit-task textarea { background: transparent; }
}

/* ---------- Recording a refill: "Picked up …?" (refill.js) ---------- */
.ek-refill-sheet {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(30, 20, 22, 0.35);
  padding: 16px;
}
@media (min-width: 700px) {
  .ek-refill-sheet {
    align-items: center;
  }
}
.ek-refill-box {
  width: min(460px, 100%);
  padding: 20px;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 12px 32px rgba(30, 20, 22, 0.25);
}
.ek-refill-box h3 {
  margin: 0 0 12px;
  font-size: 18px;
}
.ek-refill-lead {
  margin: 0 0 6px;
  color: var(--sage);
  font-size: 14px;
}
.ek-refill-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ek-refill-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
  font-size: 14px;
}
.ek-refill-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}
.ek-refill-qty input {
  width: 90px;
  min-height: 44px;
  font-size: 18px;
  text-align: center;
}
.ek-refill-fields input[type="date"] {
  min-height: 44px;
  width: 100%;
  max-width: 170px;
}
@media (max-width: 380px) {
  .ek-refill-fields {
    grid-template-columns: 1fr;
  }
}
.ek-refill-was {
  display: block;
  font-weight: 400;
  color: var(--sage);
}
.ek-refill-result {
  margin: 12px 0 4px;
  color: var(--leaf);
  line-height: 1.5;
}
.ek-refill-history ul {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}
.ek-refill-history li {
  display: flex;
  gap: 12px;
  padding: 4px 0;
  border-top: 1px solid var(--line);
}
.ek-refill-day {
  min-width: 110px;
}
.ek-refill-hint {
  margin: 4px 0 0;
}
.ek-refill-box .actions {
  margin-top: 14px;
}
.ek-scan-refill {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--mist);
  font-size: 14px;
}
.ek-scan-refill input[type="number"] {
  width: 76px;
  min-height: 36px;
}

/* Add contact: scan a card or pick from the phone's contacts. */
.ek-contact-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- In-app camera (camera.js) ---------- */
.ek-cam {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(20, 12, 14, 0.6);
}
.ek-cam-box {
  width: min(560px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 16px;
  border-radius: 16px;
  background: var(--paper);
}
.ek-cam-box h3 {
  margin: 0 0 4px;
}
.ek-cam-hint {
  margin: 0 0 8px;
}
.ek-cam-frame {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #1e1416;
  aspect-ratio: 4 / 3;
}
.ek-cam-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* A card-shaped guide (business cards are about 3.5 × 2 in). */
.ek-cam-guide {
  position: absolute;
  inset: 14% 8%;
  border: 2px dashed rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  pointer-events: none;
}
.ek-cam-status {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--sage);
}
.ek-cam .actions {
  margin-top: 10px;
  flex-wrap: wrap;
}
.ek-cam-shoot {
  min-width: 150px;
}

/* ---------- Injections: a syringe instead of a pill bottle (medForm in cloud.js) ----------
   Plunger with thumb rest and finger grips (the cap), a clear barrel with measurement marks
   holding the liquid left (the body; the dark rubber stopper sits on the liquid), the pharmacy
   label on the barrel, and an orange needle cap underneath. */
.ek-syringe-needle {
  display: none;
}
.ek-bottle.is-syringe .ek-bottle-cap {
  height: 40px;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background:
    /* thumb rest */
    linear-gradient(#f4f1ef, #d9d2ce) top center / 46% 7px no-repeat,
    /* rod */
    linear-gradient(90deg, #d8d1cd, #fbf9f8 45%, #cfc7c2) center 7px / 14% 23px no-repeat,
    /* finger grips, wider than the barrel */
    linear-gradient(#efeae7, #cfc6c1) bottom center / 100% 8px no-repeat;
  filter: drop-shadow(0 1px 1px rgba(60, 40, 30, 0.25));
}
.ek-bottle.is-syringe {
  /* Same overall height as a bottle (cap 20px + body 88% wide at 0.6): plunger 40px + barrel +
     needle 30px, so the Refilled buttons line up across the row. */
  container-type: inline-size;
}
.ek-bottle.is-syringe .ek-bottle-body {
  aspect-ratio: auto;
  height: calc(146.67cqw - 46px);
  margin: 0 7%;
  border: 1.5px solid #9db0c0;
  border-top: 0;
  border-radius: 2px 2px 10px 10px;
  background:
    linear-gradient(90deg, rgba(120, 150, 175, 0.22), transparent 18% 80%, rgba(120, 150, 175, 0.28)),
    #f3f8fb;
  box-shadow: 0 6px 8px -6px rgba(40, 60, 80, 0.35);
}
.ek-bottle.is-syringe .ek-bottle-body::before {
  /* The liquid, and the rubber stopper resting on it. */
  background: linear-gradient(to bottom, #c9e1f2, #a9cbe5);
  border-top: 7px solid #3f3a40;
  box-shadow: inset 0 6px 8px -6px rgba(255, 255, 255, 0.8);
}
.ek-bottle.is-syringe .ek-bottle-body::after {
  /* Shine on the left, measurement marks down the right side. */
  background:
    repeating-linear-gradient(to bottom, transparent 0 9px, rgba(70, 90, 110, 0.55) 9px 10px) right 4px top 6px / 14% calc(100% - 12px) no-repeat,
    linear-gradient(90deg, transparent 6%, rgba(255, 255, 255, 0.7) 10%, rgba(255, 255, 255, 0.15) 17%, transparent 24%);
}
.ek-bottle.is-syringe.is-low .ek-bottle-body {
  border-color: var(--rose);
}
.ek-bottle.is-syringe .ek-syringe-needle {
  display: block;
  height: 30px;
  margin: 0 auto;
  width: 100%;
  background:
    /* the hub */
    linear-gradient(#cbd6df, #9fb0be) top center / 22% 7px no-repeat,
    /* the needle cap */
    linear-gradient(90deg, #d9631a, #f08a3c 45%, #c95712) center 7px / 9% 23px no-repeat;
  border-radius: 0 0 6px 6px;
}
.ek-bottle.is-syringe.is-inactive .ek-syringe-needle {
  filter: grayscale(0.85);
  opacity: 0.75;
}
/* The small icon in List view. */
#cloudMedList.is-list .ek-bottle.is-syringe .ek-bottle-rx {
  border-color: #9db0c0;
  border-radius: 2px 2px 6px 6px;
  background:
    linear-gradient(to top, #bcd8ec 0 calc(var(--level, 0) * 100%), #f3f8fb calc(var(--level, 0) * 100%) 100%);
}
#cloudMedList.is-list .ek-syringe-needle {
  display: none !important;
}
/* The barrel is shorter than a bottle: a slightly smaller label leaves the liquid in view. */
.ek-bottle.is-syringe .ek-bottle-label {
  padding-top: 8px;
  padding-bottom: 14px;
  gap: 1px;
}
.ek-bottle.is-syringe .ekMedHeading strong {
  font-size: 12px;
  letter-spacing: -0.01em;
}
.ek-bottle.is-syringe .ek-bottle-strength,
.ek-bottle.is-syringe .ek-bottle-days {
  font-size: 10.5px;
}
/* List view: a syringe row is an ordinary row (no barrel height or plunger). */
#cloudMedList.is-list .ek-bottle.is-syringe {
  container-type: normal;
}
#cloudMedList.is-list .ek-bottle.is-syringe .ek-bottle-body {
  height: auto;
  margin: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
#cloudMedList.is-list .ek-bottle.is-syringe .ek-bottle-label {
  padding: 0;
}
#cloudMedList.is-list .ek-bottle.is-syringe .ekMedHeading strong {
  font-size: 15px;
}
#cloudMedList.is-list .ek-bottle.is-syringe .ek-bottle-strength,
#cloudMedList.is-list .ek-bottle.is-syringe .ek-bottle-days {
  font-size: 13px;
}

/* ---------- Boxed supplies (sensors, test strips…): a plain white carton ----------
   The lid seen from above with a round sensor on it (the cap), the front with the pharmacy
   label (the body), and a strip along the bottom filled to the supply left. No brand art. */
.ek-bottle.is-box .ek-bottle-cap {
  height: 24px;
  margin: 0 6% 0 10%;
  border: 1px solid #d6d0cc;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  clip-path: polygon(6% 0, 100% 0, 96% 100%, 0 100%);
  background:
    radial-gradient(circle at 50% 55%, #fbfaf9 0 6px, #3f3a40 6px 7px, #fbfaf9 7px 7.5px, #cfc9c5 8px 9px, #f2efed 9.5px 10.5px, transparent 11px),
    linear-gradient(#efebe8, #e2ddd9);
  box-shadow: none;
}
.ek-bottle.is-box .ek-bottle-body {
  border: 1px solid #d6d0cc;
  border-radius: 2px 2px 4px 4px;
  background:
    /* the right side of the box, in shadow */
    linear-gradient(90deg, transparent 90%, rgba(80, 60, 50, 0.1) 90%),
    linear-gradient(#fdfcfb, #f1eeeb);
  box-shadow: 0 6px 8px -6px rgba(60, 40, 30, 0.35);
}
.ek-bottle.is-box .ek-bottle-body::before {
  /* how much is left: a strip along the bottom */
  inset: auto 0 0 0;
  height: 10px;
  width: calc(var(--level, 0) * 100%);
  background: var(--leaf);
  background-image: none;
  border-top: 0;
  box-shadow: none;
}
.ek-bottle.is-box.is-low .ek-bottle-body::before {
  background: var(--rose);
}
.ek-bottle.is-box .ek-bottle-body::after {
  /* a soft line where the lid meets the front */
  background: linear-gradient(to bottom, rgba(80, 60, 50, 0.12) 0 3px, transparent 3px);
}
.ek-bottle.is-box.is-low .ek-bottle-body {
  border-color: var(--rose);
}
#cloudMedList.is-list .ek-bottle.is-box .ek-bottle-rx {
  border-color: #cfc9c5;
  border-radius: 3px;
  background: linear-gradient(to top, var(--leaf) 0 calc(var(--level, 0) * 30%), #f6f3f1 calc(var(--level, 0) * 30%) 100%);
}

/* ---------- Handheld devices (CGM receiver, reader, glucose meter): a plain device ----------
   Dark rounded body, the details on its screen in white, a round button pad. No brand art.
   It doesn't run down like pills, so there's no fill level. */
.ek-bottle.is-device .ek-bottle-cap {
  height: 24px;
  margin: 0 6%;
  border: 0;
  border-radius: 18px 18px 0 0;
  background:
    linear-gradient(#55525a, #55525a) center 11px / 26% 2px no-repeat,
    linear-gradient(#3a383d, #2c2a2e);
  box-shadow: none;
}
.ek-bottle.is-device .ek-bottle-body {
  align-items: flex-start;
  border: 0;
  border-radius: 0 0 18px 18px;
  padding: 2% 8% 0;
  background: linear-gradient(90deg, #2a282c, #343237 50%, #28262a);
  box-shadow: 0 6px 8px -6px rgba(20, 15, 20, 0.5);
}
.ek-bottle.is-device .ek-bottle-body::before {
  display: none;
}
.ek-bottle.is-device .ek-bottle-body::after {
  /* the button pad */
  inset: auto 32% 6% 32%;
  height: 21%;
  border-radius: 24%;
  background:
    radial-gradient(circle, #d9d6dc 0 2.5px, transparent 3px) center / 100% 100% no-repeat,
    radial-gradient(circle, #b9b5bd 0 2.5px, transparent 3px) 50% 14% / 100% 100% no-repeat,
    radial-gradient(circle, #b9b5bd 0 2.5px, transparent 3px) 50% 86% / 100% 100% no-repeat,
    radial-gradient(circle, #b9b5bd 0 2.5px, transparent 3px) 14% 50% / 100% 100% no-repeat,
    radial-gradient(circle, #b9b5bd 0 2.5px, transparent 3px) 86% 50% / 100% 100% no-repeat,
    linear-gradient(#232125, #1a181c);
  box-shadow: 0 0 0 2px #46434b;
}
.ek-bottle.is-device .ek-bottle-label {
  /* the screen */
  margin: 0;
  width: 100%;
  border-radius: 6px;
  padding: 8px 7px 9px;
  padding-bottom: 22px;
  background:
    /* a faint trend line along the bottom of the screen */
    radial-gradient(circle, #e8edf0 0 2px, transparent 2.5px) right 9px bottom 8px / 6px 6px no-repeat,
    repeating-linear-gradient(90deg, rgba(232, 237, 240, 0.55) 0 2px, transparent 2px 6px) left 8px bottom 10px / calc(100% - 22px) 2px no-repeat,
    linear-gradient(#ffd27a, #ffd27a) left 8px bottom 16px / calc(100% - 16px) 1px no-repeat,
    linear-gradient(#25303a, #1a2229);
  box-shadow: inset 0 0 0 2px #121518;
  color: #f4f7f9;
}
.ek-bottle.is-device .ek-bottle-label::before {
  display: none;
}
.ek-bottle.is-device .ek-bottle-rx {
  color: #8fc8ef;
}
.ek-bottle.is-device .ekMedHeading strong {
  color: #fff;
}
.ek-bottle.is-device .ek-bottle-strength {
  color: #c5d0d8;
}
.ek-bottle.is-device .ek-bottle-days {
  color: #94dcae;
}
.ek-bottle.is-device.is-low .ek-bottle-days {
  color: #ff9a9a;
}
.ek-bottle.is-device.is-low .ek-bottle-body {
  box-shadow: 0 0 0 2px var(--rose-soft), 0 6px 8px -6px rgba(20, 15, 20, 0.5);
}
#cloudMedList.is-list .ek-bottle.is-device .ek-bottle-rx {
  border-color: #2c2a2e;
  border-radius: 5px;
  background: linear-gradient(#25303a, #25303a) center 4px / 70% 45% no-repeat, #2f2d31;
}
#cloudMedList.is-list .ek-bottle.is-device .ek-bottle-label {
  background: none;
  box-shadow: none;
  color: inherit;
  padding: 0;
}
#cloudMedList.is-list .ek-bottle.is-device .ekMedHeading strong {
  color: inherit;
}
#cloudMedList.is-list .ek-bottle.is-device .ek-bottle-strength {
  color: var(--sage);
}
#cloudMedList.is-list .ek-bottle.is-device .ek-bottle-days {
  color: var(--leaf);
}
#cloudMedList.is-list .ek-bottle.is-device .ek-bottle-body {
  padding: 0;
  background: none;
  box-shadow: none;
}

/* ---------- Insulin pump: the handheld device, with a top button and tubing ----------
   Touchscreen (the details), a button on the top edge, clear tubing curling out the bottom. */
.ek-bottle.is-pump .ek-bottle-cap {
  border-radius: 14px 14px 0 0;
  background:
    linear-gradient(#6b6870, #4a474f) right 22% top 0 / 22% 4px no-repeat,
    linear-gradient(#3a383d, #2c2a2e) 0 4px / 100% 100% no-repeat;
}
.ek-bottle.is-pump .ek-bottle-body {
  border-radius: 0 0 14px 14px;
}
.ek-bottle.is-pump .ek-bottle-body::after {
  /* a loop of clear tubing below the screen, between two small connectors */
  inset: auto 24% 7% 24%;
  height: 15%;
  border: 3px solid rgba(214, 232, 242, 0.9);
  border-top: 0;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  background:
    radial-gradient(circle, #a9b6c0 0 3.5px, transparent 4px) left -5px top -4px / 11px 11px no-repeat,
    radial-gradient(circle, #a9b6c0 0 3.5px, transparent 4px) right -5px top -4px / 11px 11px no-repeat;
  box-shadow: none;
}
.ek-bottle.is-pump .ek-bottle-label {
  margin-top: 6%;
}

/* Pump cartridges and reservoirs: the supply box, with a small cartridge on the lid. */
.ek-bottle.is-box.is-cartridge .ek-bottle-cap {
  background:
    linear-gradient(#3a383d, #2a282c) center 7px / 26% 9px no-repeat,
    linear-gradient(rgba(214, 232, 242, 0.95), rgba(214, 232, 242, 0.95)) 62% 10px / 14% 2px no-repeat,
    linear-gradient(#efebe8, #e2ddd9);
}

/* ---------- Vitamins and supplements: a white over-the-counter bottle ----------
   Smooth white cap, an opaque white bottle (no pills showing), the label marked OTC, and a
   strip along the bottom filled to the supply left. No brand art. */
.ek-bottle.is-supplement .ek-bottle-cap {
  margin: 0 12%;
  border-color: #d9d3cf;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(90deg, #e6e1de, #ffffff 35%, #f4f1ef 70%, #dcd6d2);
  box-shadow: 0 -1px 0 #fff inset, 0 3px 3px -1px rgba(60, 40, 30, 0.25);
}
.ek-bottle.is-supplement .ek-bottle-body {
  border-color: #d9d3cf;
  border-top: 0;
  border-radius: 12px 12px 14px 14px / 6px 6px 10px 10px;
  background:
    linear-gradient(90deg, rgba(80, 60, 50, 0.1), transparent 14% 82%, rgba(80, 60, 50, 0.14)),
    linear-gradient(#fbfaf9, #efebe8);
}
.ek-bottle.is-supplement .ek-bottle-body::before {
  inset: auto 0 0 0;
  height: 9px;
  width: calc(var(--level, 0) * 100%);
  background: var(--leaf);
  background-image: none;
  border-top: 0;
  box-shadow: none;
}
.ek-bottle.is-supplement.is-low .ek-bottle-body::before {
  background: var(--rose);
}
.ek-bottle.is-supplement .ek-bottle-body::after {
  background: linear-gradient(90deg, transparent 8%, rgba(255, 255, 255, 0.85) 12%, transparent 20%);
}
.ek-bottle.is-supplement .ek-bottle-label::before {
  background: var(--leaf);
}
.ek-bottle.is-supplement .ek-bottle-rx {
  font-family: inherit;
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--leaf);
}
#cloudMedList.is-list .ek-bottle.is-supplement .ek-bottle-rx {
  color: transparent;
  border-color: #d9d3cf;
  background: linear-gradient(to top, var(--leaf) 0 calc(var(--level, 0) * 30%), #fbfaf9 calc(var(--level, 0) * 30%) 100%);
}

/* ---------- Creams and ointments: a tube ----------
   A crimped, ridged end at the top (the cap element), a white tube narrowing toward the
   bottom with the label (the body), a screw cap underneath (the needle element). Same
   height as a bottle: crimp 24px + tube + cap 22px. */
.ek-bottle.is-tube {
  container-type: inline-size;
}
.ek-bottle.is-tube .ek-bottle-cap {
  height: 24px;
  margin: 0 4%;
  border: 0;
  border-radius: 2px;
  background:
    repeating-linear-gradient(90deg, rgba(120, 110, 105, 0.35) 0 1px, transparent 1px 5px),
    linear-gradient(#f7f5f3, #dcd6d2);
  box-shadow: 0 2px 2px -1px rgba(60, 40, 30, 0.25);
}
.ek-bottle.is-tube .ek-bottle-body {
  aspect-ratio: auto;
  height: calc(146.67cqw - 22px);
  margin: 0 4%;
  border: 0;
  border-radius: 0 0 6px 6px;
  clip-path: polygon(0 0, 100% 0, 86% 100%, 14% 100%);
  background:
    linear-gradient(90deg, rgba(80, 60, 50, 0.16), transparent 18% 78%, rgba(80, 60, 50, 0.2)),
    linear-gradient(#ffffff, #f1eeeb);
  box-shadow: none;
  filter: drop-shadow(0 2px 2px rgba(60, 40, 30, 0.25));
}
.ek-bottle.is-tube .ek-bottle-body::before {
  /* how much is left: a strip along the bottom */
  inset: auto 0 0 0;
  height: 8px;
  width: calc(var(--level, 0) * 100%);
  background: var(--leaf);
  background-image: none;
  border-top: 0;
  box-shadow: none;
}
.ek-bottle.is-tube.is-low .ek-bottle-body::before {
  background: var(--rose);
}
.ek-bottle.is-tube .ek-bottle-body::after {
  background: linear-gradient(90deg, transparent 10%, rgba(255, 255, 255, 0.9) 14%, transparent 22%);
}
.ek-bottle.is-tube .ek-bottle-label {
  margin: 0 2%;
  width: 96%;
  padding: 8px 9% 14px;
}
.ek-bottle.is-tube .ekMedHeading strong {
  font-size: 12px;
}
.ek-bottle.is-tube .ek-bottle-strength,
.ek-bottle.is-tube .ek-bottle-days {
  font-size: 10.5px;
}
.ek-bottle.is-tube .ek-syringe-needle {
  display: block;
  height: 22px;
  width: 36%;
  margin: 0 auto;
  border-radius: 0 0 5px 5px;
  background:
    repeating-linear-gradient(90deg, rgba(120, 110, 105, 0.3) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, #e9e5e2, #ffffff 40%, #dcd6d2);
  box-shadow: 0 2px 2px -1px rgba(60, 40, 30, 0.3);
}
.ek-bottle.is-tube.is-inactive .ek-syringe-needle {
  filter: grayscale(0.85);
  opacity: 0.75;
}
#cloudMedList.is-list .ek-bottle.is-tube {
  container-type: normal;
}
#cloudMedList.is-list .ek-bottle.is-tube .ek-bottle-body {
  height: auto;
  margin: 0;
  clip-path: none;
  filter: none;
  background: none;
}
#cloudMedList.is-list .ek-bottle.is-tube .ek-bottle-label {
  margin: 0;
  width: 100%;
  padding: 0;
}
#cloudMedList.is-list .ek-bottle.is-tube .ekMedHeading strong {
  font-size: 15px;
}
#cloudMedList.is-list .ek-bottle.is-tube .ek-bottle-strength,
#cloudMedList.is-list .ek-bottle.is-tube .ek-bottle-days {
  font-size: 13px;
}
#cloudMedList.is-list .ek-bottle.is-tube .ek-bottle-rx {
  color: transparent;
  border-color: #d9d3cf;
  border-radius: 2px 2px 8px 8px;
  background: linear-gradient(to top, var(--leaf) 0 calc(var(--level, 0) * 30%), #ffffff calc(var(--level, 0) * 30%) 100%);
}

/* Care profile → Medications: read live from Medicines */
.ek-profile-meds-note, .ek-profile-meds, .ek-profile-meds + .actions, .ek-profile-meds-earlier { grid-column: 1 / -1; }
.ek-profile-meds-note { margin: 0; }
.ek-profile-meds + .actions { margin: 0.5rem 0 0; }
.ek-profile-meds h4 { margin: 0.75rem 0 0.25rem; font-size: 0.95rem; }
.ek-profile-meds ul { margin: 0; padding-left: 1.2rem; }
.ek-profile-meds li { margin: 0.2rem 0; overflow-wrap: anywhere; }
.ek-profile-meds-earlier { margin-top: 0.75rem; padding: 0.6rem 0.8rem; border: 1px dashed var(--line, #ccc); border-radius: 8px; }
.ek-profile-meds-earlier h4 { margin: 0 0 0.25rem; font-size: 0.95rem; }
.ek-profile-meds-earlier p { margin: 0.25rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* An insulin vial: a small clear glass vial with a flip-off cap over a metal collar, a narrow
   neck, the clear medicine inside up to the supply left, and a white label with a coloured
   band. Generic art (no brand's look). Same height as a bottle: cap 24px + body. */
.ek-bottle.is-vial {
  container-type: inline-size;
}
.ek-bottle.is-vial .ek-bottle-cap {
  height: 24px;
  margin: 0 31%;
  border: 0;
  border-radius: 5px 5px 1px 1px;
  background:
    linear-gradient(to bottom, transparent 0 15px, #c9cdd1 15px, #f4f6f7 18px, #aeb3b8 24px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.18), transparent 25% 70%, rgba(0, 0, 0, 0.22)),
    linear-gradient(#5aa0b8, #35798f);
  box-shadow: 0 2px 2px -1px rgba(30, 40, 50, 0.35);
}
.ek-bottle.is-vial .ek-bottle-body {
  aspect-ratio: auto;
  height: 146.67cqw;
  margin: 0 12%;
  border: 0;
  border-radius: 0 0 12px 12px;
  padding: 0 6% 9%;
  align-items: flex-end;
  clip-path: polygon(30% 0, 70% 0, 70% 9%, 100% 18%, 100% 100%, 0 100%, 0 18%, 30% 9%);
  background:
    linear-gradient(90deg, rgba(90, 120, 140, 0.32), transparent 16% 80%, rgba(90, 120, 140, 0.38)),
    linear-gradient(#f3f8fa, #e4eef2);
  box-shadow: none;
  filter: drop-shadow(0 3px 3px rgba(30, 40, 50, 0.25));
}
.ek-bottle.is-vial .ek-bottle-body::before {
  /* the clear medicine, up to the supply left, with a meniscus line */
  inset: auto 0 0 0;
  height: calc(var(--level, 0) * 82%);
  background: linear-gradient(rgba(170, 208, 228, 0.85), rgba(140, 188, 214, 0.9));
  background-image: none;
  border-top: 2px solid rgba(120, 170, 195, 0.8);
  box-shadow: none;
}
.ek-bottle.is-vial.is-low .ek-bottle-body::before {
  border-top-color: var(--rose);
}
.ek-bottle.is-vial .ek-bottle-body::after {
  background: linear-gradient(90deg, transparent 8%, rgba(255, 255, 255, 0.95) 12%, transparent 20%);
}
.ek-bottle.is-vial .ek-bottle-label {
  margin: 0 -2%;
  width: 104%;
  padding: 6px 5% 13px 13%;
  gap: 1px;
  line-height: 1.15;
  background:
    linear-gradient(90deg, #35798f 0 7%, transparent 7%),
    linear-gradient(90deg, rgba(60, 40, 30, 0.14), transparent 9% 91%, rgba(60, 40, 30, 0.18)),
    repeating-linear-gradient(90deg, #4a3a36 0 1px, transparent 1px 3px, #4a3a36 3px 5px, transparent 5px 6px, #4a3a36 6px 7px, transparent 7px 10px)
      bottom 5px left 14% / 40% 5px no-repeat,
    #ffffff;
}
.ek-bottle.is-vial .ek-bottle-label::before {
  display: none;
}
.ek-bottle.is-vial .ekMedHeading strong {
  font-size: 12px;
}
.ek-bottle.is-vial .ek-bottle-strength,
.ek-bottle.is-vial .ek-bottle-days {
  font-size: 10px;
}
.ek-bottle.is-vial.is-inactive .ek-bottle-cap {
  filter: grayscale(0.85);
  opacity: 0.75;
}
#cloudMedList.is-list .ek-bottle.is-vial {
  container-type: normal;
}
#cloudMedList.is-list .ek-bottle.is-vial .ek-bottle-body {
  height: auto;
  margin: 0;
  padding: 0;
  clip-path: none;
  filter: none;
  background: none;
}
#cloudMedList.is-list .ek-bottle.is-vial .ek-bottle-body::before,
#cloudMedList.is-list .ek-bottle.is-vial .ek-bottle-body::after {
  display: none;
}
#cloudMedList.is-list .ek-bottle.is-vial .ek-bottle-label {
  margin: 0;
  width: 100%;
  padding: 0;
  background: none;
}
#cloudMedList.is-list .ek-bottle.is-vial .ekMedHeading strong {
  font-size: 15px;
}
#cloudMedList.is-list .ek-bottle.is-vial .ek-bottle-strength,
#cloudMedList.is-list .ek-bottle.is-vial .ek-bottle-days {
  font-size: 13px;
}
#cloudMedList.is-list .ek-bottle.is-vial .ek-bottle-rx {
  color: transparent;
  border-color: #c9d6dc;
  border-radius: 3px 3px 6px 6px;
  background: linear-gradient(to top, #a9cfe0 0 calc(var(--level, 0) * 30%), #f3f8fa calc(var(--level, 0) * 30%) 100%);
}

/* Arrange your screens: Hide / Show on each row; a hidden row's name turns light gray */
button.ek-arrange-hide {
  min-height: 40px;
  padding: 0 10px;
  font-size: 13px;
}
.ek-arrange-row.is-hidden > span {
  color: #b9b1b4;
  font-weight: 500;
}
.ek-arrange-row.is-hidden {
  background: transparent;
  border-style: dashed;
}
/* Personal mode switch sits above the Features list */
.ek-personal-row {
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

/* Set up Parvin review: "Over the counter" tick on each medicine (styled like "Keep this") */
.ek-setup-fields > .ek-setup-check {
  flex-basis: 100%;
  gap: 8px;
}
.ek-setup-fields .ek-setup-check input {
  width: auto;
}
/* Care team: asking the owner to invite someone */
.ek-invite-ask {
  margin-top: 10px;
}

/* ---------- Health check → Vitals: tiles with a trend line, and a history chart ---------- */
.ek-vitals-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.ek-vitals-head h2 {
  margin: 0;
  /* Health check section headers (Vitals, Lab results): a little larger, bold and blue. */
  font-size: 26px;
  font-weight: 800;
  color: var(--sky);
}
.ek-vitals-range {
  display: flex;
  gap: 6px;
}
.ek-vitals-range .ek-filter-chip {
  min-height: 34px;
}
.ek-vitals-summary {
  margin: 8px 0 0;
  font-weight: 600;
  color: var(--ink);
}
/* One line per vital (vitals.js summary): ▲ ▼ – and the words colored by the latest reading's range,
   in regular weight so the color carries the meaning. */
.ek-vitals-move {
  display: block;
  font-weight: 400;
  color: var(--sage);
}
.ek-vitals-move.is-ok {
  color: #23785a;
}
.ek-vitals-move.is-warn {
  color: #b86400;
}
.ek-vitals-move.is-out {
  color: #d33b3b;
}
.ek-vitals-move.ek-summary-head {
  color: var(--ink);
}
/* "Dec 1, 2025 – Dec 1, 2026": the one date range every vital card and line covers. */
.ek-vitals-period {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--sage);
}
.ek-vitals-period strong {
  color: var(--ink);
}
.ek-vitals-period .ek-icon {
  width: 18px;
  height: 18px;
  color: var(--sky);
}
/* Two columns on wider screens, so a short list doesn't leave a wide empty band; one on phones.
   Filled down the first column, then the second. The lab summary's sentence spans both. */
@media (min-width: 640px) {
  .ek-vitals-summary:has(.ek-vitals-move) {
    column-count: 2;
    column-gap: 32px;
  }
  .ek-vitals-move {
    break-inside: avoid;
  }
  .ek-summary-head {
    column-span: all;
    margin-bottom: 4px;
  }
}
.ek-move-arrow {
  display: inline-block;
  min-width: 1.1em;
  text-align: center;
  color: var(--sage);
}
.ek-move-arrow.is-ok {
  color: #23785a;
}
.ek-move-arrow.is-warn {
  color: #b86400;
}
.ek-move-arrow.is-out {
  color: #d33b3b;
}
.ek-vitals-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.ek-vital-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  padding: 12px 12px 10px 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.ek-vital-tile.is-in {
  border-left-color: var(--leaf);
}
.ek-vital-tile.is-above,
.ek-vital-tile.is-below {
  border-left-color: #d98a00;
}
.ek-vital-tile[aria-pressed="true"] {
  border-color: var(--pine);
  border-left-color: var(--pine);
  box-shadow: 0 0 0 2px var(--pine-soft);
}
.ek-vital-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--sage);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ek-vital-value strong {
  font-size: 30px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.ek-vital-value small {
  font-size: 14px;
  color: var(--sage);
}
.ek-vital-status {
  display: inline-block;
  margin: 2px 0;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--leaf-soft);
  color: var(--leaf);
}
.ek-vital-tile.is-above .ek-vital-status,
.ek-vital-tile.is-below .ek-vital-status,
.ek-vital-status.is-above,
.ek-vital-status.is-below {
  background: var(--marigold-soft);
  color: var(--marigold);
}
.ek-vital-when,
.ek-vital-change {
  font-size: 12.5px;
  color: var(--sage);
  overflow-wrap: anywhere;
}
.ek-vital-change {
  font-weight: 600;
}
.ek-vital-spark {
  width: 100%;
  height: 38px;
  margin: 4px 0 2px;
}
.ek-vital-spark .ek-band,
.ek-vitals-svg .ek-band {
  fill: var(--leaf-soft);
}
.ek-vitals-svg .ek-band-2 {
  fill: #eef7f2;
}
.ek-spark-line {
  fill: none;
  stroke: var(--pine);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}
/* Dots are zero-length round lines so the stretched sparkline keeps them round. */
line.ek-spark-dot,
line.ek-spark-start-hole {
  stroke: var(--pine);
  stroke-width: 7;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
line.ek-spark-start-hole {
  stroke: var(--paper);
  stroke-width: 3;
}
.ek-spark-wrap {
  display: block;
  width: 100%;
}
.ek-spark-wrap .ek-vital-spark {
  display: block;
  margin-bottom: 0;
}
.ek-spark-axis {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
  font-size: 11px;
  color: var(--sage);
}
.ek-vitals-note {
  margin: 8px 0 0;
  font-size: 13px;
}
.ek-vitals-detail {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.ek-vitals-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}
.ek-vitals-detail-head h3 {
  margin: 0;
}
.ek-vitals-medtoggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}
.ek-vitals-insight {
  margin: 6px 0 4px;
  font-weight: 600;
}
.ek-vitals-chart {
  width: 100%;
  overflow: hidden;
}
.ek-vitals-svg {
  display: block;
  max-width: 100%;
  touch-action: manipulation;
}
.ek-vitals-svg .ek-grid {
  stroke: var(--line);
  stroke-width: 1;
}
.ek-vitals-svg .ek-axis {
  fill: var(--sage);
  font-size: 11px;
}
.ek-vitals-svg .ek-line {
  fill: none;
  stroke: var(--pine);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.ek-vitals-svg .ek-line-2 {
  stroke: var(--sky);
  stroke-width: 2;
  stroke-dasharray: 5 4;
}
.ek-vitals-svg .ek-bp-bar {
  stroke: var(--pine-soft);
  stroke-width: 8;
  stroke-linecap: round;
}
.ek-vitals-svg .ek-dot {
  fill: var(--pine);
  stroke: var(--paper);
  stroke-width: 2;
}
.ek-vitals-svg .ek-dot.is-low-number {
  fill: var(--sky);
}
/* Lab results (assets/labs.js): green in range, yellow borderline, red out of range (lab-ranges.js);
   the tile's edge, tint and badge, and the chart dots. Grey: no range to compare with. */
.ek-lab-tile {
  --lab-ok: #23785a;
  --lab-ok-soft: #eaf6ef;
  --lab-warn: #c98a00;
  --lab-warn-ink: #7a5200;
  --lab-warn-soft: #fff6d6;
  --lab-out: #c62828;
  --lab-out-ink: #b71c1c;
  --lab-out-soft: #fdecea;
}
.ek-vitals-svg .ek-dot.is-ok,
.ek-spark-dot.is-ok {
  fill: #23785a;
}
.ek-vitals-svg .ek-dot.is-warn,
.ek-spark-dot.is-warn {
  fill: #e0a100;
}
.ek-vitals-svg .ek-dot.is-out,
.ek-spark-dot.is-out {
  fill: #c62828;
}
.ek-lab-tile.is-ok {
  border-left-color: var(--lab-ok);
  background: var(--lab-ok-soft);
}
.ek-lab-tile.is-ok .ek-vital-status {
  background: #d3eedf;
  color: var(--lab-ok);
}
.ek-lab-tile.is-warn {
  border-left-color: var(--lab-warn);
  background: var(--lab-warn-soft);
}
.ek-lab-tile.is-warn .ek-vital-status {
  background: #fde89a;
  color: var(--lab-warn-ink);
}
.ek-lab-tile.is-out {
  border-left-color: var(--lab-out);
  background: var(--lab-out-soft);
}
.ek-lab-tile.is-out .ek-vital-status {
  background: #f9d2cd;
  color: var(--lab-out-ink);
}
.ek-lab-tile.is-none {
  border-left-color: var(--line, #c9cfc9);
}
.ek-lab-tile.is-none .ek-vital-status {
  background: #eceeec;
  color: var(--sage);
}
.ek-lab-typical {
  font-style: italic;
}
.ek-lab-tile .ek-vital-name {
  text-transform: none;
  letter-spacing: 0;
}
.ek-lab-words {
  margin: 4px 0;
  font-size: 14px;
  line-height: 1.35;
}
.ek-lab-list {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 14px;
}
.ek-lab-list li {
  margin-bottom: 4px;
}
.ek-lab-list li.is-out strong {
  color: #b71c1c;
}
.ek-lab-list li.is-warn strong {
  color: #7a5200;
}
.ek-lab-list li.is-ok strong {
  color: #23785a;
}
.ek-vitals-svg .ek-dot.is-home,
.ek-vitals-svg .ek-dot.is-note {
  fill: var(--paper);
  stroke: var(--pine);
  stroke-width: 2.5;
}
.ek-vitals-svg .ek-dot.is-low-number.is-home,
.ek-vitals-svg .ek-dot.is-low-number.is-note {
  stroke: var(--sky);
}
.ek-vitals-svg .ek-dot.is-above:not(.is-low-number),
.ek-vitals-svg .ek-dot.is-below:not(.is-low-number) {
  fill: #d98a00;
}
.ek-vitals-svg .ek-dot.is-above.is-home:not(.is-low-number),
.ek-vitals-svg .ek-dot.is-below.is-home:not(.is-low-number),
.ek-vitals-svg .ek-dot.is-above.is-note:not(.is-low-number),
.ek-vitals-svg .ek-dot.is-below.is-note:not(.is-low-number) {
  fill: var(--paper);
  stroke: #d98a00;
}
.ek-vitals-svg .ek-dot.is-selected {
  stroke: var(--ink);
  stroke-width: 2.5;
}
.ek-vitals-svg .ek-hit {
  fill: transparent;
  cursor: pointer;
}
.ek-vitals-svg .ek-hit:focus-visible {
  outline: none;
  stroke: var(--focus);
  stroke-width: 2;
}
.ek-vitals-svg .ek-med-mark {
  stroke: var(--sage);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  opacity: 0.6;
}
.ek-vitals-svg .ek-med-label {
  fill: var(--sage);
  font-size: 11px;
  font-weight: 600;
}
.ek-vitals-point {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-height: 40px;
  margin: 6px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--mist);
  font-size: 15px;
}
.ek-vitals-point button {
  margin-left: auto;
  min-height: 36px;
}
.ek-vitals-legend {
  margin: 4px 0 8px;
  font-size: 13px;
  line-height: 1.6;
}
.ek-key {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  vertical-align: -1px;
  background: var(--pine);
}
.ek-key.is-home {
  background: var(--paper);
  border: 2.5px solid var(--pine);
}
.ek-key.is-band {
  border-radius: 2px;
  width: 16px;
  background: var(--leaf-soft);
  border: 1px solid #b9dcc9;
}
.ek-vitals-list summary {
  cursor: pointer;
  font-weight: 600;
  padding: 6px 0;
}
.ek-vitals-list table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.ek-vitals-list th,
.ek-vitals-list td {
  padding: 6px 8px 6px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.ek-vitals-list tr.is-above td:nth-child(2),
.ek-vitals-list tr.is-below td:nth-child(2) {
  color: var(--marigold);
}
.ek-vitals-add {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.ek-vitals-add-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: flex-end;
}
.ek-vitals-add-fields label {
  margin: 0;
}
.ek-vitals-kind {
  width: 12rem;
}
.ek-vitals-num {
  width: 8rem;
}
.ek-vitals-date {
  width: 10.5rem;
}
@media (prefers-color-scheme: dark) {
  .ek-vitals-svg .ek-band-2 {
    fill: rgba(35, 120, 90, 0.14);
  }
}
.ek-key.is-out {
  background: #d98a00;
}

/* Top-bar circle picker: the name and arrow are shown; the native <select> lies over them, invisible,
   so a tap opens the usual list. The name only shortens with "…" when there's truly no room. */
.ek-circle-switch {
  position: relative;
  gap: 2px;
  min-height: 40px;
  padding: 0 6px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
}
.ek-circle-switch:hover,
.ek-circle-switch:focus-within {
  border-color: var(--line-strong);
  background-color: var(--paper);
}
.ek-circle-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 260px;
  font-size: 1.05rem;
}
.ek-circle-chevron {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  transform: rotate(90deg);
  color: var(--muted, #6b6b6b);
}
.ek-circle-switch select,
.ek-circle-switch select:hover {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  min-height: 0;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 16px; /* iPhone doesn't zoom in on 16px */
}
/* Phones: the care circle's name gets the room in the top bar. Help moves to the top of More
   (Ask Parvin answers "how do I…" questions too), and the buttons sit a little closer. */
@media (max-width: 640px) {
  #ekWelcomeBanner {
    gap: 8px;
    padding: 0 12px;
  }
  .ek-circle-switch {
    flex: 0 1 auto;
    min-width: 0;
  }
  .ek-circle-name {
    max-width: none;
  }
  .ek-topbar-actions {
    flex: 0 0 auto;
    gap: 4px;
  }
  .ek-topbar-actions .ek-help-button {
    display: none;
  }
  .ek-topbar-actions .ek-icon-button {
    width: 40px;
    height: 40px;
  }
}
.ek-menu-help-mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid currentColor;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
}

/* ---------- Screen-fit pass (November 2026): every page checked at 375, 390 and 430 wide ---------- */
/* Settings & more → Your account: the name box stayed 1 line wide and ran past the card. */
.ek-myname label {
  flex: 1 1 220px;
  min-width: 0;
  max-width: 360px;
}
/* Calculator result: the text isn't indented by the page's own spacing. */
#ekSavings {
  white-space: normal;
}
/* Today on a computer: the headline keeps a readable width next to the person's card. */
@media (min-width: 1081px) {
  .ek-today-head > div:first-child {
    flex: 1 1 340px;
    min-width: 300px;
  }
  .ek-today-head .ekRecipientCard {
    flex: 0 1 480px;
    min-width: 0;
  }
}
/* Tell Parvin anything: room for the whole example on a phone. */
@media (max-width: 640px) {
  .ek-one-box textarea#ekTodayNote {
    min-height: 94px;
  }
}
/* Medicine form: "1 pill per day" stays on one line on a phone. */
@media (max-width: 640px) {
  .ekMedDose {
    flex-wrap: nowrap;
    gap: 6px;
  }
  .ekMedDose input {
    flex: 0 0 64px;
    width: 64px;
  }
  .ekMedDose select {
    flex: 1 1 auto;
    min-width: 0;
    padding-left: 10px;
    padding-right: 26px;
  }
}
/* Contacts: on a phone an email gets the whole line, with Personal/Work and × under it. */
@media (max-width: 640px) {
  .ekContactFieldRow {
    grid-template-columns: minmax(0, 1fr) 112px 36px;
  }
  .ekContactFieldRow[data-kind="Email"] {
    grid-template-columns: minmax(0, 1fr) 36px;
  }
  .ekContactFieldRow[data-kind="Email"] > select {
    justify-self: start;
    width: auto;
  }
  .ekContactFieldRow[data-kind="Email"] > input {
    grid-column: 1 / -1;
  }
}
/* Care profile: a contact's phone box fits a whole number (it was squeezed to ~90px). */
.ek-split-contactphone .ek-split-boxes {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 210px);
}
@media (max-width: 640px) {
  .ek-split-contactphone .ek-split-boxes {
    grid-template-columns: minmax(0, 1fr);
  }
  .ek-split-contactphone .ek-split-boxes > :last-child {
    max-width: 220px;
  }
}
/* Tick boxes with a long sentence beside them: the box keeps its size and sits on the first line. */
.ekContactToggle {
  align-items: flex-start;
}
.ekContactToggle > input[type="checkbox"] {
  flex: 0 0 auto;
  margin-top: 1px;
}
/* Everyone: titles and details wrap instead of being cut off. */
.ek-every-row {
  white-space: normal;
}
.ek-every-what strong {
  white-space: normal;
  overflow: visible;
}
.ek-every-what small {
  white-space: normal;
}
/* Medicine bottles: "Details" is a comfortable tap, not 12px text. */
.ek-bottle .ekMedActions button.secondary {
  min-height: 36px;
  font-size: 14px;
}
/* Feedback filter (Open / Archive / All): taller buttons. */
.ek-feedback-filter button {
  min-height: 36px;
}
/* The screenshot hint sits under its button rather than squeezed beside it. */
#ekFeedbackShotsHint {
  display: block;
  margin-top: 8px;
}
#ekFeedbackShotsHint:empty {
  display: none;
}
/* File pickers: the button inside matches the app's other buttons. */
input[type="file"]::file-selector-button {
  font: 600 15px/1.2 var(--font);
  color: var(--pine);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  padding: 7px 12px;
  margin-right: 10px;
  cursor: pointer;
}
/* What Parvin remembers: on a phone the box gets the whole line, Remember goes under it. */
@media (max-width: 640px) {
  .ek-memory-add {
    grid-template-columns: minmax(0, 1fr);
  }
  .ek-memory-add button {
    justify-self: start;
  }
}
/* Medicine form: what's printed on the prescription label */
.ek-med-label-extra { margin: 10px 0 4px; border: 1px solid var(--line, #e3e0da); border-radius: 12px; padding: 8px 12px; }
.ek-med-label-extra > summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; color: var(--muted, #6b6b6b); }
.ek-med-label-extra[open] > summary { margin-bottom: 8px; }
.ek-med-call { margin-left: 6px; font-weight: 600; }
/* Rides and repeat days (assets/rides.js) */
.ek-ride {
  padding: 10px 12px;
  margin: 4px 0 8px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--sky);
  border-radius: 10px;
  background: var(--sky-soft);
}
.ek-ride label {
  margin-top: 6px;
}
.ek-ride-return {
  max-width: 14rem;
}
.ek-repeat-days {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 2px 0 10px;
}
.ek-repeat-days-label {
  font-weight: 600;
  margin-right: 4px;
}
.ek-repeat-days .ek-filter-chip {
  min-width: 52px;
  min-height: 38px;
}
#ekAppointmentDetail[data-ride] .ek-visit-start,
#ekAppointmentDetail[data-ride] .ek-prep-start,
#ekAppointmentDetail[data-ride] .ek-prep {
  display: none !important;
}

/* Eyeglass prescription (Care profile): right eye over left eye, a small label over each box.
   Each box is sized for its value: powers like "-10.25", an axis up to 180, a prism like "1.0 BI".
   Wide screens: one line per eye. Phones: the eye's name, then two lines of boxes. */
.ek-rx {
  display: grid;
  gap: 14px;
  margin: 4px 0 16px;
}
.ek-rx-row {
  display: grid;
  grid-template-columns: 120px repeat(4, minmax(84px, 108px)) minmax(100px, 128px);
  gap: 8px;
  align-items: end;
}
.ek-rx-eye {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.25;
  align-self: center;
  padding-top: 18px;
}
label.ek-rx-cell {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--sage);
}
.ek-rx-cell input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 4px 0 0;
  padding-inline: 8px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.ek-rx-pd input {
  max-width: 200px;
}
@media (max-width: 640px) {
  .ek-rx-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .ek-rx-eye {
    grid-column: 1 / -1;
    padding-top: 0;
  }
}

/* Renaming a document: the name becomes a box in place, room for a long name. */
.ekDocRowName {
  flex: 1 1 auto;
  min-width: 0;
}
.ek-doc-rename {
  margin: 0 0 4px;
}
.ek-doc-rename input {
  flex: 1 1 240px;
}

/* A document's name opens it. */
.ekDocNameLink {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--pine);
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  min-height: 0;
}
.ekDocNameLink:hover {
  color: var(--pine-deep);
}
.ekDocNameLink:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* Delete stands apart from the other document buttons. */
.ekDocActions .ek-doc-delete {
  color: var(--danger, #b42318);
  border-color: currentColor;
}

/* Add document: pages of one paper, joined into one PDF. */
.ek-doc-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 4px 0 14px;
}
.ek-doc-pages #ekDocumentPages {
  font-weight: 600;
}

/* "Filled in from the document …" under the eyeglass prescription. */
.ek-eyerx-source {
  margin: 0 0 10px;
  font-size: 14px;
}

/* "Parvin read your documents" (Documents page): one entry per document just saved. */
.ek-doc-findings h2 {
  margin: 0 0 8px;
}
.ek-doc-finding {
  border-top: 1px solid var(--line);
  padding: 14px 0 6px;
}
.ek-doc-finding:first-child {
  border-top: 0;
  padding-top: 4px;
}
.ek-doc-finding-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ek-doc-finding-line {
  margin: 6px 0 0;
}
.ek-doc-finding-line.is-ok::before {
  content: "✓ ";
  color: var(--pine);
  font-weight: 700;
}
.ek-doc-finding-line.is-warn::before {
  content: "! ";
  color: #b45309;
  font-weight: 700;
}
.ek-doc-finding-body:not(:empty) {
  margin-top: 10px;
}

/* The eyeglass prescription section uses the full width: the table, then PD and the dates on one
   row, then the doctor and lenses, then notes. (Care profile sections are two columns otherwise.) */
#ekEyeRx > p,
#ekEyeRx > .ek-rx-wide,
#ekEyeRx > .ek-rx,
#ekEyeRx > .ek-form-grid {
  grid-column: 1 / -1;
}
#ekEyeRx > .ek-form-grid {
  display: grid;
  grid-template-columns: minmax(150px, 200px) repeat(2, minmax(160px, 220px));
  gap: 0 18px;
  justify-content: start;
}
@media (max-width: 640px) {
  #ekEyeRx > .ek-form-grid {
    grid-template-columns: 1fr;
  }
}

/* Example hints in empty boxes ("e.g. 150 lb", "-2.25") are light and italic, so they can't be
   mistaken for something entered. */
input::placeholder,
textarea::placeholder {
  color: #cdbabe;
  opacity: 1;
  font-style: italic;
}

/* Scan a paper: "Keep the photo in Documents" on its own line above the buttons. */
.ek-scan-keepdoc {
  flex-basis: 100%;
  margin: 0 0 4px;
}

/* Family photo on Today (assets/group-photo.js). The picture keeps a calm 4:3 frame and fills
   the card's width; the caption sits under it. */
.ek-group-photo {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ek-group-photo-img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 340px;
  object-fit: cover;
  border-radius: calc(var(--r-surface, 18px) - 8px);
  background: var(--mist);
}
.ek-group-photo-caption {
  margin: 0;
  font-weight: 600;
  text-align: center;
}
.ek-group-photo-empty {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 16px;
  border: 2px dashed var(--line);
  border-radius: calc(var(--r-surface, 18px) - 8px);
}
.ek-group-photo-empty p {
  margin: 0;
}
/* Settings & more › Family photo: the current picture, then its caption and buttons. */
.ek-group-photo-preview {
  max-width: 420px;
  max-height: 260px;
  margin-bottom: 12px;
}
.ek-group-photo-settings label {
  margin-bottom: 8px;
}
.ek-group-photo-settings input {
  width: 100%;
  max-width: 420px;
}
.ek-group-photo-settings .ek-danger {
  margin-top: 8px;
}

/* Today's top row: the care recipient's card on the left, the family photo on its right, and the
   day's summary ("1 task is overdue…") across the full width below them. If the photo is hidden
   (none yet, or hidden in Arrange your screens), the card takes the whole row. */
.ek-today-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
}
.ek-today-head > div:first-child {
  order: 2;
}
.ek-today-top {
  order: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 18px;
}
.ek-today-top > .ekRecipientCard {
  flex: 1 1 340px;
  margin: 0;
  max-width: none;
}
.ek-today-top > .ek-group-photo {
  flex: 1 1 340px;
  margin: 0;
}
.ek-today-top .ek-group-photo-img {
  max-height: 240px;
}
@media (max-width: 640px) {
  .ek-today-top .ek-group-photo-img {
    max-height: 200px;
  }
}
/* Beside the photo, the care recipient's card is a profile card: bigger picture and name, centred. */
.ek-today-top > .ekRecipientCard.ek-now-card {
  align-content: center;
  align-items: center;
}
/* Her picture fills the left of the card, about as tall as the family photo beside it. */
.ek-today-top > .ekRecipientCard .ekPortrait {
  width: clamp(88px, 14vw, 190px);
  height: clamp(88px, 14vw, 190px);
  font-size: clamp(32px, 5vw, 72px);
  box-shadow: 0 0 0 5px var(--paper), 0 0 0 6px var(--line);
}
.ek-today-top > .ekRecipientCard.ek-now-card {
  column-gap: clamp(14px, 2vw, 28px);
}
@media (max-width: 640px) {
  .ek-today-top > .ekRecipientCard .ekPortrait {
    width: 96px;
    height: 96px;
    font-size: 36px;
  }
}
.ek-today-top > .ekRecipientCard .ekRecipientName {
  font-size: 22px;
}
.ek-today-top .ek-group-photo-img {
  max-height: 210px;
}
.ek-today-top > .ek-group-photo,
html[data-look] .ek-today-top > .ek-group-photo {
  margin-bottom: 0;
}
/* Picture on the left; her name, the latest update and Profile stacked beside it. */
.ek-today-top > .ekRecipientCard.ek-now-card {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  row-gap: 12px;
  padding: clamp(18px, 2vw, 28px);
}
.ek-today-top > .ekRecipientCard.ek-now-card > .ekPortrait {
  grid-row: 1 / span 2;
  align-self: center;
}
.ek-today-top > .ekRecipientCard.ek-now-card > div {
  align-self: end;
}
.ek-today-top > .ekRecipientCard.ek-now-card > .secondary {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  align-self: start;
}

/* Contacts: Delete on each contact, and "Delete several" with a tick box per contact. */
.ek-contact-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ek-contact-pick {
  display: none;
  width: 22px;
  height: 22px;
  margin: 0 10px 0 0;
  vertical-align: middle;
  accent-color: var(--pine);
}
#ekContactsList.is-picking .ek-contact-pick {
  display: inline-block;
}
.ek-contacts-bulk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--pine-soft);
}
.ek-contacts-bulk span {
  font-weight: 600;
  margin-right: auto;
}
.ek-danger-fill {
  background: #b42318;
  border-color: #b42318;
}
.ek-danger-fill:hover {
  background: #912018;
}
.ek-contact-delete {
  color: #b42318;
}

/* "Who drives?": the care team and Contacts in a list, or any name typed in. */
.ek-combo-wrap {
  position: relative;
  margin-bottom: 6px;
}
.ek-combo-wrap > label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}
.ek-combo {
  position: relative;
  max-width: 420px;
}
.ek-combo input {
  width: 100%;
  padding-right: 48px;
}
/* The arrow sits inside the box, so the box keeps the same look as every other field. */
.ek-combo-open {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  min-height: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  padding: 0;
}
.ek-combo-open:hover {
  background: var(--sky-soft, #eef4fb);
}
.ek-combo-open .ek-icon {
  width: 18px;
  height: 18px;
  transform: rotate(90deg);
}
.ek-combo-list {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  max-width: 420px;
  max-height: 280px;
  overflow-y: auto;
  margin-top: 4px;
  padding: 4px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}
.ek-combo-group {
  padding: 8px 10px 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #6b6b6b);
}
.ek-combo-item {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  white-space: normal;
}
.ek-combo-item:hover,
.ek-combo-item:focus-visible {
  background: var(--sky-soft, #eef4fb);
  outline: none;
}
.ek-combo-item strong {
  display: block;
  font-weight: 600;
}
.ek-combo-item small {
  display: block;
  color: var(--muted, #6b6b6b);
}
.ek-combo-typed {
  font-weight: 600;
  color: var(--pine);
}
.ek-ride-booking {
  max-width: 16rem;
}

/* ---------- Phones: the screen never slides sideways ----------
   Something wider than the screen (a long name, a row of buttons) used to let the whole page be
   dragged sideways on an iPhone, leaving a blank strip and pushing the bottom buttons off the
   edge. The page itself is held to the screen's width; lists that scroll sideways on purpose
   (the suggestion chips) still do. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@supports not (overflow: clip) {
  body {
    overflow-x: hidden;
  }
}
/* Long names, emails and organizations wrap inside their card instead of widening it. */
.ek-member-facts dd,
.ekContactItem summary,
.ek-attention-title {
  overflow-wrap: anywhere;
  min-width: 0;
}
.ekDashboardMain,
.ekDashboardSide,
.ek-main,
.section,
.card {
  min-width: 0;
}
/* Bottom buttons: six always fit, whatever the screen or text size. */
#ekBottomNav {
  grid-auto-columns: minmax(0, 1fr);
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
}
#ekBottomNav > button {
  min-width: 0;
  overflow: visible;
}
#ekBottomNav > button {
  white-space: nowrap;
  text-overflow: ellipsis;
}
/* Contact form: the website box is sized for an address, not the whole row. */
.ek-contact-website {
  max-width: 28rem;
}

/* ---------- iPhone: cards stay the width of the screen ----------
   On an iPhone a card could take the width of its longest line (a long task title, a pharmacy
   address) and run off the right edge, cut off now that the page can't slide sideways. Each card
   takes its width from the screen, never from what's inside it, and long lines wrap. */
@media (max-width: 900px) {
  /* The columns can never be wider than the screen ("1fr" alone lets the widest line win). */
  .ekDashboardColumns {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .ekDashboardMain,
  .ekDashboardSide {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  /* Each card fills its column: never narrower (Safari shrank one to a sliver), never wider. */
  .ekDashboardMain > .card,
  .ekDashboardSide > .card,
  .section > .card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}
.ek-attention,
.ek-attention li {
  min-width: 0;
  max-width: 100%;
}
.ek-attention-row {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
}
.ek-attention-row > span {
  min-width: 0;
}
.ek-attention-title,
.ek-attention-meta {
  overflow-wrap: anywhere;
}
.ek-mine-row,
.ek-mine-row #ekMyTasks,
.ek-mine-row .ekMyTaskLink {
  max-width: 100%;
}
.ekMyTaskTitle {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Phones: the "48 days late" / "Tomorrow 10:30 AM" tag goes under the title, so long titles
   get the whole width instead of wrapping into a narrow column. */
@media (max-width: 640px) {
  .ek-attention-row,
  html[data-look="fresh"] .ek-attention-row {
    grid-template-columns: 12px minmax(0, 1fr);
    row-gap: 6px;
  }
  .ek-attention-row > .ek-when {
    grid-column: 2;
    justify-self: start;
  }
  /* the dot lines up with the title */
  html[data-look="fresh"] .ek-attention-row::before {
    align-self: start;
    margin-top: 0.45em;
  }
}
/* Phones: in Coming up the "Tomorrow 8:00 AM" tag goes under the details, like Needs attention,
   so the title and details get the full width. */
@media (max-width: 640px) {
  .ekUpcomingRow {
    grid-template-columns: 36px minmax(0, 1fr);
    row-gap: 6px;
    align-items: start;
  }
  .ekUpcomingRow > .ekUpcomingBadge {
    grid-column: 2;
    justify-self: start;
  }
}

/* "Tell Parvin anything" opened from the top Parvin button when the Today card is hidden or
   another page is open: the same card, in a sheet over the page. */
.ek-parvin-sheet {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 36px 0 0;
  border: 0;
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  overflow: auto;
}
.ek-parvin-sheet::backdrop {
  background: rgba(20, 10, 15, 0.45);
}
.ek-parvin-sheet > .card {
  margin: 0;
  box-shadow: none;
  border: 0;
}
.ek-parvin-sheet-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 40px;
  height: 40px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}
@media (max-width: 640px) {
  .ek-parvin-sheet {
    margin: 12px auto auto;
  }
}

/* Ask Parvin answers: a short answer, then one line per item. */
.ek-ask-text p {
  margin: 0 0 8px;
}
.ek-ask-text ul {
  margin: 4px 0 8px;
  padding-left: 1.2em;
}
.ek-ask-text li {
  margin: 0 0 8px;
  line-height: 1.4;
}

/* Care profile, Medical team: one line per doctor and the pharmacy (who · name · phone); tap a
   line to open its details. Boxes are sized for what goes in them. */
#recipient fieldset > .ek-medteam {
  grid-column: 1 / -1;
}
.ek-medteam {
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.ek-medteam .ek-doc {
  border-bottom: 1px solid var(--line);
}
.ek-doc-line {
  display: grid;
  grid-template-columns: 16px minmax(9rem, 13rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}
.ek-doc-line::-webkit-details-marker {
  display: none;
}
.ek-doc-line:hover {
  background: color-mix(in srgb, var(--line) 35%, transparent);
}
.ek-doc-chevron::before {
  content: "›";
  display: inline-block;
  font-size: 20px;
  line-height: 1;
  color: var(--brand, #c9306b);
  transition: transform 0.15s;
}
.ek-doc[open] > .ek-doc-line .ek-doc-chevron::before {
  transform: rotate(90deg);
}
.ek-doc-role {
  font-size: 14px;
  font-weight: 500;
  color: var(--sage);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ek-doc-line .ek-doc-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ek-doc-line .ek-doc-name.is-empty {
  font-weight: 400;
  font-style: italic;
  color: var(--sage);
}
.ek-doc-meta {
  white-space: nowrap;
}
.ek-doc-body {
  padding: 4px 14px 12px 42px;
}
.ek-doc-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  margin: 0 0 10px;
}
#recipient label.ek-fill-pick {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  width: auto;
  max-width: 100%;
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--sage);
}
.ek-doc-tools label.ek-fill-pick {
  margin-bottom: 0;
}
#recipient label.ek-fill-pick select {
  width: 17rem;
  max-width: 100%;
  min-height: 36px;
  padding: 4px 8px;
  margin: 0;
  font-size: 14px;
}
.ek-specialist-remove {
  margin: 0;
}
/* Name, specialty and phone side by side, each as wide as what goes in it. */
#recipient .ek-doc-boxes,
#recipient .ek-medteam .ek-split-contactphone .ek-split-boxes,
#recipient .ek-medteam .ek-split-address .ek-split-boxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0 12px;
}
#recipient .ek-medteam label {
  font-weight: 500;
  font-size: 14px;
  color: var(--sage);
  margin-bottom: 10px;
}
#recipient .ek-medteam .ek-doc-boxes input,
#recipient .ek-medteam .ek-split-boxes input,
#recipient .ek-medteam .ek-split-boxes select {
  width: 100%;
}
.ek-medteam .ek-doc-name,
.ek-medteam .ek-split-person,
.ek-medteam .ek-split-street {
  flex: 0 1 16rem;
}
.ek-medteam .ek-doc-specialty,
.ek-medteam .ek-split-city {
  flex: 0 1 11rem;
}
.ek-medteam .ek-doc-phone,
.ek-medteam .ek-split-phone {
  flex: 0 1 10rem;
}
.ek-medteam .ek-split-unit {
  flex: 0 1 8rem;
}
.ek-medteam .ek-split-state {
  flex: 0 1 6rem;
}
.ek-medteam .ek-split-zip {
  flex: 0 1 7rem;
}
.ek-medteam .ek-split {
  margin: 0;
}
.ek-medteam .ek-split-title {
  font-size: 14px;
  margin: 0 0 4px;
}
.ek-medteam-add {
  margin: 0;
  padding: 10px 14px;
}
.ek-medteam-add button {
  width: auto;
}
@media (max-width: 640px) {
  .ek-doc-line {
    grid-template-columns: 16px minmax(0, 1fr);
    padding: 10px 12px;
  }
  .ek-doc-line .ek-doc-chevron {
    grid-row: 1 / span 3;
    align-self: start;
  }
  .ek-doc-line .ek-doc-role,
  .ek-doc-line .ek-doc-name,
  .ek-doc-line .ek-doc-meta {
    grid-column: 2;
    white-space: normal;
  }
  .ek-doc-body {
    padding: 4px 12px 12px;
  }
  .ek-medteam .ek-doc-name,
  .ek-medteam .ek-doc-specialty,
  .ek-medteam .ek-split-person,
  .ek-medteam .ek-split-street,
  .ek-medteam .ek-split-city {
    flex-basis: 100%;
  }
}

/* "Parvin is reading it" (reading.js): a small page with a line sweeping down it, the step Parvin
   is on, animated dots and the seconds so far, wherever a document or photo is being read. */
.ek-reading {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  color: var(--ink);
  font-weight: 600;
}
.ek-reading-doc {
  position: relative;
  flex: none;
  width: 18px;
  height: 22px;
  border: 2px solid var(--pine);
  border-radius: 3px;
  background:
    linear-gradient(var(--pine-soft), var(--pine-soft)) 3px 5px / 8px 2px no-repeat,
    linear-gradient(var(--pine-soft), var(--pine-soft)) 3px 10px / 8px 2px no-repeat,
    linear-gradient(var(--pine-soft), var(--pine-soft)) 3px 15px / 6px 2px no-repeat,
    var(--paper);
  overflow: hidden;
}
.ek-reading-doc::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--pine);
  box-shadow: 0 0 6px var(--pine);
  animation: ek-reading-scan 1.6s ease-in-out infinite alternate;
}
@keyframes ek-reading-scan {
  to {
    top: calc(100% - 3px);
  }
}
.ek-reading-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: -4px;
}
.ek-reading-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--pine);
  animation: ek-reading-dot 1.2s ease-in-out infinite;
}
.ek-reading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.ek-reading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes ek-reading-dot {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
.ek-reading-time {
  color: var(--sage);
  font-weight: 400;
  font-size: 0.85em;
  font-variant-numeric: tabular-nums;
}
.ek-reading-slow {
  flex-basis: 100%;
  color: var(--sage);
  font-weight: 400;
  font-size: 0.9em;
}
.ek-reading.is-small {
  font-weight: 400;
  color: inherit;
  gap: 6px;
}
.ek-reading.is-small .ek-reading-doc {
  width: 12px;
  height: 15px;
  border-width: 1.5px;
  background: var(--paper);
}
@media (prefers-reduced-motion: reduce) {
  .ek-reading-doc::after,
  .ek-reading-dots span {
    animation-duration: 3s;
  }
}

/* ---------- Health check on wide screens ----------
   Phones and tablets keep the single stacked column. On a computer:
   - Vitals and Lab results fit more tiles to a row (fewer rows to scroll), and the vitals summary
     runs in three columns, once their column is at least 960px (1080px for the summary) wide.
   - From 1440px the page widens and the health log sits in its own column on the right, which
     stays in view while scrolling through vitals and labs. */
.ek-health-main {
  container-type: inline-size;
}
.ek-health-log-title {
  display: none;
}
@container (min-width: 960px) {
  .ek-vitals .ek-vitals-tiles {
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  }
}
@container (min-width: 1080px) {
  #ekVitalsSummary:has(.ek-vitals-move) {
    column-count: 3;
  }
}
@media (min-width: 1440px) {
  .shell:has(#health.active) {
    max-width: 1800px;
  }
  .ek-health-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(360px, 24vw, 440px);
    gap: 20px;
    align-items: start;
  }
  .ek-health-main {
    display: flex;
    flex-direction: column;
  }
  /* "Add a health note" opens at the top of the left column, not under the lab results. */
  .ek-health-main > #ekObsForm {
    order: -1;
  }
  .ek-health-side {
    position: sticky;
    top: calc(var(--topbar) + 16px);
    max-height: calc(100vh - var(--topbar) - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    border-radius: var(--r-surface);
  }
  .ek-health-side > .card:last-child {
    margin-bottom: 0;
  }
  .ek-health-log-title {
    display: block;
    margin: 0 0 12px;
    font-size: 26px;
    font-weight: 800;
    color: var(--sky);
  }
  /* A narrow column: the filter chips wrap instead of scrolling sideways. */
  .ek-health-side .ek-filter-bar {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

/* ---------- Documents → Add document: one closed entry under the folders ----------
   Opening it shows the ways to add: one document (PDF or photos of its pages) or many at once. */
.ek-doc-add > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
}
.ek-doc-add > summary::-webkit-details-marker {
  display: none;
}
.ek-doc-add > summary .ek-icon {
  width: 22px;
  height: 22px;
  color: var(--brand-rose, #c9306b);
}
.ek-doc-add-title {
  font-size: 18px;
  font-weight: 700;
}
.ek-doc-add-hint {
  font-size: 14px;
}
.ek-doc-add > summary::after {
  content: "";
  width: 9px;
  height: 9px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.6;
}
.ek-doc-add[open] > summary::after {
  transform: rotate(-135deg);
}
.ek-doc-add-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 12px;
  align-items: start;
  margin-top: 14px;
}
.ek-doc-add-option {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 100%;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: var(--r-surface);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ek-doc-add-option:hover,
.ek-doc-add-option:focus-visible {
  border-color: var(--brand-rose, #c9306b);
}
.ek-doc-add-option strong {
  font-size: 16px;
}
.ek-doc-add #ekAddDocumentForm {
  margin-top: 18px;
}

/* ---------- Every screen on wide computer screens (1440px and up) ----------
   The pages were built for a 1120px column, which leaves wide empty margins on a big monitor.
   From 1440px most pages widen and some lay cards side by side. Phones, tablets and laptops
   are unchanged. Family updates (a conversation) and Settings (forms) keep the reading width.
   Health check has its own rules above. */
@media (min-width: 1440px) {
  .shell:is(:has(#home.active), :has(#calendar.active), :has(#carecalendar.active), :has(#meds.active),
      :has(#recipient.active), :has(#documents.active), :has(#team.active), :has(#finance.active),
      :has(#agents.active)) {
    max-width: 1560px;
  }

  /* Today: the side column (this week, suggestions) gets room for its cards. */
  .ekDashboardColumns:not(.ek-one-column) {
    grid-template-columns: minmax(0, 1.6fr) minmax(360px, 1fr);
    gap: 22px;
  }

  /* Plan → To-do list: two columns of to-dos instead of one long list. */
  #cloudTaskList {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
    align-items: start;
  }
  #cloudTaskList > :is(h2, h3, h4, p, .ek-day-head, details) {
    grid-column: 1 / -1;
  }

  /* Plan → Week: days in two columns, read left to right (Today, Tomorrow, then the next pair). */
  #ekPlanWeekList {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 36px;
    align-content: start;
  }
  #ekPlanWeekList > .is-overdue,
  #ekPlanWeekList > .ek-plan-foot {
    grid-column: 1 / -1;
  }
  #ekPlanWeekList > .ek-plan-day:nth-last-child(2) {
    border-bottom: 1px solid var(--line);
  }

  /* Michael's profile: the profile on the left, "What Parvin remembers" beside it. */
  #recipient.active {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(340px, 26vw, 420px);
    grid-template-rows: auto 1fr;
    column-gap: 20px;
    align-items: start;
  }
  #recipient > * {
    grid-column: 1;
  }
  #recipient > .card:first-of-type {
    grid-row: 1 / -1;
  }
  #recipient > .card:not(:first-of-type) {
    grid-column: 2;
  }

  /* Care team: family and helpers (and the invite) on the left, contacts on the right. */
  #team.active {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto auto 1fr;
    column-gap: 20px;
    align-items: start;
  }
  #team > * {
    grid-column: 1;
  }
  #team > .ek-page-head {
    grid-column: 1 / -1;
  }
  #team > .ek-team-contacts {
    grid-column: 2;
    grid-row: 2 / span 3;
  }
  #team > #ekContactForm {
    grid-column: 2;
    grid-row: 5;
  }

  /* Expenses → Overview: where the money goes and the latest bills beside the monthly chart. */
  #finance [data-money-panel="overview"]:not([hidden]):has(> #ekExpenseChart:not([hidden])) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 32px;
    align-items: start;
  }
}

/* Settings & more → Your calendar: two parts in one section, split by a thin line. */
.ek-cal-part > h3 {
  margin: 4px 0 6px;
  font-size: 17px;
}
.ek-cal-part + .ek-cal-part {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line, rgba(0, 0, 0, 0.1));
}

/* Emoji icon tiles (assets/heading-icons.js): every icon is an emoji on a soft colored tile.
   The tile takes the size each place already gives .ek-icon, plus a little padding around it. */
:root {
  --tile-pink: rgba(201, 48, 107, 0.13);
  --tile-sky: rgba(36, 95, 147, 0.13);
  --tile-leaf: rgba(35, 120, 90, 0.14);
  --tile-marigold: rgba(214, 150, 20, 0.18);
  --tile-plum: rgba(122, 75, 194, 0.14);
  --tile-rose: rgba(214, 60, 50, 0.13);
  --tile-slate: rgba(79, 97, 112, 0.13);
}
.ek-emo {
  display: inline-grid;
  place-items: center;
  box-sizing: content-box !important;
  width: 20px;
  height: 20px;
  padding: 5px;
  border-radius: 10px;
  background: var(--tile-pink);
  container-type: inline-size;
  flex: none !important;
  line-height: 1;
  vertical-align: middle;
  stroke: none;
  transition:
    transform 0.22s cubic-bezier(0.3, 1.6, 0.5, 1),
    background-color 0.15s;
}
.ek-emo[data-tone="sky"] { background: var(--tile-sky); }
.ek-emo[data-tone="leaf"] { background: var(--tile-leaf); }
.ek-emo[data-tone="marigold"] { background: var(--tile-marigold); }
.ek-emo[data-tone="plum"] { background: var(--tile-plum); }
.ek-emo[data-tone="rose"] { background: var(--tile-rose); }
.ek-emo[data-tone="slate"] { background: var(--tile-slate); }
.ek-emo > i {
  font-style: normal;
  font-weight: normal;
  font-size: 84cqw;
  line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
/* The calendar icon: a small page with today's month on a red band and the day below. */
.ek-emo > svg.ek-cal {
  display: block;
  width: 92cqw;
  height: 92cqw;
  overflow: visible;
  font-family: var(--font, system-ui, sans-serif);
}
.ek-cal-page {
  fill: #fff;
  stroke: rgba(36, 95, 147, 0.22);
  stroke-width: 3;
}
.ek-cal-band { fill: #e2483d; }
/* An emoji sits a little above the tile's bottom edge; the drawn page doesn't, so lower it to match. */
.ek-emo.ek-hicon:has(> .ek-cal) { vertical-align: -0.4em; }
.ek-cal-month {
  fill: #fff;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 1px;
}
.ek-cal-day {
  fill: #2b2b2b;
  font-size: 50px;
  font-weight: 700;
  letter-spacing: -1px;
}
/* On a pink (selected or primary) button the tile turns white so the emoji still stands out. */
button.primary .ek-emo,
.ek-filter-chip[aria-pressed="true"] .ek-emo {
  background: rgba(255, 255, 255, 0.85);
}
/* Headings: tile sized to the heading's text. */
.ek-emo.ek-hicon {
  width: 0.95em;
  height: 0.95em;
  padding: 0.2em;
  border-radius: 0.32em;
  margin-right: 0.4em;
  vertical-align: -0.28em;
}
.ek-emo.ek-act-icon {
  width: 20px;
  height: 20px;
  margin-top: 0;
}
.ek-emo.ek-dg-icon {
  width: 15px;
  height: 15px;
  padding: 4px;
  border-radius: 8px;
}
/* Small round tile inside filter chips and inline labels. */
:is(.ek-filter-chip, .ek-sev, .ek-sos-tag, .ek-offer-tag, .ek-double-tag, .ek-plan-title, a, summary, label) > .ek-emo:not(.ek-icon):not(.ek-hicon) {
  width: 16px;
  height: 16px;
  padding: 3px;
  border-radius: 999px;
  margin-right: 6px;
}
.ek-filter-chip > .ek-emo:not(.ek-icon) {
  margin-left: -5px;
}
button > .ek-emo:not(.ek-icon):not(.ek-hicon) {
  width: 16px;
  height: 16px;
  padding: 4px;
  border-radius: 8px;
  margin-right: 8px;
}
.ek-filter-chip {
  display: inline-flex;
  align-items: center;
}
/* Never hidden by "hide the label on phones" rules such as .ek-feedback-pill span. */
span.ek-emo:not([hidden]) {
  display: inline-grid !important;
}
/* Phone tab bar: a pill-shaped tile, like the line icons had in the fresh look. */
html #ekBottomNav button .ek-icon.ek-emo[data-tone] {
  width: 20px;
  height: 20px;
  padding: 3px 10px;
  border-radius: 999px;
}
#ekDesktopNav button .ek-emo {
  width: 18px;
  height: 18px;
}
#ekDesktopNav button.active .ek-emo {
  background: var(--paper);
  box-shadow: 0 1px 3px rgba(201, 48, 107, 0.25);
}
/* A little life on hover and tap: the icon bounces, cards in the Add box lift. */
@media (hover: hover) {
  :is(button, a, summary, .ek-act, .ek-folder-tile):hover .ek-emo {
    transform: scale(1.14) rotate(-7deg);
  }
  .ek-add-grid button,
  .ek-add-list button {
    transition:
      transform 0.18s,
      box-shadow 0.18s,
      border-color 0.18s;
  }
  .ek-add-grid button:hover,
  .ek-add-list button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(201, 48, 107, 0.16);
  }
}
:is(button, a, summary):active .ek-emo {
  transform: scale(0.9);
}
@media (prefers-reduced-motion: reduce) {
  .ek-emo,
  .ek-add-grid button,
  .ek-add-list button {
    transition: none;
  }
  :is(button, a, summary, .ek-act, .ek-folder-tile):hover .ek-emo,
  :is(button, a, summary):active .ek-emo,
  .ek-add-grid button:hover,
  .ek-add-list button:hover {
    transform: none;
  }
}

/* ---------- Top-right header buttons: one size, all round ---------- */
/* Parvin (sparkle), "+" and the initials avatar were 44 round, 42x48 rounded-square and 40
   rounded-square. Now they're the same 42px circle. On wider screens the Parvin button keeps its
   "Parvin" label as a pill of the same height. */
#ekWelcomeBanner .ek-topbar-actions > .ek-parvin-button,
#ekWelcomeBanner .ek-topbar-actions > .ek-add-button,
#ekWelcomeBanner .ek-topbar-actions > .ek-avatar-button {
  box-sizing: border-box;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  margin: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  line-height: 1;
}
#ekWelcomeBanner .ek-topbar-actions > .ek-parvin-button {
  background: var(--tile-plum, #efe7fb);
}
/* The sparkle sits straight on the round button, not on a square tile inside it. */
#ekWelcomeBanner .ek-topbar-actions > .ek-parvin-button .ek-emo {
  background: transparent;
  padding: 0;
  width: 22px;
  height: 22px;
}
@media (min-width: 521px) {
  #ekWelcomeBanner .ek-topbar-actions > .ek-parvin-button {
    width: auto;
    padding: 0 14px 0 10px;
    gap: 4px;
  }
}
/* Wider screens also show Feedback and "?": same height, "?" round too. */
#ekWelcomeBanner .ek-topbar-actions > .ek-help-button {
  width: 42px;
  height: 42px;
  border-radius: 999px;
}
#ekWelcomeBanner .ek-topbar-actions > .ek-feedback-pill {
  box-sizing: border-box;
  height: 42px;
}
/* Text Parvin: the opt-in tick box and the privacy note. */
.ek-textparvin-agree {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 12px 0 6px;
  font-weight: 400;
  line-height: 1.4;
}
.ek-textparvin-agree > input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 1px;
}
.ek-textparvin-private {
  margin-top: 4px;
}

/* "I need a break": the link in the Yours row and its sheet. */
.ek-break-link {
  margin-left: auto;
  font-size: 14px;
}
body.ek-personal .ek-break-link,
body[data-level="viewer"] .ek-break-link {
  display: none;
}
.ek-break {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 48px);
  margin: auto;
  border: 0;
  border-radius: 22px;
  padding: 20px 20px 16px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  overflow: auto;
}
.ek-break::backdrop {
  background: rgba(20, 10, 15, 0.45);
}
.ek-break h2 {
  margin: 0 0 4px;
}
.ek-break-list {
  list-style: none;
  margin: 14px 0;
  padding: 0;
}
.ek-break-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 180px);
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line, #eee);
}
.ek-break-item strong {
  display: block;
  overflow-wrap: anywhere;
}
.ek-break-item small {
  display: block;
}
.ek-break textarea {
  width: 100%;
  box-sizing: border-box;
}
.ek-break-done {
  font-weight: 600;
}
@media (max-width: 480px) {
  .ek-break-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .ek-break-who {
    max-width: 220px;
  }
}

/* Good morning check: the tablet's "I'm OK" button and its setting. */
.ek-tablet .ek-tab-btn.is-morning {
  grid-column: 1 / -1;
  background: #fff4d6;
  border-color: #f0c552;
  font-size: 1.15em;
}
.ek-tablet .ek-tab-btn.is-morning[hidden] {
  display: none;
}
.ek-morning-setting {
  margin: 12px 0;
}
.ek-morning-by {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 6px 0 0 32px;
}
.ek-morning-by input {
  width: 8.5rem;
}

/* What Parvin can see: one row per connection, with what it sees, where it goes and a switch. */
.ek-see-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.ek-see-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.ek-see-row[hidden] {
  display: none;
}
.ek-see-icon {
  font-size: 22px;
  line-height: 1.2;
}
.ek-see-text p {
  margin: 2px 0 0;
  font-size: 0.92em;
  color: var(--sage);
}
.ek-see-text .ek-see-to span,
.ek-see-text .ek-see-scope span {
  font-weight: 600;
}
.ek-see-text .ek-see-note {
  color: var(--ink);
  font-weight: 600;
}
.ek-see-text .ek-see-note:empty {
  display: none;
}
.ek-see-row .ek-switch {
  margin-top: 2px;
}
.ek-see-memory {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.ek-see-memory p {
  margin: 0 0 4px;
}
.ek-see-privacy {
  margin-top: 12px;
}

/* Vitals heads-up: on the Vitals card, on Today and under a reading said to Parvin. */
.ek-vitals-heads {
  background: #fff8e6;
  border: 1px solid #f0d58a;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 10px 0;
}
.ek-vitals-heads[hidden] {
  display: none;
}
.ek-vitals-heads-line {
  margin: 6px 0;
}
.ek-vitals-heads-line.is-urgent {
  color: var(--rose);
  font-weight: 600;
}
.ek-vitals-heads-foot {
  margin: 8px 0 0;
  font-size: 0.9em;
}
.ek-home-vitals h2 {
  margin-top: 0;
}

/* Shift handoff: the option on Quick note, and the card on Today. */
.ek-handoff-opt {
  margin: 10px 0 4px;
}
.ek-handoff-to {
  display: block;
  margin: 6px 0 0 32px;
}
.ek-handoff-to select {
  width: min(100%, 18rem);
}
.ek-home-handoff {
  border-left: 4px solid #6b8fd6;
}
.ek-home-handoff[hidden] {
  display: none;
}
.ek-home-handoff h2 {
  margin: 0 0 2px;
}
#ekHomeHandoffText p {
  margin: 4px 0;
}
#ekHomeHandoffText .ek-handoff-item {
  margin-left: 4px;
}
body.ek-personal .ek-handoff-opt,
body.ek-personal #ekHomeHandoff {
  display: none;
}

/* "Parvin's AI can make mistakes…" under everything the AI reads or writes (reading.js aiNote). */
.ek-ai-note {
  font-size: 0.85em;
  border-left: 3px solid currentColor;
  padding-left: 10px;
  margin: 8px 0;
}
