/* The teacher shell follows Today while this view is active. */
body.tos.today-ui {
  --f-text: var(--font);
  --f-display: var(--font);
  --pl-bg: var(--bg);
  --pl-card: var(--bg-panel);
  --pl-ink: var(--fg-1);
  --pl-ink2: var(--fg-2);
  --pl-ink3: var(--fg-3);
  --paper: var(--bg);
  --paper-2: var(--bg-panel);
  --ink: var(--fg-1);
  --ink-2: var(--fg-2);
  --ink-3: var(--fg-3);
  --tap: 48px;
  color-scheme: light;
  background: var(--bg);
  color: var(--fg-1);
  font: 400 max(17px, var(--t-body))/1.55 var(--font);
}
html[data-contrast="high"] body.today-ui #v-today .ui-card {
  background: var(--bg);
  outline: 2px solid currentColor;
}
html[data-contrast="high"] body.today-ui #v-today :is(.dayhead, .sc-time, .sc-who, .chip, .sc-obj) {
  color: #000;
}
body.today-ui :focus-visible,
body.tos > .ui-toast :focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}
body.tos.today-ui .appbar { background: var(--bg); }
body.tos.today-ui .appbar-tools button {
  height: auto;
  line-height: 1.25;
}
body.tos.today-ui .wordmark { display: grid; align-items: center; min-height: 48px; }

body.today-ui #v-today { animation: none; overflow-wrap: anywhere; }
body.today-ui #v-today .wrapn { padding-inline: clamp(12px, 4vw, 24px); }
body.today-ui #v-today .dayhead { padding-block: 14px 0; }
body.today-ui #v-today .dayhead h1 {
  font: 500 clamp(1.625rem, 7vw, 2rem)/1.3 var(--font);
  color: var(--fg-1);
}
body.today-ui #v-today .dayhead { color: var(--fg-1); }

body.today-ui #v-today .dayhead :is(.hi, .sum) {
  color: var(--fg-2);
  font: inherit;
}
body.today-ui #v-today .sc {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  padding: 14px;
  border: 0;
  border-radius: var(--r-2xl) !important;
  background: var(--bg-panel);
  box-shadow: none;
}
body.today-ui #v-today .sc.st-done { background: #DDF5E5; }
body.today-ui #v-today .sc-main { min-width: 0; }
body.today-ui #v-today .swipehint { font-weight: 500; }
body.today-ui #v-today .sc-time {
  display: flex;
  justify-content: start;
  gap: 6px;
  flex-wrap: wrap;
  direction: ltr;
  justify-self: start;
  font: 400 max(17px, 1rem)/1.4 var(--font);
  color: var(--fg-2);
}
body.today-ui #v-today .sc-who { display: block; font: inherit; color: var(--fg-2); }
body.today-ui #v-today .sc-obj { font: 500 max(20px, 1.18rem)/1.4 var(--font); color: var(--fg-1); }
body.today-ui #v-today .chip {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg-2);
  font: inherit;
}
body.today-ui #v-today .chip:not(:empty)::before { content: " · "; }
body.today-ui #v-today .chip:empty { display: none; }
body.today-ui #v-today .session-details { grid-column: 1 / -1; }
body.today-ui #v-today .sc.main > .ui-btn { margin-block: 4px; }
body.today-ui #v-today .session-details > summary::after { content: "+"; }
body.today-ui #v-today .session-details[open] > summary::after { content: "−"; }
body.today-ui #v-today .ui-faq > summary { font-weight: 500; }
body.today-ui #v-today summary[data-ds-press]::after {
  position: static;
  opacity: 1;
  background: none;
  font-weight: 500;
}
body.today-ui #v-today #todayMore > summary > span { display: none; }
body.today-ui #v-today .donebar { flex-wrap: wrap; }
body.today-ui #v-today :is(.sc-row, .cmd .in, .flag.compact) {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
}
body.today-ui #v-today :is(.btn, .tog, button, input, select, textarea, summary, a),
body.tos.today-ui :is(.appbar, .sheet, .demo-strip, .pa) :is(button, a.btn, a.toolbtn, a.dl),
body.tos > .ui-toast button {
  min-height: 48px;
  min-width: 48px;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: max(17px, 1rem);
}
body.today-ui #v-today a.edit-t { display: inline-flex; align-items: center; }
body.today-ui #v-today :is(.small, .sc-note, .rowlink span span, .cmd label) { font-size: max(17px, 1rem); }
body.today-ui #v-today .empty b,
body.tos.today-ui :is(.appbar, .demo-strip) :is(b, button, a, .pnl-n, #syncPill) { font-weight: 500; }
body.today-ui #v-today .ui-btn--primary {
  border-radius: var(--r-full) !important;
  font-weight: 500;
}


