/* /system/ and /en/system/ only (build.py links this file from those two pages and stamps it).
   Shared pieces live in site.css; put only this page's own rules here. Same limits as site.css:
   transitions on transform or opacity only (200 to 450 ms), no keyframes, no sticky or fixed. */

/* 1. The phone app: the homework sample, a word card and a quiz question, each on a phone on its own
   desk. The panels are the class app's own screens (site/learn: the homework screen, flash.css,
   quiz.css) set in the site's colours and its three Pretendard weights; the data is made up except
   the homework items, which are real.
   Under 720 px one column. 720 to 1099 px: homework and word card side by side, the quiz under them.
   1100 px and up: three across. From 720 px each desk and its caption sit on their own grid rows
   (the .mat wrapper steps aside), so the desks in a row are always the same height. */
.sy-panels { margin-top: 44px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 44px 24px; }
.sy-panels .desk { justify-content: flex-start; }
.sy-panels .hw-frame { flex: 1 1 auto; display: flex; flex-direction: column; }
.sy-panels .hw, .sy-screen { flex: 1 1 auto; min-height: 600px; }
.sy-screen { display: flex; flex-direction: column; overflow: hidden; border-radius: 32px; background: var(--ground); }

/* The word card (flash.css): the English word on the front; the meaning, the example and the app's
   four grade buttons on the back (다시 · 어려움 · 기억남 · 쉬움; two rows of two, 52 px tall, since
   four do not fit one row in the phone frame). The card turns on tap (site.js, [data-phrase]);
   tapping any grade turns it back, as the next card would come up front side first. */
