/* ==========================================================================
   TheWhiteRussian · Kompozisyon — portal tasarım sistemi (2026-10-07)

   - Zemin beyaz ve ferah; yüzeyler gölgesiz, yalnız ince çizgiyle ayrılır.
   - Mürekkep: Rus okulunun mavi tükenmez kalemi — portalın tek vurgu rengi
     (bağlantı, birincil eylem, odak halkası).
   - Öğretmen kalemi: kırmızı. YALNIZ düzeltme, hata ve kapanmış süre içindir.
   - Yazı: arayüz ve başlıklar sistem sans'ı; serif (PT Serif) yalnız KÂĞITTA —
     kompozisyon yaprağı, öğrenci metni, oyun kelimeleri (`[lang="ru"]`).
   - İmza: çizgili defter yaprağı, sağda kırmızı pay; öğretmen notu oraya yazılır.
   - Tek tema: gündüz. İşletim sisteminin koyu tercihi İZLENMEZ (kullanıcı kararı).
   ========================================================================== */

@font-face {
  font-family: "PT Serif";
  src: url("../fonts/pt-serif/PTSerif-Regular.8e1f0080a9ca.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PT Serif";
  src: url("../fonts/pt-serif/PTSerif-Bold.5b95e9f83f44.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PT Serif";
  src: url("../fonts/pt-serif/PTSerif-Italic.37acc2eca7ef.woff") format("woff");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ── Jetonlar (yalnız gündüz: OS'un koyu tercihi izlenmez — kullanıcı kararı) ── */
:root {
  color-scheme: light;

  --paper: #ffffff;
  --sheet: #ffffff;
  --sunk: #f4f6f9;
  --ink: #141b2b;
  --ink-body: #3b4456;
  --ink-mute: #687184;
  --ink-faint: #b7bdc8;          /* yalnız çizgi ve süs; metin değil */
  --rule: #e8ebf0;
  --rule-strong: #d6dbe3;

  --accent: #2b59e3;             /* tükenmez kalem mavisi: bağlantı, vurgu */
  --accent-fill: #2b59e3;        /* birincil düğme dolgusu */
  --accent-fill-hover: #1f48c6;
  --accent-wash: #eef3fe;
  --accent-ring: rgba(43, 89, 227, .2);

  --red: #d2433a;                /* öğretmen kalemi */
  --red-wash: #fdeeec;
  --green: #18845a;
  --green-wash: #e7f6ef;
  --amber: #9a5d00;
  --amber-wash: #fff3df;

  --line-blue: #d8e3f5;          /* defter çizgisi */
  --margin-red: #f1aaa3;         /* defter payı */

  --shadow-sheet: 0 1px 2px rgba(20, 27, 43, .04);
  --shadow-raise: 0 1px 2px rgba(20, 27, 43, .04), 0 16px 40px -24px rgba(20, 27, 43, .22);
  --shadow-pop: 0 2px 6px rgba(20, 27, 43, .06), 0 24px 56px -24px rgba(20, 27, 43, .3);

  --serif: "PT Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;

  --r-sm: 8px;
  --r-md: 8px;
  --r-lg: 8px;

  --page: 1600px;
  --gutter: 40px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ── Taban ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--paper);
  color: var(--ink-body);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

:where(a) {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .24em;
  text-decoration-color: color-mix(in srgb, currentColor 32%, transparent);
  transition: color .15s var(--ease), text-decoration-color .15s var(--ease);
}
:where(a):hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* `hidden` her zaman gizler: `display` veren bileşen kuralları (ör. `.q-card { display: grid }`)
   tarayıcının varsayılanını ezip «gizli» öğeyi ekranda bırakıyordu (soru silme düğmesi çalışmıyordu). */
[hidden] { display: none !important; }

:where(button, input, textarea, select) { font: inherit; color: inherit; }
:where(button) { cursor: pointer; }

:where(h1, h2, h3) {
  color: var(--ink);
  text-wrap: balance;
  overflow-wrap: anywhere;
}

h1 {
  margin: 0 0 .5rem;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 .75rem;
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 .25rem;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.4;
}

p { margin: 0 0 .75rem; }

:where(main, .narrow, .form-field, .row > *, .page-head > *, .review-layout > *) { min-width: 0; }

[lang="ru"] { font-family: var(--serif); }
.ru-title { font-family: var(--sans); font-weight: 700; letter-spacing: 0; }

.icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -.2em;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--paper);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .15s var(--ease);
}
.skip-link:focus { transform: none; }

/* ── Tipografik yardımcılar ────────────────────────────────────────────── */
.eyebrow {
  margin: 0 0 .7rem;
  color: var(--ink-mute);
  font: 600 .72rem/1.2 var(--sans);
  letter-spacing: 0;
  text-transform: uppercase;
}

.lead {
  max-width: 58ch;
  color: var(--ink-mute);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.muted { color: var(--ink-mute); }

/* ── Kabuk: üst çubuk, içerik, künye ───────────────────────────────────── */
.topbar {
  position: relative;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.topbar-inner { min-height: 76px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-product {
  padding-left: 10px;
  border-left: 1px solid var(--rule);
  color: var(--ink-mute);
  font-size: .9rem;
  white-space: nowrap;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topnav form { margin: 0; }

.topnav a,
.topnav button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-mute);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.topnav a:hover,
.topnav button:hover { background: var(--sunk); color: var(--ink); }
.topnav a[aria-current="page"] { color: var(--ink); background: var(--sunk); }
.topnav .nav-login { border-color: var(--rule-strong); color: var(--ink-body); }
.topnav .icon { width: 16px; height: 16px; }

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 40px var(--gutter) 64px;
}
main:focus { outline: none; }

.narrow { max-width: 600px; }

.messages { display: grid; gap: 10px; margin-bottom: 24px; }
.messages .notice { margin: 0; }

/* ── Düğmeler ──────────────────────────────────────────────────────────── */
.button {
  --btn-bg: var(--accent-fill);
  --btn-fg: var(--sheet);
  --btn-border: transparent;
  --btn-shadow: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  max-width: 100%;
  padding: 11px 18px;
  border: 1px solid var(--btn-border);
  border-radius: var(--r-md);
  background: var(--btn-bg);
  color: var(--btn-fg);
  box-shadow: var(--btn-shadow);
  font: 600 .9375rem/1.2 var(--sans);
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s var(--ease), border-color .15s var(--ease),
              color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease);
}
.button .icon { width: 18px; height: 18px; vertical-align: 0; }
.button:not(:disabled):hover { --btn-bg: var(--accent-fill-hover); }
.button:not(:disabled):active { transform: translateY(1px); }
.button:focus-visible { outline-offset: 3px; }

.button.quiet {
  --btn-bg: var(--sheet);
  --btn-fg: var(--ink);
  --btn-border: var(--rule-strong);
  --btn-shadow: none;
}
.button.quiet:not(:disabled):hover { --btn-bg: var(--sunk); --btn-border: var(--ink-faint); }

.button.ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink-mute);
  --btn-shadow: none;
}
.button.ghost:not(:disabled):hover { --btn-bg: var(--sunk); --btn-fg: var(--ink); }

.button.danger {
  --btn-bg: var(--sheet);
  --btn-fg: var(--red);
  --btn-border: var(--rule-strong);
  --btn-shadow: none;
}
.button.danger:not(:disabled):hover {
  --btn-bg: var(--red-wash);
  --btn-border: color-mix(in srgb, var(--red) 45%, transparent);
}

.button.small {
  min-height: 44px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: .875rem;
}
.button.small .icon { width: 16px; height: 16px; }

.button.block { width: 100%; }

.button:disabled,
.button[aria-disabled="true"] {
  --btn-bg: var(--sunk);
  --btn-fg: var(--ink-mute);
  --btn-border: var(--rule);
  --btn-shadow: none;
  cursor: not-allowed;
}

/* Satır içi bağlantı eylemi: «Sınıf notları ›» */
.link-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--accent);
  font-size: .9375rem;
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.link-action .icon { width: 16px; height: 16px; transition: transform .15s var(--ease); }
.link-action:hover { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.link-action:hover .icon { transform: translateX(2px); }

.back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  min-height: 44px;
  margin: 0 0 20px;
  color: var(--ink-mute);
  font-size: .875rem;
  font-weight: 550;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.back .icon { width: 16px; height: 16px; margin-left: -4px; transition: transform .15s var(--ease); }
.back:hover { color: var(--ink); }
.back:hover .icon { transform: translateX(-2px); }

/* ── Form ──────────────────────────────────────────────────────────────── */
:where(label) {
  display: block;
  margin: 0 0 6px;
  color: var(--ink);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.4;
}

:where(input:not([type="checkbox"], [type="radio"], [type="hidden"], [data-grid-cell]), textarea, select) {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-md);
  background: var(--sheet);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease);
}