/* The assistant stays mounted and its dialog retains the existing open state. */
body.tos.today-ui main { display: flex; flex-direction: column; }
body.tos.today-ui main > .pa { order: 1; width: 100%; }
body.tos.today-ui main > .pa:not(.is-open) {
  position: static;
  box-shadow: none;
  background: var(--bg);
}
body.tos.today-ui .pa:not(.is-open) :is(.pa-send, .pa-mic, .pa-name) { font-weight: 500; }
body.tos.today-ui .pa:not(.is-open):not(.is-typing) .pa-chips,
body.tos.today-ui .pa:not(.is-open) .pa-head { display: none; }
body.tos.today-ui .pa :is(.pa-in, .pa-mic, .pa-send, .pa-chip) { min-height: 48px; font-size: max(17px, 1rem); }

body.tos > .ui-toast {
  --tap: 48px;
  bottom: calc(80px + env(safe-area-inset-bottom));
  background: var(--bg-panel);
  color: var(--fg-1);
  font: 400 max(17px, 1rem)/1.45 var(--font);
  flex-wrap: wrap;
  overflow-wrap: anywhere;
  border-radius: var(--r-2xl) !important;
}
body.tos.is-demo > .ui-toast { bottom: calc(140px + env(safe-area-inset-bottom)); }
body.tos > .ui-toast .ui-btn { color: var(--fg-1); }

@media (max-width: 260px) {
  body.tos.today-ui.pa-on .pa .pa-bar {
    grid-template-columns: repeat(2, minmax(48px, 1fr));
  }
  body.tos.today-ui .pa .pa-in { grid-row: 1; grid-column: 1 / -1; }
  body.tos.today-ui .tabs a { flex-direction: column; }
  body.tos.today-ui #v-today .rowlink { grid-template-columns: minmax(0, 1fr) auto; }
  body.tos.today-ui #v-today .ui-faq > div { min-width: 0; }
  body.tos.today-ui .appbar,
  body.tos.today-ui.is-demo.pa-on .demo-strip,
  body.tos.today-ui.is-demo .demo-strip { position: static; }
  body.tos.today-ui.is-demo .demo-strip .wrap { flex-wrap: wrap; }
  body.tos.today-ui > .ui-toast { bottom: env(safe-area-inset-bottom); }
}

