/* CCD home study: the plan, the worksheet/assessment page, parent setup. Tokens from luminary.css only.
   Late work is amber (--warn), never red. Registered with register_stylesheet so the parent panel is styled too. */

/* ---------------------------------------------------------------- the plan */
.ccd-plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ccd-plan-row { display: grid; gap: 8px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.ccd-plan.is-quiet .ccd-plan-row { background: transparent; }
.ccd-plan-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.ccd-plan-head strong { overflow-wrap: anywhere; }
.ccd-plan-docs { display: flex; flex-wrap: wrap; gap: 8px; }
.ccd-plan-doc { display: inline-flex; align-items: center; gap: 6px; color: var(--good); font-weight: 700; font-size: .9rem; }
.ccd-plan-doc .icon { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- doing the work */
.ccd-sheet { gap: 14px; }
.ccd-part { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); font-size: var(--step-1); }
.ccd-read { max-width: 70ch; line-height: 1.55; }
.ccd-quote { margin: 0; padding: 10px 14px; background: var(--paint-soft); border-radius: var(--r); font-style: italic; line-height: 1.5; white-space: pre-line; }
.ccd-q { margin: 6px 0 0; font-weight: 700; line-height: 1.4; }
.ccd-q .num { margin-right: 4px; color: var(--ink-2); }
.ccd-label { margin: 0; color: var(--ink-2); font-weight: 700; }
.ccd-choice { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.ccd-choice legend { padding: 0; margin-bottom: 6px; }
.ccd-options { display: grid; gap: 6px; }
.ccd-option { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; }
.ccd-option input { width: 20px; height: 20px; accent-color: var(--blue); flex: none; }
.ccd-option:has(input:checked) { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.ccd-option:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.ccd-given { display: flex; align-items: flex-start; gap: 8px; padding: 8px 12px; border-radius: var(--r); background: var(--good-soft); color: var(--ink); overflow-wrap: anywhere; }
.ccd-given .icon { color: var(--good); flex: none; margin-top: 2px; }
.ccd-field { display: grid; gap: 6px; }
.ccd-field textarea, .ccd-field input[type="text"] { width: 100%; }
.ccd-field.is-reflect textarea { min-height: 11rem; }
.ccd-fix { display: grid; }
.ccd-status { min-height: 1.2em; font-size: .85rem; }
.ccd-status.is-warn { color: var(--warn); font-weight: 700; }
/* break-word, not anywhere: "anywhere" lets each column shrink to a few letters on a phone instead of scrolling */
.ccd-grid td, .ccd-grid th { vertical-align: top; overflow-wrap: break-word; }
.ccd-cell, .ccd-given > span { white-space: pre-line; }  /* a cell's paragraphs on their own lines */
.ccd-grid .ccd-field input[type="text"] { min-width: 6rem; }
/* A fill-in box inside a chart sentence ("the ____ of God"): sits in the line. Its "Saved" is for screen readers;
   a refusal still shows. */
.ccd-field.is-inline { display: inline-flex; vertical-align: baseline; margin: 2px 4px; position: relative; }
.ccd-field.is-inline input[type="text"] { width: 9rem; }
.ccd-field.is-inline .ccd-status.subtle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ccd-progress .tape { max-width: 28rem; }
.ccd-left { margin: 0; padding-left: 1.2rem; display: grid; gap: 4px; }
.ccd-ready { display: flex; align-items: center; gap: 8px; color: var(--good); font-weight: 700; margin: 0; }

/* ---------------------------------------------------------------- parent */
.ccd-steps-list { margin: 0; padding-left: 1.3rem; }
.ccd-steps-list li { line-height: 1.5; }
.ccd-code { width: 100%; font-size: .8rem; margin-top: 8px; background: var(--surface-2); }
.ccd-kv { display: grid; gap: 8px; margin: 8px 0 0; }
.ccd-kv > div { display: grid; grid-template-columns: minmax(7rem, 10rem) minmax(0, 1fr); gap: 12px; align-items: baseline; }
.ccd-kv dt { color: var(--ink-2); font-weight: 700; font-size: .9rem; }
.ccd-kv dd { margin: 0; overflow-wrap: anywhere; }
.ccd-kv code { user-select: all; }
@media (max-width: 520px) { .ccd-kv > div { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
.ccd-warn { display: inline-flex; align-items: flex-start; gap: 6px; color: var(--warn); font-weight: 700; }
.ccd-year td { vertical-align: top; }
.ccd-year tr.is-late td:first-child { color: var(--warn); }
.ccd-panel-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ccd-panel-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ccd-last-read { display: block; margin-top: 2px; }
.ccd-newurl > summary { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--blue); cursor: pointer; }
.ccd-newurl > summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.ccd-newurl[open] > summary { margin-bottom: 8px; }
