/* ═══════════════════════════════════════════════════════════════════════════
 * ec-settings-v2.css — §SETTINGS-V2 / §LAYOUT-PREFS 2026-11-01
 * Einstellungs-Leiste mit Icons (Glas-Pillen wie im Tresor), Rechtliches als Zeilen,
 * Spalten-Griffe + Karten-Griffe (nur html.ec-lp-on = Desktop-Shell ohne Touch).
 * Spezifitaet: die Leisten-Regeln in ec-ux-chat.css tragen 3 Shell-IDs + !important →
 * hier 4 IDs (§0.4: Kaskade im Browser gemessen, nicht geraten).
 * ═══════════════════════════════════════════════════════════════════════════ */

@media (min-width: 900px) {
  /* ── Einstellungs-Leiste: Icon + Text als Pille ────────────────────────── */
  html body.auth-ready #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-settings-nav {
    gap: 4px !important; padding: 10px !important;
  }
  html body.auth-ready #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-settings-nav button {
    display: flex !important; align-items: center !important; gap: 11px !important;
    min-height: 42px !important; padding: 0 14px 0 12px !important; border-radius: 999px !important;
    text-align: left !important; justify-content: flex-start !important; white-space: nowrap !important;
  }
  html body.auth-ready #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-settings-nav button > span {
    min-width: 0; overflow: hidden; text-overflow: ellipsis;
  }
  html body.auth-ready #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-settings-nav .ecf-snav-ico {
    flex: 0 0 auto; width: 18px; height: 18px; opacity: .78; transition: opacity .15s ease;
  }
  html body.auth-ready #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-settings-nav button:hover .ecf-snav-ico,
  html body.auth-ready #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-settings-nav button.active .ecf-snav-ico { opacity: 1; }
  html body.auth-ready #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-settings-nav button:focus-visible {
    outline: 2px solid #bdbdbd !important; outline-offset: 2px !important;
  }

  /* ── Rechtliches: Beschreibung + „Öffnen“ ─────────────────────────────── */
  #ec-claude-shell-final .ecf-legal-list { display: flex; flex-direction: column; margin-top: 10px; }
  #ec-claude-shell-final .ecf-legal-row {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 12px 0; border-top: 1px solid rgba(113, 113, 113, 0.14);
  }
  #ec-claude-shell-final .ecf-legal-row:first-child { border-top: 0; }
  #ec-claude-shell-final .ecf-legal-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  #ec-claude-shell-final .ecf-legal-copy strong { font-size: 14px; font-weight: 600; color: var(--text, #e8e8f0); }
  #ec-claude-shell-final .ecf-legal-copy small { font-size: 12.5px; color: #a0a0a0; }
  #ec-claude-shell-final .ecf-legal-row .ecf-mini-action { flex: 0 0 auto; }
}

/* ── Spalten-Griffe ──────────────────────────────────────────────────────── */
.ec-lp-resizer { display: none; }
html.ec-lp-on .ec-lp-resizer {
  display: block; position: absolute; top: 0; bottom: 0; right: -3px; width: 7px; z-index: 30;
  cursor: col-resize; touch-action: none; background: transparent;
}
html.ec-lp-on .ec-lp-resizer::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 1px;
  background: transparent; transition: background .15s ease, box-shadow .15s ease;
}
html.ec-lp-on .ec-lp-resizer:hover::after,
html.ec-lp-on .ec-lp-resizer:focus-visible::after,
html.ec-lp-on .ec-lp-resizer.is-dragging::after {
  background: rgba(168, 85, 247, 0.85); box-shadow: 0 0 10px rgba(168, 85, 247, 0.55);
}
html.ec-lp-on .ec-lp-resizer:focus-visible { outline: none; }
html.ec-lp-dragging, html.ec-lp-dragging * { cursor: col-resize !important; user-select: none !important; }
html[data-ec-sb="collapsed"] #ec-sb2 > .ec-lp-resizer { display: none; }

/* Breiten — nur Desktop-Tor + gesetzter Wert. Spezifitaet ueber den gemessenen Regeln
   (Shell-Raster 3 IDs, Chatliste 2 IDs, Einstellungen 1 ID, Tresor :is()). */
