  :root {
    --awo-red: #E2001A;
    --bg: #f4f5f7;
    --panel: #ffffff;
    --panel2: #f7f7f8;
    --hover: #eef0f2;
    --hover2: #e2e5e8;
    --text: #3b3b3b;
    --muted: #5f646b;
    --faint: #88898c;
    --border: #d9d9d9;
    --input: #ffffff;
    --paper: #ffffff;
    --flash: #fdecec;
    --diff-del: #b00020;
    --blocksel: rgba(226, 0, 26, .10);
    --toast-bg: #222222;
    --toast-fg: #ffffff;
    --shadow: rgba(0, 0, 0, .08);
    color-scheme: light;
  }
  * { box-sizing: border-box; }
  header {
    background: var(--awo-red);
    color: #fff;
    padding: 18px 28px;
    display: flex;
    align-items: center;
    gap: 14px;
  }
  body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
  }
  header .brand {
    height: 46px;
    background: var(--panel);
    border-radius: 8px;
    padding: 5px;
    flex: 0 0 auto;
    display: block;
  }
  header .brandText { flex: 1; min-width: 0; }
  header h1 { margin: 0; font-size: 22px; font-weight: 600; }
  header p { margin: 4px 0 0; font-size: 13px; opacity: .9; }
  .wrap {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 24px;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    align-items: start;
  }
  @media (max-width: 1000px) { .wrap { grid-template-columns: 1fr; } }
  .panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
  }
  .panel h2 {
    margin: 0 0 14px;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
  }
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .form-grid .full { grid-column: 1 / -1; }
  label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }
  input[type="text"], input[type="email"], input[type="tel"], select, textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: var(--panel);
  }
  input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--awo-red);
    box-shadow: 0 0 0 2px rgba(226,0,26,.12);
  }
  textarea { resize: vertical; min-height: 90px; font-size: 13px; }
  fieldset {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 18px 0 0;
    padding: 12px 14px 14px;
  }
  legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 6px; }
  .check { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 14px; }
  .check input { width: 16px; height: 16px; accent-color: var(--awo-red); }
  details { margin-top: 16px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
  summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
  details .form-grid { margin-top: 12px; }
  details.prefixHelp { margin: 6px 0 0; padding: 8px 12px; background: var(--panel2); }
  details.prefixHelp table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; }
  details.prefixHelp th, details.prefixHelp td { border: 1px solid var(--border); padding: 5px 8px; text-align: left; vertical-align: top; }
  details.prefixHelp th { background: var(--hover); color: #444; }
  details.prefixHelp td:first-child { font-weight: 600; white-space: nowrap; }
  .regChecks { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; margin-top: 4px; }
  .regChecks .check { margin: 2px 0; font-size: 13px; }
  .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
  button {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
  }
  .btn-primary { background: var(--awo-red); color: #fff; }
  .btn-primary:hover { background: #c00016; }
  .btn-secondary { background: var(--hover); color: var(--text); border: 1px solid var(--border); }
  .btn-secondary:hover { background: var(--hover2); }
  .preview-box {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    position: sticky;
    top: 24px;
  }
  @media (max-width: 1000px) { .preview-box { position: static; } }
  .preview-area {
    background: var(--paper);
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 24px;
    overflow-x: auto;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    position: relative;
  }
  .exampleBadge {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 11px;
    color: var(--muted);
    background: var(--hover);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2px 10px;
    z-index: 5;
  }
  .sig { font-family: Calibri, Arial, sans-serif; font-size: 10pt; color: #595959; line-height: 1.35; }
  .sig div { margin: 0; }
  .sig a { color: #0563C1; pointer-events: none; }
  .sig [data-block] { cursor: pointer; border-radius: 4px; transition: background .15s; }
  .sig [data-block]:hover { background: rgba(226, 0, 26, .05); }
  .sig [data-block].blockSel { background: var(--blocksel); box-shadow: 0 0 0 2px rgba(226, 0, 26, .25); }
  .fieldFlash {
    background: #fdecec !important;
    box-shadow: 0 0 0 2px rgba(226, 0, 26, .35);
    border-radius: 6px;
    transition: background .2s, box-shadow .2s;
  }
  .hint { font-size: 12px; color: var(--faint); margin-top: 12px; }
  #sourceWrap { display: none; margin-top: 16px; }
  #source {
    width: 100%;
    height: 220px;
    font-family: Consolas, monospace;
    font-size: 12px;
    white-space: pre;
  }
  .toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--toast-bg);
    color: var(--toast-fg);
    border: 1px solid var(--border);
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
  }
  .toast.show { opacity: 1; }
  .tabs { display: flex; gap: 8px; margin-bottom: 16px; }
  .tab-btn { flex: 1; padding: 9px 12px; background: var(--hover); color: var(--muted); border: 1px solid var(--border); }
  .tab-btn.active { background: var(--awo-red); border-color: var(--awo-red); color: #fff; }
  .req { color: var(--awo-red); }
  .warn { color: var(--diff-del); font-weight: 600; }
  .progress { height: 6px; background: var(--hover); border-radius: 3px; margin-top: 12px; overflow: hidden; }
  .progressFill { height: 100%; width: 0; background: #2e7d32; transition: width .2s; }
  .progressText { font-size: 12px; color: var(--faint); margin-top: 4px; }
  .chip {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid var(--diff-del);
    color: var(--diff-del);
    border-radius: 14px;
    font-size: 12px;
    margin: 0 6px 6px 0;
    cursor: pointer;
    background: transparent;
    font-weight: 600;
  }
  .chip:hover { background: var(--flash); }
  .invalid { border-color: var(--diff-del) !important; box-shadow: 0 0 0 2px rgba(176, 0, 32, .12); }
  .profileRow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
  .profileRow input, .profileRow select { flex: 1; min-width: 140px; }
  .lockBtn {
    margin-left: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    line-height: 1;
  }
  .lockBtn:hover { transform: scale(1.15); }
  input[disabled], select[disabled] {
    background: #f3f4f6;
    color: #999;
    cursor: not-allowed;
  }
  .footer {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 24px;
  }
  .about {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 20px;
    font-size: 13px;
    color: var(--muted);
  }
  .about a { color: var(--awo-red); font-weight: 600; text-decoration: none; }
  .about a:hover { text-decoration: underline; }
  .orgWrap { position: relative; }
  .sugList {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 6px 14px var(--shadow);
    z-index: 40;
    max-height: 240px;
    overflow-y: auto;
  }
  .sugItem { padding: 8px 10px; font-size: 14px; cursor: pointer; }
  .sugItem:hover, .sugItem.active { background: var(--flash); }
  .toast { z-index: 70; }
  @media (prefers-reduced-motion: reduce) {
    .sig [data-block], .fieldFlash, .mobileBar, .preview-box { transition: none !important; }
  }
  .mobileBar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: var(--panel);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px var(--shadow);
  }
  .mobileBar button { flex: 1; }

  @media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
    .regChecks { grid-template-columns: 1fr; }
  }
  @media (hover: none) and (pointer: coarse) {
    input[type="text"], input[type="email"], input[type="tel"], input[type="date"], select, textarea { font-size: 16px; }
    .lockBtn::after { content: " Profi-Modus"; font-size: 12px; font-weight: 600; color: var(--muted); }
  }
  @media (max-width: 480px) {
    header { padding: 14px 16px; gap: 10px; }
    header .brand { height: 34px; }
    header h1 { font-size: 18px; }
    header p { font-size: 11px; }
  }
  @media (max-width: 1000px) {
    .preview-box { display: none; }
    body { padding-bottom: 72px; }
    body.kb-open { padding-bottom: 8px; }
    body.kb-open .mobileBar { display: none; }
    body.preview-sheet-open .preview-box {
      display: block;
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      top: auto;
      margin: 0;
      border-radius: 14px 14px 0 0;
      max-height: 72vh;
      overflow-y: auto;
      box-shadow: 0 -6px 24px var(--shadow);
      z-index: 55;
      padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    }
    body.preview-sheet-open .preview-area { max-height: none; overflow-y: visible; }
    @media (max-height: 450px) {
      body.preview-sheet-open .preview-box { max-height: 85vh; }
    }
    .mobileBar { display: flex; }
    .toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  }
