/* Learning module (M02/M03/M06) — builds on maqraa.css tokens; logical properties only (RTL + LTR). */

.lm-section-title { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-block: 2rem .9rem; flex-wrap: wrap; }
.lm-section-title h2 { margin: 0; font-size: 1.35rem; }
.lm-section-title .eyebrow { color: var(--accent); font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; display: block; }

/* key figures */
.lm-figures { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.lm-figures .stat .value { font-size: 1.7rem; }
.lm-figures .stat .delta { color: var(--text-muted); }

/* time-zone note */
.tz-note { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: .2rem .75rem; }
.tz-note svg { inline-size: 16px; block-size: 16px; }

/* session rows */
.session-row { display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: center; padding: .75rem 0;
  border-block-end: 1px solid var(--border); }
.session-row:last-child { border-block-end: 0; }
.when-tile { inline-size: 64px; text-align: center; border-radius: 12px; background: var(--green-50); border: 1px solid var(--green-100);
  padding: .3rem .2rem; line-height: 1.15; color: var(--green-800); font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .when-tile { background: var(--surface-2); border-color: var(--border); color: var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .when-tile { background: var(--surface-2); border-color: var(--border); color: var(--text); } }
.when-tile .d { font-size: .72rem; color: var(--text-muted); display: block; }
.when-tile .t { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; display: block; }
.session-row .meta { font-size: .85rem; color: var(--text-muted); }

/* slot chips (A03: viewer time zone) */
.slot-list { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; margin: 0; padding: 0; }
.slot { display: inline-flex; flex-direction: column; padding: .4rem .75rem; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--bg-elevated); font-size: .85rem; line-height: 1.3; font-variant-numeric: tabular-nums; }
.slot strong { font-size: .95rem; }
.slot .sub { color: var(--text-muted); font-size: .75rem; }
.slot.makeup { border-style: dashed; }
.slot.cancelled { opacity: .55; text-decoration: line-through; }

/* matching (AI-04) */
.match { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; }
.match-score { inline-size: 64px; block-size: 64px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--info);
  background: conic-gradient(var(--info) calc(var(--score) * 1%), var(--info-soft) 0); position: relative; }
.match-score::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.match-score span { position: relative; z-index: 1; }
.reasons { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .2rem; font-size: .9rem; }
.reasons li::before { content: "✓"; color: var(--success); margin-inline-end: .4rem; font-weight: 700; }
.reasons li.warn::before { content: "!"; color: var(--warning); }

/* rubric (FR-203 / FR-304) */
.rubric { display: grid; gap: 1rem; }
.rubric fieldset { border: 1px solid var(--border); border-radius: 12px; padding: .75rem 1rem; margin: 0; }
.rubric legend { font-weight: 700; padding-inline: .35rem; }
.rubric .choices { display: grid; gap: .35rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.rubric .choices label { display: flex; gap: .5rem; align-items: flex-start; font-size: .88rem; border: 1px solid var(--border);
  border-radius: 9px; padding: .45rem .6rem; cursor: pointer; background: var(--bg-elevated); }
.rubric .choices label:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px var(--green-100); }
.rubric .choices label.ai-hint { border-style: dashed; border-color: var(--info); }
.score-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.score-meter { display: grid; gap: .25rem; }
.score-meter .row { display: flex; justify-content: space-between; font-size: .88rem; }
.score-meter .row b { font-variant-numeric: tabular-nums; }

/* recorder (FR-202) */
.recorder { display: grid; gap: .8rem; justify-items: center; text-align: center; padding: 1.5rem 1rem; border: 2px dashed var(--border-strong);
  border-radius: var(--radius); background: var(--bg-elevated); }
.rec-btn { inline-size: 84px; block-size: 84px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #d9584d, var(--danger)); color: #fff; box-shadow: 0 6px 18px -6px rgba(163,50,42,.6); }
.rec-btn svg { inline-size: 34px; block-size: 34px; }
.rec-btn[aria-pressed="true"] { animation: rec-pulse 1.4s infinite; }
@keyframes rec-pulse { 0% { box-shadow: 0 0 0 0 rgba(163,50,42,.5); } 70% { box-shadow: 0 0 0 16px rgba(163,50,42,0); } 100% { box-shadow: 0 0 0 0 rgba(163,50,42,0); } }
.rec-timer { font-family: var(--font-display); font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.rec-level { inline-size: min(100%, 280px); }
.recorder audio { inline-size: min(100%, 420px); }

/* attendance radio group */
.att-choices { display: flex; flex-wrap: wrap; gap: .3rem; }
.att-choices label { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .55rem; border-radius: 999px;
  border: 1px solid var(--border); font-size: .82rem; cursor: pointer; background: var(--bg-elevated); }
.att-choices label:has(input:checked) { border-color: var(--primary); background: var(--green-50); color: var(--green-800); font-weight: 600; }
:root[data-theme="dark"] .att-choices label:has(input:checked) { background: var(--surface-2); color: var(--text); }

/* levels path */
.level-path { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; counter-reset: lvl; }
.level-path > li { counter-increment: lvl; display: grid; grid-template-columns: auto 1fr; gap: .75rem; align-items: start;
  padding: .7rem .9rem; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elevated); }
.level-path > li::before { content: counter(lvl); inline-size: 2rem; block-size: 2rem; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--green-700), var(--green-900)); color: var(--gold-300); font-weight: 700; font-size: .9rem; }
.level-path .outcomes { font-size: .88rem; color: var(--text-muted); margin: .25rem 0 0; white-space: pre-line; }

/* small helpers */
.inline-form { display: inline; }
.form-inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.form-inline .field { min-inline-size: 160px; }
.chip-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.kv-compact dt, .kv-compact dd { font-size: .9rem; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; gap: .6rem; align-items: center; font-size: .9rem; }
.bar-row + .bar-row { margin-block-start: .45rem; }
.trend { display: flex; align-items: flex-end; gap: 4px; block-size: 64px; }
.trend span { flex: 1; min-inline-size: 6px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--gold-500), var(--green-600)); }
.empty-inline { color: var(--text-muted); font-size: .92rem; padding: .5rem 0; }
.passage-text { max-block-size: 360px; overflow: auto; padding: .75rem 1rem; border-radius: 12px; background: var(--bg-elevated); border: 1px solid var(--border); }
.verse-marks .w.mistake { background: var(--danger-soft); border-radius: 4px; }
.week-day { margin-block-end: 1.25rem; }
.week-day h3 { font-size: 1.05rem; margin-block-end: .4rem; color: var(--primary); }
details.card > summary { cursor: pointer; font-weight: 700; }
details.card[open] > summary { margin-block-end: .75rem; }
@media (max-width: 640px) { .session-row { grid-template-columns: auto 1fr; } .session-row > :last-child { grid-column: 1 / -1; } }
a.stat { display: block; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
a.stat:hover { border-color: var(--gold-500); box-shadow: var(--shadow-sm); }
/* `hidden` must win over component display rules */
main [hidden] { display: none !important; }
.when-tile { inline-size: 72px; }
.when-tile .d + .t + .d { margin-block-start: .1rem; }