:where(input, textarea)::placeholder { color: var(--ink-mute); opacity: .8; }

:where(input:not([type="checkbox"], [type="radio"], [data-grid-cell]), textarea, select):hover:not(:disabled, :focus) {
  border-color: var(--ink-faint);
}

:where(input:not([type="checkbox"], [type="radio"], [data-grid-cell]), textarea, select):focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

:where(input, textarea, select):disabled {
  background: var(--sunk);
  color: var(--ink-mute);
  cursor: not-allowed;
}

:where(input[readonly]) { background: var(--sunk); }

:where(textarea) { resize: vertical; line-height: 1.7; }

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-fill);
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-stack > input[type="hidden"] { display: none; }

.form-field > :last-child { margin-bottom: 0; }
.form-field:has(.errorlist) :where(input, textarea, select) {
  border-color: color-mix(in srgb, var(--red) 70%, var(--rule-strong));
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.form-actions .button { white-space: normal; }

.form-card {
  padding: 24px 0 0;
  border-top: 1px solid var(--rule);
}

.helptext {
  margin: 6px 0 0;
  color: var(--ink-mute);
  font-size: .8125rem;
  overflow-wrap: anywhere;
}

.errorlist {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  color: var(--red);
  font-size: .84rem;
  font-weight: 550;
}
.errorlist.nonfield {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--red) 28%, transparent);
  border-radius: var(--r-md);
  background: var(--red-wash);
}

/* Seviye seçimi: tam satır, en az 52 px, kendi oku (Safari'nin yerel görünümü yerine). */
.level-select { position: relative; width: 100%; }
.level-select select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 52px;
  padding-right: 44px;
  cursor: pointer;
}
.level-select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 8px;
  height: 8px;
  border-right: 1.75px solid var(--ink-mute);
  border-bottom: 1.75px solid var(--ink-mute);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

/* ── Bildirim ──────────────────────────────────────────────────────────── */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 20px;
  padding: 12px 16px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--sunk);
  color: var(--ink-body);
  font-size: .9375rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.notice::before {
  content: "";
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  margin-top: .45em;
  border-radius: 50%;
  background: var(--accent);
}
.notice.success::before { background: var(--green); }
.notice.error::before,
.notice.is-closed::before { background: var(--red); }
.notice.warning::before { background: var(--amber); }
.assignment-errors ul { margin: 8px 0 0; padding-left: 20px; }
.assignment-errors li + li { margin-top: 6px; }
.assignment-errors a { color: var(--ink-body); }
.assignment-errors:focus { outline: 2px solid var(--red); outline-offset: 3px; }
:where(.form-field, .q-card)[id] { scroll-margin-top: 100px; }

/* ── Etiketler ─────────────────────────────────────────────────────────── */
.badge,
.status,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font: 600 .75rem/1 var(--sans);
  letter-spacing: 0;
  white-space: nowrap;
  vertical-align: middle;
}
.badge { background: var(--accent-wash); color: var(--accent); }
.status,
.chip { background: var(--sunk); color: var(--ink-mute); }
.status::before,
.chip.dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.chip.ok { background: var(--green-wash); color: var(--green); }
.chip.warn { background: var(--amber-wash); color: var(--amber); }
.chip.off,
.status.is-closed { background: var(--red-wash); color: var(--red); }

/* ── Sayfa başı ────────────────────────────────────────────────────────── */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: 32px;
}
.page-head h1 { margin: 0; }
.page-head .lead { margin: 12px 0 0; }
.page-head .eyebrow { margin-bottom: .6rem; }
.page-head .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 10px 0 0;
  color: var(--ink-mute);
  font-size: .9375rem;
}
.page-head .meta > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.page-head .meta .icon { width: 16px; height: 16px; }
.page-head .meta--single { gap: 6px; }

/* Öğrencinin kendi kimliği: ad + çıkış */
.whoami {
  display: flex;
  align-items: center;
  gap: 4px 8px;
  flex-wrap: wrap;
  margin: 0;
  padding: 4px 6px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--sheet);
}
.whoami-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-right: 4px;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-wash);
  color: var(--accent);
  font: 700 .8rem/1 var(--sans);
  text-transform: uppercase;
}
.whoami .button { border-radius: var(--r-sm); }

/* Yönetim sayfası: iki yönetim kontrolü başlığın ALTINDA, alt alta (kullanıcı kararı). */
.page-head--stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

/* ── Bölümler, listeler, satırlar ──────────────────────────────────────── */
.section { margin-top: 40px; }
.section:first-child,
.page-head + .section { margin-top: 0; }
.section > h2,
.section-title {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 650;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-head h2 { margin: 0; }

.list,
.assignment-list,
.student-roster {
  border-block: 1px solid var(--rule-strong);
  background: var(--sheet);
}

.row,
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.list > .row,
.assignment-list > .row,
.student-roster > .roster-row {
  position: relative;
  padding: 20px 16px;
  border-bottom: 1px solid var(--rule);
}
.list > .row:last-child,
.assignment-list > .row:last-child,
.student-roster > .roster-row:last-child { border-bottom: 0; }

.row-main { min-width: 0; }
.row-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
}
.row-title {
  margin: 0;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.row-title.ru-title { font-size: 1.1875rem; font-weight: 650; }
.row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin: 6px 0 0;
  color: var(--ink-mute);
  font-size: .875rem;
}
.row-meta .icon { width: 15px; height: 15px; margin-right: 2px; }

/* Bütün satırı tıklanır yapan bağlantı (tek eylemli satırlarda) */
.row--link .row-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.row--link { transition: background-color .15s var(--ease); }
.row--link:hover { background: color-mix(in srgb, var(--sunk) 60%, transparent); }
.list > .row--link:first-child { border-top-left-radius: var(--r-lg); border-top-right-radius: var(--r-lg); }
.list > .row--link:last-child { border-bottom-left-radius: var(--r-lg); border-bottom-right-radius: var(--r-lg); }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.empty {
  margin: 0;
  padding: 28px 20px;
  color: var(--ink-mute);
  text-align: center;
}

/* ── Tablo ─────────────────────────────────────────────────────────────── */
.table-scroll {
  position: relative;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  background: var(--sheet);
  overscroll-behavior-x: contain;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
  font-variant-numeric: tabular-nums;
}

thead th {
  padding: 12px 18px;
  border-bottom: 1px solid var(--rule);
  background: var(--sunk);
  color: var(--ink-mute);
  font-size: .8125rem;
  font-weight: 550;
  text-align: left;
  white-space: nowrap;
}

tbody th,
tbody td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
tbody tr:last-child > * { border-bottom: 0; }
tbody th { color: var(--ink); font-weight: 600; }
tbody tr.is-viewer > * { background: color-mix(in srgb, var(--accent-wash) 70%, transparent); }

.num { text-align: right; }
thead th.num { text-align: right; }

/* ── Giriş (ana sayfa) ─────────────────────────────────────────────────── */
.join {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 64px;
  padding: 24px 0 40px;
  border-bottom: 1px solid var(--rule);
}
.join-panel { max-width: none; }
.join-panel h1 {
  margin-bottom: 24px;
  font-size: 2rem;
  letter-spacing: 0;
}
.join-panel .form-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}
.join-panel .form-stack > .errorlist { grid-column: 1 / -1; }
.join-panel #class-code {
  min-height: 48px;
  font-family: var(--mono);
  font-size: .95rem;
  letter-spacing: 0;
}
.join-panel #class-code::placeholder { font-family: var(--sans); letter-spacing: 0; }
.join-panel .button { min-height: 48px; }

/* Tanıtım yaprağı: öğrencinin yazdığı, öğretmenin kırmızıyla düzelttiği sayfa. */
.join-sheet {
  margin: 0;
  width: 100%;
}
.join-sheet .sheet-ruled {
  padding-bottom: 2.2rem;
  box-shadow: none;
}
.sheet-title {
  display: block;
  margin-bottom: 0;
  color: var(--ink);
  font-weight: 700;
  text-align: center;
}
.sheet-line { display: block; }
.sheet-fix {
  position: relative;
  display: inline-block;
}
.sheet-fix::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  top: 54%;
  height: 1.6px;
  border-radius: 2px;
  background: var(--red);
  transform-origin: left center;
  animation: pen-strike .35s var(--ease) .2s both;
}
.sheet-fix-note {
  position: absolute;
  left: 18%;
  bottom: 62%;
  color: var(--red);
  font-style: italic;
  font-size: .9em;
  line-height: 1;
  white-space: nowrap;
  transform: rotate(-3deg);
  animation: pen-note .3s var(--ease) .35s both;
}
.sheet-tick {
  position: absolute;
  right: .9rem;
  bottom: 1.1rem;
  width: 30px;
  height: 22px;
  color: var(--red);
}
.sheet-tick path {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: pen-tick .35s var(--ease) .55s forwards;
}

