:root { color-scheme: dark; font-family: system-ui, sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; background: #111418; color: #e8ecf3; display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 12px 20px; border-bottom: 1px solid #2a2f38; }
h1 { font-size: 18px; margin: 0; font-weight: 600; }
.modes, .tabs { display: flex; gap: 8px; }
.tabs { display: none; }
button { font: inherit; font-size: 14px; padding: 8px 14px; border-radius: 8px; border: 1px solid #3a4150; background: #1a1e25; color: inherit; cursor: pointer; }
button[aria-pressed="true"] { background: #e8ecf3; color: #111418; }
button:focus-visible, a:focus-visible { outline: 2px solid #5ee3c1; outline-offset: 2px; }
.hint { font-size: 13px; color: #9aa4b5; }
main { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 16px; }
figure { margin: 0; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
figcaption { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; padding: 0 2px 8px; }
figcaption a { color: #9aa4b5; font-size: 13px; }
.frame { flex: 1; overflow: hidden; border: 1px solid #2a2f38; border-radius: 10px; position: relative; background: #fff; }
iframe { border: 0; position: absolute; top: 0; left: 0; transform-origin: 0 0; }

/* Handy/Tablet: ein Entwurf in voller Breite, Umschalten per Tabs */
@media (max-width: 899px) {
  header { padding: 10px 12px; gap: 10px; padding-top: max(10px, env(safe-area-inset-top)); }
  h1 { font-size: 16px; width: 100%; }
  .modes, .hint { display: none; }
  .tabs { display: flex; width: 100%; }
  .tabs button { flex: 1; min-height: 44px; padding: 8px 6px; }
  main { grid-template-columns: 1fr; gap: 0; padding: 0 0 env(safe-area-inset-bottom); }
  figure:not(.active) { display: none; }
  figcaption { padding: 8px 12px; }
  /* Volle Gerätebreite, damit jeder Entwurf wie auf einem echten Handy rendert */
  .frame { border: 0; border-radius: 0; }
}
