/* بعد الإقراء and الوقت الفاضي (sheikh/after.js). Cards, tags, the level buttons and .level-sum come from interview.css;
   .sec-head, .field, .kpi and .muted-p from sheikh.css; the level chips, gold positions and .rs-chip from people.css and
   reports.css. بعد الإقراء follows the navy design canvas: the end to confirm in the one navy card, the session in three
   number cards, the notes and the approval beside the survey. */
.af-err { margin: 0; }
.af-q { font-family: var(--quran); font-weight: 700; }

/* under the title: who, the section, the day, whether it waits */
.af-head { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.af-who { font-weight: 700; color: var(--brand); text-decoration: none; }
.af-who:hover { text-decoration: underline; text-underline-offset: 3px; }
.af-head .tag { height: 26px; font-size: var(--text-xs); font-weight: 700; }
.af-head .tag.wait { background: var(--gold); color: var(--gold-ink); box-shadow: inset 0 0 0 1px var(--gold-edge); }
.af-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-mark); }

/* the top row: the end in navy, then three number cards */
.af-top { display: grid; grid-template-columns: minmax(0, 1.55fr) repeat(3, minmax(0, 1fr)); gap: 16px; }
.af-stat { row-gap: 12px !important; }
.af-stat > span:not(.kpi-ic, .kpi-meter) { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.af-stat small { flex-basis: 100%; margin-top: 0; }
.af-stat .af-range .pp-pos { height: 20px; padding: 0 6px; font-size: var(--text-xs); }
.af-stat .af-range .pp-range { gap: 4px; }
.af-stat .rs-chip { height: 22px; }
.af-of { display: inline !important; font-size: var(--text-lg) !important; font-weight: 700 !important; color: var(--ink-2) !important; }
.af-pips { display: grid; grid-template-columns: 1fr 1fr 1.7fr; gap: 4px; }
.af-pips i { height: 8px; border-radius: 4px; background: var(--fill-2); }
.af-pips i.on { background: var(--gold-mark); }
.af-pips i.stop { background: var(--danger-bg); box-shadow: inset 0 0 0 1px rgba(194, 52, 52, .3); }
.af-pips i.stop.on { background: var(--danger); box-shadow: none; }

.af-end { gap: 14px; padding: 20px 22px; border-radius: var(--radius-card); background: var(--grad); color: var(--on-accent); box-shadow: var(--shadow-navy); }
.af-end-h { display: flex; align-items: center; gap: 12px; }
.af-end-h .kpi-ic { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .14); }
.af-end-h h2 { margin: 0; font-size: var(--text-input); font-weight: 700; line-height: 1.35; }
.af-end-h small { display: block; font-size: var(--text-sm); font-weight: 500; color: rgba(255, 255, 255, .78); }
.af-step { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 16px; padding-inline: 18px 6px; border-radius: var(--radius-pill); background: rgba(8, 16, 40, .22); cursor: text; }
.af-step span { flex: none; font-size: var(--text-sm); font-weight: 500; color: rgba(255, 255, 255, .75); }
.af-step input { flex: 1; min-width: 0; height: 44px; border: 0; border-radius: var(--radius-pill); background: transparent; color: #E9C77D; font-size: 28px; text-align: center; transition: background-color 150ms ease-out; }
.af-step input:hover { background: rgba(255, 255, 255, .06); }
.af-step input:focus { outline: none; background: rgba(255, 255, 255, .12); }
.af-step:has(input:focus-visible) { box-shadow: 0 0 0 2px rgba(233, 199, 125, .7); }
.af-end-next { margin: 0; font-size: var(--text-md); line-height: 1.5; color: rgba(255, 255, 255, .82); }
.af-end-next b { color: var(--on-accent); }
.af-end .af-err { align-self: flex-start; padding: 6px 12px; border-radius: var(--radius-pill); background: var(--danger-bg); color: var(--danger); font-weight: 700; }
.af-stop { margin: 0; padding: 12px 16px; border-radius: var(--radius-md); background: var(--danger-bg); color: var(--danger); font-size: var(--text-md); line-height: 1.6; }

/* two columns: the notes and the approval, the survey */
.af-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.38fr); gap: 20px; align-items: start; }
.af-side { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.af-cols .i-card { padding: 18px 22px 22px; gap: 14px; }
.af-cols .sec-head .muted { font-size: var(--text-sm); color: var(--ink-2); }
.af-cols .muted-p { line-height: 1.65; }

/* the notes: the ayah in gold, the point, delete; his own words under it */
.af-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.af-note { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "pos text del" ". said ."; align-items: start; gap: 4px 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.af-note:first-child { border-top: 0; padding-top: 2px; }
.af-pos { grid-area: pos; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding-top: 9px; }
.af-pos small { font-size: var(--text-2xs); font-weight: 700; color: var(--brand); }
.af-note input { grid-area: text; width: 100%; min-width: 0; height: 42px; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 0 12px; background: var(--surface); font-size: var(--text-input);
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out; }
.af-note input:focus { outline: none; border-color: var(--navy-2); box-shadow: 0 0 0 4px var(--brand-soft); }
.af-note .icon-btn { grid-area: del; width: 40px; height: 40px; margin-top: 1px; border: 0; border-radius: 50%; background: none; color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) { .af-note .icon-btn:hover { color: var(--danger); background: var(--danger-bg); } }
.af-said { grid-area: said; font-size: var(--text-sm); line-height: 1.5; color: var(--ink-2); }   /* his own words under a point the AI wrote (drafts before 30 October 2026) */
.af-said b { font-weight: 700; }
.af-add { display: grid; grid-template-columns: 128px minmax(0, 1fr); align-items: end; gap: 12px 10px; padding: 14px; border-radius: 14px; background: var(--fill); }
.af-add .field { font-weight: 700; color: var(--ink); }
.af-add .field input { width: 100%; min-width: 0; }
.af-add .field input.af-q { font-size: var(--text-lg); }
.af-add .btn { grid-column: 1 / -1; justify-self: end; }
.btn.af-soft { height: 44px; border: 0; background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.btn.af-soft:hover { background: #DDE3F4; }

/* the survey: each item's levels in one soft segmented row, the chosen one in its level's colour */
.af-key { margin: -4px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.af-cat { display: flex; flex-direction: column; gap: 2px; }
.af-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0 6px; }
.af-cat-head h3 { margin: 0; font-size: var(--text-input); font-weight: 700; }
.af-survey .eval-row { grid-template-columns: minmax(0, 1fr) minmax(0, 404px); gap: 12px; padding: 7px 0; }
.af-survey .eval-row > span { font-size: var(--text-base); font-weight: 500; line-height: 1.45; }
.af-survey .eval-row.af-miss > span { color: var(--danger); }
.af-survey .eval-row.af-miss .levels { box-shadow: inset 0 0 0 1.5px var(--danger); }
.af-survey .levels { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.15fr); gap: 2px; padding: 3px; border-radius: 13px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--line); }
.af-survey .levels button { min-height: 34px; padding: 0 6px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); font-size: var(--text-md); white-space: nowrap;
  transition: background-color 150ms ease-out, color 150ms ease-out; }
@media (hover: hover) and (pointer: fine) { .af-survey .levels button[aria-pressed="false"]:hover { background: var(--surface); color: var(--ink); } }
.af-survey .levels button[aria-pressed="true"] { font-weight: 700; }
.af-survey .levels .lv-4[aria-pressed="true"] { background: var(--live-soft); color: var(--live); box-shadow: inset 0 0 0 1.5px rgba(21, 150, 74, .35); }
.af-survey .levels .lv-3[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 1.5px rgba(30, 58, 123, .3); }
.af-survey .levels .lv-2[aria-pressed="true"] { background: var(--amber-bg); color: var(--amber); box-shadow: inset 0 0 0 1.5px rgba(154, 106, 18, .3); }
.af-survey .levels .lv-1[aria-pressed="true"] { background: var(--danger-bg); color: var(--danger); box-shadow: inset 0 0 0 1.5px rgba(194, 52, 52, .3); }
.af-survey .levels .lv-na[aria-pressed="true"] { background: var(--surface); border: 0; color: var(--ink-2); box-shadow: var(--shadow); }
/* the total, under the survey */
.af-survey .level-sum { margin-top: 8px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px 18px; padding: 16px 18px; border-radius: 14px;
  background: var(--navy-wash); box-shadow: inset 0 0 0 1px #DFE5F4; color: var(--ink-2); }
.af-survey .level-sum > span:only-child { grid-column: 1 / -1; }
.af-total-n { margin: 0; display: flex; align-items: baseline; gap: 10px; }
.af-total-n span { font-size: var(--text-md); font-weight: 700; }
.af-total-n b { font-size: 34px; font-weight: 800; line-height: 1; color: var(--ink); }
.af-total-n .chip { align-self: center; }
.af-survey .level-sum .bar { height: 8px; }
.af-survey .level-sum small { grid-column: 1 / -1; font-size: var(--text-sm); line-height: 1.5; }

/* «اعتماد التقرير»: what goes, ticked once ready, and the two buttons */
.af-send h2 { margin: 0; font-size: var(--text-lg); font-weight: 700; }
.af-check { list-style: none; margin: -4px 0 0; padding: 0; display: grid; gap: 7px; }
.af-check li { display: flex; align-items: center; gap: 8px; font-size: var(--text-md); font-weight: 500; color: var(--ink-2); }
.af-check li i { flex: none; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #C3CADB; }
.af-check li.ok { color: var(--ink); }
.af-check li.ok svg { flex: none; color: var(--live); }
.af-send-act { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.af-send-act .btn { height: 52px; padding: 0 22px; font-size: var(--text-input); font-weight: 700; }
.af-send-act .btn:only-child { grid-column: 1 / -1; }
.af-send-act #af-draft { border: 0; box-shadow: var(--shadow); color: var(--brand); }
.af-send-note { margin: 0; font-size: var(--text-sm); color: var(--ink-2); }
/* «احذف المسودة»: quiet under the two buttons, then a short question with its own «إيه، احذفها». */
.af-drop { justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 2px; color: var(--danger); font-size: var(--text-md); font-weight: 700; }
.af-drop-ask { display: grid; gap: 12px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--danger-bg); box-shadow: inset 0 0 0 1px rgba(194, 52, 52, .18); }
.af-drop-ask p { margin: 0; font-size: var(--text-md); line-height: 1.7; color: var(--ink); }
.af-drop-act { display: flex; flex-wrap: wrap; gap: 8px; }
.af-drop-act .btn { min-height: 44px; font-weight: 700; }
.btn.af-drop-top { color: var(--danger); }
.btn.af-danger { background: var(--danger); border-color: var(--danger); color: var(--on-accent); }
.af-saved { display: inline-flex; align-items: center; gap: 6px; color: var(--live); font-size: var(--text-md); font-weight: 700; }
.af-missing { align-items: flex-start; }
.af-missing .kpi-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }

@media (max-width: 1240px) { .af-top { grid-template-columns: repeat(3, minmax(0, 1fr)); } .af-end { grid-column: 1 / -1; } }
@media (max-width: 1100px) {
  .af-cols { grid-template-columns: minmax(0, 1fr); }
  .af-side { display: contents; }
  .af-send { order: 2; }
}
@media (max-width: 760px) {
  .af-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .af-top > :last-child { grid-column: 1 / -1; }
  .af-stat { padding: 16px !important; }
  .af-step input { font-size: 24px; }
  .af-note { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "pos del" "text text" "said said"; }
  .af-pos { flex-direction: row; align-items: center; padding-top: 6px; }
  .af-survey .eval-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .af-survey .levels button { padding: 0 2px; font-size: var(--text-sm); }
  .af-add { grid-template-columns: minmax(0, 1fr); }
  .af-add .btn { justify-self: stretch; }
  .af-send-act { grid-template-columns: minmax(0, 1fr); }
  /* the buttons held over the bottom of the page while he scrolls the review (after.js sendActs); the page's own bottom
     padding (nav.css .i-page) is outside the sticky area, hence the negative inset */
  .af-bar { position: sticky; bottom: -28px; z-index: 5; margin: 0 -16px -28px; padding: 10px 16px 12px; background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid rgba(16, 27, 58, .14); }
  .af-bar .af-send-act { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .af-bar .af-send-act .btn { height: 52px; padding: 0 16px; font-size: 16px; white-space: nowrap; }
  .af-cols .i-card { padding: 16px; }
}

/* الوقت الفاضي */
.af-slot-when { margin: 0; display: flex; align-items: center; gap: 10px; color: var(--brand); }
.af-slot-when b { font-size: var(--text-xl); font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.af-trial { margin: 0; padding: 8px 12px; border: 1px dashed var(--gold-edge); border-radius: var(--radius-md); background: var(--amber-bg); color: var(--amber); font-size: var(--text-sm); line-height: 1.6; }
.af-notice { margin: 0; padding: 10px 12px; border-radius: var(--radius-md); background: var(--neutral-bg); color: var(--neutral); font-size: var(--text-md); }
.af-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.af-opt { min-height: 92px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); text-align: start; }
.af-opt:hover:not(:disabled) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.af-opt b { font-size: var(--text-input); font-weight: 600; }
.af-opt small { font-size: var(--text-sm); line-height: 1.6; color: var(--ink-2); }
.af-opt .af-opt-note { color: var(--amber); }
.af-opt:disabled { background: var(--ground); color: var(--ink-2); cursor: not-allowed; }
.af-opt .af-opt-spent { color: var(--danger); font-weight: 500; }
.af-offer-now { margin: 0; display: flex; align-items: center; gap: 10px; font-size: var(--text-lg); line-height: 1.6; color: var(--brand); }
.af-offer-now span { color: var(--ink); }
.af-clock { color: var(--amber); font-variant-numeric: tabular-nums; }
.af-moves { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 4px; font-size: var(--text-md); color: var(--ink-2); }
.af-rule { display: flex; align-items: center; gap: 6px; }
/* «تختار أنت الطالب»: his own pick, under the options */
.af-pick { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--divider); }
.af-pick label { font-size: var(--text-md); font-weight: 600; }
.af-pick select { height: 44px; max-width: 320px; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 0 12px; background: var(--surface); }
@media (max-width: 900px) { .af-opts { grid-template-columns: minmax(0, 1fr); } }