@media (min-width: 900px) {
  html.ec-lp-on[data-ec-lp-sb]:not([data-ec-sb="collapsed"]) body #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final #ec-sb2 {
    width: var(--ec-lp-sb) !important;
  }
  html.ec-lp-on[data-ec-lp-list] body.auth-ready #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-chat-layout {
    grid-template-columns: var(--ec-lp-list) minmax(0, 1fr) !important;
  }
  html.ec-lp-on[data-ec-lp-setnav] body.auth-ready #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-settings {
    grid-template-columns: var(--ec-lp-setnav) minmax(0, 1fr) !important;
  }
}
/* §CHAT-LAYOUT-RP-2026-11-02 (Owner-Fund): die gespeicherte Chatlisten-Breite setzte das Raster oben auf ZWEI
   Spalten — das Chat-Tools-Panel (drittes Kind von .ecf-chat-layout) rutschte per Auto-Platzierung in Zeile 2 unter
   die Chatliste, und die zweite Zeile halbierte die Chat-Hoehe (Eingabeleiste mitten im Bild). Ab 1200 px bei offenem
   Chat + eingeblendetem Panel deshalb drei Spalten (hoehere Spezifitaet: + Klasse + :not), die Liste hoechstens 40 %,
   und jede Spalte fest in Zeile 1 platziert, damit kein Kind je umbricht. 900–1199 px: Panel ist eine Schublade
   (ec-tablet-split.css), dort bleibt es bei zwei Spalten. */
@media (min-width: 1200px) {
  html.ec-lp-on[data-ec-lp-list] body.auth-ready.ec-final-room-open #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final:not(.ecf-rp-hidden) .ecf-chat-layout {
    grid-template-columns: min(var(--ec-lp-list), 40%) minmax(0, 1fr) minmax(300px, 320px) !important;
  }
  html body.auth-ready #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-chat-layout > .ecf-contacts { grid-column: 1 !important; grid-row: 1 !important; }
  html body.auth-ready #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-chat-layout > .ecf-chat-panel { grid-column: 2 !important; grid-row: 1 !important; }
  html body.auth-ready #ec-claude-shell-final#ec-claude-shell-final#ec-claude-shell-final .ecf-chat-layout > .ecf-rightpanel { grid-column: 3 !important; grid-row: 1 !important; }
}
@media (min-width: 1241px) {
  html.ec-lp-on[data-ec-lp-vside] #vault-screen#vault-screen .ecvd.ecvd--desktop { grid-template-columns: var(--ec-lp-vside) minmax(0, 1fr) 320px; }
}
@media (min-width: 901px) and (max-width: 1240px) {
  html.ec-lp-on[data-ec-lp-vside] #vault-screen#vault-screen .ecvd.ecvd--desktop { grid-template-columns: var(--ec-lp-vside) minmax(0, 1fr); }
}

/* ── Karten-Griffe (Einstellungen) ───────────────────────────────────────── */
.ec-lp-grip { display: none; }
@media (min-width: 900px) {
  html.ec-lp-on #ec-claude-shell-final .ecf-settings-section > .ecf-settings-card[data-ec-lp-id] { position: relative; }
  html.ec-lp-on #ec-claude-shell-final .ecf-settings-card > .ec-lp-grip {
    display: grid; place-items: center; position: absolute; top: 12px; right: 12px; z-index: 2;
    width: 28px; height: 28px; padding: 0; border-radius: 8px; border: 1px solid transparent;
    background: transparent; color: rgba(255, 255, 255, 0.38); cursor: grab; touch-action: none;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
  }
  html.ec-lp-on #ec-claude-shell-final .ecf-settings-card > .ec-lp-grip:hover,
  html.ec-lp-on #ec-claude-shell-final .ecf-settings-card > .ec-lp-grip:focus-visible {
    color: #e9d5ff; background: rgba(139, 92, 246, 0.14); border-color: rgba(168, 85, 247, 0.35); outline: none;
  }
  html.ec-lp-on #ec-claude-shell-final .ecf-settings-card.ec-lp-card-dragging {
    opacity: .72; outline: 1px dashed rgba(168, 85, 247, 0.7); outline-offset: 3px;
  }
  html.ec-lp-dragging-card, html.ec-lp-dragging-card * { cursor: grabbing !important; user-select: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .ec-lp-resizer::after, .ec-lp-grip { transition: none !important; }
}
