/* =========================================================
   IT Quiz Panel – wiederverwendbares Modal-System.
   Gescoped unter .modal-layer, damit die generischen Klassen
   (.field/.avatar/.status/.btn/.form-grid/.token-inputs sowie
   das bare select/input/textarea) den Rest des Panels NICHT
   beeinflussen. Toast-Region, Overlay und body.modal-open sind
   bewusst global. Tokens (--purple etc.) kommen aus style.css.
   ========================================================= */

/* ---- Overlay / Layer (global) ---- */
.modal-layer{position:fixed;inset:0;z-index:1000;display:none;place-items:center;padding:24px;overflow:auto}
.modal-layer.is-open{display:grid}
.modal-backdrop{position:fixed;inset:0;background:rgba(16,14,29,.65);backdrop-filter:blur(6px);animation:mFadeIn .18s ease}
body.modal-open{overflow:hidden}
@keyframes mFadeIn{from{opacity:0}}
@keyframes mModalIn{from{opacity:0;transform:translateY(14px) scale(.98)}}
@keyframes mToastIn{from{opacity:0;transform:translateY(8px)}}

/* ---- Modal-Box ---- */
.modal-layer .modal{position:relative;z-index:1;width:100%;max-height:calc(100vh - 48px);overflow:auto;border:1px solid rgba(255,255,255,.6);border-radius:20px;background:#fff;box-shadow:0 30px 90px -24px rgba(28,20,70,.42);animation:mModalIn .22s cubic-bezier(.2,.8,.2,1)}
.modal-layer .modal-sm{max-width:440px}
.modal-layer .modal-md{max-width:560px}
.modal-layer .modal-lg{max-width:760px}
.modal-layer .modal-xl{max-width:900px}
.modal-layer .modal-header{position:sticky;top:0;z-index:3;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 22px;border-bottom:1px solid var(--line);background:rgba(255,255,255,.95);backdrop-filter:blur(8px)}
.modal-layer .modal-heading{display:flex;align-items:center;gap:12px}
.modal-layer .modal-heading>div{display:grid}
.modal-layer .modal-heading h2{margin:2px 0 0;font-size:18px;letter-spacing:-.02em}
.modal-layer .modal-kicker{color:var(--muted);font-size:8px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.modal-layer .danger-text{color:var(--bad)}
.modal-layer .modal-icon{display:grid;place-items:center;width:43px;height:43px;border-radius:12px;flex:0 0 auto}
.modal-layer .modal-icon.info{background:var(--purple-soft);color:var(--purple)}
.modal-layer .modal-icon.warning{background:var(--warn-soft);color:var(--warn)}
.modal-layer .modal-icon.danger{background:var(--bad-soft);color:var(--bad)}
.modal-layer .modal-icon.success{background:var(--good-soft);color:var(--good)}
.modal-layer .modal-close{display:grid;place-items:center;width:34px;height:34px;border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--muted);cursor:pointer}
.modal-layer .modal-close:hover{background:var(--surface);color:var(--ink)}
.modal-layer .modal-body{padding:22px}
.modal-layer .modal-copy{margin:0 0 16px;color:var(--muted);font-size:11px;line-height:1.7}
.modal-layer .modal-footer{position:sticky;bottom:0;z-index:3;display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:15px 22px;border-top:1px solid var(--line);background:rgba(255,255,255,.96);backdrop-filter:blur(8px)}
.modal-layer .modal-footer.centered{justify-content:center}

/* ---- Buttons ---- */
.modal-layer .btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:39px;padding:9px 13px;border:1px solid transparent;border-radius:9px;font:inherit;font-size:10px;font-weight:800;cursor:pointer;text-decoration:none}
.modal-layer .btn:disabled{opacity:.45;cursor:not-allowed}
.modal-layer .btn.secondary,.modal-layer .btn.compact{border-color:var(--line);background:#fff;color:var(--ink)}
.modal-layer .btn.primary{background:linear-gradient(135deg,var(--purple2),var(--purple));color:#fff}
.modal-layer .btn.danger-button{background:var(--bad);color:#fff}
.modal-layer .btn.warning-button{background:#b87800;color:#fff}
.modal-layer .btn.compact{min-height:32px;padding:6px 9px}

/* ---- Formularfelder ---- */
.modal-layer .modal-form{display:contents}
.modal-layer .field-group{display:grid;gap:6px;margin-bottom:15px}
.modal-layer .field-group>span,.modal-layer .section-label{font-size:9px;font-weight:800;color:var(--ink)}
.modal-layer .field{display:flex;align-items:center;gap:9px;padding:0 12px;border:1.5px solid var(--line);border-radius:10px;background:#fbfaff;color:#9a94aa}
.modal-layer .field:focus-within{border-color:var(--purple);box-shadow:0 0 0 3px #eeeaff;background:#fff}
.modal-layer .field input{width:100%;height:42px;border:0;outline:0;background:transparent;font:inherit;font-size:11px;color:var(--ink)}
.modal-layer select,.modal-layer input[type=datetime-local],.modal-layer textarea{width:100%;padding:11px;border:1.5px solid var(--line);border-radius:10px;background:#fbfaff;color:var(--ink);font:inherit;font-size:11px;outline:0}
.modal-layer select:focus,.modal-layer input[type=datetime-local]:focus,.modal-layer textarea:focus{border-color:var(--purple);box-shadow:0 0 0 3px #eeeaff}
.modal-layer .field-hint{color:var(--muted);font-size:8px}
.modal-layer .field-error{display:none;color:var(--bad);font-size:8px}
.modal-layer .field-group.invalid .field,.modal-layer .field-group.invalid select,.modal-layer .field-group.invalid input{border-color:var(--bad)}
.modal-layer .field-group.invalid .field-error{display:block}
.modal-layer .form-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.modal-layer .check-row{display:flex;align-items:flex-start;gap:9px;padding:11px;margin-bottom:8px;border:1px solid var(--line);border-radius:10px;background:var(--surface)}
.modal-layer .check-row input,.modal-layer .option-cards input,.modal-layer .choice-grid input{width:15px;height:15px;accent-color:var(--purple)}
.modal-layer .check-row span{display:grid}
.modal-layer .check-row small{color:var(--muted);font-size:8px}
.modal-layer .path-chip{display:flex;align-items:center;gap:8px;margin-bottom:16px;padding:10px;border-radius:9px;background:var(--surface);color:var(--muted);font-family:monospace;font-size:9px}

/* ---- Entity-/Info-Karten ---- */
.modal-layer .entity-card,.modal-layer .mfa-account,.modal-layer .restore-point,.modal-layer .detail-status{display:flex;align-items:center;gap:10px;padding:12px;border:1px solid var(--line);border-radius:11px;background:var(--surface);margin-bottom:15px}
.modal-layer .entity-card>div,.modal-layer .mfa-account>span:nth-child(2),.modal-layer .restore-point>div,.modal-layer .detail-status>div{display:grid;flex:1}
.modal-layer .entity-card small,.modal-layer .mfa-account small,.modal-layer .restore-point small,.modal-layer .restore-point em,.modal-layer .detail-status small{color:var(--muted);font-size:8px;font-style:normal}
.modal-layer .avatar{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:var(--purple);color:#fff;font-size:9px;font-weight:800}
.modal-layer .status{padding:3px 7px;border-radius:20px;font-size:7px;font-weight:800;text-transform:uppercase}
.modal-layer .status.suspended{background:var(--warn-soft);color:var(--warn)}
.modal-layer .status.active{background:var(--good-soft);color:var(--good)}
.modal-layer .impact-box{padding:13px;margin-bottom:15px;border-radius:11px;font-size:9px}
.modal-layer .impact-box b{display:flex;align-items:center;gap:7px}
.modal-layer .impact-box ul{margin:9px 0 0;padding-left:20px;line-height:1.8}
.modal-layer .danger-box{border:1px solid #f3caca;background:#fff8f8;color:#982626}
.modal-layer .warning-box{border:1px solid #eed694;background:#fffdf5;color:#866000}
.modal-layer .notice{display:flex;gap:9px;padding:11px;margin-bottom:15px;border-radius:10px;font-size:9px;line-height:1.5}
.modal-layer .warning-notice{background:var(--warn-soft);color:#856000}
.modal-layer .info-notice{background:#eaf2ff;color:#255695}
.modal-layer .restore-point>span:first-child{display:grid;place-items:center;width:42px;height:42px;border-radius:10px;background:var(--purple-soft);color:var(--purple)}

/* ---- Options-/Auswahl-Karten ---- */
.modal-layer .option-cards{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:9px 0 15px}
.modal-layer .option-cards label{display:flex;align-items:flex-start;gap:8px;padding:11px;border:1px solid var(--line);border-radius:10px;cursor:pointer}
.modal-layer .option-cards label:has(input:checked){border-color:#cec4f7;background:#faf8ff}
.modal-layer .option-cards label>span{display:grid;grid-template-columns:22px 1fr}
.modal-layer .option-cards label i{grid-row:1/3;color:var(--purple)}
.modal-layer .option-cards small{grid-column:2;color:var(--muted);font-size:8px}

/* ---- Tabs / Details / Timeline ---- */
.modal-layer .modal-tabs{display:flex;gap:4px;padding:11px 22px 0;border-bottom:1px solid var(--line)}
.modal-layer .modal-tabs button{padding:9px 12px;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--muted);font:inherit;font-size:9px;font-weight:800;cursor:pointer}
.modal-layer .modal-tabs button.active{border-color:var(--purple);color:var(--purple)}
.modal-layer .tab-panel{display:none}
.modal-layer .tab-panel.active{display:block}
.modal-layer .details-list{margin:0}
.modal-layer .details-list>div{display:flex;justify-content:space-between;gap:18px;padding:10px 0;border-bottom:1px solid var(--line)}
.modal-layer .details-list dt{color:var(--muted);font-size:9px}
.modal-layer .details-list dd{margin:0;text-align:right;font-size:9px;font-weight:700}
.modal-layer .mono{font-family:monospace}
.modal-layer .timeline{display:grid}
.modal-layer .timeline>div{display:flex;gap:10px;padding:11px 0;border-bottom:1px solid var(--line)}
.modal-layer .timeline>div>span{display:grid}
.modal-layer .timeline small{color:var(--muted);font-size:8px}
.modal-layer .success-dot,.modal-layer .info-dot{width:9px;height:9px;margin-top:3px;border-radius:50%;background:var(--good);box-shadow:0 0 0 4px var(--good-soft)}
.modal-layer .info-dot{background:var(--blue,#2563eb);box-shadow:0 0 0 4px #eaf2ff}

/* ---- Wizard ---- */
.modal-layer .wizard-steps{display:flex;align-items:center;padding:18px 22px;border-bottom:1px solid var(--line)}
.modal-layer .wizard-steps span{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:8px;font-weight:800}
.modal-layer .wizard-steps span i{display:grid;place-items:center;width:25px;height:25px;border-radius:50%;background:#eceaf2;font-style:normal}
.modal-layer .wizard-steps span.active{color:var(--purple)}
.modal-layer .wizard-steps span.active i,.modal-layer .wizard-steps span.done i{background:var(--purple);color:#fff}
.modal-layer .wizard-steps span.done{color:var(--purple)}
.modal-layer .wizard-steps b{height:1px;flex:1;margin:0 8px;background:var(--line)}
.modal-layer .wizard-steps b.done{background:var(--purple)}
.modal-layer .wizard-page{display:none}
.modal-layer .wizard-page.active{display:block}
.modal-layer .wizard-page h3{margin:0 0 5px;font-size:16px}
.modal-layer .wizard-page>p{margin:0 0 18px;color:var(--muted);font-size:9px}
.modal-layer .wizard-count{margin-right:auto;color:var(--muted);font-size:8px}
.modal-layer .choice-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}
.modal-layer .choice-grid input{display:none}
.modal-layer .choice-grid label>span{display:grid;place-items:center;gap:5px;padding:20px 10px;border:1px solid var(--line);border-radius:11px;text-align:center;cursor:pointer}
.modal-layer .choice-grid input:checked+span{border-color:var(--purple);background:#faf8ff;color:var(--purple)}
.modal-layer .choice-grid i{font-size:24px}
.modal-layer .choice-grid small{font-size:8px;color:var(--muted)}
.modal-layer .stacked-options{display:grid;gap:9px}
.modal-layer .summary-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-bottom:16px}
.modal-layer .summary-grid>div{display:grid;padding:12px;border:1px solid var(--line);border-radius:9px;background:var(--surface)}
.modal-layer .summary-grid span{color:var(--muted);font-size:8px}

/* ---- Token / MFA im Modal ---- */
.modal-layer .token-group{text-align:center}
.modal-layer .token-inputs{display:grid;grid-template-columns:repeat(6,1fr);gap:7px}
.modal-layer .token-inputs input{height:53px;padding:0;border:1.5px solid var(--line);border-radius:10px;text-align:center;font-size:21px;font-weight:800;background:#fbfaff}
.modal-layer .token-inputs input:focus{border-color:var(--purple);box-shadow:0 0 0 3px #eeeaff}
.modal-layer .token-timer{color:var(--muted);font-size:8px}
.modal-layer .token-group.invalid .token-inputs input{border-color:var(--bad)}

/* ---- Success-Modal ---- */
.modal-layer .success-modal{text-align:center}
.modal-layer .success-animation{display:grid;place-items:center;width:74px;height:74px;margin:8px auto 21px;border-radius:50%;background:var(--good-soft);color:var(--good);font-size:28px;box-shadow:0 0 0 12px #f4fbf7}
.modal-layer .success-modal h2{margin:0 0 8px}
.modal-layer .success-modal p{color:var(--muted);font-size:10px}
.modal-layer .success-details{display:flex;justify-content:center;gap:12px;margin-top:18px;color:var(--muted);font-size:8px}

/* ---- Toasts (global) ---- */
.toast-region{position:fixed;right:20px;bottom:20px;z-index:2000;display:grid;gap:8px}
.toast{display:flex;align-items:center;gap:9px;min-width:280px;padding:12px;border:1px solid var(--line);border-radius:11px;background:#fff;box-shadow:0 15px 35px rgba(30,20,70,.18);animation:mToastIn .2s ease}
.toast.bad i{color:var(--bad)}
.toast i{color:var(--good)}
.toast span{display:grid;font-size:10px}
.toast small{color:var(--muted);font-size:8px}

@media(max-width:600px){
  .modal-layer{padding:10px}
  .modal-layer .modal{max-height:calc(100vh - 20px);border-radius:15px}
  .modal-layer .modal-header,.modal-layer .modal-body{padding:17px}
  .modal-layer .modal-footer{padding:12px 17px;flex-wrap:wrap}
  .modal-layer .form-grid,.modal-layer .option-cards,.modal-layer .choice-grid,.modal-layer .summary-grid{grid-template-columns:1fr}
  .modal-layer .wizard-steps span{font-size:0}
  .modal-layer .wizard-steps span i{font-size:8px}
  .modal-layer .details-list>div{flex-direction:column;gap:3px}
  .modal-layer .details-list dd{text-align:left}
  .toast,.toast-region{right:10px;left:10px;min-width:0}
}

/* ---- Backup-Fortschritt / Erfolg (scoped .modal-layer) ---- */
.modal-layer .modal-icon.progress{background:#e5f0fd;color:#2563eb}
.modal-layer .estimate{display:flex;justify-content:space-between;align-items:center;margin-top:13px;padding:11px 12px;border-radius:10px;background:var(--purple-soft);color:var(--purple);font-size:10px}
.modal-layer .estimate span{display:flex;gap:7px}
.modal-layer .backup-target{display:flex;align-items:center;gap:11px;padding:12px;border:1px solid var(--line);border-radius:11px;background:var(--surface)}
.modal-layer .database-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:11px;background:var(--purple-soft);color:var(--purple);flex:0 0 auto}
.modal-layer .backup-target>div{display:grid;flex:1}
.modal-layer .backup-target b{font-size:12px}
.modal-layer .backup-target small,.modal-layer .backup-target em{color:var(--muted);font-size:8px;font-style:normal}
.modal-layer .running{display:flex;align-items:center;gap:6px;padding:4px 8px;border-radius:20px;background:#e5f0fd;color:#2563eb;font-size:7px;font-weight:800;text-transform:uppercase}
.modal-layer .running i{width:7px;height:7px;border-radius:50%;background:#2563eb;animation:mPulse 1.2s infinite}
@keyframes mPulse{50%{opacity:.3}}
.modal-layer .secure-badge{display:flex;align-items:center;gap:6px;padding:5px 8px;border-radius:20px;background:var(--good-soft);color:var(--good);font-size:7px;font-weight:800}
.modal-layer .progress-overview{display:grid;grid-template-columns:130px 1fr;align-items:center;gap:23px;margin:20px 0}
.modal-layer .radial-progress{--progress:0;display:grid;place-items:center;width:124px;height:124px;border-radius:50%;background:conic-gradient(var(--purple) calc(var(--progress)*1%),#eceaf2 0);position:relative;transition:.4s}
.modal-layer .radial-progress:before{content:"";position:absolute;inset:11px;border-radius:50%;background:#fff}
.modal-layer .radial-progress span{position:relative;display:grid;text-align:center}
.modal-layer .radial-progress b{font-size:24px}
.modal-layer .radial-progress small{color:var(--muted);font-size:7px}
.modal-layer .progress-copy>span{font-size:11px;font-weight:800}
.modal-layer .progress-track{height:8px;margin:9px 0 13px;border-radius:12px;background:#ebe9f1;overflow:hidden}
.modal-layer .progress-track i{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--purple2),var(--purple));transition:.35s}
.modal-layer .progress-track.busy i{width:35%;transition:none;animation:mIndet 1.25s ease-in-out infinite}
@keyframes mIndet{0%{margin-left:-35%}100%{margin-left:100%}}
.modal-layer .progress-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}
.modal-layer .progress-metrics span{display:grid;padding:8px;border-radius:8px;background:var(--surface)}
.modal-layer .progress-metrics small{color:var(--muted);font-size:7px}
.modal-layer .progress-metrics b{font-size:10px;font-variant-numeric:tabular-nums}
.modal-layer .step-list{display:grid;border:1px solid var(--line);border-radius:11px;overflow:hidden}
.modal-layer .step-list>div{display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid var(--line)}
.modal-layer .step-list>div:last-child{border:0}
.modal-layer .step-list>div>span:first-child{display:grid;place-items:center;width:30px;height:30px;border-radius:8px;background:#f0eff4;color:#a6a2af;flex:0 0 auto}
.modal-layer .step-list>div>div{display:grid;flex:1}
.modal-layer .step-list b{font-size:10px}
.modal-layer .step-list small{color:var(--muted);font-size:7px}
.modal-layer .step-list em{font-size:7px;font-style:normal;color:var(--muted)}
.modal-layer .step-list>div.active{background:#faf8ff}
.modal-layer .step-list>div.active>span:first-child{background:var(--purple-soft);color:var(--purple)}
.modal-layer .step-list>div.active em{color:var(--purple);font-weight:800}
.modal-layer .step-list>div.done>span:first-child{background:var(--good-soft);color:var(--good)}
.modal-layer .step-list>div.done em{color:var(--good);font-weight:800}
.modal-layer .live-log{margin-top:13px;border:1px solid #29263a;border-radius:10px;overflow:hidden;background:#171522;color:#d7d3e4}
.modal-layer .live-log header{display:flex;justify-content:space-between;padding:9px 11px;border-bottom:1px solid #312e42;background:#201d2d;font-size:8px}
.modal-layer .live-log header span{display:flex;gap:7px}
.modal-layer .live-log>div{max-height:110px;overflow:auto;padding:8px 11px;font-family:monospace;font-size:8px}
.modal-layer .live-log p{margin:4px 0}
.modal-layer .live-log time{display:inline-block;width:45px;color:#7bdbab}
.modal-layer .progress-note{display:flex;gap:8px;margin-top:12px;color:var(--muted);font-size:8px}
.modal-layer .progress-note i{color:#2563eb}
.modal-layer .footer-status{display:flex;gap:6px;margin-left:auto;color:var(--muted);font-size:8px}
.modal-layer .success-kicker{display:block;color:var(--good)}
.modal-layer .success-card{display:flex;align-items:center;gap:10px;margin-top:20px;padding:12px;border:1px solid var(--line);border-radius:11px;background:var(--surface);text-align:left}
.modal-layer .success-card>div{display:grid;flex:1;min-width:0}
.modal-layer .success-card small{color:var(--muted);font-size:8px;overflow:hidden;text-overflow:ellipsis}
.modal-layer .verified{display:flex;align-items:center;gap:5px;color:var(--good);font-size:7px;font-weight:800;white-space:nowrap}
.modal-layer .success-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:10px}
.modal-layer .success-stats span{display:grid;padding:10px;border:1px solid var(--line);border-radius:9px;background:#fff}
.modal-layer .success-stats small{color:var(--muted);font-size:7px}
.modal-layer .success-stats b{font-size:9px}
.modal-layer .success-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:15px}
.modal-layer .text-button{border:0;background:transparent;color:var(--purple);font:inherit;font-size:10px;font-weight:800;cursor:pointer}
@media(max-width:650px){.modal-layer .progress-overview{grid-template-columns:1fr}.modal-layer .radial-progress{margin:auto}.modal-layer .progress-metrics,.modal-layer .success-stats,.modal-layer .success-actions{grid-template-columns:1fr}}

/* ---- CHMOD-Berechtigungs-Modal (scoped .modal-layer) ---- */
.modal-layer .modal.modal-chmod{max-width:820px}
.modal-layer .hidden{display:none!important}
.modal-layer .file-summary{display:flex;align-items:center;gap:11px;padding:13px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.modal-layer .cm-file-icon{display:grid;place-items:center;width:40px;height:40px;border-radius:11px;background:var(--purple-soft);color:var(--purple);flex:0 0 auto}
.modal-layer .file-summary>div:nth-child(2){display:grid;flex:1;min-width:0}
.modal-layer .file-summary b{font-size:12px}
.modal-layer .file-summary small{font-size:8px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.modal-layer .cm-meta{display:flex;gap:16px}
.modal-layer .cm-meta span{display:grid}
.modal-layer .cm-meta small{color:var(--muted);font-size:8px}
.modal-layer .cm-meta b{font-size:10px}
.modal-layer .permission-overview{display:grid;grid-template-columns:.8fr 1.2fr;gap:12px;margin-top:13px}
.modal-layer .permission-code{display:grid;grid-template-columns:1fr auto;align-items:center;padding:15px;border:1px solid var(--line);border-radius:12px;background:#fff}
.modal-layer .permission-code small{color:var(--muted);font-size:8px}
.modal-layer .permission-code b{grid-row:1/3;grid-column:2;font-size:32px;color:var(--purple);font-variant-numeric:tabular-nums}
.modal-layer .permission-code span{font-family:monospace;font-size:11px}
.modal-layer .security-gauge{display:flex;align-items:center;gap:13px;padding:15px;border:1px solid var(--line);border-radius:12px;background:#fff}
.modal-layer .security-gauge>div:last-child{display:grid}
.modal-layer .security-gauge b{font-size:12px}
.modal-layer .security-gauge small{color:var(--muted);font-size:8px}
.modal-layer .gauge{display:grid;place-items:center;width:62px;height:62px;border-radius:50%;background:conic-gradient(var(--good) calc(var(--score)*1%),#e9e7ee 0);position:relative;flex:0 0 auto}
.modal-layer .gauge:before{content:"";position:absolute;inset:7px;border-radius:50%;background:#fff}
.modal-layer .gauge span{position:relative;display:flex;align-items:baseline}
.modal-layer .gauge b{font-size:17px}
.modal-layer .gauge small{font-size:6px}
.modal-layer .comparison{display:grid;grid-template-columns:1fr 34px 1fr;align-items:center;gap:9px;margin-top:12px}
.modal-layer .comparison>div{display:grid;grid-template-columns:1fr auto;padding:11px;border:1px solid var(--line);border-radius:10px;background:var(--surface)}
.modal-layer .comparison small{font-size:8px;color:var(--muted)}
.modal-layer .comparison b{grid-row:1/3;grid-column:2;font-size:18px}
.modal-layer .comparison span{font-family:monospace;font-size:8px}
.modal-layer .comparison>i{text-align:center;color:var(--muted)}
.modal-layer .comparison .new{border-color:#d7cff7;background:#faf8ff}
.modal-layer .section-title{display:flex;justify-content:space-between;align-items:center;margin:20px 0 10px}
.modal-layer .section-title>div{display:grid}
.modal-layer .section-title b{font-size:11px}
.modal-layer .section-title small{font-size:8px;color:var(--muted)}
.modal-layer .section-title button{border:0;background:transparent;color:var(--purple);font:inherit;font-size:9px;font-weight:800;cursor:pointer}
.modal-layer .matrix{border:1px solid var(--line);border-radius:12px;overflow:hidden}
.modal-layer .matrix-row{display:grid;grid-template-columns:minmax(160px,1.4fr) repeat(3,1fr) 60px;align-items:center;border-top:1px solid var(--line)}
.modal-layer .matrix-row:first-child{border:0}
.modal-layer .matrix-row>span,.modal-layer .matrix-row>label,.modal-layer .matrix-row>strong{padding:11px;text-align:center}
.modal-layer .matrix-head{background:var(--surface);font-size:8px;font-weight:800;text-transform:uppercase;color:var(--muted)}
.modal-layer .matrix-head span:first-child{text-align:left}
.modal-layer .matrix-head i{margin-right:4px}
.modal-layer .identity{display:flex!important;align-items:center;gap:9px;text-align:left!important}
.modal-layer .identity>i{display:grid;place-items:center;width:31px;height:31px;border-radius:8px;background:var(--purple-soft);color:var(--purple);flex:0 0 auto}
.modal-layer .identity>span{display:grid}
.modal-layer .identity b{font-size:10px}
.modal-layer .identity small{font-size:7px;color:var(--muted)}
.modal-layer .matrix-row label{cursor:pointer}
.modal-layer .matrix-row label input{display:none}
.modal-layer .matrix-row label i{display:inline-grid;place-items:center;width:22px;height:22px;border:1.5px solid #c9c5d3;border-radius:6px;background:#fff}
.modal-layer .matrix-row label input:checked+i{border-color:var(--purple);background:var(--purple)}
.modal-layer .matrix-row label input:checked+i:after{content:"";width:9px;height:5px;border:2px solid #fff;border-top:0;border-right:0;transform:rotate(-45deg) translate(1px,-1px)}
.modal-layer .matrix-row strong{font-size:15px;color:var(--purple);font-variant-numeric:tabular-nums}
.modal-layer .presets{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}
.modal-layer .presets button{display:grid;gap:3px;padding:12px 8px;border:1px solid var(--line);border-radius:10px;background:#fff;text-align:left;color:var(--ink);cursor:pointer}
.modal-layer .presets button:hover,.modal-layer .presets button.selected{border-color:var(--purple);background:#faf8ff}
.modal-layer .presets button>span{font-size:16px;font-weight:800;color:var(--purple)}
.modal-layer .presets button b{font-size:9px}
.modal-layer .presets small{font-size:7px;color:var(--muted)}
.modal-layer .presets .danger-preset>span{color:var(--bad)}
.modal-layer .cm-warning{display:flex;align-items:center;gap:10px;margin-top:14px;padding:13px;border:1px solid #f0caca;border-radius:11px;background:#fff7f7;color:#9b2929}
.modal-layer .cm-warning>span{display:grid;place-items:center;width:38px;height:38px;border-radius:10px;background:var(--bad-soft);color:var(--bad);flex:0 0 auto}
.modal-layer .cm-warning>div{flex:1}
.modal-layer .cm-warning b{font-size:10px}
.modal-layer .cm-warning p{margin:3px 0 0;font-size:8px}
.modal-layer .cm-warning em{padding:3px 7px;border-radius:20px;background:var(--bad-soft);font-size:7px;font-style:normal;font-weight:800;white-space:nowrap}
.modal-layer .cm-explanation{display:flex;gap:10px;margin-top:13px;padding:12px;border:1px solid #d8e4f8;border-radius:11px;background:#f5f9ff}
.modal-layer .cm-explanation>span{color:#2563eb}
.modal-layer .cm-explanation b{font-size:10px}
.modal-layer .cm-explanation p{margin:3px 0 0;color:var(--muted);font-size:8px;line-height:1.5}
.modal-layer .cm-advanced{display:grid;gap:8px;margin-top:13px}
.modal-layer .toggle-row{display:flex;align-items:center;gap:10px;padding:12px;border:1px solid var(--line);border-radius:11px;background:var(--surface)}
.modal-layer .toggle-row>span{display:grid;flex:1}
.modal-layer .toggle-row b{font-size:10px}
.modal-layer .toggle-row small{font-size:8px;color:var(--muted)}
.modal-layer .toggle-row input{display:none}
.modal-layer .toggle-row>i{width:36px;height:20px;padding:3px;border-radius:20px;background:#cbd0da;flex:0 0 auto}
.modal-layer .toggle-row>i:after{content:"";display:block;width:14px;height:14px;border-radius:50%;background:#fff}
.modal-layer .toggle-row input:checked+i{background:var(--good)}
.modal-layer .toggle-row input:checked+i:after{margin-left:16px}
.modal-layer .recursive-options{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.modal-layer .recursive-options label{display:flex;gap:8px;padding:10px;border:1px solid var(--line);border-radius:9px;cursor:pointer}
.modal-layer .recursive-options input{margin-top:2px;accent-color:var(--purple)}
.modal-layer .recursive-options span{display:grid}
.modal-layer .recursive-options b{font-size:9px}
.modal-layer .recursive-options small{font-size:7px;color:var(--muted)}
.modal-layer .cm-audit{display:flex;gap:6px;margin-right:auto;color:var(--muted);font-size:8px}
.modal-layer .cm-audit i{color:var(--good)}
@media(max-width:750px){.modal-layer .permission-overview{grid-template-columns:1fr}.modal-layer .presets{grid-template-columns:repeat(2,1fr)}.modal-layer .cm-meta{display:none}}
@media(max-width:560px){.modal-layer .matrix-row{grid-template-columns:120px repeat(3,1fr) 40px}.modal-layer .matrix-head span{font-size:0}.modal-layer .matrix-head span:first-child{font-size:8px}.modal-layer .matrix-head i{font-size:10px}.modal-layer .presets,.modal-layer .recursive-options{grid-template-columns:1fr}.modal-layer .comparison{grid-template-columns:1fr}.modal-layer .comparison>i{transform:rotate(90deg)}}

/* ---- CHMOD-Modal: lesbarere Schriftgrössen + Audit-Zeile über den Buttons ---- */
.modal-layer .modal-chmod .file-summary b{font-size:15px}
.modal-layer .modal-chmod .file-summary small,
.modal-layer .modal-chmod .permission-code small,
.modal-layer .modal-chmod .security-gauge small,
.modal-layer .modal-chmod .comparison small,
.modal-layer .modal-chmod .section-title small,
.modal-layer .modal-chmod .identity small,
.modal-layer .modal-chmod .cm-meta small,
.modal-layer .modal-chmod .presets small,
.modal-layer .modal-chmod .toggle-row small,
.modal-layer .modal-chmod .recursive-options small,
.modal-layer .modal-chmod .cm-warning p,
.modal-layer .modal-chmod .cm-explanation p{font-size:11px;line-height:1.5}
.modal-layer .modal-chmod .cm-meta b,
.modal-layer .modal-chmod .identity b,
.modal-layer .modal-chmod .presets button b,
.modal-layer .modal-chmod .toggle-row b,
.modal-layer .modal-chmod .recursive-options b,
.modal-layer .modal-chmod .cm-warning b,
.modal-layer .modal-chmod .cm-explanation b,
.modal-layer .modal-chmod .section-title b,
.modal-layer .modal-chmod .security-gauge b{font-size:13px}
.modal-layer .modal-chmod .permission-code span,
.modal-layer .modal-chmod .comparison span{font-size:14px}
.modal-layer .modal-chmod .comparison b{font-size:22px}
.modal-layer .modal-chmod .permission-code b{font-size:34px}
.modal-layer .modal-chmod .matrix-head{font-size:10px}
.modal-layer .modal-chmod .matrix-row strong{font-size:19px}
.modal-layer .modal-chmod .gauge b{font-size:19px}
.modal-layer .modal-chmod .gauge small{font-size:8px}
.modal-layer .modal-chmod .presets button>span{font-size:20px}
.modal-layer .modal-chmod .cm-warning em{font-size:9px}
.modal-layer .modal-chmod .section-title button{font-size:11px}
.modal-layer .modal-chmod .modal-kicker{font-size:9px}

/* Audit-Hinweis: eigene Zeile ganz oben im Footer, Buttons darunter */
.modal-layer .modal-chmod .modal-footer{flex-wrap:wrap;justify-content:flex-end}
.modal-layer .modal-chmod .cm-audit{order:-1;flex-basis:100%;justify-content:center;margin:0 0 12px;padding-bottom:12px;border-bottom:1px solid var(--line);font-size:11px}
.modal-layer .modal-chmod .modal-footer .btn{min-height:44px;font-size:11px;padding:11px 16px}

/* CHMOD-Footer: Audit-Zeile oben, Buttons nebeneinander, Abbrechen sichtbar */
.modal-layer .modal-chmod .modal-footer{display:block;flex-wrap:nowrap}
.modal-layer .modal-chmod .cm-audit{order:0;flex-basis:auto;justify-content:center;margin:0 0 12px;padding-bottom:12px;border-bottom:1px solid var(--line);font-size:11px}
.modal-layer .modal-chmod .cm-btns{display:flex;gap:10px;justify-content:flex-end}
.modal-layer .modal-chmod .cm-btns .btn{min-height:44px;font-size:11px;padding:11px 18px}
.modal-layer .modal-chmod .cm-btns .btn.secondary{background:#eceef3;border-color:#d3d9e6;color:var(--ink)}
.modal-layer .modal-chmod .cm-btns .btn.secondary:hover{background:#e2e5ee}