@keyframes pen-strike { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pen-note { from { opacity: 0; transform: translateY(4px) rotate(-3deg); } to { opacity: 1; transform: rotate(-3deg); } }
@keyframes pen-tick { to { stroke-dashoffset: 0; } }

/* ── İmza: çizgili kompozisyon yaprağı ─────────────────────────────────── */
.sheet-ruled,
#composition-body,
.essay {
  --lh: 2rem;           /* satır yüksekliği = çizgi aralığı */
  --pad-top: 1.15rem;
  --margin: 2.75rem;    /* sağ pay */

  position: relative;
  padding: var(--pad-top) calc(var(--margin) + 1rem) 1.5rem 1.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  background-color: var(--sheet);
  background-image:
    linear-gradient(to right,
      transparent calc(100% - var(--margin)),
      var(--margin-red) calc(100% - var(--margin)),
      var(--margin-red) calc(100% - var(--margin) + 1px),
      transparent calc(100% - var(--margin) + 1px)),
    repeating-linear-gradient(to bottom,
      transparent 0,
      transparent calc(var(--lh) - 1px),
      var(--line-blue) calc(var(--lh) - 1px),
      var(--line-blue) var(--lh));
  background-repeat: no-repeat, repeat;
  /* Çizgi taban çizgisinin hemen ALTINDA: PT Serif'te (hhea 1018/−276) 18 px
     yazı 32 px satırda taban çizgisini satır kutusunun 22,7 px'ine koyar;
     karo çizgiyi kendi son pikselinde (31) çizdiği için 7 px yukarı kaydırılır
     ve çizgi 24 px'e düşer — harfler çizginin üstüne oturur, kuyruklar keser. */
  background-position: 0 0, 0 calc(var(--pad-top) - 7px);
  background-size: 100% 100%, 100% var(--lh);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: var(--lh);
  overflow-wrap: anywhere;
}

#composition-body {
  min-height: calc(var(--lh) * 14 + var(--pad-top) + 1.5rem);
  background-attachment: local, local;
  box-shadow: var(--shadow-sheet);
  resize: vertical;
}
#composition-body:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.essay { white-space: pre-wrap; }

/* ── Ödev (öğrenci yazma ekranı) ───────────────────────────────────────── */
.deadline-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--sheet);
  color: var(--ink-mute);
  font-size: .875rem;
}
.deadline-meta .icon { width: 17px; height: 17px; }
.deadline-meta strong {
  color: var(--ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.brief {
  margin: 0 0 20px;
  padding: 18px 20px;
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  background: var(--sheet);
}
.brief .eyebrow { margin-bottom: .5rem; }
.brief-body,
.instructions {
  color: var(--ink-body);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.composition-form { margin-top: 28px; }
.composition-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 10px;
}
.composition-head label { margin: 0; font-size: 1rem; }
.author {
  color: var(--ink-mute);
  font-size: .875rem;
}
.author strong { color: var(--ink); font-weight: 600; }

.editor-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  margin-top: 10px;
  color: var(--ink-mute);
  font-size: .8125rem;
}
.editor-meta output {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.editor-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-left: auto;
  justify-content: flex-end;
}
#word-count { color: var(--ink); font-weight: 600; }
.editor-actions { margin-top: 24px; }

/* ── Teslim makbuzu ────────────────────────────────────────────────────── */
.receipt {
  max-width: 560px;
  margin: clamp(8px, 4vw, 40px) auto 0;
  padding: clamp(28px, 5vw, 44px);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  background: var(--sheet);
  box-shadow: var(--shadow-raise);
  text-align: center;
}
.receipt-seal {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--green-wash);
  color: var(--green);
}
.receipt-seal .icon { width: 26px; height: 26px; stroke-width: 2.2; }
.receipt h1 { font-size: 1.75rem; }
.receipt-time {
  display: inline-block;
  margin: 4px 0 16px;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  background: var(--sunk);
  color: var(--ink-mute);
  font-family: var(--mono);
  font-size: .8125rem;
}
.receipt .actions { justify-content: center; margin-top: 24px; }
.receipt--plain { box-shadow: var(--shadow-sheet); }
.receipt-seal--lock { background: var(--accent-wash); color: var(--accent); }
.receipt-seal--lock .icon { stroke-width: 1.9; }

/* ── Sonuçlar ──────────────────────────────────────────────────────────── */
.student-results { table-layout: fixed; min-width: 520px; }
.student-results thead th:nth-child(-n+2) { width: 28%; }
.student-results th,
.student-results td { overflow-wrap: anywhere; }

.grade {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
}
.grade strong { color: var(--ink); font-size: 1rem; font-weight: 650; }
.grade-bar {
  width: 72px;
  height: 4px;
  border-radius: 4px;
  background: var(--sunk);
  overflow: hidden;
}
.grade-bar span {
  display: block;
  height: 100%;
  width: calc(var(--grade, 0) * 1%);
  border-radius: inherit;
  background: var(--accent);
}

.teacher-note summary {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  min-width: 132px;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--sheet);
  color: var(--ink-body);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.teacher-note summary:hover { background: var(--sunk); border-color: var(--rule-strong); }
.teacher-note[open] summary { background: var(--accent-wash); border-color: var(--accent-ring); color: var(--accent); }
.teacher-note summary::-webkit-details-marker { display: none; }
.teacher-note summary::after {
  content: "";
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-right: 1.75px solid currentColor;
  border-bottom: 1.75px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .15s var(--ease);
}
.teacher-note[open] summary::after { transform: translateY(2px) rotate(225deg); }
.note-close-label,
.teacher-note[open] .note-open-label { display: none; }
.teacher-note[open] .note-close-label { display: inline; }

.teacher-note-content {
  max-height: 260px;
  margin-top: 10px;
  padding: 16px;
  overflow: auto;
  border-left: 2px solid var(--rule-strong);
  background: var(--sunk);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--ink-body);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
}
.teacher-note summary:focus-visible,
.teacher-note-content:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.empty-note,
.private-note { color: var(--ink-mute); }
.private-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .875rem;
}

.result-session { margin: 0; }

/* ── Öğretmen: sınıf yönetimi ──────────────────────────────────────────── */
.room-management-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 8px;
  width: 320px;
  max-width: 100%;
}
.room-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.room-workspace > .section { margin-top: 0; }
.assignment-create > summary { display: inline-flex; list-style: none; cursor: pointer; }
.assignment-create > summary::-webkit-details-marker { display: none; }
.assignment-create[open] > summary { background: var(--ink); }
.assignment-create[open] > summary .icon { transform: rotate(45deg); }
.assignment-create > .narrow { margin-top: 24px; }
.assignment-create .create-head { margin-bottom: 20px; }
.roster-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; }
.roster-game-standing { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: .8125rem; }
.roster-game-standing .icon { width: 16px; height: 16px; }
.period-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 24px; }
.period-toolbar .segmented { display: flex; margin: 0; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--rule); border-radius: 8px; background: var(--sunk); }
.period-toolbar .segment { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 4px; color: var(--ink-mute); text-decoration: none; font-size: .875rem; font-weight: 600; }
.period-toolbar .segment.is-active { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sheet); }
.period-caption { margin: 0; color: var(--ink-mute); font-size: .875rem; }
.room-management-actions .button {
  justify-content: flex-start;
  min-height: 48px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.roster-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}
.roster-who {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.roster-row h2 {
  margin: 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.roster-row p { margin: 4px 0 0; }
.roster-row form { margin: 0; }
.roster-row .button { white-space: normal; }
/* Öğrencinin giriş kodu: satırın altında, istenince açılır (sınıfa yansıtılan ekranda kapalı kalır). */
.roster-code { flex: 1 0 100%; min-width: 0; }
.roster-code summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--sheet);
  color: var(--ink-body);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.roster-code summary::-webkit-details-marker { display: none; }
.roster-code summary:hover { background: var(--accent-wash); color: var(--accent); }
.roster-code[open] summary { background: var(--accent-wash); color: var(--accent); }
.roster-code summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-right: 1.75px solid currentColor;
  border-bottom: 1.75px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .15s var(--ease);
}
.roster-code[open] summary::after { transform: translateY(2px) rotate(225deg); }
.roster-code summary .icon { width: 16px; height: 16px; }
.roster-code[open] .note-open-label { display: none; }
.roster-code[open] .note-close-label { display: inline; }
.roster-code-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 12px 16px;
  margin-top: 12px;
}
.roster-code-body label { font-size: .8125rem; }
.roster-code-body input { min-height: 48px; padding-block: 8px; font-family: var(--mono); font-size: .875rem; }
.roster-code-missing { margin: 10px 0 0; color: var(--ink-mute); font-size: .875rem; }

