/* Englisch-Desktop – Stile */

  * { box-sizing: border-box; }
  html, body { margin: 0; height: 100%; overflow: hidden; }
  body {
    background: #008080;
    font-family: Tahoma, "MS Sans Serif", "Segoe UI", Arial, sans-serif;
    font-size: 12px; color: #000;
    -webkit-font-smoothing: none;
    user-select: none;
  }
  /* ---------- Win98 bevels ---------- */
  .raised { background: #c0c0c0; box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px #808080, inset 2px 2px #dfdfdf; }
  .sunken { background: #fff; box-shadow: inset -1px -1px #fff, inset 1px 1px #808080, inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a; }
  .btn {
    font: inherit; min-width: 75px; padding: 4px 10px; border: 0; cursor: pointer;
    background: #c0c0c0; box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px #808080, inset 2px 2px #dfdfdf;
  }
  .btn:active, .btn.pressed { box-shadow: inset -1px -1px #fff, inset 1px 1px #0a0a0a, inset -2px -2px #dfdfdf, inset 2px 2px #808080; padding: 5px 9px 3px 11px; }
  .btn:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }

  /* ---------- Desktop ---------- */
  #desktop { position: absolute; inset: 0 0 30px 0; }
  #icons { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; flex-wrap: wrap; gap: 14px; max-height: calc(100% - 16px); }
  .icon {
    width: 78px; display: flex; flex-direction: column; align-items: center; gap: 4px;
    cursor: pointer; padding: 2px; border: 0; background: none; font: inherit;
  }
  .icon svg { width: 32px; height: 32px; image-rendering: pixelated; }
  .icon span { color: #fff; text-align: center; line-height: 1.25; padding: 1px 2px; overflow-wrap: anywhere; hyphens: auto; }
  .icon:focus { outline: none; }
  .icon.selected span, .icon:focus-visible span { background: #000080; outline: 1px dotted #ff0; }
  .icon.selected svg { filter: brightness(.6) sepia(1) hue-rotate(190deg) saturate(4); }
  .explorer .icon { width: 92px; }
  .explorer .icon span { color: #000; }
  .explorer .icon.selected span { color: #fff; }

  /* ---------- Windows ---------- */
  .window { position: absolute; padding: 3px; display: flex; flex-direction: column; min-width: 260px; min-height: 120px; }
  .titlebar {
    display: flex; align-items: center; gap: 4px; padding: 2px 2px 2px 3px; height: 20px;
    background: linear-gradient(90deg, #808080, #b5b5b5); color: #dfdfdf; font-weight: bold; cursor: default; touch-action: none;
  }
  .window.active .titlebar { background: linear-gradient(90deg, #000080, #1084d0); color: #fff; }
  .titlebar svg { width: 16px; height: 16px; flex: none; }
  .titlebar .t { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tbtn { width: 16px; height: 14px; padding: 0; border: 0; display: grid; place-items: center; cursor: pointer;
    background: #c0c0c0; box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px #808080, inset 2px 2px #dfdfdf; }
  .tbtn:active { box-shadow: inset -1px -1px #fff, inset 1px 1px #0a0a0a, inset -2px -2px #dfdfdf, inset 2px 2px #808080; }
  .tbtn svg { width: 8px; height: 7px; }
  .tbtn + .tbtn.close { margin-left: 2px; }
  .menubar { display: flex; gap: 2px; padding: 2px 0; }
  .menubar span { padding: 1px 6px; }
  .menubar span u { text-decoration: underline; }
  .addr { display: flex; align-items: center; gap: 6px; padding: 2px 2px 4px; }
  .addr .field { flex: 1; padding: 3px 4px; display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; }
  .addr .field svg { width: 16px; height: 16px; }
  .body { flex: 1; overflow: auto; margin: 0 1px; }
  .statusbar { display: flex; gap: 2px; margin-top: 2px; }
  .statusbar div { padding: 2px 4px; flex: 1; box-shadow: inset -1px -1px #fff, inset 1px 1px #808080; }
  .explorer .body { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 10px; padding: 10px; }
  .window.maximized { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; }
  .window.minimized { display: none; }

  /* Notepad */
  .notepad { padding: 6px 8px; font-family: "Courier New", monospace; font-size: 13px; white-space: pre-wrap; user-select: text; line-height: 1.4; }

  /* Dialog */
  .dialog .body { background: #c0c0c0; box-shadow: none; display: flex; gap: 14px; padding: 14px 12px 6px; align-items: flex-start; }
  .dialog .body svg { width: 32px; height: 32px; flex: none; }
  .dialog .actions { display: flex; justify-content: center; gap: 6px; padding: 8px 0 6px; }

  /* H5P demo */
  .h5p { background: #fff; padding: 0; user-select: text; font-family: "Open Sans", Arial, sans-serif; font-size: 14px; }
  .h5p-note { background: #ffffe1; border-bottom: 1px solid #808080; padding: 6px 10px; font-family: Tahoma, Arial, sans-serif; font-size: 12px; }
  .h5p-inner { padding: 18px 20px; }
  .h5p-inner h3 { margin: 0 0 4px; font-size: 17px; color: #1a73d9; }
  .h5p-inner p.task { margin: 0 0 14px; color: #555; }
  .h5p-q { margin: 10px 0; line-height: 2; }
  .h5p-q input { font: inherit; width: 110px; padding: 2px 6px; border: 0; border-bottom: 2px solid #1a73d9; background: #f2f6fc; outline: none; }
  .h5p-q input.ok { border-color: #2a8a35; background: #e3f5e5; }
  .h5p-q input.bad { border-color: #c62828; background: #fbe6e6; }
  .h5p-q .sol { color: #2a8a35; font-weight: 600; margin-left: 4px; }
  .h5p-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid #e3e3e3; padding: 12px 20px; }
  .h5p-btn { font: inherit; font-size: 13px; border: 0; border-radius: 16px; padding: 7px 16px; color: #fff; background: #1a73d9; cursor: pointer; }
  .h5p-btn.sec { background: #fff; color: #1a73d9; box-shadow: inset 0 0 0 1px #1a73d9; }
  .h5p-score { margin-left: auto; display: flex; align-items: center; gap: 8px; font-weight: 600; }
  .h5p-bar { width: 120px; height: 10px; border-radius: 5px; background: #e5e5e5; overflow: hidden; }
  .h5p-bar i { display: block; height: 100%; width: 0; background: #2a8a35; transition: width .4s; }


  /* Übungen */
  .ex { background: #c0c0c0; box-shadow: none; padding: 0; display: flex; flex-direction: column; }
  .ex-setup { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
  .ex-head { display: flex; gap: 12px; align-items: flex-start; line-height: 1.5; }
  .ex-head svg { width: 32px; height: 32px; flex: none; }
  fieldset { border: 0; margin: 0; padding: 10px 12px 8px; box-shadow: inset -1px -1px #fff, inset 1px 1px #808080, inset -2px -2px #808080, inset 2px 2px #fff; display: flex; flex-direction: column; gap: 6px; }
  legend { padding: 0 3px; }
  fieldset label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
  .dim { color: #555; }
  .ex-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding-top: 6px; }
  .btn.small { min-width: 0; padding: 2px 8px; }
  .ex-bar { display: flex; align-items: center; gap: 16px; padding: 5px 8px; border-bottom: 1px solid #808080; box-shadow: 0 1px #fff; }
  .ex-bar .quit { margin-left: auto; }
  .m-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px; overflow: auto; }
  .m-grid .col { display: flex; flex-direction: column; gap: 8px; }
  .card { font: inherit; font-size: 13px; text-align: left; padding: 8px 10px; min-height: 40px; border: 0; cursor: pointer; background: #fff;
    box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px #808080, inset 2px 2px #dfdfdf; }
  .card.sel { background: #000080; color: #fff; }
  .card.bad { background: #c00; color: #fff; animation: shake .3s; }
  .card.done { background: #b8f0b8; color: #005a00; font-weight: bold; cursor: default; box-shadow: inset 0 0 0 2px #2a8a35; animation: pop .35s; }
  .card.done::before { content: "✔ "; }
  @keyframes pop { 0% { background: #2a8a35; color: #fff; transform: scale(1); } 40% { transform: scale(1.04); } 100% { transform: scale(1); } }
  @keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
  .w-box { padding: 18px 22px; display: flex; flex-direction: column; gap: 10px; }
  .w-prompt { font-size: 19px; font-weight: bold; line-height: 1.35; user-select: text; }
  .w-in { font: inherit; font-size: 16px; padding: 6px 8px; border: 0; outline: none; user-select: text; }
  .w-fb { min-height: 40px; line-height: 1.5; font-size: 14px; user-select: text; }
  .w-fb.ok { color: #006400; } .w-fb.no { color: #a00000; }
  .ex-end { padding: 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; overflow: auto; }
  .ex-end svg { width: 32px; height: 32px; }
  .ex-end h2 { margin: 4px 0; font-size: 20px; }
  .w-list { text-align: left; background: #fff; padding: 8px 8px 8px 26px; margin: 4px 0; max-width: 100%; box-shadow: inset 1px 1px #808080, inset -1px -1px #fff; user-select: text; }
  .w-list li { margin: 3px 0; }
  .inv-wrap.playing { background: #000; align-items: center; justify-content: center; }
  .inv-wrap canvas { image-rendering: pixelated; outline: none; touch-action: none; display: block; }
  .inv-wrap .ex-setup { background: #c0c0c0; align-self: stretch; flex: 1; }
  .lv table { width: 100%; border-collapse: collapse; user-select: text; }
  .lv th { position: sticky; top: 0; text-align: left; font-weight: normal; padding: 3px 6px; background: #c0c0c0; box-shadow: inset -1px -1px #808080, inset 1px 1px #fff; }
  .lv td { padding: 3px 6px; vertical-align: top; border-bottom: 1px dotted #c0c0c0; }
  .lv td:first-child { color: #808080; width: 34px; }
  .lv tr.c td:nth-child(2) { color: #00008b; }
  .lv tr.sec td { background: #000080; color: #fff; font-weight: bold; }

  /* ---------- Taskbar ---------- */
  #taskbar { position: absolute; left: 0; right: 0; bottom: 0; height: 30px; display: flex; align-items: center; gap: 4px; padding: 2px 2px 2px 2px; z-index: 100000;
    background: #c0c0c0; box-shadow: inset 0 1px #dfdfdf, inset 0 2px #fff; }
  #start { display: flex; align-items: center; gap: 4px; font-weight: bold; min-width: 0; height: 22px; padding: 0 6px 0 4px; }
  #start.pressed { padding: 1px 5px 0 5px; }
  #start svg { width: 18px; height: 16px; }
  #tasks { flex: 1; display: flex; gap: 3px; overflow: hidden; height: 22px; padding-left: 4px; border-left: 1px solid #808080; box-shadow: -1px 0 #fff inset; }
  .task { display: flex; align-items: center; gap: 4px; min-width: 0; max-width: 160px; flex: 1 1 160px; height: 22px; padding: 0 6px; text-align: left; overflow: hidden; white-space: nowrap; }
  .task.pressed { font-weight: bold; background-image: repeating-conic-gradient(#c0c0c0 0 25%, #fff 0 50%); background-size: 2px 2px; }
  .task svg { width: 16px; height: 16px; flex: none; }
  .task span { overflow: hidden; text-overflow: ellipsis; }
  #tray { height: 22px; display: flex; align-items: center; gap: 6px; padding: 0 10px; box-shadow: inset -1px -1px #fff, inset 1px 1px #808080; }
  #tray svg { width: 16px; height: 16px; }

  /* Start menu */
  #startmenu { position: absolute; left: 2px; bottom: 28px; display: none; padding: 3px; z-index: 100001; }
  #startmenu.open { display: flex; }
  #startmenu .side { width: 22px; background: linear-gradient(0deg, #000080, #1084d0); color: #c0c0c0; writing-mode: vertical-rl; transform: rotate(180deg); font-weight: bold; font-size: 17px; padding: 6px 0; letter-spacing: 1px; }
  #startmenu .side b { color: #fff; }
  #startmenu ul { list-style: none; margin: 0; padding: 0; min-width: 190px; }
  #startmenu li { display: flex; align-items: center; gap: 10px; padding: 6px 20px 6px 6px; cursor: pointer; }
  #startmenu li svg { width: 24px; height: 24px; }
  #startmenu li:hover { background: #000080; color: #fff; }
  #startmenu hr { border: 0; border-top: 1px solid #808080; border-bottom: 1px solid #fff; margin: 3px 2px; }

  /* Shutdown */
  #shutdown { position: fixed; inset: 0; background: #000; color: #ff8c00; display: none; place-items: center; z-index: 200000; font-size: 22px; text-align: center; font-family: Tahoma, Arial, sans-serif; cursor: pointer; }
  #shutdown small { display: block; color: #777; font-size: 13px; margin-top: 16px; }

  @media (max-width: 640px) {
    .window:not(.dialog) { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; }
    #icons { flex-direction: row; max-height: none; right: 8px; }
    .task { max-width: 110px; }
  }

  .inv-wrap.playing { background: #000 !important; }
  /* Karteikarten */
  .fc-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 6px 18px; min-height: 0; }
  .fc { width: min(100%, 520px); height: min(100%, 260px); min-height: 170px; perspective: 1200px; border: 0; padding: 0; background: none; cursor: pointer; font: inherit; color: inherit; touch-action: pan-y; }
  .fc:focus-visible { outline: none; }
  .fc:focus-visible .fc-face { box-shadow: 0 0 0 3px rgba(10,132,255,.5), 0 8px 24px rgba(0,0,0,.15); }
  .fc-inner { position: relative; width: 100%; height: 100%; transition: transform .45s cubic-bezier(.3,.7,.3,1); transform-style: preserve-3d; }
  .fc.flipped .fc-inner { transform: rotateY(180deg); }
  .fc-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px 26px; border-radius: 18px;
    backface-visibility: hidden; -webkit-backface-visibility: hidden; background: rgba(255,255,255,.92); box-shadow: 0 8px 24px rgba(0,0,0,.15), inset 0 0 0 .5px rgba(0,0,0,.06); text-align: center; }
  .fc-back { transform: rotateY(180deg); background: linear-gradient(135deg, #eaf4ff, #ffffff); }
  .fc-lang { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #6e6e73; }
  .fc-text { font-size: 21px; font-weight: 600; line-height: 1.35; }
  .fc-back .fc-text { color: #0059c7; }
  .fc-hint { font-size: 12px; color: #8e8e93; }
  .fc-act { padding: 4px 0 16px; }
  .fc-act .btn { min-width: 130px; font-size: 14px; padding: 8px 16px; }
  .fc-act .btn:active { padding: 8px 16px; }
  /* Grammatik */
  .rules { padding: 6px 16px 16px; user-select: text; line-height: 1.45; font-size: 13px; }
  .rules h3 { color: #0046d5; font-size: 15px; margin: 16px 0 6px; padding-bottom: 3px; border-bottom: 1px solid #d6d2c2; }
  .rules table { border-collapse: collapse; width: 100%; margin: 4px 0; }
  .rules th, .rules td { border: 1px solid #d6d2c2; padding: 5px 8px; text-align: left; vertical-align: top; }
  .rules th { background: #f1efe2; font-weight: bold; width: 130px; }
  .rules table.two th { width: 50%; }
  .rules p { margin: 6px 0; }
  .rules .tip { background: #ffffe1; border: 1px solid #e0d890; padding: 6px 10px; }
  .g-menu { display: flex; flex-direction: column; gap: 6px; }
  .g-item { font: inherit; font-size: 14px; display: flex; align-items: center; gap: 12px; text-align: left; padding: 9px 12px; cursor: pointer; background: #fff; border: 1px solid #7f9db9; border-radius: 4px; }
  .g-item:hover { border-color: #f8b636; box-shadow: 0 0 0 2px #fde59a; }
  .g-item span:nth-child(2) { flex: 1; font-weight: bold; }
  .g-no { width: 24px; height: 24px; border-radius: 50%; background: #316ac5; color: #fff; display: grid; place-items: center; font-weight: bold; font-size: 12px; flex: none; }
  .g-opts { display: flex; flex-direction: column; gap: 8px; }
  .g-opt:disabled { color: inherit; cursor: default; }
  .card.bad-final { background: #fbe0e0; border-color: #c00; color: #900; }
  .g-gap { line-height: 2.1; }
  .g-blank { font: inherit; font-size: 17px; font-weight: normal; width: 170px; max-width: 45vw; margin: 0 4px; padding: 1px 6px; border: 0; border-bottom: 2px solid #316ac5; background: #eef3fc; outline: none; }
  .g-blank.ok { border-color: #2a8a35; background: #e3f5e5; }
  .g-blank.bad { border-color: #c62828; background: #fbe6e6; }
  .ex-bar { flex-wrap: wrap; row-gap: 4px; }
  .ex-bar .rl { margin-left: auto; }
  .ex-bar .rl + .quit { margin-left: 0; }
  .up-btn { min-width: 0 !important; padding: 2px 8px !important; }
  .dialog .msg { white-space: pre-wrap; }
  .find { flex: 1; border: 0; padding: 3px 4px; font: inherit; }

  /* ===== macOS-26-Look mit „Liquid Glass“ (überschreibt den Grundstil) ===== */
  :root {
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Inter, Roboto, Arial, sans-serif;
    --accent: #0a84ff;
    --glass: rgba(255, 255, 255, .52);
    --glass-strong: rgba(255, 255, 255, .72);
    --edge: rgba(255, 255, 255, .65);
    --text: #1d1d1f;
    --muted: #6e6e73;
    --sep: rgba(0, 0, 0, .09);
  }
  html, body { height: 100%; }
  :root { color-scheme: light; }
  button, input, select, textarea { color: inherit; }
  .g-item, .card, .fc, .btn { color: var(--text); }
  body {
    font-family: var(--font); font-size: 13px; color: var(--text); -webkit-font-smoothing: antialiased;
    background-color: #2a1f6b;
    background-image:
      radial-gradient(ellipse 60% 55% at 12% 18%, rgba(64, 200, 255, .95), transparent 70%),
      radial-gradient(ellipse 55% 60% at 88% 12%, rgba(255, 120, 200, .85), transparent 70%),
      radial-gradient(ellipse 70% 60% at 78% 88%, rgba(255, 170, 70, .9), transparent 70%),
      radial-gradient(ellipse 65% 60% at 18% 92%, rgba(120, 90, 255, .95), transparent 70%),
      radial-gradient(ellipse 50% 45% at 50% 50%, rgba(80, 220, 190, .55), transparent 70%),
      linear-gradient(135deg, #3b2f9e, #6a3fc4 45%, #e0607e);
    background-attachment: fixed;
  }

  /* Glas-Grundmaterial */
  .glass, #menubar, #dock, #startmenu, .window {
    background: var(--glass);
    -webkit-backdrop-filter: blur(28px) saturate(185%);
    backdrop-filter: blur(28px) saturate(185%);
    border: 1px solid var(--edge);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.85), inset 0 -1px 0 rgba(255,255,255,.25), 0 10px 40px rgba(20, 10, 60, .28);
  }
  /* echte Lichtbrechung (nur Chrome/Edge) für Dock und Menüleiste */
  .refract #dock, .refract #menubar { backdrop-filter: url(#lg) blur(10px) saturate(190%); }

  .svgdefs { position: absolute; width: 0; height: 0; overflow: hidden; }
  /* Menüleiste */
  #menubar { position: absolute; top: 0; left: 0; right: 0; height: 28px; z-index: 100002; display: flex; align-items: center; gap: 2px; padding: 0 10px;
    border-width: 0 0 1px; border-radius: 0; background: rgba(255,255,255,.32); box-shadow: inset 0 -1px 0 rgba(255,255,255,.4); font-size: 13px; }
  #menubar .mi { padding: 3px 9px; border-radius: 5px; cursor: default; }
  #menubar .mi.app { font-weight: 700; }
  #menubar .mi:hover { background: rgba(255,255,255,.45); }
  #menubar .right { margin-left: auto; display: flex; gap: 14px; align-items: center; padding-right: 4px; }
  #start { display: flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; min-width: 0; border: 0; border-radius: 6px; background: transparent; box-shadow: none; font: inherit; font-weight: 700; color: var(--text); cursor: pointer; }
  #start:hover, #start.pressed { background: rgba(255,255,255,.5); box-shadow: none; }
  #start svg { width: 18px; height: 18px; }
  #clock { font-variant-numeric: tabular-nums; }

  /* Schreibtisch */
  #desktop { inset: 28px 0 82px 0; }
  #icons { top: 14px; left: auto; right: 14px; align-items: center; gap: 10px; flex-wrap: wrap-reverse; max-height: calc(100% - 20px); }
  .icon { width: 92px; gap: 5px; padding: 4px 2px; border-radius: 8px; }
  .icon svg { width: 54px; height: 54px; image-rendering: auto; filter: drop-shadow(0 3px 5px rgba(0,0,0,.25)); }
  .icon span { color: #fff; font-size: 12px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.55); line-height: 1.25; padding: 1px 5px; border-radius: 4px; }
  .icon.selected { background: rgba(255,255,255,.18); }
  .icon.selected span, .icon:focus-visible span { background: var(--accent); outline: none; text-shadow: none; }
  .icon.selected svg { filter: drop-shadow(0 3px 5px rgba(0,0,0,.25)) brightness(.9); }
  .explorer .icon span, .ex .icon span { color: var(--text); text-shadow: none; font-weight: 500; }
  .explorer .icon.selected span { color: #fff; }
  .explorer .icon.selected { background: rgba(10,132,255,.12); }

  /* Fenster */
  .window { padding: 0; border-radius: 16px; overflow: hidden; min-width: 280px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 22px 60px rgba(20, 10, 60, .38), 0 0 0 .5px rgba(0,0,0,.15); }
  .window:not(.active) { background: rgba(255,255,255,.38); box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 10px 30px rgba(20,10,60,.22), 0 0 0 .5px rgba(0,0,0,.12); }
  .window.maximized { border-radius: 0; }
  .titlebar, .window.active .titlebar, .window:not(.active) .titlebar {
    height: 40px; margin: 0; padding: 0 12px; gap: 8px; border-radius: 0; background: transparent; color: var(--text); text-shadow: none;
    font-weight: 600; font-size: 13px; position: relative; }
  .window:not(.active) .titlebar { color: var(--muted); }
  .titlebar > svg { display: none; }
  .titlebar .t { text-align: center; padding: 0 70px 0 0; }
  .tbtn { width: 13px; height: 13px; border-radius: 50%; border: 0; padding: 0; background: #ff5f57; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.18); display: grid; place-items: center; }
  .tbtn.close { order: -3; background: #ff5f57; }
  .tbtn[data-a=min] { order: -2; background: #febc2e; }
  .tbtn[data-a=max] { order: -1; background: #28c840; }
  .tbtn + .tbtn.close { margin-left: 0; }
  .tbtn svg { width: 7px; height: 7px; opacity: 0; }
  .tbtn svg path { fill: rgba(0,0,0,.55); }
  .titlebar:hover .tbtn svg { opacity: 1; }
  .tbtn:hover, .tbtn:active { filter: none; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.25); }
  .window:not(.active) .tbtn { background: rgba(0,0,0,.14); opacity: 1; }
  .window > :not(.titlebar) { background: transparent; }
  .menubar { display: none; }
  .addr { padding: 0 12px 8px; gap: 8px; border: 0; color: var(--muted); font-size: 12px; }
  .addr .field { padding: 4px 10px; border-radius: 8px; border: 0; background: rgba(255,255,255,.55); box-shadow: inset 0 0 0 .5px rgba(0,0,0,.08); color: var(--text); }
  .addr .field svg { width: 16px; height: 16px; }
  .up-btn, .addr .btn { min-width: 0 !important; padding: 3px 10px !important; }
  .body { margin: 0; }
  .sunken, .window > .body.sunken { background: rgba(255,255,255,.78); border: 0; box-shadow: none; }
  .explorer .body { margin: 0 8px; border-radius: 10px; padding: 14px; gap: 8px; }
  .statusbar { padding: 6px 14px 8px; margin: 0; border: 0; color: var(--muted); font-size: 11px; }
  .statusbar div { box-shadow: none; border: 0; padding: 0; }
  .statusbar div + div { text-align: right; }
  .notepad { margin: 0 8px; border-radius: 10px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; padding: 12px 14px; }
  .lv { margin: 0 8px; border-radius: 10px; }
  .rules { margin: 0 8px; border-radius: 10px; }

  /* Knöpfe */
  .btn { font: inherit; font-size: 13px; min-width: 72px; padding: 5px 14px; border: 0; border-radius: 8px; color: var(--text); cursor: pointer;
    background: rgba(255,255,255,.85); box-shadow: 0 .5px 1.5px rgba(0,0,0,.25), inset 0 0 0 .5px rgba(0,0,0,.08); }
  .btn:hover { background: #fff; box-shadow: 0 .5px 1.5px rgba(0,0,0,.25), inset 0 0 0 .5px rgba(0,0,0,.08); }
  .btn:active, .btn.pressed { background: #e8e8ed; padding: 5px 14px; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.12); }
  .btn:focus-visible { outline: 3px solid rgba(10,132,255,.45); outline-offset: 1px; }
  .btn.go, .btn.chk, .dialog .actions .btn { background: var(--accent); color: #fff; font-weight: 600; box-shadow: 0 1px 2px rgba(10,132,255,.4); }
  .btn.go:hover, .btn.chk:hover, .dialog .actions .btn:hover { background: #1a8cff; }
  .btn.small { min-width: 0; padding: 3px 10px; font-size: 12px; }
  .btn:disabled { opacity: .45; }

  /* Dialog */
  .dialog { border-radius: 18px; }
  .dialog .body { background: transparent !important; padding: 4px 18px 6px; }
  .dialog .actions { padding: 10px 0 14px; }

  /* Übungen */
  .ex, .inv-wrap .ex-setup { background: transparent !important; border: 0; }
  .ex-setup { padding: 8px 18px 18px; }
  .ex-head svg, .ex-end svg { width: 40px; height: 40px; }
  fieldset { border: 0; border-radius: 12px; background: rgba(255,255,255,.7); box-shadow: inset 0 0 0 .5px rgba(0,0,0,.06); padding: 12px 14px; }
  legend { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 0; float: left; width: 100%; margin-bottom: 4px; }
  fieldset label { padding: 3px 0; }
  input[type=radio] { accent-color: var(--accent); }
  .ex-bar { border: 0; box-shadow: none; background: transparent; padding: 0 14px 8px; color: var(--muted); }
  .icon span { hyphens: manual; overflow-wrap: break-word; }
  .ex-bar b { color: var(--text); }
  .m-grid { padding: 4px 14px 14px; gap: 10px; }
  .card { border: 0; border-radius: 12px; background: rgba(255,255,255,.85); font-size: 14px; padding: 10px 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.12), inset 0 0 0 .5px rgba(0,0,0,.05); transition: transform .12s, background .12s; }
  .card:hover:not(.done):not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.14); border: 0; }
  .card.sel { background: var(--accent); color: #fff; }
  .card.bad { background: #ff3b30; color: #fff; }
  .card.done { background: #d4f5dc; color: #116329; box-shadow: inset 0 0 0 1.5px #34c759; }
  .card.bad-final { background: #ffe1df; color: #a1150d; box-shadow: inset 0 0 0 1.5px #ff3b30; }
  @keyframes pop { 0% { background: #34c759; color: #fff; transform: scale(1); } 40% { transform: scale(1.03); } 100% { transform: scale(1); } }
  .w-box { padding: 8px 22px 18px; }
  .w-in { border: 0; border-radius: 10px; background: rgba(255,255,255,.9); box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); padding: 9px 12px; }
  .w-in:focus { box-shadow: inset 0 0 0 2px var(--accent); }
  .w-fb.ok { color: #157a32; } .w-fb.no { color: #c0261b; }
  .w-list { border: 0; border-radius: 10px; background: rgba(255,255,255,.75); box-shadow: none; }
  .g-item { border: 0; border-radius: 12px; background: rgba(255,255,255,.82); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
  .g-item:hover { border: 0; box-shadow: 0 4px 12px rgba(0,0,0,.14); transform: translateY(-1px); }
  .g-no { background: var(--accent); }
  .g-blank { border-radius: 6px 6px 0 0; background: rgba(10,132,255,.08); border-bottom-color: var(--accent); }
  .rules h3 { color: var(--accent); border-color: var(--sep); }
  .rules th, .rules td { border-color: var(--sep); }
  .rules th { background: rgba(0,0,0,.03); }
  .rules .tip { background: rgba(255, 214, 10, .18); border: 0; border-radius: 8px; }
  .lv th { background: rgba(245,245,247,.95); border-color: var(--sep); }
  .lv tr.sec td { background: var(--accent); }
  .lv tr.c td:nth-child(2) { color: #0059c7; }
  .find { border-radius: 8px; padding: 5px 10px; background: rgba(255,255,255,.8); box-shadow: inset 0 0 0 .5px rgba(0,0,0,.1); }
  .inv-wrap.playing { margin: 0 8px 8px; border-radius: 10px; background: #000 !important; }
  .h5p { margin: 0 8px; border-radius: 10px; }

  /* Dock */
  #taskbar { display: none; }
  #dock { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 100000; display: flex; align-items: flex-end; gap: 6px;
    padding: 8px 10px; border-radius: 24px; max-width: calc(100vw - 16px); overflow-x: auto; scrollbar-width: none; }
  #dock::-webkit-scrollbar { display: none; }
  #dock .dk, #dock .task { position: relative; flex: none; width: 52px; height: 52px; min-width: 0; max-width: none; padding: 0; border: 0; border-radius: 12px;
    background: transparent; box-shadow: none; cursor: pointer; display: grid; place-items: center; transition: transform .15s ease; font-weight: 400; }
  #dock .dk:hover, #dock .task:hover { transform: translateY(-6px) scale(1.12); filter: none; background: transparent; box-shadow: none; }
  #dock svg { width: 48px; height: 48px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.25)); }
  #dock .task span { display: none; }
  #dock .task::after { content: ""; position: absolute; bottom: -5px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: rgba(0,0,0,.55); }
  #dock .task.pressed { background: transparent; box-shadow: none; padding: 0; }
  #tasks { display: contents; }
  .dock-sep { width: 1px; align-self: stretch; margin: 4px 4px; background: rgba(0,0,0,.15); flex: none; }
  .dock-sep:last-child { display: none; }
  #dock [data-tip]:hover::before { content: attr(data-tip); position: absolute; bottom: 64px; left: 50%; transform: translateX(-50%); white-space: nowrap;
    background: rgba(255,255,255,.85); color: var(--text); font-size: 12px; padding: 3px 9px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.2); pointer-events: none; }

  /* Menü (statt Startmenü) */
  #startmenu { left: 8px; top: 32px; bottom: auto; padding: 6px; border-radius: 12px; flex-direction: column; min-width: 240px; overflow: visible; }
  #startmenu .side { display: none; }
  #startmenu ul { min-width: 0; padding: 0; }
  #startmenu li { padding: 5px 10px; gap: 10px; border-radius: 6px; font-size: 13px; }
  #startmenu li svg { width: 22px; height: 22px; }
  #startmenu li:hover { background: var(--accent); color: #fff; }
  #startmenu li:last-child { background: transparent; color: inherit; margin: 0; justify-content: flex-start; padding: 5px 10px; }
  #startmenu li:last-child:hover { background: var(--accent); color: #fff; }
  #startmenu hr { border: 0; border-top: 1px solid var(--sep); margin: 5px 8px; }

  #shutdown { background: #000; color: #fff; font-family: var(--font); font-weight: 500; }
  #shutdown small { color: #888; }

  @media (max-width: 640px) {
    .window:not(.dialog) { border-radius: 0; top: 0 !important; }
    #desktop { bottom: 76px; }
    #icons { right: 8px; left: 8px; justify-content: flex-start; flex-wrap: wrap; flex-direction: row; max-height: none; }
    #menubar .mi:not(.app) { display: none; }
    #dock svg { width: 40px; height: 40px; }
    #dock .dk, #dock .task { width: 44px; height: 44px; }
  }

  /* ===== iPhone-/iPadOS-Logik (überschreibt den Mac-Stil) ===== */
  #menubar { height: 34px; background: transparent; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 0 22px; font-weight: 600; font-size: 15px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
  .refract #menubar { backdrop-filter: none; }
  #menubar .mi, #start { display: none; }
  #menubar .right { margin-left: 0; width: 100%; justify-content: space-between; padding: 0; }
  #menubar .right span:first-child { order: 2; }
  #startmenu { display: none !important; }

  /* Home-Bildschirm */
  #desktop { inset: 34px 0 104px 0; overflow-y: auto; }
  #home { max-width: 720px; margin: 0 auto; padding: 14px 22px 30px; display: flex; flex-direction: column; gap: 22px; }
  #widget { border-radius: 24px; padding: 18px 20px; color: var(--text); }
  #widget h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.01em; }
  #widget p { margin: 0; color: #3a3a3c; font-size: 15px; }
  #icons { position: static; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px 10px; max-height: none; padding: 0; }
  #icons .icon { width: auto; padding: 0; gap: 7px; border-radius: 0; background: none !important; }
  #icons .icon svg { width: 68px; height: 68px; padding: 11px; border-radius: 17px; background: rgba(255,255,255,.88);
    box-shadow: 0 4px 14px rgba(20,10,60,.22), inset 0 0 0 .5px rgba(255,255,255,.9); filter: none; }
  #icons .icon:active svg { transform: scale(.92); filter: brightness(.9); }
  #icons .icon.cls svg { padding: 0; background: none; border-radius: 17px; box-shadow: 0 6px 16px rgba(20,10,60,.3); }
  #icons .icon span { font-size: 12.5px; font-weight: 500; background: none !important; padding: 0; text-shadow: 0 1px 3px rgba(0,0,0,.45); }

  /* Dock */
  #dock { bottom: 14px; padding: 12px 16px; border-radius: 32px; gap: 18px; }
  #dock .dk { width: 64px; height: 64px; border-radius: 16px; background: none; box-shadow: none; }
  #dock .dk svg { width: 74px; height: 74px; margin: -5px; filter: drop-shadow(0 4px 8px rgba(20,10,60,.25)); }
  #dock .dk:hover { transform: none; }
  #dock .dk:active { transform: scale(.92); }
  #dock [data-tip]:hover::before { display: none; }
  .dock-sep, #tasks { display: none !important; }

  /* Fenster = Bildschirme mit Navigationsleiste */
  .window:not(.dialog) { position: fixed; inset: 0 !important; left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important;
    border-radius: 0; border: 0; min-width: 0; background: rgba(242,242,247,.86); -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
    box-shadow: none; animation: pushIn .32s cubic-bezier(.2,.8,.2,1); z-index: 100003; }
  .window:not(.dialog):not(.active) { background: rgba(242,242,247,.86); box-shadow: none; }
  @keyframes pushIn { from { transform: translateX(40%); opacity: 0; } to { transform: none; opacity: 1; } }
  .window.minimized { display: flex !important; }
  .window:not(.dialog) .titlebar, .window:not(.dialog):not(.active) .titlebar { height: 52px; padding: 0 16px; justify-content: center; color: var(--text); font-size: 17px; font-weight: 600;
    background: rgba(242,242,247,.75); border-bottom: .5px solid rgba(0,0,0,.12); flex: none; }
  .window:not(.dialog) .titlebar .t { padding: 0 90px; }
  .window:not(.dialog) .tbtn[data-a=min], .window:not(.dialog) .tbtn[data-a=max] { display: none; }
  .window:not(.dialog) .tbtn.close { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: auto; height: 36px; padding: 0 10px 0 6px;
    border-radius: 18px; background: transparent; box-shadow: none; color: var(--accent); font-size: 17px; font-weight: 400; display: flex; align-items: center; gap: 2px; }
  .window:not(.dialog) .tbtn.close::before { content: "‹"; font-size: 30px; line-height: 1; margin-top: -3px; }
  .window:not(.dialog) .tbtn.close::after { content: "Zurück"; }
  .window:not(.dialog) .tbtn.close svg { display: none; }
  .window:not(.dialog) .tbtn.close:active { background: rgba(0,0,0,.06); }
  .window:not(.dialog) > :not(.titlebar) { width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; }
  .window:not(.dialog) > .body { flex: 1; min-height: 0; }

  /* Ordner = Listen wie in iOS */
  .explorer .addr, .explorer .statusbar { display: none; }
  .explorer .body { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 0; padding: 0; margin: 18px auto !important; width: calc(100% - 32px) !important; flex: 0 1 auto !important;
    border-radius: 14px; overflow: hidden; background: #fff; box-shadow: none; }
  .explorer .body .icon { width: 100%; flex-direction: row; align-items: center; gap: 14px; padding: 10px 16px; border-radius: 0; text-align: left; position: relative; }
  .explorer .body .icon + .icon::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; border-top: .5px solid rgba(60,60,67,.2); }
  .explorer .body .icon svg { width: 34px; height: 34px; flex: none; filter: none; }
  .explorer .body .icon span { flex: 1; text-align: left; font-size: 16px; font-weight: 400; color: var(--text) !important; background: none !important; padding: 0; }
  .explorer .body .icon::after { content: "›"; color: #c4c4c7; font-size: 24px; line-height: 1; }
  .explorer .body .icon:active { background: #e5e5ea !important; }
  .explorer .body .icon.soon { cursor: default; }
  .explorer .body .icon.soon:active { background: none !important; }
  .explorer .body .icon.soon svg, .explorer .body .icon.soon span { opacity: .45; }
  .explorer .body .icon.soon::after { content: none; }
  .soon-tag { font-style: normal; font-size: 13px; font-weight: 600; color: #8e8e93; background: rgba(120,120,128,.14); padding: 3px 10px; border-radius: 99px; }
  .explorer .body .icon.selected { background: transparent !important; }
  #icons .icon.selected span { background: none !important; }
  .explorer .body:empty::after { content: "Hier ist noch nichts drin."; display: block; padding: 18px; color: var(--muted); text-align: center; }

  /* Inhalte auf hellem Grund */
  .notepad, .lv, .rules, .h5p { margin: 16px auto !important; width: calc(100% - 32px) !important; border-radius: 14px; background: #fff !important; }
  .inv-wrap.playing { margin: 0 !important; width: 100% !important; max-width: none !important; border-radius: 0; }
  .ex-bar { padding: 12px 16px 6px; }
  fieldset, .card, .g-item, .w-list, .fc-face { background: #fff; }

  /* Dialog = iOS-Hinweis */
  .dialog { position: fixed; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(300px, 86vw) !important; height: auto !important;
    border-radius: 16px; background: rgba(245,245,247,.92); z-index: 100010; }
  .dialog .titlebar { justify-content: center; height: 46px; }
  .dialog .titlebar .t { padding: 0; }
  .dialog .tbtn { display: none !important; }
  .dialog .body svg { display: none; }
  .dialog .body { text-align: center; justify-content: center; padding: 0 18px 4px !important; }

  @media (min-width: 700px) { #icons { grid-template-columns: repeat(6, 1fr); } }
  @media (min-width: 900px) { #icons .icon svg { width: 92px; height: 92px; } #icons .icon.cls svg { border-radius: 22px; } #icons .icon span { font-size: 14px; } #home { gap: 30px; padding-top: 30px; } }
  @media (max-width: 640px) {
    #desktop { bottom: 100px; }
    #icons .icon svg { width: 62px; height: 62px; }
    #dock .dk { width: 58px; height: 58px; }
    #menubar .mi:not(.app) { display: none; }
  }

  #menubar, #dock { z-index: 5; }

  /* Abschnitte in Unit-Ordnern (iOS-Stil) */
  .explorer .body.sectioned { background: transparent !important; overflow: visible; border-radius: 0; margin-top: 4px !important; }
  .explorer .body.sectioned { overflow-y: auto; }
  .sec-head { font-size: 13px; font-weight: 400; text-transform: uppercase; letter-spacing: .02em; color: #6e6e73; padding: 18px 16px 7px; }
  .sec-head:first-child { padding-top: 8px; }
  .sec-group { background: #fff; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; flex: none; }
  .sec-group .icon + .icon::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; border-top: .5px solid rgba(60,60,67,.2); }
