/* The questionnaire's form icon, after the task title in place of a type pill (tasks deck .task-kind). */
#akashic-health-records-patient-portal-root .patient-task-kind-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 5px;
  vertical-align: -2px;
  color: var(--ink-muted);
}

/* THE PATIENT'S OWN TASKS PAGE, drawn from the approved tasks deck (patient-portal.html #s-tasks).
   Weights follow Spencer's 2026-09-09 scale (regular 300, bold 400) and the 2026-09-10 tab weight. */
#akashic-health-records-patient-portal-root .patient-tasks-page {
  padding: 0;
}

#akashic-health-records-patient-portal-root .patient-tasks-page > [data-slot="tabs"] {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

/* Two equal halves across the page; the segmented control's skin is shared. */
#akashic-health-records-patient-portal-root .patient-tasks-page .patient-tasks-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: 620px;
  height: auto;
}

#akashic-health-records-patient-portal-root .patient-tasks-page .patient-task-groups,
#akashic-health-records-patient-portal-root .patient-tasks-page .patient-task-group[data-testid="patient-referrals"] {
  margin-top: 12px;
}

#akashic-health-records-patient-portal-root .patient-tasks-page .patient-task-groups > * {
  margin: 0;
}

#akashic-health-records-patient-portal-root .patient-tasks-page .patient-task-group {
  margin-bottom: 15px;
}

#akashic-health-records-patient-portal-root .patient-tasks-page .patient-task-group > * {
  margin: 0;
}

#akashic-health-records-patient-portal-root .patient-tasks-page .patient-task-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  padding: 0 3px 3px;
}

/* Title and count share the first line; a long title wraps inside its own column. */
#akashic-health-records-patient-portal-root .patient-tasks-page .patient-task-group-title {
  flex: 1 1 0;
  min-width: 0;
}

#akashic-health-records-patient-portal-root .patient-tasks-page .patient-task-group-count {
  flex: none;
  margin-left: auto;
  white-space: nowrap;
  font-size: var(--ak-font-11-5);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}

#akashic-health-records-patient-portal-root .patient-tasks-page .patient-task-group-sub {
  display: flex;
  flex-basis: 100%;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin: 0;
  font-size: var(--ak-font-11-5);
  font-weight: var(--ak-body-weight);
  color: var(--ink-muted);
}

#akashic-health-records-patient-portal-root .patient-tasks-page .patient-task-group-ready {
  margin: 0 3px;
}

#akashic-health-records-patient-portal-root .patient-tasks-page .patient-task-org-line {
  min-width: 0;
  margin: 6px 0 0;
}

#akashic-health-records-patient-portal-root .patient-tasks-page .patient-task-org-line > span:last-child {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A referral's line is the mark and one sentence. The sentence keeps its place beside the mark and wraps
   there, so the org line's wrap never leaves the mark alone above a cut-off "Referred by". */
#akashic-health-records-patient-portal-root .patient-tasks-page .ahr-list-card-head + .patient-task-org-line {
  align-items: baseline;
}

#akashic-health-records-patient-portal-root .patient-tasks-page .ahr-list-card-head + .patient-task-org-line > span:last-child {
  flex: 1 1 0;
  white-space: normal;
}

/* On a phone the arrow is always there; on a laptop the deck draws none until the row is pointed at. */
@media (min-width: 1024px) {
  #akashic-health-records-patient-portal-root .patient-tasks-page .patient-task-chevron {
    opacity: 0;
  }

  #akashic-health-records-patient-portal-root .patient-tasks-page .ak-card:hover .patient-task-chevron,
  #akashic-health-records-patient-portal-root .patient-tasks-page .ak-card:focus-visible .patient-task-chevron {
    opacity: 1;
  }

  /* The laptop row: title across the top, practice at the left and the due line at the right beneath. */
  #akashic-health-records-patient-portal-root .patient-tasks-page .patient-task-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "head head" "org due";
    align-items: baseline;
    gap: 2px 14px;
  }

  #akashic-health-records-patient-portal-root .patient-tasks-page .patient-task-body > .ahr-list-card-head {
    grid-area: head;
  }

  #akashic-health-records-patient-portal-root .patient-tasks-page .patient-task-body > .patient-task-org-line {
    grid-area: org;
    margin-top: 2px;
  }

  /* A referral row keeps its practice line under the title, at the same 2px. */
  #akashic-health-records-patient-portal-root .patient-tasks-page .ahr-list-card-head + .patient-task-org-line {
    margin-top: 2px;
  }

  #akashic-health-records-patient-portal-root .patient-tasks-page .patient-task-body > .ahr-row-deadline {
    grid-area: due;
    justify-self: end;
    margin-top: 0;
  }
}