.form-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-page {
  max-width: 520px;
  margin: 0;
}
.form-page h1 { margin-bottom: 24px; }

.meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--ink-mute);
  font-size: .875rem;
}
.meta-line .icon { width: 16px; height: 16px; }

/* Kod kartı: öğretmenin bir kez gördüğü giriş bilgisi */
.credential {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}
.credential-field label { margin-bottom: 8px; }
.copy-row {
  display: flex;
  gap: 8px;
}
.copy-row input {
  flex: 1 1 auto;
  font-family: var(--mono);
  font-size: .875rem;
  letter-spacing: 0;
}
.copy-row .button { flex: 0 0 auto; }
.code-list { font-family: var(--mono); font-size: .8125rem; }

/* ── Öğretmen: inceleme ────────────────────────────────────────────────── */
.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
  align-items: start;
  gap: 40px;
}
.review-layout > section > h2 { margin-bottom: 12px; }

.panel {
  padding: 20px 0;
  border-top: 1px solid var(--rule-strong);
}
.panel + .panel { margin-top: 16px; }
.panel h3 { margin-bottom: 12px; }

.scores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}
.scores > p {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  color: var(--ink-mute);
  font-size: .8125rem;
  font-weight: 550;
}
.scores strong {
  color: var(--ink);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.fine-print {
  color: var(--ink-mute);
  font-size: .8125rem;
  line-height: 1.55;
}

.rubric-breakdown {
  display: grid;
  gap: 2px;
  margin: 16px 0;
}
.rubric-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 2px 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.rubric-row::after {
  content: "";
  grid-column: 1 / -1;
  height: 4px;
  margin-top: 6px;
  border-radius: 4px;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 0 / var(--pct, 0%) 100% no-repeat,
    var(--sunk);
}
.rubric-row:last-child { border-bottom: 0; }
.rubric-breakdown dt,
.rubric-breakdown dd { margin: 0; }
.rubric-breakdown dt { color: var(--ink-body); font-size: .9rem; overflow-wrap: anywhere; }
.rubric-breakdown dd {
  color: var(--ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.feedback {
  margin: 0 0 4px;
  color: var(--ink-body);
  line-height: 1.65;
}

/* Inline corrections keep the existing red-pencil marks; only explanations float. */
.results-page { width: 100%; }
.results-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 600px);
  align-items: start;
  gap: 40px;
}
.results-workspace > .section { margin-top: 0; }
.paper-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: 14px;
}
.paper-head h2 { margin: 0; }
.paper-score {
  margin: 0;
  color: var(--ink-mute);
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}
.paper-score strong {
  margin-left: 6px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: 0;
}
.paper-score span { color: var(--ink-mute); font-family: var(--serif); }
.paper-hint { margin: 12px 0 0; color: var(--ink-mute); font-size: .8125rem; line-height: 1.5; }
.paper-hint--inline { margin: 0; }

.paper { position: relative; max-width: 60rem; }
.paper .essay { box-shadow: var(--shadow-sheet); }

.fix {
  border-radius: 3px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .15s var(--ease);
}
.fix del {
  color: var(--ink-mute);
  text-decoration: line-through;
  text-decoration-color: var(--red);
  text-decoration-thickness: 1.6px;
}
.fix ins {
  margin-left: .3em;
  color: var(--red);
  font-style: italic;
  text-decoration: none;
}
.fix-ref {
  position: relative;
  top: -.62em;
  margin-left: .08em;
  padding: 0 .1em;
  color: var(--red);
  font-family: var(--sans);
  font-size: .6875rem;
  font-style: normal;
  font-weight: 700;
  line-height: 0;
}
.fix:hover, .fix.is-active { background: var(--red-wash); }
.fix:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.correction-popover {
  position: fixed;
  z-index: 1300;
  max-width: calc(100vw - 24px);
  margin: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--sheet);
  box-shadow: var(--shadow-pop);
  color: var(--ink-body);
  font-family: var(--sans);
  letter-spacing: 0;
}
.correction-popover-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 8px 4px 16px;
  border-bottom: 1px solid var(--rule);
  background: var(--sheet);
}
.correction-popover-head h3 { margin: 0; font-size: .875rem; letter-spacing: 0; }
.correction-popover-close { width: 44px; min-width: 44px; padding: 0; }
.correction-popover-body { padding: 12px 16px 16px; overflow-wrap: anywhere; }
.correction-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0;
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.5;
}
.correction-pair del { color: var(--red); text-decoration-thickness: 1.5px; }
.correction-pair ins { color: var(--ink); text-decoration: none; font-style: italic; }
.correction-arrow { color: var(--ink-faint); font-family: var(--sans); }
.correction-delete { color: var(--ink-mute); font-family: var(--sans); font-size: .875rem; }
.correction-reason { margin: 10px 0 0; color: var(--ink-body); font-size: .875rem; line-height: 1.6; }
.correction-fallback { margin-top: 16px; }
.correction-fallback summary { cursor: pointer; }

/* Öğretmen görünümü: her öğrencinin yaprağı kapalı bir satırda (sayfa sınıf kadar uzamasın). */
.essay-entries {
  border-block: 1px solid var(--rule-strong);
  background: var(--sheet);
  overflow: hidden;
}
.essay-entry + .essay-entry { border-top: 1px solid var(--rule); }
.essay-entry summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 16px;
  color: var(--ink);
  font-weight: 600;
  transition: background-color .15s var(--ease);
  cursor: pointer;
  list-style: none;
}
.essay-entry summary::-webkit-details-marker { display: none; }
.essay-entry summary:hover { background: var(--sunk); }
.essay-entry[open] > summary { background: var(--sunk); }
.essay-entry summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.essay-entry-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.essay-entry-meta {
  color: var(--ink-mute);
  font-size: .8125rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow-wrap: anywhere;
}
.essay-entry summary > .icon { width: 20px; height: 20px; }
.essay-entry-chevron { color: var(--ink-mute); transition: transform .2s var(--ease); }
.essay-entry[open] .essay-entry-chevron { transform: rotate(90deg); }
.essay-entry-body { padding: 20px 16px 24px; }
.essay-entry-body .paper .essay { box-shadow: none; }
@media (max-width: 640px) {
  .essay-entry summary { padding: 10px 14px; }
  .essay-entry-body { padding: 2px 8px 14px; }
}

.review-form { display: grid; gap: 16px; margin-top: 4px; }
.review-layout .notice { margin-bottom: 16px; }

/* Teslim tablosu (öğretmen). «İncele» tek parça kalır: harf harf kırılabilseydi tablo o sütunu bir harf
   genişliğine indirip kelimeyi dikine diziyordu (2026-10-08, telefonda görüldü). */
.submissions td,
.submissions th { vertical-align: middle; }
.submissions .link-action { min-height: 0; white-space: nowrap; overflow-wrap: normal; }
.submissions .cell-plays .icon { display: none; }

/* Dar ekranda her teslim iki satırlık liste öğesidir: ad (+ dinleme) + not, durum + «İncele».
   Satırın tamamı dokunulabilir; başlık satırı yalnız ekran okuyucuya kalır. Eşik 760px: daha darda uzun
   durum etiketi («Değerlendirme tekrar bekliyor») ile beş sütun tabloyu yana taşırıyordu. */
@media (max-width: 760px) {
  .submissions,
  .submissions tbody { display: block; }
  .submissions thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .submissions tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "name plays score" "status status action";
    align-items: center;
    gap: 2px 12px;
    padding: 12px 16px 4px;
    border-bottom: 1px solid var(--rule);
  }
  .submissions tbody tr:last-child { border-bottom: 0; }
  .submissions tbody :is(th, td) { display: block; padding: 0; border: 0; text-align: left; }
  .submissions tbody th { grid-area: name; overflow-wrap: anywhere; }
  .submissions .cell-status { grid-area: status; min-width: 0; }
  .submissions .cell-status .chip { height: auto; min-height: 24px; padding-block: 4px; line-height: 1.25; white-space: normal; }
  .submissions .cell-plays {
    grid-area: plays;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--ink-mute);
    font-size: .8125rem;
  }
  .submissions .cell-plays .icon { display: inline-block; width: 15px; height: 15px; }
  .submissions .cell-score { grid-area: score; text-align: right; }
  .submissions .cell-action { grid-area: action; }
  .submissions .link-action { min-height: 44px; }
  .submissions .link-action::after { content: ""; position: absolute; inset: 0; }
  .submissions td.empty { grid-column: 1 / -1; padding: 16px 0 20px; text-align: center; }
}

.publish-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}
.publish-panel > div { flex: 1 1 340px; min-width: 0; }
.publish-panel h2 { margin-bottom: 6px; }
.publish-panel p { margin: 0; color: var(--ink-mute); font-size: .9375rem; max-width: 62ch; }
.publish-panel form { margin: 0; }

