/* Remark VFL 1.1.0 */
.vfl {
  --vfl-ink: #3b2a1e; --vfl-muted: #7a6652; --vfl-line: #d6c5a8; --vfl-bg: #f7f0e3; --vfl-tint: #eddfc8;
  --vfl-accent: #8a5a2b; --vfl-dld: #7a4a5a; --vfl-dld-tint: #f0e1da;
  --vfl-fast: #6b3f1f; --vfl-vaeske: #7a7430; --vfl-gass: #b4532a; --vfl-warm: #b4381f; --vfl-cold: #5a6f8a;
  --vfl-fu: #7b4a24; --vfl-fb: #a8661a; --vfl-ff: #5f7a34;
  --vfl-r: #8a7a68; --vfl-t1: #7b4a24; --vfl-t2: #b0701c; --vfl-i: #7a4a5a;
  color: var(--vfl-ink); background: var(--vfl-bg); max-width: 760px; margin: 0 auto; line-height: 1.6; font-size: 1rem;
  border: 1px solid var(--vfl-line); border-radius: 14px; padding: 20px clamp(14px, 4vw, 28px) 28px; box-sizing: border-box;
}
.vfl *, .vfl *::before, .vfl *::after { box-sizing: border-box; }
.vfl p { margin: 0 0 .8em; }
.vfl ul, .vfl ol { margin: 0 0 .9em; padding-left: 1.4em; }
.vfl li { margin: .2em 0; }

/* Header */
.vfl-title { margin: 0 0 .1em; font-size: 1.7rem; line-height: 1.2; color: var(--vfl-ink); }
.vfl-sub { margin: 0 0 .8em; color: var(--vfl-muted); }
.vfl-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 16px; margin: 0 0 16px; padding: 12px 14px; background: var(--vfl-tint); border-radius: 10px; }
.vfl-meta dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--vfl-muted); }
.vfl-meta dd { margin: 0; font-weight: 600; }

/* Phases */
.vfl-phase { margin: 0 0 26px; padding-left: 14px; border-left: 4px solid var(--c); }
.vfl-phase--feedup { --c: var(--vfl-fu); } .vfl-phase--feedback { --c: var(--vfl-fb); } .vfl-phase--feedforward { --c: var(--vfl-ff); }
.vfl-phase__bar { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 8px; }
.vfl-phase__name { font-size: 1.15rem; font-weight: 800; color: var(--c); text-transform: uppercase; letter-spacing: .05em; }
.vfl-phase__q { font-style: italic; color: var(--vfl-muted); }
.vfl-phase__time { margin-left: auto; font-size: .85rem; color: var(--vfl-muted); }
.vfl-h3 { margin: 0 0 .5em; font-size: 1.25rem; line-height: 1.25; }
.vfl-h4 { margin: 1.1em 0 .35em; font-size: 1.05rem; }

/* Boxes */
.vfl-box { margin: 0 0 1em; padding: 10px 14px; background: var(--vfl-tint); border-left: 4px solid var(--vfl-accent); border-radius: 0 10px 10px 0; }
.vfl-box--sikkerhet { border-left-color: var(--vfl-warm); }
.vfl-box--husk { border-left-color: var(--vfl-fb); }
.vfl-box__title { display: block; margin-bottom: .2em; }
.vfl-box > :last-child { margin-bottom: 0; }

/* Figures */
.vfl-fig { margin: 1em 0; }
.vfl-fig figcaption { margin-top: 4px; font-size: .85rem; color: var(--vfl-muted); }
.vfl-svg { display: block; width: 100%; height: auto; max-width: 560px; color: var(--vfl-ink); }
.vfl-svg text { font-family: inherit; }
.vfl-fig:has(svg[viewBox="0 0 482 272"]) .vfl-svg { max-width: 600px; }