.wc { justify-content: center; padding: 24px 14px; }
.wc .phrase-item { width: 100%; }
.js .wc .card-inner { aspect-ratio: auto; min-height: 460px; }
.wc .card-face { padding: 20px 18px; }
.wc .card-front { align-items: center; text-align: center; }
.wc .card-back { border: 1px solid var(--rule-soft); background: var(--paper); box-shadow: var(--shadow-paper); color: var(--ink); }
.wc-en { margin: auto 0; font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -0.025em; color: var(--ink); }
.wc-flip { flex: 0 0 auto; color: var(--muted); }
.wc-flip path { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.wc-main { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.wc-ko { font-size: 40px; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; color: var(--ink); }
.wc-ex { display: flex; flex-direction: column; gap: 2px; padding-top: 14px; border-top: 1px solid var(--rule); }
.wc-ex-en { font-size: 18px; font-weight: 600; line-height: 1.45; color: var(--ink); }
.wc-ex-ko { font-size: 16px; line-height: 1.6; color: var(--muted); }
.wc-grades { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.wc-g { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 8px; border: 1.5px solid var(--rule); border-radius: 15px; background: var(--paper); font-size: 17px; font-weight: 600; line-height: 1.3; text-align: center; }
.wc-again { color: var(--coral-ink); }
.wc-good { border-color: var(--teal); background: var(--teal); color: #FFFFFF; }

/* The quiz question (quiz.css): marked by CSS alone from the checked radio, so it works without
   JavaScript and nothing is kept. The right answer always shows; a wrong choice is struck through. */
.qz { padding: 18px 16px 22px; }
.qz-run { display: flex; align-items: center; min-height: 24px; }
.qz-track { flex: 1 1 auto; height: 6px; overflow: hidden; border-radius: 3px; background: var(--rule); }
.qz-track span { display: block; width: 30%; height: 100%; border-radius: 3px; background: var(--teal); }
.qz-item { position: relative; margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }
.qz-in { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.qz-eyebrow { font-size: 14px; font-weight: 600; line-height: 1.4; letter-spacing: 0.04em; color: var(--teal); }
.qz-prompt { margin-top: -8px; font-size: 19px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.qz-stem { font-size: 24px; font-weight: 600; line-height: 1.4; letter-spacing: -0.015em; color: var(--ink); }
.qz-blank { display: inline-block; min-width: 3.4em; padding: 0 0.15em; border-bottom: 3px solid var(--coral); line-height: 1.05; text-align: center; }
.qz-fill { visibility: hidden; color: var(--teal-down); }
.qz-opts { display: grid; gap: 10px; }
.qz-opt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 14px 8px 18px;
  border: 1.5px solid var(--field-line);
  border-radius: 15px;
  background: var(--paper);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  cursor: pointer;
  transition: opacity 250ms ease;
}
.qz-opt:hover { background: var(--ground); }
.qz-mark { display: grid; place-items: center; width: 24px; height: 24px; }
.qz-mark svg { grid-area: 1 / 1; opacity: 0; transition: opacity 200ms ease; }
.qz svg path { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.qz-in:checked ~ .qz-stem .qz-fill { visibility: visible; }
.qz-in:checked ~ .qz-stem .qz-blank { border-bottom-color: var(--teal); }
.qz-in:checked ~ .qz-stem .sr-only { display: none; }
.qz-in:checked ~ .qz-opts .qz-opt { opacity: 0.5; }
.qz-in:checked ~ .qz-opts .is-answer { opacity: 1; border-color: var(--teal); background: var(--teal-wash); color: var(--teal-down); }
.qz-in:checked ~ .qz-opts .is-answer .m-ok { opacity: 1; color: var(--teal); }
#qz-2:checked ~ .qz-opts [for="qz-2"],
#qz-3:checked ~ .qz-opts [for="qz-3"] { opacity: 1; border-color: var(--coral); background: var(--coral-wash); color: var(--coral-ink); text-decoration: line-through; }
#qz-2:checked ~ .qz-opts [for="qz-2"] .m-no,
#qz-3:checked ~ .qz-opts [for="qz-3"] .m-no { opacity: 1; }
#qz-1:focus-visible ~ .qz-opts [for="qz-1"],
#qz-2:focus-visible ~ .qz-opts [for="qz-2"],
#qz-3:focus-visible ~ .qz-opts [for="qz-3"] { outline: 3px solid var(--teal); outline-offset: 3px; }

.qz-fb { display: none; padding: 14px 16px; border-radius: 16px; }
.qz-in:checked ~ .qz-live .qz-fb { display: grid; gap: 6px; }
#qz-1:checked ~ .qz-live .qz-fb { background: var(--teal-wash); }
#qz-2:checked ~ .qz-live .qz-fb,
#qz-3:checked ~ .qz-live .qz-fb { background: var(--coral-wash); }
.qz-fb-h { display: none; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; line-height: 1.4; }
.qz-fb-h svg { flex: 0 0 auto; padding: 4px; border-radius: 50%; color: #FFFFFF; }
.qz-fb-ok svg { background: var(--teal); }
.qz-fb-no svg { background: var(--coral-ink); }
#qz-1:checked ~ .qz-live .qz-fb-ok { display: flex; color: var(--teal-down); }
#qz-2:checked ~ .qz-live .qz-fb-no,
#qz-3:checked ~ .qz-live .qz-fb-no { display: flex; color: var(--coral-ink); }
.qz-fb-why { font-size: 16px; line-height: 1.6; color: var(--body2); }

/* 2. The teacher view (teacher.css): one learner's "go over in class" list, as a table on a tablet.
   Under 600 px each row stands on its own, labelled, as the dashboard does on a phone. */
.sy-split { margin-top: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; }
.tv-screen { padding: 18px; border-radius: 13px; background: var(--ground); }
.tv-panel { padding: 20px 22px 6px; border-radius: 16px; background: var(--paper); box-shadow: 0 1px 2px rgba(19, 36, 42, 0.04), 0 10px 28px -16px rgba(19, 36, 42, 0.18); }
.tv-table { width: 100%; border-collapse: collapse; }
.tv-table caption { padding-bottom: 12px; text-align: left; font-size: 20px; font-weight: 800; line-height: 1.4; letter-spacing: -0.01em; color: var(--ink); }
.tv-table th { padding: 10px 12px; border-bottom: 1px solid var(--rule); text-align: left; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--muted); white-space: nowrap; }
.tv-table td { padding: 14px 12px; border-top: 1px solid var(--rule-soft); vertical-align: top; font-size: 16px; line-height: 1.5; color: var(--muted); }
.tv-table tbody tr:first-child td { border-top: 0; }
.tv-table th:first-child, .tv-table td:first-child { padding-left: 0; }
.tv-table th:last-child, .tv-table td:last-child { padding-right: 0; }
.tv-table .tv-en { font-size: 18px; font-weight: 600; line-height: 1.4; color: var(--ink); }

@media (max-width: 599px) {
  .tv-screen { padding: 12px; }
  .tv-panel { padding: 16px 16px 6px; }
  .tv-table, .tv-table caption, .tv-table tbody, .tv-table tr, .tv-table td { display: block; }
  .tv-table thead { display: none; }
  .tv-table tr { padding: 12px 0; border-top: 1px solid var(--rule-soft); }
  .tv-table td, .tv-table td:first-child, .tv-table td:last-child { padding: 2px 0; border: 0; }
  .tv-table td[data-label]::before { content: attr(data-label) " · "; font-weight: 600; }
}

/* 3. The book, the slides and the films: material on desks, as on the home page */
.sy-pain .book-page { max-width: 520px; }
.sy-tbook .book-page { max-width: 640px; }
.sy-pack .book-page { max-width: 380px; }
.sy-film { width: 100%; border-radius: 12px; box-shadow: var(--shadow-paper); }

@media (min-width: 400px) {
  .wc-en { font-size: 36px; }
}

@media (min-width: 720px) {
  .sy-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 0; }
  .sy-panels .mat { display: contents; }
  .sy-panels .desk { padding-left: 24px; padding-right: 24px; }
  .sy-hw .desk { grid-area: 1 / 1; }
  .sy-hw .mat-cap { grid-area: 2 / 1; }
  .sy-wc .desk { grid-area: 1 / 2; }
  .sy-wc .mat-cap { grid-area: 2 / 2; }
  .sy-qz .desk { grid-area: 3 / 1 / 4 / 3; margin-top: 44px; }
  .sy-qz .mat-cap { grid-area: 4 / 1 / 5 / 3; }
  .wc-en { font-size: 32px; }
}

@media (min-width: 960px) {
  .sy-split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 56px; align-items: start; }
  .sy-tv { margin-top: 26px; }
  .sy-cover { grid-column: 1 / 5; }
  .sy-pain { grid-column: 5 / 13; }
  .sy-tbook { grid-column: 1 / 9; }
  .sy-pack { grid-column: 9 / 13; }
  .sy-pair > .mat:first-child { grid-column: 1 / 7; }
  .sy-pair > .mat:last-child { grid-column: 7 / 13; }
}

@media (min-width: 1100px) {
  .sy-panels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sy-qz .desk { grid-area: 1 / 3; margin-top: 0; }
  .sy-qz .mat-cap { grid-area: 2 / 3; }
}

@media (min-width: 1280px) {
  .wc-en { font-size: 36px; }
}