/* Sınıf sayfasında oyun girişi: «п _ с _» yuvaları — oyunun kendisinden bir kesit. */
.games-entry-main {
  display: flex;
  align-items: center;
  gap: 16px;
}
.games-glyph {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 4px;
  height: 44px;
  padding: 0 10px 9px;
  border-radius: var(--r-md);
  background: var(--sunk);
}
.games-glyph span {
  display: grid;
  place-items: end center;
  width: 14px;
  height: 22px;
  border-bottom: 1.5px solid var(--ink-faint);
  color: var(--ink);
  font: 700 1.05rem/1 var(--serif);
}

/* ── Son teslim: tarih + saat seçici (flatpickr + çark) ────────────────── */
.deadline-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.deadline-field legend {
  margin-bottom: 10px;
  padding: 0;
  color: var(--ink);
  font-size: .875rem;
  font-weight: 600;
}
.deadline-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.deadline-part { min-width: 0; }
.deadline-part:first-child { grid-column: 1 / -1; }
.deadline-part label { color: var(--ink-mute); font-size: .8125rem; font-weight: 550; }
.deadline-part select[hidden] { display: none; }
/* flatpickr'ın tarih kutusu salt-okunurdur ama seçilen tarihin kendisidir:
   devre dışı gibi gri görünmemeli. */
.deadline-part input[readonly] { background: var(--sheet); }
.deadline-part input:not([type="hidden"]) {
  min-height: 52px;
  font-size: 1.0625rem;
  font-variant-numeric: tabular-nums;
}

.time-wheel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-md);
  background: var(--sheet);
  -webkit-user-select: none;
  user-select: none;
}
.time-wheel:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.time-wheel-scroll {
  position: relative;
  z-index: 1;
  height: 220px;
  padding: 88px 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  touch-action: pan-y;
  mask-image: linear-gradient(transparent, black 26%, black 74%, transparent);
  cursor: grab;
}
.time-wheel-scroll::-webkit-scrollbar { display: none; }
/* Fareyle sürüklenirken ve bırakılınca süzülürken satıra yakalama kapalı (classroom-deadline.js). */
.time-wheel-scroll.is-free { scroll-snap-type: none; }
.time-wheel.is-dragging .time-wheel-scroll { cursor: grabbing; }
.time-wheel-row {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  min-height: 44px;
  color: var(--ink-mute);
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  scroll-snap-align: center;
}
.time-wheel-row.is-selected { color: var(--ink); font-weight: 700; }
/* Seçim bandı kaydırıcının ARKASINDA: metnin kontrastını düşürmez. */
.time-wheel-band {
  position: absolute;
  z-index: 0;
  top: 88px;
  left: 10px;
  right: 10px;
  height: 44px;
  border-radius: 8px;
  background: var(--accent-wash);
  pointer-events: none;
}

.deadline-calendar.flatpickr-calendar {
  width: 100%;
  max-width: 420px;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-md);
  background: var(--sheet);
  box-shadow: none;
  color: var(--ink);
}
.deadline-calendar .flatpickr-rContainer,
.deadline-calendar .flatpickr-days,
.deadline-calendar .dayContainer {
  width: 100%;
  min-width: 0;
  max-width: none;
}
.deadline-calendar .dayContainer {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.deadline-calendar .flatpickr-day {
  width: 100%;
  max-width: none;
  height: 46px;
  line-height: 46px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.deadline-calendar .flatpickr-day:hover,
.deadline-calendar .flatpickr-day:focus {
  border-color: var(--rule-strong);
  background: var(--sunk);
}
.deadline-calendar .flatpickr-day.selected,
.deadline-calendar .flatpickr-day.selected:hover {
  border-color: var(--accent-fill);
  background: var(--accent-fill);
  color: #fff;
}
.deadline-calendar .flatpickr-day.today { border-color: var(--accent); }
.deadline-calendar .flatpickr-day.flatpickr-disabled,
.deadline-calendar .flatpickr-day.prevMonthDay,
.deadline-calendar .flatpickr-day.nextMonthDay,
.deadline-calendar .flatpickr-weekday { color: var(--ink-mute); }
.deadline-calendar .flatpickr-months,
.deadline-calendar .flatpickr-month,
.deadline-calendar .flatpickr-weekdays {
  background: transparent;
  color: var(--ink);
  fill: var(--ink);
}
.deadline-calendar .flatpickr-months .flatpickr-month { height: 52px; }
.deadline-calendar .flatpickr-current-month {
  height: 48px;
  padding-top: 8px;
  font-size: 1.05rem;
  font-weight: 650;
}
.deadline-calendar .flatpickr-current-month input.cur-year {
  display: inline;
  min-height: 32px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font: inherit;
}
.deadline-calendar .flatpickr-prev-month,
.deadline-calendar .flatpickr-next-month {
  width: 44px;
  height: 44px;
  padding: 14px;
  border-radius: 8px;
  color: var(--ink);
  fill: var(--ink);
}
.deadline-calendar .flatpickr-prev-month:hover,
.deadline-calendar .flatpickr-next-month:hover { background: var(--sunk); }
.deadline-calendar .flatpickr-prev-month:hover svg,
.deadline-calendar .flatpickr-next-month:hover svg { fill: var(--accent); }
.deadline-calendar .flatpickr-weekday { font-size: .75rem; font-weight: 600; }
.deadline-calendar .numInputWrapper span { width: 24px; }
.deadline-calendar.flatpickr-calendar::before,
.deadline-calendar.flatpickr-calendar::after { display: none; }

/* ── Hareket ───────────────────────────────────────────────────────────── */
/* Sayfa açılışı: içerik bir kez, hafifçe yerine oturur. Yalnız SAYDAMLIK —
   `transform` atası `position: fixed` çocuğu (bulmaca doku) kendine bağlardı. */
@media (prefers-reduced-motion: no-preference) {
  main > * { animation: page-in .32s var(--ease) both; }
  main > :nth-child(2) { animation-delay: .03s; }
  main > :nth-child(3) { animation-delay: .06s; }
  main > :nth-child(n+4) { animation-delay: .09s; }
}
@keyframes page-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
  }
}

/* ── Quiz (2026-10-04) ─────────────────────────────────────────────────────
   Kompozisyonla aynı defter: soru numarası kâğıdın solunda, yazılı cevap çizgili satıra
   yazılır, öğretmenin düzeltmesi kırmızı kalemle (italik serif) cevabın altına düşer. */
.optional {
  margin-left: 4px;
  color: var(--ink-mute);
  font-size: .8125rem;
  font-weight: 450;
}

/* Öğretmen: ödev türü anahtarı + soru kartları */
.create-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 14px;
}
.create-head h2 { margin: 0; }
.kind-switch {
  display: flex;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--sunk);
}
.kind-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 5px;
  color: var(--ink-mute);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
}
.kind-switch a:hover { color: var(--ink); }
.kind-switch a[aria-current="page"] {
  background: var(--sheet);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(20, 27, 43, .08), 0 0 0 1px var(--rule);
}

.q-builder { display: grid; gap: 14px; }
.q-builder-title { margin: 8px 0 0; font-size: 1.0625rem; }
.q-list {
  display: grid;
  gap: 12px;
  counter-reset: question;
}
.q-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  margin: 0;
  padding: 16px 18px 18px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--sheet);
}
.q-card:not([hidden]) { counter-increment: question; }
.q-card:focus-within { border-color: var(--rule-strong); }
.q-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.q-number {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-wash);
  color: var(--accent);
  font: 700 .875rem/1 var(--sans);
  font-variant-numeric: tabular-nums;
}
.q-number::before { content: counter(question); }
.q-type { flex: 1 1 auto; min-width: 0; }
.q-type .level-select select { min-height: 44px; }
.q-written .level-select select { min-height: 46px; }
.q-remove {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-mute);
}
.q-remove:hover { background: var(--red-wash); color: var(--red); }
.q-remove .icon { width: 18px; height: 18px; }