/* RTTI questions */
.vfl-q { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 .8em; }
.vfl-q__text { flex: 1; min-width: 0; }
.vfl-q__text > :last-child { margin-bottom: 0; }
.vfl-rtti { flex: none; min-width: 2.4em; padding: 2px 8px; text-align: center; font-size: .8rem; font-weight: 800; color: #fff; border-radius: 6px; background: var(--vfl-r); }
.vfl-rtti--t1 { background: var(--vfl-t1); } .vfl-rtti--t2 { background: var(--vfl-t2); } .vfl-rtti--i { background: var(--vfl-i); }
.vfl-answer { margin-top: 4px; font-size: .92rem; }
.vfl-answer summary { cursor: pointer; color: var(--vfl-accent); font-weight: 600; }
.vfl-answer p { margin: .3em 0 0; }
.vfl-key { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 14px; }
.vfl-key li { display: flex; gap: 10px; align-items: flex-start; margin: 0; }

/* Rubric */
.vfl-rubric { margin: 0 0 1em; border: 1px solid var(--vfl-line); border-radius: 10px; overflow: hidden; }
.vfl-level { display: grid; grid-template-columns: 9.5em 1fr; }
.vfl-level + .vfl-level { border-top: 1px solid var(--vfl-line); }
.vfl-level__name { padding: 8px 12px; font-weight: 700; background: var(--vfl-tint); }
.vfl-level__text { padding: 8px 12px; }
.vfl-level__text > :last-child { margin-bottom: 0; }
@media (max-width: 520px) { .vfl-level { grid-template-columns: 1fr; } }

/* Words and cards */
.vfl-words { margin: 0 0 1em; border: 1px solid var(--vfl-line); border-radius: 10px; overflow: hidden; }
.vfl-words > div { display: grid; grid-template-columns: 10em 1fr; }
.vfl-words > div + div { border-top: 1px solid var(--vfl-line); }
.vfl-words dt { padding: 6px 12px; font-weight: 700; background: var(--vfl-tint); }
.vfl-words dd { margin: 0; padding: 6px 12px; }
@media (max-width: 520px) { .vfl-words > div { grid-template-columns: 1fr; } }
.vfl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0 0 1em; }
.vfl-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; text-align: center; border: 1.5px solid var(--vfl-line); border-radius: 12px; background: var(--vfl-bg); }
.vfl-card__img { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 76px; color: var(--vfl-warm); }
.vfl-card strong { font-size: 1.05rem; }
.vfl-card span { font-size: .88rem; color: var(--vfl-muted); }
.vfl-sym { width: 30px; height: 30px; }
.vfl-arr { width: 38px; height: 20px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.vfl-arr--back { transform: scaleX(-1); }
.vfl-pbox, .vfl-obj { width: 76px; height: 76px; }
.vfl-pbox circle { fill: var(--c, var(--vfl-ink)); }
.vfl-pbox__frame { fill: none; stroke: var(--c, var(--vfl-ink)); stroke-width: 3; }
.vfl-pbox__line { fill: none; stroke: var(--c, var(--vfl-ink)); stroke-width: 2.5; stroke-linecap: round; }
.vfl-obj__stroke { fill: none; stroke: var(--c, var(--vfl-ink)); stroke-width: 4; stroke-linejoin: round; }
.vfl-obj__line { fill: none; stroke: var(--c, var(--vfl-ink)); stroke-width: 4; stroke-linecap: round; }

/* Pupil sheet */
.vfl-sheet { display: grid; gap: 10px; }
.vfl-sheet__row { --c: var(--vfl-fast); display: grid; grid-template-columns: 90px 90px 1fr; align-items: center; gap: 10px; padding: 8px 12px; border: 3px solid var(--c); border-radius: 16px; }
.vfl-sheet__row--vaeske { --c: var(--vfl-vaeske); } .vfl-sheet__row--gass { --c: var(--vfl-gass); }
.vfl-sheet__row .vfl-pbox, .vfl-sheet__row .vfl-obj { width: 84px; height: 84px; }
.vfl-sheet__word { display: flex; flex-direction: column; }
.vfl-sheet__word strong { font-size: 1.5rem; color: var(--c); letter-spacing: .04em; }
.vfl-sheet__word span { font-size: 1.1rem; color: var(--vfl-muted); }
.vfl-sheet__trans { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.vfl-sheet__t { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px; font-weight: 800; border: 2.5px solid currentColor; border-radius: 999px; }
.vfl-sheet__t--warm { color: var(--vfl-warm); } .vfl-sheet__t--cold { color: var(--vfl-cold); }
@media (max-width: 480px) { .vfl-sheet__row { grid-template-columns: 64px 64px 1fr; } .vfl-sheet__row .vfl-pbox, .vfl-sheet__row .vfl-obj { width: 64px; height: 64px; } }

/* Can-do list and sources */
.vfl-cando { margin: 0 0 1em; padding: 10px 14px; border: 1.5px solid var(--vfl-line); border-radius: 12px; }
.vfl-cando ul { list-style: none; padding: 0; margin: .4em 0 0; }
.vfl-cando li { display: flex; align-items: center; gap: 10px; }
.vfl-check { flex: none; width: 18px; height: 18px; border: 2px solid var(--vfl-ink); border-radius: 4px; }
.vfl-sources { margin-top: 20px; padding-top: 10px; border-top: 1px solid var(--vfl-line); font-size: .85rem; color: var(--vfl-muted); }
.vfl-sources p { margin: .3em 0; }

/* DLD blocks: a tag in the text; click to open the content */
.vfl-dld { margin: 0 0 .9em; background: var(--vfl-dld-tint); border: 1.5px solid var(--vfl-dld); border-radius: 12px; }
.vfl-dld:not([open]) { display: inline-block; margin-right: 8px; background: transparent; border-radius: 999px; }
.vfl-dld__tag { display: flex; align-items: center; gap: 8px; padding: 5px 12px; font-size: .85rem; font-weight: 700; color: var(--vfl-dld); cursor: pointer; list-style: none; user-select: none; }
.vfl-dld__tag::-webkit-details-marker { display: none; }
.vfl-dld__tag::after { content: "+"; margin-left: 2px; font-size: 1.1rem; line-height: 1; }
.vfl-dld[open] > .vfl-dld__tag::after { content: "\2212"; }
.vfl-dld[open] > .vfl-dld__tag { padding: 8px 14px 4px; }
.vfl-dld__tag:hover { text-decoration: underline; }
.vfl-dld__tag:focus-visible { outline: 3px solid var(--vfl-accent); outline-offset: 2px; border-radius: 10px; }
.vfl-dld__badge { padding: 1px 7px; font-size: .7rem; letter-spacing: .06em; color: #fff; background: var(--vfl-dld); border-radius: 5px; }
.vfl-dld__tag em { font-weight: 400; font-style: normal; color: var(--vfl-ink); }
.vfl-dld__body { padding: 2px 14px 12px; }
.vfl-dld__body > :last-child { margin-bottom: 0; }

@media print {
  .vfl { border: 0; padding: 0; max-width: none; }
  .vfl-phase, .vfl-dld, .vfl-fig, .vfl-q { break-inside: avoid; }
}