/* CARE area styles. All classes are prefixed care-. Colours come from the shared design tokens only. */

.care-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Tabs inside medicine tracking, hospital mode and checklists */
.care-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}
.care-tabs button,
.care-tabs a {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  border: 1px solid var(--border, #c9ced6);
  border-radius: 999px;
  background: var(--surface, #fff);
  color: var(--text, #1c1f24);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* .tabs button[aria-selected] in components.css colours the text plum-deep; the extra class here keeps white-on-plum winning. */
.care-tabs [aria-selected="true"],
.care-tabs [aria-current="page"],
.care-tabs .tabs button[aria-selected="true"] {
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  color: var(--on-primary, #fff);
  font-weight: 600;
}

/* Today's doses */
.care-slot {
  margin: 16px 0 6px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted, #4b5563);
}
.care-dose {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 12px;
  margin: 6px 0;
  border: 1px solid var(--border, #c9ced6);
  border-radius: 12px;
  background: var(--surface, #fff);
  color: var(--text, #1c1f24);
}
.care-dose-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.care-dose-actions button {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border, #c9ced6);
  background: var(--surface-2, var(--surface, #fff));
  color: var(--text, #1c1f24);
  font: inherit;
  cursor: pointer;
}

/* Dose status chip. Colour is never the only signal: the chip always carries text. */
.care-st {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--border, #c9ced6);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--surface-2, #f3f4f6);
  color: var(--text, #1c1f24);
}
.care-st-taken {
  border-color: var(--success, #15803d);
  color: var(--success, #15803d);
}
.care-st-missed {
  border-color: var(--danger, #b91c1c);
  color: var(--danger, #b91c1c);
}
.care-st-notLogged {
  border-style: dashed;
  color: var(--text-muted, #4b5563);
}
.care-st-upcoming {
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
}

/* Medicine list, appointments, history */
.care-med,
.care-appt {
  padding: 12px;
  margin: 8px 0;
  border: 1px solid var(--border, #c9ced6);
  border-radius: 12px;
  background: var(--surface, #fff);
  color: var(--text, #1c1f24);
}
.care-med h3,
.care-appt h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}
.care-appt-done {
  opacity: 0.75;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.care-med button,
.care-appt button,
.care-member button,
.care-visit button {
  min-height: 44px;
  min-width: 44px;
}
.care-hist {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.care-hist table,
.care-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.care-hist th,
.care-hist td,
.care-table th,
.care-table td {
  padding: 8px 10px;
  text-align: start;
  border-bottom: 1px solid var(--border, #c9ced6);
  vertical-align: top;
}
.care-hist th,
.care-table th {
  font-weight: 700;
  background: var(--surface-2, #f3f4f6);
}

/* Care timeline uploads */
.care-tl {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  border-inline-start: 3px solid var(--border, #c9ced6);
}
.care-tl > li {
  position: relative;
  margin: 0 0 14px;
  padding: 8px 12px 8px 16px;
  border-radius: 10px;
  background: var(--surface, #fff);
  color: var(--text, #1c1f24);
}
.care-tl > li::before {
  content: "";
  position: absolute;
  inset-inline-start: -10px;
  top: 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary, #2563eb);
  border: 2px solid var(--bg, #fff);
}
.care-preview {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  margin: 8px 0;
  border: 1px solid var(--border, #c9ced6);
  border-radius: 10px;
  object-fit: contain;
  background: var(--surface-2, #f3f4f6);
}
.care-preview-frame {
  width: 100%;
  min-height: 60vh;
  border: 1px solid var(--border, #c9ced6);
  border-radius: 10px;
}

/* Text blocks meant to be copied or shared */
.care-share-text {
  width: 100%;
  min-height: 8em;
  padding: 10px;
  border: 1px solid var(--border, #c9ced6);
  border-radius: 10px;
  background: var(--surface, #fff);
  color: var(--text, #1c1f24);
  font: inherit;
  white-space: pre-wrap;
}

/* Care circle */
.care-member {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 12px;
  margin: 6px 0;
  border: 1px solid var(--border, #c9ced6);
  border-radius: 12px;
  background: var(--surface, #fff);
  color: var(--text, #1c1f24);
}

/* Hospital mode readiness list */
.care-ready {
  list-style: none;
  margin: 8px 0;
  padding: 0;
}
.care-ready > li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  margin: 6px 0;
  border: 1px solid var(--border, #c9ced6);
  border-radius: 10px;
  background: var(--surface, #fff);
  color: var(--text, #1c1f24);
}
.care-ready > li[data-ok="true"] {
  border-color: var(--success, #15803d);
}

/* Report tracking trends and list decoration */
.care-trend {
  display: inline-block;
  min-width: 1.4em;
  font-weight: 700;
  text-align: center;
}
.care-trend-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 4px 0;
}
.care-deco {
  margin-top: 6px;
  padding: 6px 10px;
  border-inline-start: 4px solid var(--primary, #2563eb);
  border-radius: 6px;
  background: var(--surface-2, #f3f4f6);
  color: var(--text, #1c1f24);
  font-size: 0.95rem;
}
.care-deco a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Doctor visit summary */
.care-visit {
  padding: 12px;
  margin: 12px 0;
  border: 1px solid var(--border, #c9ced6);
  border-radius: 12px;
  background: var(--surface, #fff);
  color: var(--text, #1c1f24);
}
.care-visit h3 {
  margin: 12px 0 4px;
}
.care-visit ul {
  margin: 4px 0;
  padding-inline-start: 20px;
}

/* Narrow screens */
@media (max-width: 480px) {
  .care-dose,
  .care-member {
    flex-direction: column;
    align-items: stretch;
  }
  .care-dose-actions button {
    flex: 1 1 auto;
  }
}

/* Print: only the summary shows, chrome is hidden by .no-print elsewhere */
.care-print {
  display: none;
}
@media print {
  .care-print {
    display: block;
    color: #000;
    background: #fff;
  }
  .care-visit,
  .care-table {
    break-inside: avoid;
    border-color: #000;
  }
  .care-tabs,
  .care-dose-actions,
  .care-member button,
  .care-appt button {
    display: none !important;
  }
}
