.eld-page main > .card.lead .chips { margin: 16px 0 12px; }

/* Longer Arabic for the Qur'an and hadith quotations; the font stack is unchanged. */
.eld-page figure.ibq p.ar, .eld-page blockquote p.ar { font-size: 1.6rem; line-height: 2.1; text-align: right; }
.eld-page .arline .ar { font-size: 1.4rem; }
.eld-page .helpbox { scroll-margin-top: 16px; }

/* Long evidence lists fold after three; references stay visible in the summary. */
.eld-page details.evmore { margin: 8px 0 4px; }
.eld-page details.evmore > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; padding: 8px 4px; color: var(--muted); font-size: .92rem; line-height: 1.4; list-style-position: inside; border-radius: 8px; }
.eld-page details.evmore > summary:hover { color: var(--ink); }
.eld-page details.evmore > summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; color: var(--ink); }
.eld-page details.evmore[open] > summary { margin-bottom: 8px; }

/* Step rail: where you are in the reading, nothing more. One row always; on a narrow screen the row scrolls sideways inside itself, so the page never does. */
.eld-page .steprail { display: flex; flex-wrap: nowrap; gap: 8px; margin: 12px 0 24px; padding: 6px; max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
@media (min-width: 960px) { .eld-page main > .steprail { grid-column: 1 / -1; } }
.eld-page .steprail a { flex: 1 1 auto; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); text-decoration: none; font-size: .95rem; font-variant-numeric: tabular-nums; }
.eld-page .steprail a:hover { border-color: var(--ink); color: var(--ink); }
.eld-page .steprail a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.eld-page .steprail a[aria-current="step"] { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 600; }

/* Home: the journey line. Eight cards in .secgrid.four: four across, two across or one, so no cell is ever empty. */
.eld-page .journeyline { margin: 8px 0 16px; max-width: none; }
.eld-page .secgrid { gap: 14px; }
.eld-page .sec:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Reading steps: the reading takes the wider column; Reflect and Act sit beside the start of it. On a phone the order stays Learn, sources, Reflect, Act. */
.eld-page .card p { line-height: 1.7; }
.eld-page .card h3 { font: 600 1.15rem/1.35 var(--serif); margin: 26px 0 8px; }
.eld-page .card h3:first-child { margin-top: 0; }
.eld-page .card ul.trylist li { margin: 8px 0; line-height: 1.65; }
.eld-page .card > p.eyebrow { margin-bottom: 8px; }
.eld-page .card.lead h2 { font-size: 1.35rem; line-height: 1.35; }
.eld-page .card.act p.big { font-size: 1.2rem; }
.eld-page .secnav { margin: 32px 0 40px; }
@media (min-width: 960px) {
  .eld-page .cols { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; }
  .eld-page .cols > div:last-child > .card.lead { order: -2; }
  .eld-page .cols > div:last-child > .card.act { order: -1; }
}

/* Add to my plan: a toggle under each step's one response. */
.eld-page .actadd { margin-top: 16px; }
.eld-page .addstate { display: none; }
.eld-page .actadd .hint { margin: 10px 0 0; }
.eld-page .btn.small { min-height: 44px; padding: 8px 16px; font-size: .9rem; }

/* My plan and the other personal cards. */
.eld-page main > .card.plan { margin: 24px 0; }
.eld-page .plan .field { margin: 16px 0 0; }
.eld-page .plan textarea { width: 100%; min-height: 112px; padding: 12px 14px; font-size: 1rem; line-height: 1.6; }
.eld-page .plan textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* This week's focus: a heavier border and an inverted label, so it reads without colour. */
.eld-page .plansaved { margin: 12px 0 20px; }
.eld-page .addedlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.eld-page .addedlist li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.eld-page .addedlist li > span { flex: 1 1 16em; min-width: 0; line-height: 1.6; }

