

/* Legacy time-slot support during transition */
#akashic-health-records-patient-portal-root [data-slot="button"][data-kind="time-slot"] {
  background-color: var(--green-soft);
  color: var(--success);
  border: 1px solid transparent;
  border-radius: 0.3rem;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

#akashic-health-records-patient-portal-root [data-slot="button"][data-kind="time-slot"]:hover:not([data-selected="true"]):not([aria-pressed="true"]):not(:disabled) {
  background-color: var(--green-soft);
  color: var(--success);
  border-color: transparent;
}

#akashic-health-records-patient-portal-root [data-slot="button"][data-kind="time-slot"][data-selected="true"],
#akashic-health-records-patient-portal-root [data-slot="button"][data-kind="time-slot"][aria-pressed="true"] {
  background-color: var(--success);
  border-color: var(--success);
  color: var(--primary-foreground);
}

#akashic-health-records-patient-portal-root [data-slot="button"][data-kind="time-slot"][data-selected="true"]:hover,
#akashic-health-records-patient-portal-root [data-slot="button"][data-kind="time-slot"][aria-pressed="true"]:hover {
  background-color: var(--success-hover);
  border-color: var(--success-hover);
  color: var(--primary-foreground);
}

/* HEADINGS IN THE CHART AND ITS RECORD STREAM.
   Moved out of the components 2026-09-07: each asked for the right values as utilities and lost to the
   app-wide `h2,h3,h4 { font-size: var(--ak-font-lg) }` at (1,0,1). Three of them had been forced with
   `!important` to win that fight - correct on screen, wrong as a pattern, and unnecessary once the
   style lives here. */
#akashic-health-records-patient-portal-root .ahr-chart-identity-name {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--ink-strong);
}

/* The condition card's own title, one step down from a detail title. */
#akashic-health-records-patient-portal-root .ahr-stream-condition-title {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
}

/* THE STAFF CHART (patient-chart deck .chartcols): one card, the section nav, then the band over the section. */
#akashic-health-records-patient-portal-root .chart-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

#akashic-health-records-patient-portal-root .chart-shell-main { min-width: 0; }
#akashic-health-records-patient-portal-root .chart-shell-page { padding: 16px 18px; min-width: 0; }
#akashic-health-records-patient-portal-root .chart-shell-page[data-flush="true"] { padding: 0; }

@media (min-width: 640px) {
  #akashic-health-records-patient-portal-root .chart-shell { grid-template-columns: auto minmax(0, 1fr); }
}

#akashic-health-records-patient-portal-root .chart-nav {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

#akashic-health-records-patient-portal-root .chart-nav-toggle {
  display: flex;
  justify-content: flex-end;
  padding: 3px 4px 8px;
}

#akashic-health-records-patient-portal-root .chart-nav-toggle button,
#akashic-health-records-patient-portal-root .chart-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

#akashic-health-records-patient-portal-root .chart-nav-toggle button {
  width: auto;
  padding: 0 2px;
  color: var(--ink-muted);
}

#akashic-health-records-patient-portal-root .chart-nav-toggle svg { width: 16px; height: 16px; }
#akashic-health-records-patient-portal-root .chart-nav-item:hover { background: var(--paper); }
#akashic-health-records-patient-portal-root .chart-nav-item[aria-current="page"] {
  border-color: var(--primary);
  color: var(--primary);
  background: transparent;
}

#akashic-health-records-patient-portal-root .chart-nav-icon { width: 16px; height: 16px; flex: none; }
#akashic-health-records-patient-portal-root .chart-nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#akashic-health-records-patient-portal-root .chart-nav-chevron { width: 14px; height: 14px; flex: none; margin-left: auto; transition: transform 0.15s; }
#akashic-health-records-patient-portal-root .chart-nav-chevron[data-open="true"] { transform: rotate(90deg); }
#akashic-health-records-patient-portal-root .chart-nav-kids { padding: 2px 0 4px 26px; }
#akashic-health-records-patient-portal-root .chart-nav-sub { padding: 6px 10px; font-size: 13px; }

/* On the rail the icons stand alone, centred, with the group chevron tucked beside them. */
#akashic-health-records-patient-portal-root .chart-nav[data-collapsed="true"] .chart-nav-item {
  justify-content: center;
  gap: 2px;
  padding: 8px 0;
}
#akashic-health-records-patient-portal-root .chart-nav[data-collapsed="true"] .chart-nav-chevron { margin-left: 0; width: 12px; height: 12px; }
#akashic-health-records-patient-portal-root .chart-nav[data-collapsed="true"] .chart-nav-toggle { justify-content: center; }

/* A phone keeps the rail as one scrolling row, so the section is on screen rather than below forty icons. */
@media (max-width: 639px) {
  #akashic-health-records-patient-portal-root .chart-nav[data-collapsed="true"] {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    padding: 4px 8px;
  }
  #akashic-health-records-patient-portal-root .chart-nav[data-collapsed="true"] .chart-nav-toggle { flex: none; padding: 0; }
  #akashic-health-records-patient-portal-root .chart-nav[data-collapsed="true"] .chart-nav-toggle button { justify-content: center; min-width: 44px; }
  #akashic-health-records-patient-portal-root .chart-nav[data-collapsed="true"] .chart-nav-items { flex: none; }
  #akashic-health-records-patient-portal-root .chart-nav[data-collapsed="true"] .chart-nav-items { display: flex; gap: 2px; }
  #akashic-health-records-patient-portal-root .chart-nav[data-collapsed="true"] .chart-nav-item { width: 44px; }
  #akashic-health-records-patient-portal-root .chart-nav-item,
  #akashic-health-records-patient-portal-root .chart-nav-toggle button { min-height: 44px; }
}

@media (min-width: 640px) {
  #akashic-health-records-patient-portal-root .chart-nav {
    width: 232px;
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }
  #akashic-health-records-patient-portal-root .chart-nav[data-collapsed="true"] { width: 56px; padding: 8px 4px; }
}

/* The band (deck .pband): who, what is dangerous, the visit, the actions - one row that wraps. */
#akashic-health-records-patient-portal-root .chart-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 11px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

#akashic-health-records-patient-portal-root .chart-band-mark .ahr-inbox-avatar { width: 36px; height: 36px; font-size: 12.5px; }
#akashic-health-records-patient-portal-root .chart-band-who { min-width: 0; }
#akashic-health-records-patient-portal-root .chart-band-line { display: block; font-size: 11.5px; line-height: 1.55; color: var(--ink-muted); }

/* The allergy and visit tags are the shared pills; the actions are the shared small buttons. */
#akashic-health-records-patient-portal-root .chart-band-visit { gap: 6px; }
#akashic-health-records-patient-portal-root .chart-band-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }

#akashic-health-records-patient-portal-root .chart-band-note { flex-basis: 100%; margin-top: 2px; font-size: 12.5px; line-height: 1.5; color: var(--ink-muted); }

@media (max-width: 639px) {
  #akashic-health-records-patient-portal-root .chart-band-actions { margin-left: 0; width: 100%; }
  #akashic-health-records-patient-portal-root .chart-band-actions > .btn { flex: 1; min-height: 44px; }
}