.today-tasks, #v-today .today-week, .today-voice { margin-block-start: var(--s-5, 20px); }
.today-tasks .rowlink { min-height: 52px; }
.week-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--hairline, var(--hair));
  border-radius: 12px;
  background: var(--bg, var(--paper));
}
.week-strip a {
  display: grid;
  grid-template-rows: auto auto 1em;
  justify-items: center;
  align-content: center;
  min-width: 0;
  min-height: 64px;
  padding-block: 4px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.3;
  text-decoration: none;
}
.week-strip a[data-week-today] { color: var(--action); box-shadow: inset 0 -2px var(--action); font-weight: 700; }
.week-strip a[aria-current="true"] { color: var(--action); background: var(--info-bg); box-shadow: inset 0 0 0 2px var(--action); font-weight: 700; }
.week-strip a:focus-visible { outline-offset: -3px; }
.week-strip a > span:first-child { font-size: clamp(13px, 4.1vw, 17px); }
.week-dots { display: flex; gap: 2px; max-width: 100%; overflow: hidden; font-size: 12px; direction: ltr; }
.week-dots .waiting { font-weight: 800; }
.week-dots .done { font-weight: 700; }
.week-sticky {
  position: sticky;
  top: var(--week-top, 56px);
  z-index: 8;
  padding-block: 4px;
  background: var(--bg, var(--paper));
  overflow: clip;
}
.week-heading { display: flex; align-items: center; gap: 12px; }
.week-heading .back { min-height: 48px; }
.week-number { font: 700 22px/1.4 var(--f-text); animation: week-label-in 240ms ease-out; }
.week-sticky .wknav { grid-template-columns: auto 1fr auto; align-items: center; text-align: center; gap: 6px; margin-block-start: 4px; }
.week-sticky .wknav .btn { min-height: 48px; padding: 0 6px; font-size: 17px; }
.week-sticky .wknav button:disabled { color: var(--ink-3); opacity: .65; }
.week-current, .week-range, .week-context { font-size: 17px; }
.week-range { margin-block: 12px; }
.week-context { margin-block-start: 4px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#v-week .wrapn { overflow-x: clip; }
#v-week :is(.week-strip, .week-content) { touch-action: pan-y pinch-zoom; }
#v-week .wday { scroll-margin-top: var(--week-offset, 144px); }
#v-week .wday.today { box-shadow: inset -3px 0 var(--action); }
.week-day-fold > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding-block: 8px;
  cursor: pointer;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  list-style: none;
}
.week-day-fold > summary::-webkit-details-marker { display: none; }
.week-day-fold > summary::after { content: "+"; flex: none; margin-inline-start: auto; }
.week-day-fold[open] > summary::after { content: "−"; }
.week-day-fold > summary .wcount { font-size: 17px; margin-inline-start: 0; }
.week-day-fold[open] .wrow { animation: week-label-in 220ms ease-out; }
.lesson-returned { animation: lesson-return 280ms ease-out both; }
@keyframes week-label-in { from { opacity: .55; } to { opacity: 1; } }
@keyframes lesson-return { from { box-shadow: inset 0 0 0 3px var(--action); } to { box-shadow: inset 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) {
  #v-week.on, .week-number, .week-day-fold[open] .wrow, .lesson-returned { animation: none; }
  .lesson-returned { outline: 2px solid var(--action); outline-offset: -2px; }
}
.today-voice .btn { width: 100%; }
.today-ui #pa:not(.is-open):not(.is-typing) { display: none; }
.today-ui:has(#pa:not(.is-open):not(.is-typing)).pa-on { --pa-h: 0px !important; }
#v-today #todayMore { margin-block-start: var(--s-5, 20px); }
.wday, #pntBox, #teacherSettings { scroll-margin-top: 85px; }

body.today-ui .appbar :is(.wordmark, [data-pn-net], #moreBtn),
body.today-ui #demoStrip { display: none; }
#todayVoice:not([hidden]) { min-width: 48px; min-height: 48px; }
#todayVoice svg { width: 22px; height: 22px; }
.today-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.today-timeline-row {
  padding: 0.65rem 0.75rem;
  border-block-end: 1px solid #dce3ed;
  color: var(--fg-1);
}
.today-timeline-row .ds-lesson-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
}
.today-timeline-row h3, .today-timeline-row p, .today-row-time, .today-tomorrow {
  margin: 0;
  font-size: max(17px, 1rem);
}
.today-row-time span, .today-row-time bdi { display: block; }
.today-timeline-row.today-past { color: var(--fg-2); }
.today-timeline-row.today-focus {
  margin-block: 0.5rem;
  border: 1px solid #ccd8f2;
  border-inline-start: 4px solid var(--action);
  border-radius: 12px;
  background: #f1f5ff;
}
.today-focus .ds-lesson-row h3 { font-size: 1.2rem; }
.today-tomorrow { padding-block: 0.75rem; color: var(--fg-2); }
.today-focus > a { width: 100%; margin-block: .5rem; }
.teacher-return { display: inline-flex; align-items: center; min-height: 48px; }
body.today-ui #todayMore .swipehint { display: none; }
:is(#todayLessonSupport, .today-row-support) ul { list-style: none; margin: 0; padding: 0; }
:is(#todayLessonSupport, .today-row-support) h3 { font-size: 1.2rem; margin-block: .5rem; }
:is(#todayLessonSupport, .today-row-support) .rowlink { display: grid; gap: 0; justify-content: start; padding-block: .3rem; }

body.today-ui #pnl-btn,
body.today-ui:not(.today-vault) #pnv-switch { display: none; }
body.today-ui.today-vault:has(#todayLessonSupport li:nth-child(3)) #textsize { display: none; }

/* ---------- «الرئيسية» (28 Nov 2026, FINAL-SPEC §3): goal card · strip · «الآن» · timeline · attendance ---------- */
body.today-ui #v-today .home-head { padding-block: 6px 0; }
body.today-ui #v-today .home-head h1 { font: 600 1.375rem/1.3 var(--font); margin: 0; }
body.today-ui #v-today .home-head .sum { margin: 2px 0 0; font-size: 1rem; color: var(--fg-2); }
.goal-card { margin-top: 10px; padding: 12px 14px 6px; border-radius: var(--r-2xl, 20px); background: var(--bg-panel); }
.goal-card .goal-line1 { margin: 0; font: 600 1.0625rem/1.45 var(--font); color: var(--fg-1); }
.goal-card .goal-line2 { margin: 2px 0 6px; font-size: 1rem; line-height: 1.45; color: var(--fg-2); }
.subject-rows { display: grid; }
.subject-row, .all-subjects {
  display: grid; grid-template-columns: minmax(6.5em, auto) minmax(40px, 1fr) auto 16px; align-items: center; gap: 10px;
  min-height: 48px; padding-block: 4px; color: var(--fg-1); text-decoration: none; border-top: 1px solid var(--hairline);
  transition: transform 120ms var(--ease-out, ease), background-color 120ms;
}
.subject-row:active, .all-subjects:active { transform: scale(.98); background: var(--bg-sunken, #F2F3F5); }
.subject-row .sr-name { font-weight: 600; }
.subject-row .sr-state { font-size: 1rem; color: var(--fg-2); white-space: nowrap; }
.subject-row[data-state="behind"] .sr-state { color: var(--action); font-weight: 600; }
.subject-row .sr-num { font-size: .9375rem; color: var(--fg-2); }
.subject-rows-all .subject-row { grid-template-columns: minmax(6.5em, auto) minmax(40px, 1fr) auto auto 16px; }
.subject-row svg, .all-subjects svg { width: 16px; height: 16px; color: var(--fg-3); }
.all-subjects { grid-template-columns: 1fr 16px; font-weight: 600; color: var(--action); }
.yr-bar { position: relative; display: block; height: 8px; border-radius: 999px; background: #E3E7EE; overflow: visible; }
.yr-bar-big { height: 14px; margin-block: 10px 14px; }
.yr-fill { position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--w); border-radius: inherit; background: var(--action); }
[data-state="ontime"] .yr-fill, [data-state="ahead"] .yr-fill { background: #5B6B8C; }
.yr-goal { position: absolute; inset-block: -4px; inset-inline-start: var(--x); width: 0; border-inline-start: 2px solid #1F2A44; }
.yr-term { position: absolute; inset-block: 1px; inset-inline-start: var(--x); width: 1px; background: #FFFFFF; }
@media (prefers-reduced-motion: no-preference) {
  #v-home[data-first] .yr-fill { width: 0; }
  #v-home .yr-fill { transition: width 420ms cubic-bezier(.32,.72,0,1); }
}
body.today-ui #v-today .week-strip { margin-top: 10px; }
body.today-ui #v-today .home-today-h { margin: 12px 0 6px; font: 600 1.125rem/1.3 var(--font); }
.now-card { padding: 12px 14px; border-radius: var(--r-2xl, 20px); background: #EEF2FB; }
.now-card .now-label { margin: 0; font-size: 1rem; color: #1F2A44; }
.now-card .now-title { margin: 2px 0 0; font: 600 1.125rem/1.4 var(--font); }
.now-card .now-need { margin: 4px 0 0; font-size: 1rem; color: var(--fg-2); }
.now-card .now-need:empty { display: none; }
.now-card .ui-btn--primary { display: flex; justify-content: center; width: 100%; min-height: 52px; margin-top: 10px; }
.today-timeline { list-style: none; margin: 12px 0 0; padding: 0; }
.lrow { padding-block: 8px; border-top: 1px solid var(--hairline); }
.lrow .wrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 48px; color: var(--fg-1); text-decoration: none; }
.lrow .ob { display: grid; }
.lrow .ob small { color: var(--fg-2); font-size: .9375rem; }
.lrow .today-row-time { display: grid; justify-items: end; font-size: .9375rem; color: var(--fg-2); }
.lrow-state[data-state="الآن"] { padding: 0 8px; border-radius: 999px; background: #EEF2FB; color: var(--action); font-weight: 600; }
.lrow.today-past .lrow-title { color: var(--fg-2); }
.lrow-absent { margin: 4px 0 0; font-weight: 600; color: #1F2A44; }
.lrow-acts { display: flex; gap: 8px; margin-top: 6px; }
.lrow-acts .btn { flex: 1; min-height: 48px; }
.home-att { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-top: 12px; padding: 10px 14px; border-radius: var(--r-xl, 16px); background: var(--bg-panel); min-height: 64px; }
.home-att .att-line { margin: 0; }
.home-att .att-fix { min-height: 48px; }
.home-att .att-conflict { grid-column: 1 / -1; margin: 0; }
body.today-ui #v-today .today-tomorrow { margin: 12px 0 0; color: var(--fg-2); }
.att-grid { list-style: none; margin: 12px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.att-tile { display: grid; justify-items: center; gap: 2px; width: 100%; min-height: 88px; padding: 8px 4px; border: 1px solid var(--hairline-strong, #C9CED8); border-radius: 14px; background: #FFFFFF; color: var(--fg-1); font: inherit; transition: transform 120ms, background-color 180ms; }
.att-tile:active { transform: scale(.97); }
.att-tile .att-av { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #E3E7EE; font-weight: 600; }
.att-tile .att-st { font-size: .9375rem; color: var(--fg-2); }
.att-tile[data-st="absent"] { background: #EEF2FB; border-color: var(--action); }
.att-tile[data-st="absent"] .att-st { color: var(--action); font-weight: 600; }
.att-tile[data-st="late"] { background: #F6F2E8; border-color: #8A6D1F; }
.att-tile[data-changed] { box-shadow: inset 0 0 0 2px var(--action); }
.att-paper { margin-top: 8px; }
.subj .subj-line { margin: 6px 0 0; color: var(--fg-2); }
.subj .unit-list { list-style: none; margin: 12px 0 0; padding: 0; }
.subj .unit-list > li { padding-block: 10px; border-top: 1px solid var(--hairline); }
.subj .unit-h { display: flex; justify-content: space-between; gap: 10px; }
.subj .unit-n { color: var(--fg-2); white-space: nowrap; }
.subj [data-unit-state="now"] .unit-n { color: var(--action); font-weight: 600; }
.subj [data-unit-state="later"] { color: var(--fg-2); }
.subj .unit-src { display: block; color: var(--fg-2); }
.subj .unit-list .ui-btn--primary { display: flex; justify-content: center; margin-top: 8px; min-height: 52px; }
.subj .subj-catch { margin-top: 8px; min-height: 48px; }
.linkish { border: 0; background: none; color: var(--action); text-decoration: underline; font: inherit; min-height: 48px; }
.subj h1.t { font: 600 1.5rem/1.3 var(--font); margin: 8px 0 0; }
.subj .unit-done-sum { margin: 12px 0 0; color: var(--fg-2); }

/* «تمّت ✓» on a past lesson (personas walk, 28 Nov 2026) */
.today-row-time .today-done { min-height: 44px; min-width: 88px; margin-top: 4px; padding: 0 12px; font-weight: 700; }

/* print picker: the checkbox itself is a 44 px target (28 Nov 2026) */
.print-lessons input[type="checkbox"] { width: 44px; height: 44px; margin: 0; flex: none; }

/* labelled week arrows (28 Nov 2026): «→ السابق» / «القادم ←» */
.week-sticky .wknav .btn { min-width: 88px; min-height: 48px; white-space: nowrap; padding: 0 10px; }

/* ---------- portal pass (28 Nov 2026): the teacher home at the headmaster's bar ----------
   ONE header (name + class, mic), «اليوم» + the date, chevron rows, lessons as rows in one grey card,
   the time small beside the title (it was a 21 px column that squeezed the title). Solid text colours. */
body.today-ui #v-today .home-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s-4, 12px); padding-block: 8px 2px; }
body.today-ui #v-today .home-head h1 { font: var(--w-medium) var(--t-title)/var(--lh-title) var(--font); }
body.today-ui #v-today .home-head .sum { margin: 0; font-size: var(--t-small); color: var(--fg-3); }
.goal-card { padding: 16px 20px 4px; }
.subject-row, .all-subjects { border-top-color: var(--bg-sunken, #E7E6E1); }
.subject-row svg.sr-go, .all-subjects svg { width: 20px; height: 20px; fill: none; stroke: var(--fg-3); }
body.today-ui #v-today .week-strip { border: 0; background: var(--bg-panel); border-radius: var(--r-2xl, 20px); }
body.today-ui #v-today .home-today-h { margin: 20px 0 8px; font: var(--w-medium) var(--t-subtitle)/var(--lh-subtitle) var(--font); }
.now-card { background: var(--bg-panel); padding: 16px 20px; }
.now-card .now-label { color: var(--fg-1); font-weight: var(--w-medium); }
/* lessons: rows in one card, on Home and in the Week */
body.today-ui .today-timeline { margin-top: 12px; padding: 0 16px; border-radius: var(--r-2xl, 20px); background: var(--bg-panel); }
body.today-ui .today-timeline > .lrow { padding-block: 8px; border-top: 1px solid var(--bg-sunken, #E7E6E1); }
body.today-ui .today-timeline > .lrow:first-child { border-top: 0; }
/* the two answers on a past lesson: quiet, side by side, under the title */
/* the support line of a lesson: the name on its own line, then what to do (was glued: «آدم ب.اقرئي…») */
:is(#todayLessonSupport, .today-row-support) .rowlink { display: block; }
/* the lesson row: the title takes the full width; time and state sit on one quiet line under it */

.subject-row { grid-template-columns: minmax(5.5em, auto) minmax(40px, 1fr) auto 20px; }
.subject-rows-all .subject-row { grid-template-columns: minmax(5.5em, auto) minmax(40px, 1fr) auto auto 20px; }
.all-subjects { grid-template-columns: 1fr 20px; }
