@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-style: normal; font-display: swap; src: url("/vendor/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-style: normal; font-display: swap; src: url("/vendor/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("/vendor/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 600; font-style: normal; font-display: swap; src: url("/vendor/fonts/jetbrains-mono-latin-600-normal.woff2") format("woff2"); }

:root {
  --font-ui: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-code: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --bg: #E9EFEE;
  --surface: #FFFFFF;
  --surface-2: #F4F8F7;
  --ink: #1B2B2A;
  --muted: #536968;
  --line: #D0DBD9;
  --accent: #226B74;
  --accent-ink: #FFFFFF;
  --accent-soft: #DAEDEF;
  --ok: #276E47;
  --ok-soft: #DCF0E4;
  --bad: #A23A2A;
  --bad-soft: #F8E4DF;
  --warn: #7E5300;
  --warn-soft: #F7EBCD;
  --focus: #0B5FD0;

  --c-var: #226B74;
  --c-object: #5A6B7B;
  --c-array: #2E6FA3;
  --c-instance: #A8651A;
  --c-class: #7452B0;

  --shadow: 0 1px 2px rgba(20, 40, 40, .06), 0 6px 20px rgba(20, 40, 40, .05);
  --radius: 14px;
  --gap: 16px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #111819;
  --surface: #1A2425;
  --surface-2: #213031;
  --ink: #E4EEEC;
  --muted: #9DB2B0;
  --line: #2E4143;
  --accent: #6FC1C9;
  --accent-ink: #0E2123;
  --accent-soft: #23454A;
  --ok: #7BD0A1;
  --ok-soft: #1F3E2E;
  --bad: #F29A88;
  --bad-soft: #442620;
  --warn: #E6BE6A;
  --warn-soft: #3F3217;
  --focus: #7DB4FF;

  --c-var: #6FC1C9;
  --c-object: #9DB0C2;
  --c-array: #7DB5E8;
  --c-instance: #E2A458;
  --c-class: #B79AE6;

  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

html { font-size: 18px; }
html[data-size="l"] { font-size: 20px; }
html[data-size="xl"] { font-size: 22px; }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.6;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { line-height: 1.25; margin: 0; }
p { margin: 0 0 .9em; }
code, pre, kbd { font-family: var(--font-code); }
code { font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: .05em .35em; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.spacer { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

.btn {
  font: inherit; font-size: .9rem; font-weight: 700;
  min-height: 44px; padding: .45em 1em;
  border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  transition: background-color .15s, border-color .15s;
}
.btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.small { min-height: 36px; font-size: .8rem; padding: .25em .75em; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover:not(:disabled) { border-color: var(--line); background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.08); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
:root[data-theme="dark"] .btn.danger { color: #2a0f0a; }
.kbd { font-family: var(--font-code); font-size: .7rem; font-weight: 400; opacity: .85; border: 1px solid currentColor; border-radius: 5px; padding: 0 .35em; }

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px;
}
.topbar-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.topbar-title h1 { font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { display: flex; align-items: center; gap: 10px; }
.progress-track { width: 140px; height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .4s ease; }

.layout {
  display: grid;
  grid-template-columns: minmax(340px, 36%) minmax(0, 1fr);
  gap: var(--gap);
  padding: 0 16px 16px;
  min-height: 0;
}
.pane { min-height: 0; min-width: 0; }
.pane-left { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.pane-right { display: grid; grid-template-rows: minmax(250px, 1fr) minmax(250px, 44%); gap: var(--gap); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-height: 0; min-width: 0; overflow: hidden; display: flex; flex-direction: column; }

.tabs { display: flex; gap: 4px; padding: 8px 8px 0; border-bottom: 1px solid var(--line); background: var(--surface-2); flex: none; }
.tab {
  font: inherit; font-weight: 700; font-size: .92rem; color: var(--muted);
  background: transparent; border: 0; border-bottom: 4px solid transparent;
  padding: .55em .9em .5em; min-height: 44px; cursor: pointer; border-radius: 8px 8px 0 0;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); background: var(--surface); }
.small-tabs .tab { font-size: .85rem; min-height: 40px; }
.small-tabs .expand { margin-left: auto; align-self: center; margin-bottom: 4px; }
.pane-right.is-expanded { grid-template-rows: minmax(150px, 30%) minmax(0, 1fr); }
.badge { display: inline-block; min-width: 1.5em; text-align: center; font-size: .72rem; padding: 0 .4em; border-radius: 99px; background: var(--line); color: var(--ink); margin-left: .25em; vertical-align: 1px; }
.badge:empty { display: none; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }

.pane-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.tab-panel { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 26px 28px; }
.tab-panel.tutor { display: flex; flex-direction: column; padding: 14px 16px 12px; overflow: hidden; }
.tab-panel[hidden] { display: none; }

.prose { max-width: 62ch; }
.prose h2 { font-size: 1.35rem; margin: 0 0 .7em; }
.prose h3 { font-size: 1.1rem; margin: 1.3em 0 .5em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .4em; }
.prose pre { margin: 0 0 1em; }
pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: .8em 1em; overflow-x: auto; font-size: .85rem; line-height: 1.6; }
pre code { background: none; border: 0; padding: 0; font-size: inherit; }

.table-wrap { overflow-x: auto; margin: 0 0 1.1em; border: 1px solid var(--line); border-radius: 10px; }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.table-wrap th, .table-wrap td { text-align: left; padding: .45em .8em; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap th { background: var(--surface-2); font-weight: 700; }
.table-wrap tr:last-child td { border-bottom: 0; }

.codeblock { margin: 0 0 1.1em; }
.codeblock pre { margin: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.codeblock-bar { display: flex; justify-content: flex-end; padding: 6px 8px; background: var(--surface-2); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; }
.try-out { margin-top: 8px; border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; background: var(--surface); }
.try-label { font-size: .75rem; color: var(--muted); margin-bottom: 4px; }

.callout { border-left: 5px solid var(--accent); background: var(--accent-soft); border-radius: 4px 10px 10px 4px; padding: .8em 1em .3em; margin: 0 0 1.2em; }
.callout-title { font-weight: 700; font-size: .85rem; margin-bottom: .35em; color: var(--accent); }
.callout-tipp { border-left-color: var(--warn); background: var(--warn-soft); margin-top: 14px; }
.callout-tipp .callout-title { color: var(--warn); }
.next-hint { margin-top: 28px; }
.tip-box { margin-top: 24px; }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: none; }
.quick .btn { font-size: .82rem; }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; margin: 12px 0; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.msg { max-width: 92%; padding: .6em .9em .1em; border-radius: 14px; font-size: .95rem; }
.msg p, .msg ul, .msg ol, .msg pre { margin-bottom: .6em; }
.msg-user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.msg-user code { color: var(--ink); }
.msg-bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg-hint { align-self: stretch; max-width: none; color: var(--muted); background: transparent; padding-left: 0; }
.msg-error { align-self: stretch; max-width: none; background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad); }
.typing { color: var(--muted); letter-spacing: .2em; }
.chat-form { flex: none; display: flex; flex-direction: column; gap: 8px; }
.chat-form textarea {
  font: inherit; font-size: .95rem; resize: none; width: 100%; padding: .6em .8em;
  border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
}
.chat-actions { display: flex; justify-content: space-between; gap: 8px; }
.chat-actions .primary, .chat-actions #chat-stop { margin-left: auto; }

.notice { border-radius: 10px; padding: .7em 1em; margin-bottom: 12px; font-size: .9rem; }
.notice-warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); }

.editor-bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex: none; flex-wrap: wrap; }
.file { font-family: var(--font-code); font-size: .82rem; font-weight: 600; }
.editor { flex: 1; min-height: 0; }
.run { min-width: 12em; }
#save-state.is-error { color: var(--bad); font-weight: 700; }

.nextstep { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex: none; flex-wrap: wrap; }
.nextstep .ns-text { flex: 1; min-width: 14em; }
.nextstep.is-info { background: var(--accent-soft); }
.nextstep.is-progress { background: var(--warn-soft); }
.nextstep.is-success { background: var(--ok-soft); }
.nextstep.is-error { background: var(--bad-soft); }
.results-body { flex: 1; min-height: 0; position: relative; overflow: hidden; display: flex; }
.rtab-panel { flex: 1; min-width: 0; overflow: auto; padding: 14px 16px 18px; }
.rtab-panel#rtab-diagramm { padding: 10px 12px 14px; }

.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty p { margin-bottom: .5em; }

.tests { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.test { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); }
.test-icon { font-weight: 700; width: 1.6em; height: 1.6em; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: .9rem; margin-top: .1em; }
.test.is-ok { background: var(--surface); }
.test.is-ok .test-icon { background: var(--ok-soft); color: var(--ok); }
.test.is-ok .test-name { color: var(--muted); }
.test.is-fail { background: var(--bad-soft); border-color: var(--bad); }
.test.is-fail .test-icon { background: var(--bad); color: #fff; }
:root[data-theme="dark"] .test.is-fail .test-icon { color: #2a0f0a; }
.test-name { font-weight: 700; font-size: .95rem; }
.test-msg { margin-top: 4px; font-size: .9rem; }
.test-hint { margin-top: 6px; font-size: .88rem; color: var(--ink); background: var(--surface); border-radius: 8px; padding: .35em .7em; }

.console { font-family: var(--font-code); font-size: .85rem; display: flex; flex-direction: column; gap: 2px; }
.log { padding: 3px 10px; border-left: 3px solid var(--line); white-space: pre-wrap; word-break: break-word; }
.log-warn { border-left-color: var(--warn); background: var(--warn-soft); }
.log-error { border-left-color: var(--bad); background: var(--bad-soft); }
.log-muted { color: var(--muted); }
.errorcard { border: 1.5px solid var(--bad); background: var(--bad-soft); border-radius: 12px; padding: 12px 16px; margin-bottom: 12px; }
.errorcard-title { font-weight: 700; color: var(--bad); margin-bottom: 4px; }
.errorcard-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.errorcard details { font-size: .8rem; color: var(--muted); }

.dg-scroll { overflow: auto; max-width: 100%; }
.dg-canvas { position: relative; display: inline-block; min-width: 100%; padding: 10px 14px 18px; }
.dg-arrows { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; z-index: 2; }
.dg-cols { position: relative; z-index: 1; display: flex; align-items: flex-start; gap: 72px; }
.dg-col { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.dg-col-vars { gap: 10px; }
.dg-coltitle { font-size: .78rem; font-weight: 700; color: var(--muted); }

.dg-path { fill: none; stroke-width: 2; stroke: var(--c-object); opacity: .9; transition: opacity .15s, stroke-width .15s; }
.dg-path-ref { stroke: var(--accent); }
.dg-path-isa { stroke: var(--c-instance); stroke-dasharray: 6 5; }
.dg-path-inherit { stroke: var(--c-class); stroke-width: 3.5; }
.dg-marker { stroke: none; }
.dg-marker-ref { fill: var(--accent); }
.dg-marker-isa { fill: var(--c-instance); }
.dg-marker-inherit { fill: var(--c-class); }
.is-hovering .dg-path { opacity: .15; }
.is-hovering .dg-path.is-active { opacity: 1; stroke-width: 3; }

.dg-var, .dg-node { font-family: var(--font-code); font-size: .8rem; background: var(--surface); border-radius: 10px; }
.dg-var { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 2px solid var(--c-var); min-width: 11em; }
.dg-kindchip { font-size: .7rem; color: var(--c-var); border: 1px solid var(--c-var); border-radius: 5px; padding: 0 .35em; }
.dg-name { font-weight: 600; }
.dg-var .dg-val, .dg-var .dg-port { margin-left: auto; }

.dg-node { min-width: 12em; max-width: 22em; border: 2px solid var(--c-object); overflow: hidden; }
.dg-node:focus-visible { outline-offset: 3px; }
.dg-object { --c: var(--c-object); }
.dg-array, .dg-map, .dg-set { --c: var(--c-array); border-color: var(--c-array); }
.dg-instance { --c: var(--c-instance); border-color: var(--c-instance); }
.dg-class { --c: var(--c-class); border-color: var(--c-class); border-width: 3px; }
.dg-other { --c: var(--c-object); }
.dg-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--c, var(--c-object)); color: var(--surface); }
.dg-badge { font-size: .68rem; font-weight: 600; border: 1px solid currentColor; border-radius: 5px; padding: 0 .35em; }
.dg-title { font-weight: 600; }
.dg-row { display: flex; align-items: center; gap: 10px; padding: 4px 10px; border-top: 1px solid var(--line); }
.dg-key { color: var(--muted); white-space: nowrap; }
.dg-row .dg-val, .dg-row .dg-port { margin-left: auto; }
.dg-link { background: var(--surface-2); }
.dg-ref { font-weight: 600; }
.dg-more { color: var(--muted); font-style: italic; }
.dg-private { color: var(--muted); }
.dg-hidden { font-style: italic; }
.dg-string { color: var(--ok); }
.dg-number { color: var(--c-array); }
.dg-boolean { color: var(--c-class); }
.dg-null, .dg-undefined, .dg-more { color: var(--muted); }
.dg-fn { color: var(--c-instance); }
.dg-arrowlabel { color: var(--muted); }
.dg-port { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--accent); flex: none; }
.dg-port[data-type="isa"] { background: var(--c-instance); box-shadow: 0 0 0 1px var(--c-instance); }
.dg-port[data-type="inherit"] { background: var(--c-class); box-shadow: 0 0 0 1px var(--c-class); }
.dg-list { display: flex; flex-wrap: wrap; gap: 5px; padding: 6px 10px; border-top: 1px solid var(--line); align-items: center; }
.dg-list-title { font-size: .7rem; color: var(--muted); width: 100%; }
.dg-chip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 .4em; }
.dg-legend { margin: 8px 4px 0; }

dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 0; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
dialog::backdrop { background: rgba(10, 20, 20, .5); }
.modal { width: min(30rem, 92vw); padding: 22px 24px; }
.modal h2 { font-size: 1.2rem; margin-bottom: .6em; }
.modal fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 14px; padding: 8px 14px 10px; }
.modal legend { font-weight: 700; font-size: .85rem; padding: 0 6px; }
.modal label { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
.modal input[type="radio"] { width: 20px; height: 20px; accent-color: var(--accent); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

.drawer { margin: 0 auto 0 0; height: 100vh; max-height: 100vh; width: min(26rem, 94vw); border-radius: 0 var(--radius) var(--radius) 0; padding: 0; overflow: auto; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 8px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.drawer-head h2 { font-size: 1.15rem; }
.lesson-list { list-style: none; margin: 0; padding: 4px 10px 16px; display: flex; flex-direction: column; gap: 4px; }
.lesson-item { width: 100%; text-align: left; font: inherit; display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1.5px solid transparent; background: transparent; color: var(--ink); cursor: pointer; }
.lesson-item:hover { background: var(--surface-2); }
.lesson-item.is-current { border-color: var(--accent); background: var(--accent-soft); }
.lesson-status { width: 1.6em; height: 1.6em; flex: none; display: grid; place-items: center; font-weight: 700; color: var(--ok); margin-top: .1em; }
.lesson-text { display: flex; flex-direction: column; }
.lesson-name { font-weight: 700; }
.lesson-meta { font-size: .8rem; color: var(--muted); line-height: 1.4; }
#lesson-problems { padding: 0 18px 16px; }

.fatal { max-width: 36rem; margin: 12vh auto; padding: 0 20px; }

a.btn { text-decoration: none; }
.icon-btn svg { display: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.account { display: flex; align-items: center; }
.login svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.login-short { display: none; }
.account-btn { gap: .55em; padding-left: .4em; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: .78rem; font-weight: 700; letter-spacing: .02em; flex: none; }
.account-name { max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 16px; }
.danger-zone { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; margin-bottom: 8px; }
.danger-zone summary { cursor: pointer; font-weight: 700; color: var(--bad); min-height: 32px; display: flex; align-items: center; }
.danger-zone .btn { margin: 4px 0 8px; }
.notice-info { background: var(--accent-soft); color: var(--ink); border: 1px solid var(--accent); }
.notice-info p { margin-bottom: .6em; }
.guest-note { margin: 0 18px 8px; padding: .6em .8em; border-radius: 10px; background: var(--accent-soft); line-height: 1.5; }
.guest-note a { color: var(--accent); font-weight: 700; }
.toast { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 60; max-width: min(34rem, calc(100vw - 24px)); padding: .7em 1.1em; border-radius: 12px; background: var(--surface); color: var(--ink); border: 1.5px solid var(--accent); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font-size: .92rem; }
.toast-error { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }

.mobile-nav { display: none; }

@media (max-width: 999px) {
  html, body { height: 100%; height: 100dvh; }
  body { grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }

  .topbar { position: relative; gap: 8px; padding: 8px 10px 10px; padding-top: max(8px, env(safe-area-inset-top)); }
  .topbar .btn { min-height: 40px; padding: .3em .7em; font-size: .82rem; }
  .topbar-title h1 { font-size: 1.02rem; }
  .topbar-title #lesson-counter { font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .login-long, .account-name { display: none; }
  .login-short { display: inline; }
  .account-btn { padding: .2em; min-height: 40px; }
  .progress { position: absolute; left: 0; right: 0; bottom: 0; gap: 0; }
  .progress-track { width: 100%; height: 3px; border-radius: 0; background: transparent; }
  .progress-fill { border-radius: 0; }
  #progress-text { display: none; }

  .layout { display: block; padding: 0 8px 8px; overflow: hidden; }
  .pane-left, .pane-right { height: 100%; }
  .pane-right { display: flex; flex-direction: column; gap: 0; }
  .pane-right .card { flex: 1; }
  body[data-view="lernen"] .pane-right,
  body[data-view="code"] .pane-left,
  body[data-view="code"] .results-card,
  body[data-view="ergebnis"] .pane-left,
  body[data-view="ergebnis"] .editor-card { display: none; }

  .tabs { padding: 6px 6px 0; overflow-x: auto; scrollbar-width: none; }
  .tab { padding: .5em .75em .45em; font-size: .88rem; white-space: nowrap; }
  .tab-panel { padding: 16px 16px 24px; }
  .tab-panel.tutor { padding: 12px; }
  .prose h2 { font-size: 1.2rem; }

  .editor-bar { gap: 8px; padding: 6px 8px; flex-wrap: nowrap; }
  .editor-bar .file { display: none; }
  .editor-bar .long-label, .run .kbd { display: none; }
  .run { min-width: 0; }
  #save-state { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

  .expand { display: none; }
  .nextstep { padding: 10px 12px; gap: 8px; flex-direction: column; align-items: flex-start; }
  .nextstep .ns-text { min-width: 0; font-size: .92rem; }
  .nextstep .btn { min-height: 38px; font-size: .82rem; }
  .rtab-panel { padding: 12px; }

  .mobile-nav {
    display: grid; grid-template-columns: repeat(3, 1fr);
    background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mn-btn {
    font: inherit; font-size: .78rem; font-weight: 700; color: var(--muted);
    background: transparent; border: 0; cursor: pointer;
    min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    position: relative;
  }
  .mn-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .mn-btn[aria-pressed="true"] { color: var(--accent); }
  .mn-btn[aria-pressed="true"]::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
  .mn-btn .badge { position: absolute; top: 6px; left: calc(50% + 8px); margin: 0; }

  .modal { width: calc(100vw - 16px); max-width: 30rem; padding: 18px; }
  .drawer { width: 100vw; border-radius: 0; }
  .quick .btn { font-size: .78rem; padding: .35em .5em; }
}

@media (max-width: 600px) {
  .icon-btn svg { display: block; }
  .icon-btn .btn-label { display: none; }
  .topbar .icon-btn { padding: .3em .45em; min-width: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