/* The one-page summary: a title, then the focus and small action first, then each quality with its two labelled lines. */
.eld-page .summary { border: 1px dashed var(--line); border-radius: 12px; padding: 22px 24px; margin: 8px 0 24px; max-width: 46rem; }
.eld-page .summary .sumtitle { margin: 0; font: 600 1.4rem/1.3 var(--serif); }
.eld-page .summary .sumsub { margin: 4px 0 8px; color: var(--muted); font-size: .9rem; }
.eld-page .summary .sumgroup { margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.eld-page .summary h4 { margin: 0 0 8px; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.eld-page .summary ul { margin: 0; padding: 0; list-style: none; }
.eld-page .summary li { margin: 0 0 14px; overflow-wrap: anywhere; line-height: 1.6; }
.eld-page .summary li > strong { display: block; }
.eld-page .summary .sumline { display: block; margin-top: 2px; white-space: pre-wrap; }
.eld-page .summary .sumlab { color: var(--muted); font-size: .9rem; margin-right: 6px; }
.eld-page .sumactions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; }
.eld-page .sumactions .btn:disabled { opacity: .5; cursor: default; }
.eld-page #sumStatus { margin: 12px 0 0; min-height: 1.4em; }
.eld-page .planhint { margin: 12px 0 0; min-height: 1.4em; }
.eld-page main > .card.plan#delcard { margin-bottom: 8px; }

@media print {
  @page { margin: 18mm; }
  .eld-page .steprail, .eld-page .helpbox, .eld-page .btn, .eld-page .actions, .eld-page nav.chips, .eld-page .secnav { display: none !important; }
  /* The personal cards (your initial, week boxes and plan) and the responses are never printed with the reading. They print only from “Print or save as PDF”. */
  body:not(.print-plan) :is(#weekcard, #summarycard, #fromsteps-card, #delcard, #newcard, #fucard) { display: none !important; }
  body.print-plan { --ink: #000; --bg: #fff; --line: #999; --muted: #444; background: #fff; color: #000; }
  body.print-plan :is(header.top, footer.foot) { display: none !important; }
  body.print-plan #view { display: block; max-width: none; }
  body.print-plan #view > :not(#summarycard) { display: none !important; }
  body.print-plan #summarycard { display: block; border: 0; background: none; backdrop-filter: none; padding: 0; margin: 0; max-width: none; }
  body.print-plan #summarycard .nopr { display: none !important; }
  body.print-plan #summary { border: 0; padding: 0; margin: 0; display: block; max-width: none; column-count: 1; font-size: 12pt; }
  body.print-plan #summary .sumtitle { font-size: 20pt; }
  body.print-plan #summary .sumgroup { break-inside: avoid; border-top-color: #999; }
  body.print-plan #summary li { break-inside: avoid; }
  .eld-page details.evmore::details-content { content-visibility: visible; display: block; }
  .eld-page details.evmore > summary { display: none; }
}

/* Eight steps: four across on a wide screen (two full rows), two across on a tablet (four rows), one on a phone. */
@media (min-width: 960px) { .eld-page .secgrid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.eld-page .secgrid.four .sec { min-height: 140px; }
@media (min-width: 640px) { .eld-page .secgrid.four .sec:last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (min-width: 960px) { .eld-page .secgrid.four .sec:last-child:nth-child(odd) { grid-column: span 2; } }

/* Personal cards on the steps: a few fields, two columns on a wide screen, one on a phone. */
.eld-page main > .card.tool { margin: 24px 0; }
.eld-page .tool .field { margin: 16px 0 0; }
.eld-page .tool .field > span { display: block; font-size: .95rem; font-weight: 600; margin-bottom: 6px; }
.eld-page .tool textarea { width: 100%; min-height: 88px; padding: 12px 14px; font-size: 1rem; line-height: 1.6; }
.eld-page .tool textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.eld-page .toolgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 24px; }
@media (min-width: 900px) { .eld-page .toolgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .eld-page .toolgrid > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
.eld-page .qitem { border-top: 1px solid var(--line); padding: 16px 0 6px; min-width: 0; }
.eld-page .qitem h3 { margin: 0 0 4px; font-size: 1.1rem; }
.eld-page .qitem p { margin: 0 0 4px; }
.eld-page .toollink { margin: 12px 0 0; }
.eld-page .toollink a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 3px; }


.eld-page .sumactions { align-items: center; }
.eld-page .sumactions a.btn { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }


/* The plan summary on a phone: tighter box, bigger text for the words to carry, nothing wider than the screen. */
@media (max-width: 640px) {
  .eld-page .summary { padding: 16px 14px; margin: 8px 0 16px; max-width: 100%; }
  .eld-page .summary .sumgroup[data-g="carry"] li { font-size: 1.1rem; }
  .eld-page .summary .sumgroup { margin-top: 18px; padding-top: 12px; }
  .eld-page .sumactions { gap: 12px; }
  .eld-page .sumactions .btn { flex: 1 1 100%; justify-content: center; }
  .eld-page main > .card.plan, .eld-page main > .card.tool { margin: 16px 0; }
}

/* Step 1: three short care lines, three across on a wide screen, one on a phone. */
.eld-page main > .card.carecard { margin: 24px 0; }
.eld-page .caregrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 8px; }
@media (min-width: 900px) { .eld-page .caregrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; } }
.eld-page .caregrid h3 { font: 600 1.05rem/1.35 var(--serif); margin: 0 0 6px; }
.eld-page .caregrid p { margin: 0; }
.eld-page .caregrid a { text-underline-offset: 3px; }
@media (max-width: 640px) { .eld-page main > .card.carecard { margin: 16px 0; } .eld-page .caregrid { gap: 16px; } }

/* Step 8: the initial on its own row, then six boxes in two columns (three rows), one column on a phone. */
.eld-page .personrow { max-width: 28rem; }
.eld-page .personrow textarea { min-height: 48px; }
.eld-page .weekgrid { margin-top: 8px; }

/* Past ones and the optional one-week reflection: quiet, same look as the other cards. */
.eld-page .past > details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font: 600 1.05rem/1.35 var(--serif); }
.eld-page .past > details > summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.eld-page .past > details[open] > summary { margin-bottom: 8px; }
.eld-page .followup .field + .field { margin-top: 12px; }
.eld-page .fusaved { margin: 0 0 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
@media print { .eld-page .past, .eld-page .followup, .eld-page #fucard, .eld-page #newcard { display: none !important; } }
