/* EMS theme: same Zielnote fonts, ink and layout, without the school-notebook marks.
   Loaded after site.css on /ems/ pages only. */
html[data-theme="ems"] {
  --paper: #F6F8FA; --surface: #FFFFFF; --ink: #142039; --ink-2: #374359; --muted: #5E6878;
  --line: #CDD5DF; --line-soft: #E4E9EF;
  --blue: #1F3A93; --blue-hover: #172D74;
  --teal: #0B7F6E; --teal-soft: #E3F2EF; --wrong: #B4372F;
  --g-wissen: #1F3A93; --g-raum: #0B7F6E; --g-gedaechtnis: #7048C2; --g-tempo: #8C6A00;
}
html[data-theme="ems"] body { background-image: none; background-color: var(--paper); }
html[data-theme="ems"] .sheetpage { padding: 0 28px; }
html[data-theme="ems"] .sheetpage::before, html[data-theme="ems"] .sheetpage::after { display: none; }
@media (max-width: 860px) { html[data-theme="ems"] .sheetpage { padding: 0 16px; } }
html[data-theme="ems"] .foot-in { padding-left: 28px; }
html[data-theme="ems"] .brand small { font-family: var(--f-ui); font-weight: 600; font-size: 13px; letter-spacing: 0; color: var(--teal); margin-left: 8px; padding: 2px 7px; border: 1px solid currentColor; border-radius: 3px; vertical-align: 4px; }
html[data-theme="ems"] .ticks li::before { background: var(--teal); }
html[data-theme="ems"] .price, html[data-theme="ems"] .ems-item { box-shadow: 0 1px 2px rgba(20,32,57,.06), 0 8px 24px -12px rgba(20,32,57,.18); border: 1px solid var(--line); border-radius: 6px; }
html[data-theme="ems"] .price .amount b { font-family: var(--f-read); font-size: 56px; font-weight: 600; letter-spacing: -0.02em; }
html[data-theme="ems"] .who .sig { font-family: var(--f-read); font-style: italic; font-weight: 500; font-size: 22px; transform: none; color: var(--ink); }
html[data-theme="ems"] .hero h1 { font-size: 54px; }
@media (max-width: 860px) { html[data-theme="ems"] .hero h1 { font-size: 36px; } }

/* Hero: one EMS item, answered, with the time it took */
.ems-item { background: var(--surface); padding: 22px 26px 20px; }
.ems-item .meta { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--muted); padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.ems-item .meta b { color: var(--ink); font-weight: 600; }
.ems-item .stem { font-family: var(--f-read); font-size: 18px; line-height: 1.55; margin: 16px 0 14px; }
.ems-item ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ems-item li { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 4px; font-size: 16px; }
.ems-item li span:first-child { font-weight: 700; color: var(--muted); }
.ems-item li.ok { border-color: var(--teal); background: var(--teal-soft); }
.ems-item li.ok span:first-child, .ems-item li.ok em { color: var(--teal); }
.ems-item li em { font-style: normal; font-size: 13.5px; font-weight: 600; }
.ems-item .why { margin-top: 14px; font-size: 15px; color: var(--ink-2); }
.ems-item .clock { margin-top: 14px; }
.ems-item .clock .bar { height: 6px; border-radius: 3px; background: var(--line-soft); position: relative; overflow: hidden; }
.ems-item .clock .bar i { position: absolute; inset: 0 auto 0 0; background: var(--teal); border-radius: 3px; }
.ems-item .clock .bar s { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }
.ems-item .clock p { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--muted); margin-top: 6px; }

/* The test day, to scale */
.day { margin-top: 40px; }
.day .half { margin-top: 18px; }
.day .half > p { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.day .strip { display: flex; gap: 3px; }
.day .seg { flex: var(--m) 1 0; min-width: 0; background: var(--g); color: #fff; border-radius: 3px; padding: 10px 8px 9px; min-height: 92px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.day .seg b { font-size: 13.5px; line-height: 1.25; font-weight: 600; }
.day .seg span { font-size: 12.5px; opacity: .85; }
.day .seg.thin b { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12.5px; }
.day .legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px; font-size: 14.5px; color: var(--ink-2); }
.day .legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; background: var(--g); margin-right: 7px; vertical-align: -1px; }
@media (max-width: 760px) {
  .day .strip { flex-direction: column; }
  .day .seg { flex: none; min-height: 0; flex-direction: row; align-items: baseline; padding: 8px 10px; height: calc(var(--m) * 1.6px + 26px); }
  .day .seg.thin b { writing-mode: horizontal-tb; transform: none; }
}
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 36px; }
.facts div { border-top: 2px solid var(--ink); padding-top: 12px; }
.facts b { display: block; font-family: var(--f-read); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
.facts span { font-size: 15px; color: var(--ink-2); }
@media (max-width: 760px) { .facts { grid-template-columns: 1fr; } }

/* Task groups */
.groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 36px; }
.groups section { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; border-top: 4px solid var(--g); padding: 18px 22px 20px; }
.groups h3 { font-size: 20px; }
.groups dl { margin: 12px 0 0; }
.groups dt { font-weight: 600; margin-top: 10px; display: flex; justify-content: space-between; gap: 10px; }
.groups dt small { font-weight: 400; color: var(--muted); font-size: 14px; white-space: nowrap; }
.groups dd { margin: 2px 0 0; color: var(--ink-2); font-size: 15.5px; }
@media (max-width: 760px) { .groups { grid-template-columns: 1fr; } }

