/* ==========================================================================
   إحراز — Study plan (plan.html), in the dashboard's language (home.css, after
   the Eduzen learning dashboard): soft white cards on the grey canvas, small
   square number tiles, pill buttons with one purple accent, purple + yellow
   for data, each skill in its own tint. Reuses the dashboard's pieces from
   home.css (.db-sq tiles, .db-gauge, .db-bar, .db-tk rows).
   - Header: the title, the date, three square tiles (days to the test as the gradient one).
   - Setup: each question its own card with a number tile; a summary card beside
     them (hours a week as the gradient tile, three small numbers, an example day).
   - «اليوم»: the next task in a card of its skill's tint with one purple button;
     beside it today's tasks under a half-circle gauge; under both «طريقك» (the phases to the test).
   - «مهاراتك», «أخطاؤك», «تقدّمك»: numbers as tiles, lists as soft rows, bars
     instead of tables; details fold away and open in place.
   Text never animates. Also loaded by home.html (.pl-muted, .pl-phase).
   ========================================================================== */
.pl-muted { color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.pl-h { display: flex; align-items: center; gap: 10px; font-size: clamp(17px, 1.3vw, 20px); font-weight: var(--w-regular); line-height: 1.4; }
.pl-eyebrow { font-size: 13px; color: var(--ink-2); }
#pl-root { display: grid; gap: 16px; align-content: start; }
.pl-panel { min-width: 0; }
.pl-tasks, .pl-mlist, .pl-strip, .pl-stats, .pl-mopts,
.pl-goals, .pl-cps, .pl-cmps, .pl-sum__tiles { list-style: none; margin: 0; padding: 0; }

/* every skill has its section colour (assets/tokens.css): --k icon, --t tint */
.sk-reading { --sk-c: var(--c-reading); --sk-t: var(--t-reading); --sk-l: var(--l-reading); }
.sk-listening { --sk-c: var(--c-listening); --sk-t: var(--t-listening); --sk-l: var(--l-listening); }
.sk-writing { --sk-c: var(--c-writing); --sk-t: var(--t-writing); --sk-l: var(--l-writing); }
.sk-speaking { --sk-c: var(--c-speaking); --sk-t: var(--t-speaking); --sk-l: var(--l-speaking); }
.sk-grammar { --sk-c: var(--c-grammar); --sk-t: var(--t-grammar); --sk-l: var(--l-grammar); }
.sk-vocab { --sk-c: var(--c-vocab); --sk-t: var(--t-vocab); --sk-l: var(--l-vocab); }
.sk-review { --sk-c: var(--c-plan); --sk-t: var(--t-plan); --sk-l: var(--l-plan); }
:is(.sk-reading, .sk-listening, .sk-writing, .sk-speaking, .sk-grammar, .sk-vocab, .sk-review) { --k: var(--sk-c); --t: var(--sk-t); }

/* a small icon tile (white, the skill's colour) */
.pl-ic { width: 36px; height: 36px; flex: none; display: inline-grid; place-items: center; border-radius: 12px; background: var(--surface); color: var(--sk-c, var(--accent)); }
.pl-ic .icon { width: 17px; height: 17px; }
.pl-h > .pl-ic { background: color-mix(in srgb, var(--sk-t, var(--violet-soft)) 70%, #fff); }
/* a quiet pill for minutes, stages, small states */
.pl-min { flex: none; display: inline-block; font-size: 12px; font-weight: var(--w-regular); color: var(--ink-2); padding: 2px 10px; border-radius: var(--r-pill);
  background: var(--lilac); white-space: nowrap; }

/* ---------- header: title, date, three square tiles ---------- */
.plan-page .dash-head { align-items: center; }
.plan-page .dash-tools { gap: 12px; }
.plan-page .db-squares:empty { display: none; }
.plan-page .db-sq { min-height: 84px; }
/* the header tiles and «عدّل الخطة» open the plan's settings */
.plan-page button.db-sq { border: 0; text-align: start; cursor: pointer; }
.pl-edit { display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; white-space: nowrap; }
.pl-edit[hidden] { display: none; }
.pl-edit .icon { width: 15px; height: 15px; }

/* ---------- tabs ---------- */
.pl-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.pl-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700;
  background: var(--lilac); color: var(--ink-2); }
.pl-tabs button[aria-selected="true"] .pl-count { background: var(--accent); color: #fff; }

/* ==========================================================================
   Setup: question cards + a summary card
   ========================================================================== */
.pl-setupgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 16px; align-items: start; }
.pl-setup { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pl-q { display: grid; gap: 14px; align-content: start; padding: 18px 20px 20px; border-radius: 24px; background: var(--card-bg); }
.pl-q--wide { grid-column: 1 / -1; }
.pl-q > header { display: flex; align-items: center; gap: 10px; }
.pl-q h3 { font-size: 16px; font-weight: var(--w-regular); line-height: 1.4; }
.pl-q h3 label { cursor: pointer; }
.pl-q header small { margin-inline-start: auto; font-size: 11.5px; color: var(--muted); padding: 2px 10px; border-radius: var(--r-pill); background: var(--lilac); white-space: nowrap; }
.pl-qn { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--violet-soft); color: var(--accent-press); font-size: 13px; font-weight: var(--w-semibold); }
.pl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pl-chips .chip { cursor: pointer; font: inherit; font-size: 13.5px; min-height: 38px; padding: 7px 16px; border: 0; background: var(--lilac); color: var(--ink); }
.pl-chips .chip:hover { background: var(--border-strong); }
.pl-chips .chip.is-active { background: var(--ink); color: #fff; }
.pl-chips .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pl-chips--big { gap: 6px; }
.pl-chips--big .chip { min-width: 50px; padding-inline: 12px; font-size: 15px; justify-content: center; }
.pl-chips--days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.pl-chips--days .chip { padding-inline: 4px; min-height: 44px; border-radius: 14px; text-align: center; font-size: 13px; }
.pl-chips--days .chip.is-active { background: var(--accent); }
.pl-q input[type="date"] { justify-self: stretch; height: 46px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: var(--lilac); font: inherit; font-size: 15px; color: var(--ink); }
.pl-q input[type="date"]:focus { outline: 2px solid var(--accent); outline-offset: 0; background: var(--surface); }

.pl-sum { position: sticky; top: 16px; display: grid; gap: 14px; padding: 20px; border-radius: 28px; background: var(--card-bg); }
.pl-sum__h { font-size: 18px; font-weight: var(--w-regular); }
.pl-preview { display: grid; gap: 12px; }
.pl-preview:empty { display: none; }
.pl-sum .pl-sum__glow { width: auto; min-height: 112px; padding: 16px 18px; border-radius: 22px; }
.pl-sum .pl-sum__glow b { font-size: 40px; }
.pl-sum .pl-sum__glow .db-sq__t { font-size: 13px; }
.pl-sum__tiles { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 8px; }
.pl-sum__tiles li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 16px; background: var(--lilac); }
.pl-sum__tiles b { font-size: 22px; font-weight: var(--w-regular); line-height: 1.15; justify-self: start; }
.pl-sum__tiles span { font-size: 11.5px; color: var(--ink-2); }
.pl-sum__day { display: grid; gap: 8px; }
.pl-sum__sub { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13.5px; font-weight: var(--w-medium); }
.pl-sum__sub small { font-size: 11.5px; color: var(--muted); font-weight: var(--w-regular); }
.pl-sum .db-tasklist { list-style: none; margin: 0; padding: 0; }
.pl-sum .db-tk b { white-space: normal; }
.pl-sum .db-tk__ico .icon { width: 15px; height: 15px; }
.pl-foot { display: flex; gap: 10px; align-items: center; }
.pl-foot .btn--primary { flex: 1; justify-content: center; min-height: 48px; }

/* ==========================================================================
   «اليوم»
   ========================================================================== */
#pl-today { display: grid; gap: 16px; }
.pl-todaygrid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: 16px; align-items: stretch; }
/* the next task: a card in its skill's tint, one purple button */
.pl-focus { display: grid; gap: 12px; align-content: start; padding: 24px 26px; border-radius: 28px;
  background: color-mix(in srgb, var(--sk-t, var(--violet-soft)) 50%, #fff); border: 0; }
.pl-focus__eyebrow { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); }
.pl-focus__eyebrow .pl-min { background: rgba(255, 255, 255, .75); }
.pl-focus h2 { font-size: clamp(22px, 2vw, 30px); font-weight: var(--w-regular); line-height: 1.4; max-width: 30ch; }
.pl-passage { width: fit-content; font-size: 13px; font-weight: var(--w-medium); color: var(--ink-2); text-align: start; unicode-bidi: plaintext;
  padding: 4px 12px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .7); }
.pl-focus__acts { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 6px; }
.pl-start, .pl-start-alt { border-radius: var(--r-pill); min-height: 48px; padding-inline: 26px; justify-self: start; }
.pl-note { font-size: 13.5px; line-height: 1.7; padding: 10px 14px; border-radius: 16px; background: rgba(255, 255, 255, .7); }
.pl-focus--rest { gap: 10px; }
.pl-focus__goal { display: grid; gap: 6px; max-width: 360px; }
.pl-focus__goal p { font-size: 13px; color: var(--ink-2); }
.pl-focus__goal b { color: var(--ink); font-weight: var(--w-semibold); }
.pl-focus__goal .pl-meter { background: rgba(255, 255, 255, .85); }
.pl-focus__acts .link--btn { font-size: 13px; color: var(--ink-2); }
.pl-detail > summary, .pl-follow > summary { cursor: pointer; list-style: none; }
.pl-detail > summary::-webkit-details-marker, .pl-follow > summary::-webkit-details-marker,
.pl-mcard summary::-webkit-details-marker, .pl-menu summary::-webkit-details-marker { display: none; }

/* today's tasks under the gauge */
.pl-daycard { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border-radius: 28px; }
.pl-daycard__head { display: flex; gap: 8px 12px; justify-content: space-between; align-items: center; }
.pl-daycard__head h3 { font-size: clamp(17px, 1.3vw, 20px); font-weight: var(--w-regular); }
.pl-gauge { width: min(100%, 230px); margin: 0 auto 4px; }
.pl-gauge .db-gauge__mid strong { font-size: 30px; }
.pl-gauge .db-gauge__mid small { font-size: 12.5px; }
.pl-daybar { display: none; gap: 6px; }
.pl-daybar small { font-size: 12px; color: var(--muted); }
.pl-tasks { display: grid; gap: 6px; }
.pl-task { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 10px; border-radius: 16px; background: var(--lilac); }
.pl-task.is-next { background: var(--violet-soft); }
.pl-check { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface); color: var(--sk-c, var(--muted)); }
.pl-check .icon { width: 16px; height: 16px; }
.pl-task.is-done .pl-check { background: var(--mint); color: #fff; }
.pl-task.is-done .pl-check .icon { stroke-width: 2.6; }
.pl-task__body { display: grid; gap: 6px; min-width: 0; align-self: center; }
.pl-task__line { display: flex; gap: 10px; align-items: center; justify-content: space-between; min-height: 34px; }
.pl-task__t { font-size: 13.5px; line-height: 1.55; font-weight: var(--w-medium); }
.pl-task.is-done .pl-task__t { color: var(--muted); }
.pl-task__sub { font-size: 12px; color: var(--muted); }
.pl-task .pl-min { background: var(--surface); }
/* a small chevron (a shape, so it may turn): down when closed, up when open */
.pl-detail > summary.pl-task__line::after, .pl-mcard > details > summary::after { content: ""; flex: none; align-self: center; width: 7px; height: 7px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-2px) rotate(45deg); transition: transform var(--dur-fast) var(--ease-out); }
.pl-detail[open] > summary.pl-task__line::after, .pl-mcard > details[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.pl-detail > summary .pl-task__t { flex: 1; }
.pl-task__more { display: grid; gap: 8px; padding: 10px 12px; margin-top: 4px; border-radius: 12px; background: var(--surface); }
.pl-task__acts { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; }
.pl-task__acts > :is(*, .link) { min-height: 0; border: 0; padding: 5px 12px; border-radius: var(--r-pill); background: var(--lilac); color: var(--ink); text-decoration: none; font-size: 12.5px; }
.pl-task__acts > a.link { background: var(--accent); color: #fff; }
.pl-task__acts > :is(*, .link):hover { background: var(--border-strong); }
.pl-task__acts > a.link:hover { color: #fff; background: var(--accent-hover); }
.pl-res { font-size: 12px; line-height: 1.7; padding: 6px 10px; border-radius: 10px; background: var(--surface); }
.pl-res.is-pass { background: color-mix(in srgb, var(--mint-2) 55%, #fff); }
.pl-res.is-short { background: var(--sun-soft); }
.pl-res.is-wait { background: var(--violet-soft); }
.pl-extra { font-size: 12.5px; color: var(--ink-2); }
.pl-daycard__foot { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: flex-end; margin-top: auto; padding-top: 6px; }
.pl-menu { position: relative; }
.pl-menu > summary.link { cursor: pointer; list-style: none; min-height: 0; border: 0; padding: 6px 16px; border-radius: var(--r-pill); background: var(--lilac); font-size: 12.5px; color: var(--ink-2); text-decoration: none; }
.pl-menu > summary.link:hover { background: var(--border-strong); color: var(--ink); }
.pl-menu > div { position: absolute; z-index: 6; inset-inline-end: 0; bottom: calc(100% + 6px); display: grid; min-width: 210px; padding: 6px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-float); }
.pl-menu > div button { text-align: start; padding: 9px 12px; border: 0; border-radius: 12px; background: none; font: inherit; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.pl-menu > div button:hover, .pl-menu > div button:focus-visible { background: var(--lilac); }
.pl-card--warn { display: grid; gap: 6px; background: var(--sun-soft); font-size: 14px; line-height: 1.75; }

/* ---------- «طريقك»: the phases as one bar, each named under its segment, today's purple ---------- */
.pl-road { display: grid; gap: 14px; padding: 18px 22px; border-radius: 28px; }
.pl-road__h { font-size: clamp(17px, 1.3vw, 20px); font-weight: var(--w-regular); }
.pl-road__bar { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.pl-road__bar > li { flex: 1 1 0; min-width: 0; display: grid; gap: 6px; align-content: start; }
.pl-road__bar > li > i { display: block; height: 10px; border-radius: 99px; background: var(--lilac); }
.pl-road__bar > li.is-done > i { background: var(--violet-soft); }
.pl-road__bar > li.is-now > i { background: linear-gradient(to left, var(--violet), var(--violet-2)); }
.pl-road__bar b { display: flex; gap: 4px; align-items: center; font-size: 12.5px; font-weight: var(--w-regular); line-height: 1.4; color: var(--muted); }
.pl-road__bar b .icon { flex: none; width: 13px; height: 13px; color: var(--accent); stroke-width: 2.6; }
.pl-road__bar .is-now b { font-weight: var(--w-semibold); color: var(--ink); }
.pl-road__bar small { font-size: 11.5px; color: var(--muted); }
.pl-road__end { flex: none !important; }
.pl-road__end > i { width: 10px; background: var(--c-exam) !important; }
.pl-road__end b { color: var(--ink); }
.pl-road__end b .icon { color: var(--c-exam); stroke-width: 2; }
.pl-road__now { font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
.pl-road__now b { font-weight: var(--w-semibold); color: var(--ink); }
.pl-road__nodate { font-size: 13px; color: var(--ink-2); }
.pl-road__warn { display: flex; gap: 10px; align-items: center; font-size: 12.5px; line-height: 1.7; color: var(--ink-2); padding: 8px 14px; border-radius: 16px; background: var(--sun-soft); }
.pl-road__warn .icon { flex: none; width: 16px; height: 16px; color: var(--c-plan); }

/* ==========================================================================
   «مهاراتك»: every section as a card; the chosen one opens below as rows
   (a name, a bar, a number), like «دقّتك حسب النوع» on the reading page
   ========================================================================== */
.pl-skcs { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.pl-skc { width: 100%; height: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px 10px; padding: 14px 16px 16px; border: 0; border-radius: 24px;
  text-align: start; font: inherit; color: var(--ink); cursor: pointer; background: color-mix(in srgb, var(--sk-t) 45%, var(--surface)); transition: background-color var(--dur-fast), box-shadow var(--dur-fast); }
.pl-skc:hover { background: color-mix(in srgb, var(--sk-t) 75%, var(--surface)); }
.pl-skc[aria-pressed="true"] { background: var(--surface); box-shadow: inset 0 0 0 2px var(--sk-c); }
.pl-skc[aria-pressed="true"] .pl-ic { background: color-mix(in srgb, var(--sk-t) 70%, #fff); }
.pl-skc:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pl-skc__name { font-size: 14.5px; font-weight: var(--w-medium); }
.pl-skc__n { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 8px; min-height: 34px; }
.pl-skc__n b { font-size: 28px; font-weight: var(--w-regular); line-height: 1.1; }
.pl-skc__n small { font-size: 12px; color: var(--ink-2); }

.pl-secd { display: grid; gap: 14px; padding: 20px 22px; border-radius: 28px; }
.pl-secd__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; }
.pl-secd__lv { font-size: 13.5px; color: var(--ink-2); }
.pl-mnext__go { display: inline-flex; align-items: center; gap: 10px; }
.pl-mnext .pl-min { background: var(--surface); }

/* a row: name (and its state), a bar, the number; a link (arrow) or a fold (chevron) */
.pl-rows { list-style: none; margin: 0; padding: 0; display: grid; }
.pl-row + .pl-row { border-top: 1px solid var(--border); }
.pl-row > a, .pl-row > div, .pl-row summary { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(80px, 1fr) 96px 10px; gap: 14px; align-items: center;
  padding: 12px 8px; border-radius: 14px; color: inherit; text-decoration: none; transition: background-color var(--dur-fast); }
.pl-row summary { cursor: pointer; list-style: none; }
.pl-row summary::-webkit-details-marker { display: none; }
.pl-row > a:hover, .pl-row summary:hover { background: var(--lilac); }
.pl-row > a:hover .pl-meter, .pl-row summary:hover .pl-meter { background: var(--surface); }
.pl-row > a:focus-visible, .pl-row summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* the arrow (forward is left) and the chevron are shapes, so they may turn */
.pl-row > a::after, .pl-row summary::after { content: ""; justify-self: center; width: 7px; height: 7px; border-left: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); }
.pl-row summary::after { border-left: 0; border-right: 1.5px solid var(--muted); transform: translateY(-2px) rotate(45deg); transition: transform var(--dur-fast) var(--ease-out); }
.pl-row details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.pl-row__name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.pl-row__name b { font-size: 14px; font-weight: var(--w-medium); line-height: 1.55; }
.pl-row__val { display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.pl-row__val b { font-size: 15px; font-weight: var(--w-semibold); }
.pl-row__val small { font-size: 11.5px; color: var(--muted); }
.pl-row__body { display: grid; gap: 12px; padding: 2px 8px 16px; }
.pl-row__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--lilac); }
.pl-goal { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.pl-goal b { font-weight: var(--w-medium); }
.pl-goal .icon { width: 16px; height: 16px; color: var(--accent); }
.pl-badge { font-size: 11.5px; padding: 2px 10px; border-radius: var(--r-pill); background: var(--lilac); white-space: nowrap; font-weight: var(--w-medium); color: var(--ink-2); }
.pl-badge.is-weak { background: var(--t-exam); color: var(--terracotta); }
.pl-badge.is-tent { background: var(--sun-soft); color: #7a5a00; }
.pl-badge.is-up { background: color-mix(in srgb, var(--mint-2) 60%, #fff); color: #1f5f32; }
.pl-badge.is-unknown { color: var(--muted); }
.pl-badge.is-strong, .pl-badge.is-ok { background: var(--t-vocab); color: #0b5e57; }
/* a bar with the goal as a small tick: far (red), close (yellow), there (green); a course's progress in purple */
.pl-meter { position: relative; display: block; height: 8px; border-radius: 8px; background: var(--lilac); }
.pl-meter i { display: block; height: 100%; border-radius: inherit; background: var(--violet); }
.pl-meter.is-low i { background: var(--c-exam); }
.pl-meter.is-mid i { background: var(--highlight); }
.pl-meter.is-high i { background: var(--c-speaking); }
.pl-meter em { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 2px; background: var(--ink); opacity: .45; }
/* a sub-skill's steps: small segments and the one it's on */
.pl-stepline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--ink-2); }
.pl-seg { display: inline-flex; gap: 3px; }
.pl-seg i { width: 18px; height: 6px; border-radius: 6px; background: var(--border-strong); }
.pl-seg i.is-done { background: var(--violet); }
.pl-seg i.is-now { background: var(--sun); }

/* ==========================================================================
   «أخطاؤك»: number tiles, soft rows; opened: the question, the two answers,
   where the evidence is, why, then one plain question about what happened
   ========================================================================== */
.pl-mistcard { max-width: 920px; }
.pl-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* the mistakes under their passage and day, said once; each mistake one plain row with a hairline between */
.pl-mgroup { display: grid; gap: 2px; }
.pl-mgroup + .pl-mgroup { margin-top: 10px; }
.pl-mfilter + .pl-mgroup { margin-top: 14px; }
.pl-mgroup__h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding-inline: 14px; font-size: 13px; font-weight: var(--w-semibold); color: var(--ink-2); }
.pl-mgroup__h small { font-size: 12px; font-weight: 400; color: var(--muted); }
.pl-mfilter .chip { min-height: 34px; padding: 5px 14px; font-size: 12.5px; }
.pl-mlist { display: grid; }
.pl-mcard { border-radius: 14px; transition: background-color var(--dur-fast); }
.pl-mcard + .pl-mcard { box-shadow: inset 0 1px 0 var(--border); }
.pl-mcard:hover { background: var(--lilac); }
.pl-mcard:has(details[open]) { background: var(--surface); box-shadow: 0 0 0 1.5px var(--border-strong); }
.pl-mcard > details > summary { cursor: pointer; list-style: none; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto 10px; gap: 12px; align-items: center; padding: 11px 14px; }
.pl-mno { font-size: 12.5px; font-weight: var(--w-semibold); color: var(--muted); text-align: center; }
.pl-mcard.is-seen .pl-mno { color: var(--mint); }
.pl-msum { display: grid; gap: 2px; min-width: 0; }
.pl-mq1 { font-size: 14px; font-weight: var(--w-medium); text-align: start; unicode-bidi: plaintext; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-mpair { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: var(--w-medium); white-space: nowrap; }
.pl-mpair > span { padding: 3px 10px; border-radius: var(--r-pill); max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.pl-mpair .is-wrong { background: var(--t-exam); color: var(--terracotta); text-decoration: line-through; text-decoration-color: rgba(220, 38, 38, .45); }
.pl-mpair .is-key { background: color-mix(in srgb, var(--mint-2) 60%, #fff); color: #1f5f32; }
.pl-mpair i { font-style: normal; color: var(--muted); }
.pl-mtag { font-size: 11.5px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--sun-soft); white-space: nowrap; }
.pl-mbody { display: grid; gap: 16px; padding: 4px 16px 18px; padding-inline-start: 48px; font-size: 14.5px; line-height: 1.8; }
.pl-mq { text-align: left; font-size: 15px; line-height: 1.7; padding: 12px 16px; border-radius: 16px; background: var(--lilac); }
.pl-mq mark { background: var(--sun-soft); padding: 0 3px; }
.pl-mopts { display: grid; gap: 3px; margin-top: 8px; font-size: 13.5px; color: var(--ink-2); }
.pl-mopts li.is-key { color: #1f5f32; font-weight: 600; }
.pl-mopts li.is-key::before { content: "✓ "; }
.pl-mopts li.is-wrong { color: var(--terracotta); text-decoration: line-through; }
.pl-mcmp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pl-mcmp > div { display: grid; gap: 2px; padding: 12px 16px; border-radius: 16px; }
.pl-mcmp small { font-size: 12px; color: var(--ink-2); }
.pl-mcmp b { font-size: 18px; font-weight: var(--w-regular); overflow-wrap: anywhere; }
.pl-mcmp .is-wrong { background: var(--t-exam); }
.pl-mcmp .is-wrong b { color: var(--terracotta); text-decoration: line-through; text-decoration-color: rgba(220, 38, 38, .4); }
.pl-mcmp .is-key { background: color-mix(in srgb, var(--mint-2) 55%, #fff); }
.pl-mcmp .is-key b { color: #1f5f32; }
.pl-mblock { display: grid; gap: 6px; }
.pl-mblock h4, .pl-mask h4 { font-size: 13.5px; font-weight: var(--w-semibold); color: var(--ink); }
.pl-mblock h4 small { font-weight: 400; color: var(--muted); margin-inline-start: 6px; }
.pl-mblock blockquote { margin: 0; padding: 10px 16px; border-inline-start: 3px solid var(--sun); background: var(--sun-soft); border-radius: 4px 16px 16px 4px; font-size: 14.5px; line-height: 1.7; font-style: italic; text-align: left; }
.pl-mblock p { color: var(--ink-2); }
.pl-en { font-weight: 600; color: var(--ink); }
.pl-mpp { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; list-style: none; padding: 0; }
.pl-mpp li { display: inline-flex; gap: 6px; align-items: baseline; padding: 4px 12px; border-radius: var(--r-pill); background: var(--lilac); font-size: 12.5px; }
.pl-mpp i { font-style: normal; color: var(--muted); }
.pl-mask { display: grid; gap: 8px; padding: 14px 16px; border-radius: 18px; background: var(--violet-soft); }
.pl-mask p { font-size: 13px; }
.pl-mchoices { display: grid; gap: 6px; }
.pl-mchoices button { text-align: start; font: inherit; font-size: 14px; padding: 10px 16px; border-radius: 14px; border: 0; background: var(--surface); color: var(--ink); cursor: pointer; transition: background-color var(--dur-fast), color var(--dur-fast); }
.pl-mchoices button:hover, .pl-mchoices button:focus-visible { background: var(--ink); color: #fff; }
.pl-mcause { font-size: 13.5px; color: var(--ink-2); }
.pl-mcause b { color: var(--ink); }
.pl-mcause small { color: var(--muted); }
.pl-follow > summary { width: fit-content; font-size: 13px; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--violet-2); text-underline-offset: 4px; }
.pl-follow[open] > summary { margin-bottom: 8px; }
.pl-mfoot { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding-top: 4px; }
.pl-donetag { font-size: 13px; color: #1f5f32; font-weight: 600; }
.pl-mmore { justify-self: start; }
/* the next step after understanding a mistake: fresh questions on the same skill */
.pl-mnext { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 16px; border-radius: 18px;
  background: var(--violet-soft); color: var(--ink); text-decoration: none; transition: background-color var(--dur-fast); }
.pl-mnext:hover, .pl-mnext:focus-visible { background: #e4d8fd; }
.pl-mnext__txt { display: grid; gap: 2px; min-width: 0; }
.pl-mnext__txt b { font-size: 14.5px; font-weight: var(--w-medium); }
.pl-mnext__txt small { font-size: 12.5px; color: var(--ink-2); }
.pl-mnext .btn { pointer-events: none; }
/* nothing to review yet */
.pl-empty { display: grid; justify-items: center; gap: 8px; padding: 28px 16px 30px; text-align: center; border-radius: 22px; background: var(--lilac); }
.pl-empty__ic { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 6px; border-radius: 22px; background: var(--glow); color: #fff;
  box-shadow: 0 18px 34px -18px rgba(150, 100, 200, .7); }
.pl-empty__ic .icon { width: 28px; height: 28px; stroke-width: 2.2; }
.pl-empty h3 { font-size: 19px; font-weight: var(--w-regular); }
.pl-empty p { max-width: 40ch; font-size: 13.5px; line-height: 1.7; color: var(--muted); }
.pl-empty .btn { margin-top: 8px; border-radius: var(--r-pill); min-height: 46px; padding-inline: 24px; }

/* ==========================================================================
   «تقدّمك»
   ========================================================================== */
.pl-roadgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.pl-rcol { display: grid; gap: inherit; min-width: 0; }
.pl-rcard { display: grid; gap: 12px; align-content: start; padding: 18px 20px; border-radius: 28px; }
.pl-rcard h3 { font-size: clamp(17px, 1.3vw, 20px); font-weight: var(--w-regular); }
.pl-rcard h3 small { font-size: 12px; color: var(--muted); margin-inline-start: 6px; }
.pl-rcard h4 { font-size: 13.5px; font-weight: var(--w-medium); margin-top: 6px; }
.pl-rcard h4 small { font-size: 11.5px; color: var(--muted); font-weight: var(--w-regular); margin-inline-start: 4px; }
/* this week's goals: an icon, the skill, the goal, its step as a pill */
.pl-goals { display: grid; gap: 6px; }
.pl-goals li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 16px; background: color-mix(in srgb, var(--sk-t, var(--violet-soft)) 55%, #fff); }
.pl-goals .pl-ic { color: var(--sk-c, var(--accent)); }
.pl-goals p { display: grid; gap: 1px; min-width: 0; }
.pl-goals b { font-size: 14px; font-weight: var(--w-medium); }
.pl-goals p span { font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
.pl-goals .pl-min { background: var(--surface); }
/* checkpoints: a date bubble and the step */
.pl-cps { display: grid; gap: 6px; }
.pl-cps li { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 12px; align-items: center; padding: 6px 8px; border-radius: 16px; background: var(--lilac); }
.pl-date { width: 46px; height: 50px; display: grid; justify-items: center; align-content: center; border-radius: 14px; background: var(--surface); }
.pl-date small { font-size: 10.5px; color: var(--muted); line-height: 1.2; }
.pl-date b { font-size: 18px; font-weight: var(--w-medium); line-height: 1.2; }
.pl-cps p { display: grid; gap: 1px; min-width: 0; }
.pl-cps p b { font-size: 13.5px; font-weight: var(--w-medium); line-height: 1.55; }
.pl-cps p small { font-size: 12px; color: var(--muted); line-height: 1.55; }
/* the start against now: two bars per condition */
.pl-cmps { display: grid; gap: 10px; }
.pl-cmp { display: grid; gap: 8px; padding: 12px 14px; border-radius: 18px; background: var(--lilac); }
.pl-cmp__h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pl-cmp__h b { font-size: 14px; font-weight: var(--w-medium); }
.pl-cmp__bar { display: grid; grid-template-columns: 52px minmax(0, 1fr) 44px; gap: 10px; align-items: center; }
.pl-cmp__bar small { font-size: 11.5px; color: var(--muted); }
.pl-cmp__bar b { font-size: 14px; font-weight: var(--w-medium); }
.pl-cmp .db-bar--thick { background: repeating-linear-gradient(90deg, #e3e3e8 0 2px, transparent 2px 5px), var(--surface); }
.pl-diff { font-size: 12px; padding: 2px 10px; border-radius: var(--r-pill); background: var(--surface); color: var(--ink-2); }
.pl-diff.is-up { background: color-mix(in srgb, var(--mint-2) 60%, #fff); color: #1f5f32; }
.pl-diff.is-down { background: var(--t-exam); color: var(--terracotta); }
/* the week: seven day pills, then two or three number tiles */
.pl-week { display: grid; gap: 14px; }
.pl-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.pl-day { display: grid; justify-items: center; gap: 2px; padding: 8px 0; border-radius: 16px; }
.pl-day small { font-size: 11px; color: var(--muted); }
.pl-day > b { font-size: 16px; font-weight: var(--w-medium); line-height: 1.2; }
.pl-day i { width: 20px; height: 20px; margin-top: 2px; border-radius: 50%; display: grid; place-items: center; font-style: normal; background: var(--lilac); }
.pl-day i .icon { width: 12px; height: 12px; stroke-width: 2.6; }
.pl-day.is-full i { background: var(--mint); color: #fff; }
.pl-day.is-some i { background: var(--sun); color: var(--ink); }
.pl-day.is-miss i { background: var(--t-exam); }
.pl-day.is-rest i, .pl-day.is-before i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.pl-day.is-before > b { color: var(--faint); }
.pl-day.is-now { background: var(--ink); color: #fff; }
.pl-day.is-now small { color: rgba(255, 255, 255, .7); }
.pl-stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.pl-stats li { display: grid; gap: 2px; padding: 12px 14px; border-radius: 18px; background: var(--lilac); }
.pl-stats b { font-size: 26px; font-weight: var(--w-regular); line-height: 1.15; justify-self: start; }
.pl-stats b small { font-size: 14px; color: var(--muted); }
.pl-stats span { font-size: 12px; color: var(--ink-2); line-height: 1.5; }

/* home.html shows the exam phase with this */
.pl-phase { font-size: 13px; padding: 6px 10px; margin-top: 4px; border-radius: 10px; background: var(--tint-cyan); border: 1px solid var(--border-strong); }

/* ---------- hover: a gentle lift (with `top` — the rows hold Arabic text) ---------- */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  html:not(.calm) :is(.pl-skc, .pl-stats li) { position: relative; top: 0; transition: top 420ms var(--ease-out), box-shadow 420ms var(--ease-out), background-color var(--dur-fast); }
  html:not(.calm) .pl-skc:hover { top: -4px; box-shadow: 0 18px 32px -20px color-mix(in srgb, var(--sk-c) 70%, transparent); }
  html:not(.calm) .pl-stats li:hover { top: -3px; box-shadow: 0 16px 30px -22px rgba(20, 20, 30, .35); }
  .pl-skc .pl-ic, .pl-check { transition: transform 480ms var(--ease-spring); }
  .pl-skc:hover .pl-ic { transform: scale(1.12) rotate(-8deg); }
  .pl-task:hover .pl-check { transform: scale(1.08); }
}

/* ---------- smaller screens ---------- */
@media (max-width: 1280px) {
  .pl-skcs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .pl-todaygrid, .pl-setupgrid { grid-template-columns: minmax(0, 1fr); }
  .pl-sum { position: static; }
}
@media (max-width: 960px) {
  #pl-root, #pl-today, .pl-todaygrid, .pl-roadgrid { gap: 12px; }
  .plan-page .dash-head { flex-wrap: wrap; }
  .plan-page .dash-tools { flex: 1 1 100%; flex-wrap: wrap; }
  .plan-page .db-squares { flex: 1 1 100%; }
  .pl-edit { order: 1; }                                   /* the tiles keep the row, «عدّل الخطة» goes under them */
  .plan-page .db-sq { flex: 1; width: auto; min-height: 74px; padding: 10px 12px; }
  .plan-page .db-sq b { font-size: 22px; }
  .pl-setup, .pl-roadgrid { grid-template-columns: minmax(0, 1fr); }
  .pl-q, .pl-sum, .pl-daycard, .pl-road, .pl-skillcard, .pl-mistcard, .pl-evsrc, .pl-rcard { padding: 16px; border-radius: 22px; }
  .pl-focus { padding: 20px; border-radius: 24px; gap: 10px; }
  .pl-start { flex: 1; justify-content: center; }
  .pl-gauge { display: none; }
  .pl-daybar { display: grid; }
  .pl-secd { padding: 16px; border-radius: 22px; }
  .pl-row > a, .pl-row > div, .pl-row summary { grid-template-columns: minmax(0, 1fr) auto 10px; gap: 8px 12px; padding-inline: 4px; }
  .pl-row .pl-meter { grid-column: 1 / 3; grid-row: 2; }
  .pl-row > a::after, .pl-row summary::after { grid-column: 3; grid-row: 1; }
  .pl-row__body { padding-inline: 4px; }
  .pl-tabs { overflow-x: auto; }
  .pl-strip { gap: 2px; }
  .pl-day { width: 40px; }
  .pl-mcard > details > summary { grid-template-columns: 22px minmax(0, 1fr) 10px; gap: 6px 10px; padding: 12px 10px; }
  .pl-mpair { grid-column: 2; grid-row: 2; justify-self: start; }
  .pl-mtag { grid-column: 2; grid-row: 3; justify-self: start; }
  .pl-mcard > details > summary::after { grid-column: 3; grid-row: 1; }
  .pl-mbody { padding-inline: 10px; }
  .pl-mgroup__h { padding-inline: 10px; }
  .pl-mcmp { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  /* «طريقك» on a phone: the bar stands up, one phase per row (its name, its date at the row's end) */
  .pl-road__bar { flex-direction: column; gap: 3px; }
  .pl-road__bar > li { flex: none; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 30px; }
  .pl-road__bar > li > i { width: 8px; height: auto; align-self: stretch; }
  .pl-road__end > i { height: 8px; align-self: center !important; }
  .pl-skcs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pl-skc { padding: 12px 14px; border-radius: 20px; }
  .pl-skc__n b { font-size: 24px; }
  .pl-chips--days .chip { font-size: 11.5px; }
  .pl-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pl-stats b { font-size: 21px; }
  .pl-cmp__bar { grid-template-columns: 44px minmax(0, 1fr) 40px; }
  .pl-cmp__bar > small:last-child { display: none; }
}