.q-card:not([data-type="written"]) [data-for="written"],
.q-card:not([data-type="choice"]) [data-for="choice"],
.q-card:not([data-type="cloze"]) [data-for="cloze"] { display: none; }
.q-card[data-type="cloze"] textarea[name$="-prompt"] { min-height: 10rem; }
.q-cloze-tools { display: grid; gap: 10px; }
.q-cloze-tools [data-cloze-gap] { justify-self: start; }
.q-cloze-preview { min-width: 0; color: var(--ink-body); }
.q-cloze-preview > strong { display: block; margin-bottom: 6px; }
.q-cloze-preview p { margin: 4px 0; overflow-wrap: anywhere; }
.q-cloze-preview p[lang="ru"] { font-family: var(--serif); }
.q-cloze-preview .q-preview-gap { color: var(--accent); font-weight: 700; }
.q-cloze-preview .q-cloze-error { color: var(--red); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.q-written {
  display: grid;
  grid-template-columns: minmax(8rem, 11rem) minmax(0, 1fr);
  gap: 14px;
}
.q-options { display: grid; gap: 8px; }
.q-option {
  display: grid;
  grid-template-columns: 40px 28px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}
.q-option input[type="text"] { min-height: 42px; padding-block: 8px; }
.q-key {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 50%;
  cursor: pointer;
}
.q-key:hover { background: var(--green-wash); }
.q-key input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--green);
  cursor: pointer;
}
.q-letter {
  margin: 0;
  color: var(--ink-mute);
  font: 700 .875rem/1 var(--sans);
  text-align: center;
}
.q-option:has(.q-key input:checked) .q-letter { color: var(--green); }
.q-option:has(.q-key input:checked) input[type="text"] { border-color: color-mix(in srgb, var(--green) 55%, var(--rule-strong)); }
.q-add { justify-self: start; }

/* Öğrenci: soru listesi */
.quiz-form { margin-top: 28px; }
.quiz-questions {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: quiz;
}
.quiz-question {
  position: relative;
  padding: 22px 0 24px 52px;
  border-top: 1px solid var(--rule);
  counter-increment: quiz;
}
.quiz-question:first-child { border-top: 0; padding-top: 4px; }
.quiz-question::before {
  content: counter(quiz);
  position: absolute;
  top: 22px;
  left: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--sunk);
  color: var(--ink);
  font: 700 .9375rem/1 var(--sans);
  font-variant-numeric: tabular-nums;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.quiz-question:first-child::before { top: 4px; }
.quiz-question.is-answered::before { background: var(--accent); color: #fff; }
.quiz-passage { counter-increment: none; }
.quiz-passage::before { display: none; }
.quiz-passage-text { margin: 0; color: var(--ink); font-family: var(--serif); font-size: 1.125rem; line-height: 2.6; overflow-wrap: anywhere; }
/* Metin boşluğu: numara yuvanın içinde (soru numaralarıyla aynı daire), liste kendi okuyla; yuvanın tamamı listeyi açar.
   Seçilen cevap mavi mürekkeple yazılır, numara maviye dolar. */
.gap { display: inline-flex; position: relative; vertical-align: baseline; margin: 0 .15em; border-radius: 999px; counter-increment: quiz; }
.gap::before {
  content: counter(quiz);
  position: absolute;
  top: 50%;
  left: 6px;
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--sunk);
  color: var(--ink);
  font: 650 12px/1 var(--sans);
  font-variant-numeric: tabular-nums;
  transform: translateY(-50%);
  pointer-events: none;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.gap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--ink-mute);
  border-bottom: 1.5px solid var(--ink-mute);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.gap .gap-n { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.gap-placeholder { display: none; }
.gap.has-choice-only:not(.is-answered) .gap-placeholder {
  display: block;
  position: absolute;
  top: 50%;
  left: 44px;
  color: var(--ink-mute);
  font: 400 17px/1.2 var(--serif);
  transform: translateY(-50%);
  pointer-events: none;
}
.gap select {
  appearance: none;
  -webkit-appearance: none;
  width: auto;
  min-width: 0;
  max-width: min(46vw, 15rem);
  height: 42px;
  min-height: 0;
  padding: 0 38px 0 44px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--sheet);
  color: var(--ink-mute);
  font: 400 17px/1.2 var(--serif);
  text-overflow: ellipsis;
  cursor: pointer;
}
.gap option { color: var(--ink); }
.gap select:hover:not(:disabled, :focus) { border-color: var(--ink-faint); }
.gap select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.gap.is-answered select { border-color: color-mix(in srgb, var(--accent) 40%, var(--rule-strong)); background: var(--accent-wash); color: var(--accent); }
.gap.is-answered::before { background: var(--accent); color: #fff; }
.gap.is-answered::after { border-color: var(--accent); }
.gap select:disabled { background: var(--sunk); color: var(--ink-mute); }
.quiz-question fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.quiz-kind {
  margin: 0 0 4px;
  color: var(--ink-mute);
  font-size: .75rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: uppercase;
}
.quiz-prompt {
  display: block;
  margin: 0 0 12px;
  padding: 0;
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.quiz-prompt[lang="ru"] { font-family: var(--serif); font-size: 1.25rem; font-weight: 400; }

/* Yazılı cevap: iki çizgili satır, defterdeki gibi */
.quiz-answer textarea {
  --lh: 2rem;
  min-height: calc(var(--lh) * 2 + 1rem);
  padding: .5rem 1rem;
  border-radius: var(--r-md);
  background-color: var(--sheet);
  background-image: repeating-linear-gradient(to bottom,
    transparent 0, transparent calc(var(--lh) - 1px),
    var(--line-blue) calc(var(--lh) - 1px), var(--line-blue) var(--lh));
  background-position: 0 calc(.5rem - 7px);
  background-attachment: local;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: var(--lh);
  resize: vertical;
}

.quiz-options {
  display: grid;
  gap: 8px;
  counter-reset: option;
}
.quiz-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-md);
  background: var(--sheet);
  color: var(--ink);
  font-weight: 450;
  cursor: pointer;
  counter-increment: option;
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.quiz-option::before {
  content: counter(option, upper-alpha);
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sunk);
  color: var(--ink-mute);
  font: 700 .8125rem/1 var(--sans);
}
.quiz-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.quiz-option:hover { border-color: var(--ink-faint); }
.quiz-option:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.quiz-option:has(input:checked)::before { background: var(--accent); color: #fff; }
.quiz-option:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--accent-ring); }
.quiz-option-text { min-width: 0; overflow-wrap: anywhere; }

.quiz-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 8px calc(-1 * var(--gutter)) 0;
  padding: 14px var(--gutter) max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.quiz-progress {
  margin: 0;
  color: var(--ink-mute);
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}
.quiz-progress output { color: var(--ink); font-weight: 700; }
.quiz-input-notice { flex: 1 1 12rem; margin: 0; color: var(--red); font-size: .8125rem; }
.quiz-footer .button { margin-left: auto; }

/* Sonuç ve inceleme: soru soru döküm */
.quiz-review {
  display: grid;
  margin: 0;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  background: var(--sheet);
  list-style: none;
}
.qr {
  display: grid;
  gap: 8px;
  padding: 18px 20px 20px;
  overflow-wrap: anywhere;
}
.qr + .qr { border-top: 1px solid var(--rule); }
.qr-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.qr-n {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sunk);
  color: var(--ink);
  font: 700 .8125rem/1 var(--sans);
  font-variant-numeric: tabular-nums;
}
.qr-kind { color: var(--ink-mute); font-size: .8125rem; font-weight: 550; }
.qr-verdict { margin-left: auto; }
.qr-suggest {
  margin-left: auto;
  color: var(--ink-mute);
  font-size: .8125rem;
}
.qr-prompt { margin: 0; color: var(--ink); font-weight: 600; line-height: 1.5; }
.qr-prompt[lang="ru"] { font-family: var(--serif); font-size: 1.125rem; font-weight: 400; }
.qr-passage { margin: 0; color: var(--ink); font: 400 1.0625rem/1.8 var(--serif); overflow-wrap: anywhere; }
.qr-gap { white-space: nowrap; }
.qr-gap.is-correct { color: var(--green); font-weight: 650; }
.qr-gap.is-wrong { color: var(--red); text-decoration: line-through; text-decoration-thickness: 1.3px; }
.qr-gap.is-empty { color: var(--ink-mute); }
.qr-gap.fix {
  display: inline-block;
  min-width: 44px;
  min-height: 44px;
  max-width: 100%;
  padding: 2px 3px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  font: inherit;
  text-align: left;
  vertical-align: baseline;
  white-space: normal;
  text-decoration: none;
}
.qr-gap.fix:hover, .qr-gap.fix.is-active { background: var(--accent-wash); }
.qr-gap.fix:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.qr-gap.fix del { color: var(--red); text-decoration-color: var(--red); }
.qr-gap.fix ins { color: var(--green); text-decoration: none; }
.qr-gap.fix.is-correct { font-weight: 650; }
.qr-gap-number { margin-left: .15em; color: var(--ink-mute); font: 600 .6875rem var(--sans); }
.cloze-note { margin-block: 8px; }
.cloze-note summary { cursor: pointer; color: var(--accent); }
.has-cloze-popovers .cloze-note { display: none; }
.cloze-note-verdict { margin: 0 0 10px; }
.correction-popover .verdict-switch { margin-top: 12px; }
.correction-popover .verdict-switch label { min-height: 44px; }
.correction-popover .qr-options li { min-height: 44px; overflow-wrap: anywhere; }
.qr-answer {
  margin: 0;
  padding: 2px 0 2px 12px;
  border-left: 2px solid var(--line-blue);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
}
.qr.is-wrong .qr-answer,
.qr.is-partial .qr-answer { border-left-color: var(--margin-red); }
.qr.is-wrong .qr-answer:not(:has(.qr-empty)) {
  color: var(--ink-mute);
  text-decoration: line-through;
  text-decoration-color: var(--red);
  text-decoration-thickness: 1.4px;
}
.qr-fix {
  margin: 0;
  padding-left: 14px;
  color: var(--red);
  font-family: var(--serif);
  font-size: 1.0625rem;
  font-style: italic;
  line-height: 1.6;
}
.qr-reason { margin: 0; padding-left: 14px; color: var(--ink-body); font-size: .875rem; line-height: 1.5; }
.qr-reference { margin: 0; padding-left: 14px; color: var(--ink-mute); font-size: .875rem; }
.qr-reference [lang="ru"] { color: var(--ink-body); font-family: var(--serif); font-size: 1rem; }
.qr-empty { color: var(--ink-mute); font-family: var(--sans); font-size: .875rem; font-style: italic; }

