/* NeXtMail – Editor-Werkzeuge (nmedit.js, c23-signatur). DIESELBE Datei in Webmail und Windows-Client. Farben über die
   Variablen der Oberfläche (--panel, --line, --text, --muted, --hover, --accent, --accent-soft), hell und dunkel. */

/* Kombifelder Schriftgröße / Schriftart */
.nme-kombi { display: inline-flex; align-items: stretch; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); flex: none; min-width: 0; box-sizing: border-box; }
.nme-kombi:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.nme-kombi-ein { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; padding: 0 4px 0 8px; outline: none; }
.nme-kombi-ein.fehler { color: var(--gefahr, #c92a2a); }
.nme-groesse .nme-kombi-ein { text-align: right; padding-right: 2px; }
.nme-kombi-pf { flex: none; width: 22px; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; padding: 0; border-radius: 0 6px 6px 0; font-size: 11px; }
.nme-kombi-pf:hover { background: var(--hover); color: var(--text); }

/* Aufklapper (Listen, Paletten, Menüs) */
.nme-pop { position: fixed; z-index: 140; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(0, 0, 0, .18); padding: 6px; max-height: calc(100vh - 16px); max-width: calc(100vw - 16px); overflow: auto; box-sizing: border-box; }
.nme-pop .nme-kopfz { padding: 6px 4px 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.nme-pop-zeile { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); cursor: pointer; font: inherit; font-size: 13px; text-align: left; white-space: nowrap; }
.nme-pop-zeile:hover, .nme-pop-zeile:focus-visible { background: var(--hover); outline: none; }
.nme-pop-zeile.an { font-weight: 600; }
.nme-haken-sym { width: 14px; flex: none; color: var(--accent); }
.nme-trennlinie { height: 1px; background: var(--line); margin: 4px 0; }
.nme-liste { display: flex; flex-direction: column; min-width: 100%; }
.nme-listen-zeile { display: block; width: 100%; min-height: 30px; padding: 4px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); cursor: pointer; text-align: left; font-size: 15px; white-space: nowrap; }
.nme-groesse ~ .nme-listen-zeile, .nme-kombi-pop .nme-listen-zeile { font-size: 14px; }
.nme-listen-zeile:hover, .nme-listen-zeile:focus-visible { background: var(--hover); outline: none; }
.nme-listen-zeile.an { background: var(--accent-soft); color: var(--akzent-text, var(--accent)); }
.nme-kombi-pop { max-height: min(420px, calc(100vh - 16px)); }

/* Farben */
.nme-palette { width: 252px; }
.nme-farbraster { display: grid; grid-template-columns: repeat(10, 20px); gap: 3px 4px; padding: 2px 4px 4px; }
.nme-design { row-gap: 1px; }
.nme-design > :nth-child(-n+10) { margin-bottom: 4px; }
.nme-farbe { display: block; width: 20px; height: 20px; padding: 0; margin: 0; border: 1px solid rgba(0, 0, 0, .18); border-radius: 3px; cursor: pointer; box-sizing: border-box; }
.nme-farbe:hover, .nme-farbe:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; position: relative; z-index: 1; }
.nme-ohne { background: linear-gradient(135deg, #fff 45%, #c92a2a 46%, #c92a2a 54%, #fff 55%); flex: none; }
.nme-regenbogen { background: conic-gradient(#f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); flex: none; border-radius: 50%; }
.nme-weitere { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; }

/* Dialoge */
.nme-schleier { position: fixed; inset: 0; z-index: 150; background: rgba(15, 20, 30, .35); display: flex; align-items: center; justify-content: center; padding: 16px; }
.nme-dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); width: 100%; max-width: 420px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.nme-dialog.breit { max-width: 560px; }
.nme-dlg-kopf { display: flex; align-items: center; gap: 8px; padding: 14px 12px 8px 20px; }
.nme-dlg-kopf h2 { flex: 1; margin: 0; font-size: 17px; font-weight: 600; }
.nme-x { width: 32px; height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }
.nme-x:hover { background: var(--hover); color: var(--text); }
.nme-dlg-inhalt { padding: 4px 20px 14px; overflow: auto; }
.nme-dlg-fuss { display: flex; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.nme-kn { height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; }
.nme-kn:hover { background: var(--hover); }
.nme-kn.haupt { background: var(--accent); border-color: var(--accent); color: #fff; }
.nme-form { display: flex; flex-direction: column; gap: 10px; }
.nme-zeile { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 1.2fr); align-items: center; gap: 10px; font-size: 13.5px; }
.nme-feldrahmen { display: flex; align-items: center; gap: 6px; min-width: 0; }
.nme-feld { height: 34px; min-width: 0; width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); padding: 0 10px; font: inherit; font-size: 13.5px; }
.nme-feld:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.nme-einheit { color: var(--muted); font-size: 12.5px; flex: none; }
.nme-haken { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.nme-farbwahl { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; }
.nme-sv { position: relative; width: 220px; height: 160px; border-radius: 6px; cursor: crosshair; touch-action: none; border: 1px solid var(--line); }
.nme-sv:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nme-sv-punkt { position: absolute; width: 12px; height: 12px; margin: -7px 0 0 -7px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .6); pointer-events: none; }
.nme-ton { width: 100%; height: 14px; -webkit-appearance: none; appearance: none; border-radius: 7px; background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.nme-ton::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 18px; border-radius: 4px; background: #fff; border: 1px solid #555; }
.nme-tonzeile { grid-template-columns: auto 1fr; margin-top: 10px; }
.nme-farbwahl-rechts { display: flex; flex-direction: column; gap: 8px; }
.nme-farbwahl-rechts .nme-zeile { grid-template-columns: 54px 1fr; }
.nme-vgl { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 22px 22px; gap: 0 8px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 4px; }
.nme-vgl-neu, .nme-vgl-alt { height: 22px; border: 1px solid var(--line); }
.nme-vgl-neu { grid-column: 2; grid-row: 1; border-radius: 6px 6px 0 0; }
.nme-vgl-alt { grid-column: 2; grid-row: 2; border-radius: 0 0 6px 6px; }
.nme-vgl .nme-vgl-t:first-child { grid-column: 1; grid-row: 1; }
.nme-vgl .nme-vgl-t:last-child { grid-column: 1; grid-row: 2; }

/* Tabellen */
.nme-tabraster { display: grid; gap: 2px; padding: 2px 4px 6px; }
.nme-zelle { width: 18px; height: 18px; padding: 0; border: 1px solid var(--line); border-radius: 2px; background: var(--panel); cursor: pointer; }
.nme-zelle.an, .nme-zelle:focus-visible { background: var(--accent-soft); border-color: var(--accent); outline: none; }
.nme-tleiste { position: fixed; z-index: 120; display: flex; align-items: center; gap: 2px; padding: 3px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 16px rgba(0, 0, 0, .14); }
.nme-tk { display: inline-flex; align-items: center; gap: 2px; height: 28px; min-width: 28px; padding: 0 5px; border: 0; border-radius: 6px; background: transparent; color: var(--text); cursor: pointer; font-size: 14px; }
.nme-tk:hover, .nme-tk:focus-visible { background: var(--hover); outline: none; }
.nme-tk .nme-pf { font-size: 10px; color: var(--muted); }
.nme-trenn { width: 1px; height: 18px; background: var(--line); margin: 0 3px; }
.nme-ecke { width: 14px; height: 14px; margin-left: 4px; border-right: 3px solid var(--muted); border-bottom: 3px solid var(--muted); border-radius: 0 0 3px 0; cursor: nwse-resize; touch-action: none; }
/* Hilfslinien für Tabellen ohne Rahmen – nur am Bildschirm (outline, nicht im HTML der Mail) */
.nme-ed table td, .nme-ed table th { outline: 1px dashed rgba(128, 140, 160, .45); outline-offset: -1px; }

/* Bilder */
.nme-ed img { cursor: pointer; }
.nme-bildrahmen { position: fixed; z-index: 115; border: 1px solid var(--accent); pointer-events: none; box-sizing: border-box; }
.nme-griff { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; background: #fff; border: 1px solid var(--accent); border-radius: 2px; pointer-events: auto; touch-action: none; box-sizing: border-box; }
.nme-nw { left: 0; top: 0; cursor: nwse-resize; } .nme-n { left: 50%; top: 0; cursor: ns-resize; } .nme-ne { left: 100%; top: 0; cursor: nesw-resize; }
.nme-e { left: 100%; top: 50%; cursor: ew-resize; } .nme-se { left: 100%; top: 100%; cursor: nwse-resize; } .nme-s { left: 50%; top: 100%; cursor: ns-resize; }
.nme-sw { left: 0; top: 100%; cursor: nesw-resize; } .nme-w { left: 0; top: 50%; cursor: ew-resize; }
.nme-mass { position: absolute; right: 0; bottom: 100%; margin-bottom: 4px; padding: 1px 6px; border-radius: 4px; background: var(--accent); color: #fff; font-size: 11px; white-space: nowrap; }

@media (max-width: 760px) {
  .nme-kombi { height: 40px; }
  .nme-tk { height: 36px; min-width: 36px; }
  .nme-farbwahl { grid-template-columns: 1fr; }
  .nme-sv { width: 100%; }
  .nme-griff { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
}