/* Progress report mock */
.report { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 20px 22px; }
.report h3 { font-size: 18px; }
.report .sub { font-size: 14px; color: var(--muted); margin-top: 2px; }
.report .r { display: grid; grid-template-columns: 1fr 120px 36px; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 14.5px; }
.report .r:last-child { border-bottom: 0; }
.report .r .b { height: 8px; background: var(--line-soft); border-radius: 4px; position: relative; }
.report .r .b i { position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--g, var(--teal)); border-radius: 4px; }
.report .r b { text-align: right; font-variant-numeric: tabular-nums; }
.report .total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; padding-top: 12px; border-top: 1.5px solid var(--ink); }
.report .total b { font-family: var(--f-read); font-size: 26px; }

/* Try it */
.try table { border-collapse: collapse; font-size: 15.5px; margin: 6px 0 14px; font-variant-numeric: tabular-nums; }
.try th, .try td { padding: 6px 14px 6px 0; border-bottom: 1px solid var(--line-soft); text-align: left; }
.try th { font-weight: 600; border-bottom: 1.5px solid var(--ink); }
.try td + td, .try th + th { text-align: right; }
.try .opts { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 14px; }
.try .opts label { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 4px; cursor: pointer; }
.try .opts input { accent-color: var(--blue); }
html[data-theme="ems"] .try { border-radius: 6px; }
html[data-theme="ems"] .try .fb { color: var(--wrong); }
html[data-theme="ems"] .try .fb.ok { color: var(--teal); font-weight: 600; }

/* ---------- Direction A "Testheft": navy band hero, tinted test-day band ---------- */
.bleed { background: var(--bg); box-shadow: 0 0 0 100vmax var(--bg); clip-path: inset(0 -100vmax); }
html[data-theme="ems"] { overflow-x: clip; --navy: #142039; --navy-2: #C9D3E6; --navy-3: #93A1BC; --mint: #7FD3C3; --band: #EEF2F7; }
html[data-theme="ems"] .hero { --bg: var(--navy); color: #fff; padding: 72px 0 88px; }
html[data-theme="ems"] .hero h1 { color: #fff; font-size: 64px; }
html[data-theme="ems"] .hero .lead { color: var(--navy-2); }
html[data-theme="ems"] .hero .fine { color: var(--navy-3); }
html[data-theme="ems"] .hero .cta > a:not(.btn) { color: #fff; }
html[data-theme="ems"] .hero .btn.primary, html[data-theme="ems"] .closing .btn.primary { background: #fff; border-color: #fff; color: var(--navy); }
html[data-theme="ems"] .hero .btn.primary:hover, html[data-theme="ems"] .closing .btn.primary:hover { background: var(--band); }
html[data-theme="ems"] .hero .kick { display: block; font-size: 15px; color: var(--mint); font-weight: 600; margin-bottom: 18px; }
html[data-theme="ems"] .hero .ems-item { position: relative; color: var(--ink); border: 0; box-shadow: 0 30px 60px -20px rgba(0,0,0,.55); transform: rotate(1.2deg); }
html[data-theme="ems"] .hero .ems-item::before { content: "Testheft A"; position: absolute; top: -30px; right: 0; font-size: 13px; color: var(--navy-3); }
html[data-theme="ems"] section.block.bleed { --bg: var(--band); border-top: 0; }
html[data-theme="ems"] section.block.bleed + section.block { border-top: 0; }
html[data-theme="ems"] section.block h2 { font-size: 40px; }
html[data-theme="ems"] .groups section { border-top-width: 6px; }
html[data-theme="ems"] #preis .price { border: 2px solid var(--navy); }
html[data-theme="ems"] .closing { --bg: var(--navy); color: #fff; padding: 64px 0; display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: center; justify-content: space-between; }
html[data-theme="ems"] .closing h2 { color: #fff; font-size: 36px; max-width: 18ch; }
html[data-theme="ems"] .closing p { color: var(--navy-2); margin-top: 8px; }
@media (max-width: 860px) {
  html[data-theme="ems"] .hero { padding: 40px 0 56px; }
  html[data-theme="ems"] .hero h1 { font-size: 40px; }
  html[data-theme="ems"] .hero .ems-item { transform: none; }
  html[data-theme="ems"] section.block h2, html[data-theme="ems"] .closing h2 { font-size: 30px; }
}
html[data-theme="ems"] .kurz li::before { color: var(--teal); }
/* EMS guide pages and the Prozentrang-Rechner */
.ems-calc { margin-top: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; max-width: 640px; }
.ems-calc table { width: 100%; border-collapse: collapse; }
.ems-calc td, .ems-calc th { padding: 6px 8px 6px 0; text-align: left; border-bottom: 1px solid var(--line-soft); font-size: 15.5px; }
.ems-calc th { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.ems-calc .r { text-align: right; font-variant-numeric: tabular-nums; }
.ems-calc .gin { width: 64px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; font: inherit; font-family: var(--f-ui); font-size: 16px; color: var(--ink); background: var(--surface); font-variant-numeric: tabular-nums; }
.ems-calc .gin::placeholder { color: var(--muted); opacity: .55; }
.ems-calc .gin[aria-invalid="true"] { border-color: var(--wrong); }
.ems-calc .calc-out { margin-top: 14px; padding-top: 14px; border-top: 1.5px solid var(--ink); }
.ems-calc .calc-out ul { margin-top: 6px; }
.ems-res b { display: block; font-family: var(--f-read); font-size: 32px; font-weight: 600; color: var(--ink); line-height: 1.15; }
.ems-res span { color: var(--muted); font-size: 15px; }
.ems-calc .warn { color: var(--wrong); }