.qr-options {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.qr-options li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  color: var(--ink-mute);
}
.qr-letter {
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--sunk);
  font: 700 .75rem/1 var(--sans);
}
.qr-options li.is-key { background: var(--green-wash); color: var(--green); font-weight: 600; }
.qr-options li.is-key .qr-letter { background: var(--green); color: #fff; }
.qr-options li.is-chosen:not(.is-key) { background: var(--red-wash); color: var(--red); text-decoration: line-through; }
.qr-options li.is-chosen:not(.is-key) .qr-letter { background: var(--red); color: #fff; }

/* Öğretmen kararı: üç parçalı anahtar */
.quiz-review-form { display: grid; gap: 20px; }
.quiz-retry { margin: -8px 0 20px; }
.verdict-switch {
  display: inline-flex;
  justify-self: start;
  margin: 6px 0 0;
  padding: 3px;
  border: 0;
  border-radius: 999px;
  background: var(--sunk);
}
.verdict-switch label {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin: 0;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--ink-mute);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
}
.verdict-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.verdict-switch label:hover { color: var(--ink); }
.verdict-switch label:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-ring); }
.verdict-switch .verdict-correct:has(input:checked) { background: var(--green); color: #fff; }
.verdict-switch .verdict-partial:has(input:checked) { background: var(--amber); color: #fff; }
.verdict-switch .verdict-wrong:has(input:checked) { background: var(--red); color: #fff; }

.quiz-approve { display: grid; gap: 16px; }
.question-grade { display: grid; justify-items: start; gap: 6px; margin-top: 8px; }
.question-grade > label { font-size: .875rem; font-weight: 600; }
.question-grade-input { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; max-width: 100%; }
.question-grade-input .question-points { width: 7rem; max-width: 100%; min-height: 44px; font-size: 1rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.question-grade-input > span { color: var(--ink-mute); font-size: .875rem; }
.question-grade-hint { margin: 0; color: var(--ink-mute); font-size: .8125rem; }
.qr-points { margin-left: auto; font-variant-numeric: tabular-nums; }

/* Kesin not alanı (bütün incelemeler, 2026-10-08): not kısa bir sayıdır, alan da kısadır. Quizde yanında
   kararlardan hesaplanan not durur; öğretmen alana başka not yazabilir. */
.grade-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.grade-number {
  width: 7.5rem;
  font-size: 1.125rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.grade-auto {
  margin: 0;
  color: var(--ink-mute);
  font-size: .875rem;
}
.grade-auto output {
  margin-left: 4px;
  color: var(--ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .quiz-question { padding-left: 44px; }
  .quiz-question::before { width: 30px; height: 30px; }
  .qr { padding: 16px 14px 18px; }
  .q-card { padding: 14px; }
  .quiz-passage-text { line-height: 2.35; }
  .gap select { max-width: min(62vw, 15rem); height: 40px; }
  .q-written { grid-template-columns: minmax(0, 1fr); }
  .quiz-footer .button { width: 100%; justify-content: center; }
}

/* ── Onay penceresi + silme (2026-10-07) ────────────────────────────────────
   Duyurma, not yayımlama, kod/erişim ve silme işlemleri önce sorar (`classroom-confirm.js`).
   Silme düğmesi sayfanın en altında, yalnız çizgiyle ayrılmış sessiz bir bölgededir. */
.confirm-dialog {
  width: min(440px, calc(100vw - 2 * var(--gutter)));
  max-width: none;
  margin: auto;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  background: var(--sheet);
  color: var(--ink-body);
  box-shadow: var(--shadow-pop);
}
.confirm-dialog::backdrop { background: rgba(20, 27, 43, .32); }
.confirm-sheet {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 24px 24px 20px;
}
.confirm-sheet h2 {
  margin: 0;
  font-size: 1.1875rem;
  line-height: 1.3;
  letter-spacing: 0;
}
.confirm-sheet p {
  margin: 0;
  color: var(--ink-mute);
  font-size: .9375rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.button.destructive { --btn-bg: var(--red); --btn-fg: #fff; }
.button.destructive:not(:disabled):hover { --btn-bg: #b8352d; }

.zone {
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.zone form { margin: 0; }

.rubric-band {
  margin-left: 8px;
  color: var(--ink-mute);
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .confirm-dialog[open] { animation: confirm-in .16s var(--ease); }
  @keyframes confirm-in { from { opacity: 0; transform: translateY(6px) scale(.985); } }
}
@media (max-width: 480px) {
  .confirm-actions { flex-direction: column-reverse; }
  .confirm-actions .button { width: 100%; }
}

/* ── Dinleme (2026-10-07) ───────────────────────────────────────────────────
   Öğrenci oynatıcısı tek düğmedir; çevresindeki mürekkep halkası kaydın ilerleyişidir. Başlayan kayda
   dokunulamaz (düğme çalarken kapalıdır, duraklatma ve sarma yok). Noktalar dinleme hakkıdır: dolu = kalan.
   Çalarken kart üstte yapışık durur: soruları cevaplarken süre görünür kalır. */
.listen {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 20px;
  padding: 12px 18px 12px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  background: var(--sheet);
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.listen[data-state="playing"] {
  position: sticky;
  top: 10px;
  z-index: 3;
  border-color: var(--rule-strong);
  box-shadow: var(--shadow-raise);
}
.listen-button {
  position: relative;
  flex: 0 0 64px;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}
.listen-button::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--accent-fill);
  transition: background-color .15s var(--ease), transform .1s var(--ease);
}
.listen-button:not(:disabled):hover::before { background: var(--accent-fill-hover); }
.listen-button:not(:disabled):active::before { transform: scale(.96); }
.listen-button:disabled { cursor: default; }
.listen-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  fill: none;
  stroke-width: 3;
}
.listen-ring-track { stroke: var(--line-blue); }
.listen-ring-fill {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 188.5;
  stroke-dashoffset: 188.5;
}
.listen-glyph {
  position: relative;
  display: none;
  place-items: center;
}
.listen-glyph .icon { width: 24px; height: 24px; stroke-width: 2; }
.listen-glyph.is-play .icon { fill: currentColor; transform: translateX(1.5px); }
.listen[data-state="loading"] .listen-glyph.is-play,
.listen[data-state="ready"] .listen-glyph.is-play,
.listen[data-state="replay"] .listen-glyph.is-replay,
.listen[data-state="error"] .listen-glyph.is-replay,
.listen[data-state="done"] .listen-glyph.is-done,
.listen[data-state="playing"] .listen-glyph.is-wave { display: grid; }
.listen[data-state="loading"] .listen-button::before { background: var(--sunk); }
.listen[data-state="loading"] .listen-button { color: var(--ink-faint); }
.listen[data-state="playing"] .listen-button::before { background: var(--accent-wash); }
.listen[data-state="playing"] .listen-button { color: var(--accent); }
.listen[data-state="done"] .listen-button::before { background: var(--sunk); }
.listen[data-state="done"] .listen-button { color: var(--ink-mute); }
.listen[data-state="error"] .listen-button::before { background: var(--red-wash); }
.listen[data-state="error"] .listen-button { color: var(--red); }
.listen-glyph.is-wave {
  grid-auto-flow: column;
  align-items: center;
  gap: 3px;
  height: 22px;
}
.listen-glyph.is-wave i {
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: currentColor;
  transform: scaleY(.4);
  animation: listen-wave 1.05s ease-in-out infinite;
}
.listen-glyph.is-wave i:nth-child(2) { animation-delay: -.45s; }
.listen-glyph.is-wave i:nth-child(3) { animation-delay: -.8s; }
.listen-glyph.is-wave i:nth-child(4) { animation-delay: -.25s; }
@keyframes listen-wave {
  0%, 100% { transform: scaleY(.35); }
  50% { transform: scaleY(1); }
}
.listen-main { flex: 1 1 auto; min-width: 0; }
.listen-status {
  margin: 0;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.35;
}
.listen[data-state="error"] .listen-status { color: var(--red); }
.listen-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2px 16px;
  margin-top: 2px;
}
.listen-time,
.listen-rights {
  margin: 0;
  color: var(--ink-mute);
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}
.listen-rights {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .8125rem;
  font-weight: 600;
  white-space: nowrap;
}
.listen-dots { display: inline-flex; gap: 5px; }
.listen-dots i {
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  transition: background-color .2s var(--ease);
}
.listen-dots i.is-left { background: var(--accent); }
.listen[data-state="done"] .listen-dots i { border-color: var(--ink-faint); }

/* Öğretmen: kayıt seçme alanı, dinleme hakkı, ödev sayfasındaki önizleme */
.audio-pick {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px 16px;
  border: 1.5px dashed var(--rule-strong);
  border-radius: var(--r-md);
  background: var(--sheet);
  transition: border-color .15s var(--ease), background-color .15s var(--ease), box-shadow .15s var(--ease);
}
.audio-pick input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}
.audio-pick:hover,
.audio-pick.is-over { border-color: var(--accent); background: var(--accent-wash); }
.audio-pick:has(input:focus-visible) { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.audio-pick.has-file { border-style: solid; }
.audio-pick.is-invalid,
.form-field:has(.errorlist) .audio-pick { border-color: var(--red); background: var(--red-wash); }
.audio-pick-icon {
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-wash);
  color: var(--accent);
}
.audio-pick-icon .icon { width: 22px; height: 22px; }
.audio-pick-text { display: grid; gap: 1px; min-width: 0; }
.audio-pick-text strong { color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.audio-pick-text span { color: var(--ink-mute); font-size: .8125rem; }
.audio-pick.is-invalid .audio-pick-text span { color: var(--red); }
.audio-preview { display: block; width: 100%; margin-top: 10px; }

.plays-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.plays-field legend {
  margin: 0 0 6px;
  padding: 0;
  color: var(--ink);
  font-size: .875rem;
  font-weight: 600;
}
.plays-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--sunk);
}
.plays-switch label { position: relative; display: block; margin: 0; }
.plays-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.plays-switch span {
  display: grid;
  place-items: center;
  min-width: 46px;
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--ink-mute);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  transition: color .15s var(--ease), background-color .15s var(--ease);
}
.plays-switch label:hover span { color: var(--ink); }
.plays-switch input:checked + span {
  background: var(--sheet);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(20, 27, 43, .08), 0 0 0 1px var(--rule);
}
.plays-switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-ring); }

.listen-preview {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  background: var(--sheet);
}
.listen-preview + .section { margin-top: 36px; }
.listen-preview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
}
.listen-preview-head h2 { margin: 0; font-size: 1rem; font-weight: 650; }
.listen-preview-name { min-width: 0; color: var(--ink-mute); font-size: .8125rem; overflow-wrap: anywhere; }
.listen-preview audio { display: block; width: 100%; }

@media (max-width: 480px) {
  .listen { gap: 12px; padding: 10px 14px 10px 10px; }
  .listen-button { flex-basis: 56px; width: 56px; height: 56px; }
  .listen-button::before { inset: 7px; }
  .plays-switch { display: flex; }
  .plays-switch label { flex: 1 1 0; }
  .plays-switch span { min-width: 0; }
}

/* ── Dar ekran ─────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  :root { --gutter: 24px; }
  .join {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    gap: 40px;
  }
  .join-sheet {
    justify-self: stretch;
    width: 100%;
    max-width: none;
  }
  .review-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1100px) {
  .room-workspace,
  .results-workspace { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .join { gap: 32px; }
  .join-panel .form-stack { grid-template-columns: minmax(0, 1fr); }
  .join-panel .button { width: 100%; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  main { padding-block: 28px 48px; }
  .topbar-inner { min-height: 68px; flex-wrap: wrap; gap: 8px 12px; padding-block: 10px; }
  .brand-product { display: none; }
  .join { padding-top: 8px; }
  .kind-switch { width: 100%; }
  .kind-switch a { flex: 1 1 0; padding-inline: 8px; }
  .page-head { margin-bottom: 24px; align-items: flex-start; }
  .page-head > .actions,
  .page-head > .button { width: 100%; }
  .page-head > .button { justify-content: center; }
  .row { flex-direction: column; align-items: stretch; }
  .row .actions { justify-content: flex-start; }
  .row .actions .button { flex: 1 1 auto; }
  .student-results { min-width: 0; }
  .student-results thead th:first-child { width: 34%; }
  .student-results thead th:nth-child(2) { width: 24%; }
  .student-results thead th { white-space: normal; }
  .student-results :is(th, td) { padding: 12px; }
  .student-results tbody th { font-size: .875rem; }
  .student-results .grade { max-width: 100%; }
  .student-results .grade strong { font-size: .8125rem; }
  .student-results .grade-bar { width: 100%; max-width: 72px; }
  .student-results .teacher-note summary {
    width: 100%;
    min-width: 0;
    padding: 8px;
    gap: 6px;
    font-size: .8125rem;
  }
  .student-results .teacher-note summary > span { min-width: 0; overflow-wrap: anywhere; }
  .student-results .teacher-note-content { padding: 10px; font-size: .875rem; }
  .list > .row,
  .assignment-list > .row,
  .student-roster > .roster-row { padding: 16px; }
  .room-management-actions { width: 100%; }
  .sheet-ruled,
  #composition-body,
  .essay {
    --margin: 1.75rem;
    padding-left: 1rem;
    padding-right: calc(var(--margin) + .65rem);
    font-size: 1.0625rem;
  }
  .copy-row { flex-direction: column; }
  .copy-row .button { width: 100%; }
  .form-pair { grid-template-columns: minmax(0, 1fr); }
  .games-entry-main { align-items: flex-start; }
  .publish-panel form,
  .publish-panel .button { width: 100%; }
}

@media (max-width: 420px) {
  .brand-name { font-size: .92rem; }
  .topnav a,
  .topnav button { padding: 0 10px; }
  .deadline-calendar.flatpickr-calendar {
    width: calc(100% + 20px);
    margin-left: -10px;
    padding: 4px;
  }
}

/* Auto Quiz öğretmen akışı */
.autoquiz-lessons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.autoquiz-volume { display: flex; flex-wrap: wrap; gap: 8px; }
.autoquiz-volume [aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-wash); }
.autoquiz-progress ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule-strong); }
.autoquiz-progress li { position: relative; padding: 10px 12px 10px 20px; color: var(--ink-mute); }
.autoquiz-progress li::before { content: ""; position: absolute; left: -4px; top: 17px; width: 7px; height: 7px; border-radius: 50%; background: var(--rule-strong); }
.autoquiz-progress li.is-current { color: var(--accent); font-weight: 700; }
.autoquiz-progress li.is-current::before, .autoquiz-progress li.is-done::before { background: var(--accent); }
.autoquiz-progress li.is-done { color: var(--ink-body); }
.autoquiz-summary p { margin-top: 0; overflow-wrap: anywhere; }
.autoquiz-answer-key { margin: 8px 0; padding: 10px; border: 1px solid var(--rule); border-radius: var(--r-sm); }
.autoquiz-answer-key p { margin: 8px 0; overflow-wrap: anywhere; }
.autoquiz-request-edit { margin-block: 20px; padding: 16px; border: 1px solid var(--rule); border-radius: var(--r-md); }
.autoquiz-request-edit > summary { cursor: pointer; font-weight: 650; }
.autoquiz-request-edit form { margin-top: 16px; }
.autoquiz-answer-key .chip { display: inline-flex; margin: 3px; white-space: normal; }
.autoquiz-answer-key .chip.error { color: var(--red); background: var(--red-wash); }
.autoquiz-answer-key .chip.warning { color: var(--amber); background: var(--amber-wash); }
@media (max-width: 520px) {
  .autoquiz-lessons { grid-template-columns: minmax(0, 1fr); }
  .autoquiz-volume .button { flex: 1 1 auto; }
}

/* Ödev havuzu (2026-10-12) */
.pool-filter {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
}
.pool-filter .form-field { margin: 0; }
.pool-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex-shrink: 0; }
.pool-actions form { margin: 0; }
.pool-picked { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
@media (max-width: 640px) {
  .kind-switch { flex-wrap: wrap; }
  .kind-switch a { flex: 1 1 30%; }
  .pool-filter { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pool-filter-q,
  .pool-filter .button { grid-column: 1 / -1; }
  .pool-list > .row { flex-direction: column; align-items: stretch; }
}
