/* Cleaned stylesheet: last-wins per property; duplicates merged */

:root {
  --bg: #ffffff;
  --text: #0b1420;
  --muted: #5b6573;
  --accent: #0d6efd;
  --border: #e6e9ee;
  --card: #f7f9fc;
  --shadow: 0 10px 20px rgba(15,23,42,.08);
  --ok: #1f9d55;
  --warn: #f59e0b;
  --bad: #ef4444;
}

* {
  box-sizing: border-box;
}

html,body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.4 system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  height: 100%;
}

.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-bottom: 0px solid var(--border);
}

.brand img {
  width: 85%;
  height: auto;
  object-fit: contain;
  opacity: .95;
}

.brand-title {
  font-weight: 700;
  letter-spacing: .2px;
}

.side-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px 6px 14px;
}

.side-header h2 {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.count-badge {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 999px;
}

.chain-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .12s ease, font .12s ease;
  font-size: 12px;
}

.chain-tile:hover {
  transform: translateY(-1px);
}

.chain-tile .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot.running {
  background: var(--ok);
}

.dot.paused {
  background: var(--warn);
}

.dot.stopped {
  background: var(--bad);
}

.chain-tile .name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chain-tile .sub {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-btn.play svg {
  fill: #334155;
  stroke: none;
}

.icon-btn.stop svg {
  fill: #ef4444;
  stroke: none;
}

.icon-btn.edit svg {
  fill: none;
  stroke: #334155;
}

.side-footer label {
  font-size: 11px;
  color: var(--muted);
}

.main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.workspace {
  height: 100%;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #fff;
  padding-bottom: 96px;
}

.workspace img {
  max-width: 180px;
  opacity: .9;
}

.workspace .generating {
  display: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

.workspace.generating .generating {
  display: block;
}

.workspace.generating img {
  display: none;
}

.workspace.show-graph {
  align-items: flex-start;
  justify-content: flex-start;
  padding: 12px 12px 96px;
}

.workspace.show-graph img, .workspace.show-graph .generating {
  display: none;
}

.workspace.show-graph .graph {
  display: block;
}

.graph {
  width: 100%;
  height: auto;
  min-height: 280px;
  max-height: calc(100vh - 160px);
  background: #fff;
  display: none;
}

.node rect {
  fill: #fff;
  stroke: var(--border);
  stroke-width: 1;
  rx: 8;
}

.node text {
  font-size: 10px;
  font-weight: 500;
  fill: #111827;
}

.edge {
  stroke: #cbd5e1;
  stroke-width: .9;
}

.arrow {
  fill: #cbd5e1;
}

.view-toggle {
  position: absolute;
  top: 8px;
  right: 12px;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.prompt-overlay {
  position: fixed;
  left: 300px;
  right: 12px;
  bottom: 48px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: 0 8px 24px rgba(2,6,23,.12);
}

.prompt-overlay textarea {
  flex: 1;
  min-height: 54px;
  max-height: 140px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  resize: vertical;
  background: #fff;
  font-size: 13px;
}

.prompt-overlay .actions {
  display: flex;
  gap: 6px;
  align-items: stretch;
  flex-direction: column;
}

.prompt-overlay .actions #btnGenerate {
  align-self: stretch;
}

button {
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 8px rgba(13,110,253,.2);
}

.btn-primary:disabled {
  opacity: .6;
}

button.ghost {
  background: #fff;
  border: 1px solid var(--border);
  color: #111;
}

/* --- Login-Modal: Divider, Tryout-Button & Rechts-Links --- */
.auth-divider {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}
.auth-try-btn {
  width: 100%;
}
.legal-inline {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1.2;
  color: var(--muted);
  opacity: .95;
}
.legal-inline a {
  color: inherit;
  text-decoration: none;
}
.legal-inline a:hover,
.legal-inline a:focus {
  text-decoration: underline;
}
@media print {
  .legal-inline { display: none; }
}

/* --- Rechtliches-Leiste unter dem Prompt-Overlay --- */
.legal-links {
  position: fixed;
  left: 300px;        /* ausgerichtet an Sidebar + Overlay */
  right: 12px;
  bottom: 4px;        /* knapp unter der Prompt-Leiste */
  font-size: 12px;
  line-height: 1.2;
  color: var(--muted);
  opacity: .9;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  z-index: 9;         /* unter Overlay (Overlay liegt höher) */
  pointer-events: auto;
}
.legal-links a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
}
.legal-links a:focus,
.legal-links a:hover {
  text-decoration: underline;
}

/* Mobile / schmale Layouts: links/rechts bündig führen */
@media (max-width: 860px) {
  .prompt-overlay { left: 12px; bottom: 56px; }
  .legal-links   { left: 12px; justify-content: center; }
}

@media print {
  .legal-links { display: none; }
}

.badge {
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

#apiStatus {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,.32);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: min(560px,96vw);
  max-height: 80vh;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(2,6,23,.20);
  padding: 12px;
  overflow: auto;
}

.modal h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.kv .k {
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  max-height: 60vh;
  overflow: auto;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
  background: #fff;
}

.table th,.table td {
  border-bottom: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
  background: #fff;
}

.table th {
  background: var(--card);
  position: sticky;
  top: 0;
}

.table colgroup col:nth-child(1) {
  width: 76px;
}

.table colgroup col:nth-child(2) {
  width: 160px;
}

.table colgroup col:nth-child(3) {
  width: auto;
}

.table td.val {
  font-variant-numeric: tabular-nums;
}

.curlsheet {
  padding: 14px;
  max-width: 100%;
  overflow: auto;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.curlsheet h1,.curlsheet h2,.curlsheet h3 {
  margin: 10px 0 6px;
}

.curlsheet h2 {
  margin: 12px 0 6px;
}

.curl-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 10px 0;
  background: #fff;
}

.curl-block header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.curl-block pre {
  position: relative;
  padding: 10px;
  background: #111;
  color: #fff;
  border-radius: 6px;
  overflow: auto;
}

.copy-btn,.run-btn {
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.copy-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(255,255,255,.1);
  color: #fff;
  border-color: #555;
}

.copy-btn:hover {
  background: rgba(255,255,255,.2);
}

.result {
  margin-top: 8px;
  background: #0b1020;
  color: #d6e1ff;
  padding: 8px;
  border-radius: 6px;
  white-space: pre-wrap;
  overflow: auto;
}

.curl-toolbar {
  position: sticky;
  top: 12px;
  z-index: 5;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px 10px;
  margin-bottom: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

body.hide-prompt .prompt-overlay {
  display: none;
}

.select-wrap {
  position: relative;
  display: inline-block;
}

.soft-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 38px 8px 12px;
  font: inherit;
  box-shadow: var(--shadow);
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}

.soft-select:hover {
  transform: translateY(-1px);
}

.soft-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.2);
}

.soft-select:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.select-wrap::after {
  content: "";
  position: absolute;
  pointer-events: none;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #64748b;
}

.prompt-overlay .soft-select {
  width: 100%;
  font-size: 12px;
  padding: 6px 34px 6px 10px;
  border-radius: 8px;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 18, 27, 0.6);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 9999;
}

.auth-overlay.hidden {
  display: none;
}

.auth-card {
  width: min(92vw, 420px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
  padding: 24px;
}

.auth-card h2 {
  margin: 0 0 6px;
  font: 600 20px/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.auth-sub {
  margin: 0 0 16px;
  color: #555;
  font-size: 14px;
}

.auth-label {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  font-size: 14px;
}

.auth-label input {
  padding: 10px 12px;
  border: 1px solid #d7d7d7;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
}

.auth-label input:focus {
  border-color: #7aa2ff;
  box-shadow: 0 0 0 3px rgba(122,162,255,.25);
}

#auth-login {
  width: 100%;
  margin-top: 12px;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: #1f6feb;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

#auth-login:hover {
  filter: brightness(0.95);
}

.auth-error {
  color: #b00020;
  min-height: 1.2em;
  margin-top: 10px;
  white-space: pre-wrap;
}

.bottom-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid #e6e6e6;
  background: #fff;
  z-index: 5;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #d7d7d7;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow .15s ease, transform .02s ease, background .15s ease;
  padding: 0 10px;
  color: #333;
}

.icon-btn:hover {
  transform: translateY(-1px);
  background: #f7f7f7;
}

.icon-btn:active {
  transform: translateY(1px);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: #334155;
  display: block;
}

.auth-info {
  color: #2a6;
  font-size: 13px;
}

.auth-switch {
  margin-top: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.linklike {
  background: transparent;
  border: 0;
  color: #1f6feb;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  font-size: 13px;
}

.linklike.subtle {
  color: #666;
  text-decoration: none;
}

.linklike.subtle:hover {
  text-decoration: underline;
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.auth-header h2 {
  margin: 0;
  font: 600 20px/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.auth-logo {
  height: 60px;
  width: auto;
  margin-left: 12px;
}

.side {
  display: flex;
  flex-direction: column;
  /* background: #fff; */
  background: #fdfcff;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100%;
  align-self: start;
  min-height: 0;
}

.chains {
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
}

.side-footer {
  border-top: 0px solid #e6e6e6;
  padding: 8px;
  /*background: #fff;*/
  background: #fbfcff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.profile-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #d7d7d7;
  border-radius: 10px;
  background: #fff;
  color: #333;
  cursor: pointer;
  text-align: left;
}

.profile-btn:hover {
  background: #f7f7f7;
}

.profile-btn:focus {
  outline: 2px solid rgba(31,111,235,.35);
  outline-offset: 2px;
}

.profile-btn .avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-btn .chev {
  opacity: .7;
}

.profile-menu {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 54px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,.12);
  padding: 6px;
  display: none;
}

.profile-menu.open {
  display: block;
}

.menu-item {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
}

.menu-item:hover {
  background: #f5f7fb;
}

.menu-item.danger {
  color: #b00020;
}

.menu-item.danger:hover {
  background: #fdecee;
}

.settings-overlay.hidden {
  display: none;
}

.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-overlay modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
}

.settings-dialog {
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
  max-height: 85vh;
  overflow: auto;
  padding: 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
}

.modal-body {
  display: flex;
  min-height: 360px;
}

.modal-nav {
  width: 200px;
  border-right: 1px solid #eee;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #f7f7f9;
  cursor: pointer;
}

.nav-item:not(.active):hover { background:#f0f2f7; }

.nav-item.active {
  background: #eef3ff;
  border-color: #c9d7ff;
}

.modal-content {
  flex: 1;
  padding: 16px;
}

.tab-panel.hidden {
  display: none;
}

.kv {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px;
  padding: 6px 0;
}

.kv label {
  color: #555;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  width: 100%;
}

.close-btn {
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.save-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.curl-block .body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: visible;
}

.code-wrap {
  position: relative;
  margin-bottom: 6px;
  z-index: 0;
}

.code-wrap pre {
  margin: 0;
  padding: 40px 10px 10px 10px;
  background: #111;
  color: #fff;
  border-radius: 6px;
  overflow: auto;
  white-space: pre;
  max-height: 320px;
}

.code-wrap .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid #555;
  border-radius: 6px;
  background: rgba(255,255,255,.1);
  color: #fff;
  cursor: pointer;
  z-index: 1;
}

.code-wrap .copy-btn:hover {
  background: rgba(255,255,255,.2);
}

.reqbar {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
  flex-direction: column;
}

.reqbar-label {
  font-size: 12px;
  color: #666;
}

.reqbar textarea {
  width: 100%;
  min-height: 120px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.actions-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.run-btn {
  align-self: flex-start;
}

.curl-block .result {
  white-space: pre-wrap;
  background: #0c0c0c;
  color: #eaeaea;
  border-radius: 6px;
  padding: 8px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid #222;
}

/* Prompt standardmäßig ausblenden; nur bei .show-prompt zeigen */
.prompt-overlay { display: none; }
body.show-prompt .prompt-overlay { display: flex; }

/* + Neue Kette Kachel */
.chain-tile.add-new {
  justify-content: center;
  gap: 8px;
  border: 1px dashed var(--border);
  background: #fff;
}
.chain-tile.add-new .plus {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0px solid #cdd6ee; border-radius: 6px;
  font-weight: 700;
}

/* + Neue Prozesskette Kachel */
.chain-tile.add-new {
  justify-content: center;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  color: #369BBF;                /* Grün wie dein --ok */
  border: 2px dashed #1f9d55;    /* grün-gestrichelte Linie */
  background: #fff;
  box-shadow: none;              /* kein Schatten */
  cursor: pointer;
}

.chain-tile.add-new:hover {
  background: #f0fff4;           /* leichtes Grün bei Hover */
}

.chain-tile.add-new .plus {
  font-size: 22px;
  line-height: 1;
}

.chain-tile.add-new {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 28px;              /* schön groß */
  font-weight: 700;
  color: #369BBF;               /* Grün */
  border: 2px dashed #369BBF;   /* grün-gestrichelte Linie */
  background: #fff;
  box-shadow: none;
  min-height: 48px;             /* gleiche Höhe wie andere Tiles */
}

.chain-tile.add-new:hover {
  background: #f0fff4;          /* dezentes Grün bei Hover */
}

.chains {
  padding: 14px 12px;           /* etwas mehr Padding oben/unten */
  gap: 12px;                    /* Abstand zwischen den Kacheln leicht erhöhen */
}

/* Generating 2-step UI */
#generating .gen-steps { display:flex; flex-direction:column; gap:8px; align-items:center; }
#generating .gen-step { display:flex; gap:8px; align-items:center; font-size:14px; }
#generating .gen-step .label { font-weight:600; }
#generating .gen-step .status { opacity:.8; }
#generating .gen-step.active .status { opacity:1; }
#generating .gen-step.done .status::before { content: "✓ "; }

#generating .gen-deployment { border-top: 1px dashed rgba(0,0,0,.15); padding-top: 6px; }

/* Settings-Optik */
.settings-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0;
  box-shadow: var(--shadow);
}

.settings-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.settings-desc {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin: 0 0 10px 0;
}

/* Kompakter Number-Input */
.w-compact {
  max-width: 160px;
}

/* Schöner Toggle (Switch) – harmoniert mit dem restlichen Look */
.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
}

.switch input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 42px;
  height: 24px;
  background: #e5e7eb;
  border: 1px solid var(--border);
  border-radius: 9999px;
  position: relative;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.switch input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 9999px;
  box-shadow: 0 1px 3px rgba(2,6,23,.12);
  transition: transform .15s ease;
}

.switch input[type="checkbox"]:hover {
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.switch input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: #3b82f6;
}

.switch input[type="checkbox"]:checked::after {
  transform: translateX(18px);
}

.switch .switch-label {
  user-select: none;
}

/* Settings-Optik für alle Tabs (Info, Token, Allgemein) */
.settings-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0;
  box-shadow: var(--shadow);
}

.settings-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.settings-desc {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin: 0 0 10px 0;
}

.settings-group .row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* ---- Danger Button ------------------------------------------------------- */
:root{
  --danger:     #ef4444; /* red-500 */
  --danger-600: #dc2626;
  --danger-700: #b91c1c;
}

/* Soft-Stil, passt zu deinen bestehenden Buttons */
.soft-btn.danger,
button.danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
  border: 1px solid rgba(239,68,68,.45);
  background: rgba(239,68,68,.08);
  color: var(--danger-700);
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .02s ease;
  cursor: pointer;
}

.soft-btn.danger:hover,
button.danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.soft-btn.danger:active,
button.danger:active {
  transform: translateY(1px);
}

.soft-btn.danger:focus-visible,
button.danger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(239,68,68,.2);
}

.soft-btn.danger[disabled],
button.danger[disabled] {
  opacity: .6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Optional: „Ghost“-Variante (nur Text, ohne Füllung) */
.ghost.danger {
  background: transparent;
  border: 1px solid transparent;
  color: var(--danger-700);
}
.ghost.danger:hover {
  background: rgba(239,68,68,.08);
  border-color: rgba(239,68,68,.25);
}

/* Kompaktere Buttons (opt-in per .btn-slim) */
.btn-slim {
  height: 32px;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 8px;
}

/* Soft-Button-Varianten */
.soft-btn { border: 1px solid var(--border); background: var(--card); }
.soft-btn:hover { filter: brightness(0.98); }
.soft-btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.soft-btn.secondary { background: #f3f4f6; }

/* Link-artiger Danger-Button (für „Kette löschen“) */
.link-btn { background: transparent; border: 0; padding: 0; height: auto; font-size: 13px; }
.link-btn.danger { color: #ef4444; }
.link-btn.danger:hover { text-decoration: underline; }

/* Actions-Zeile im Modal */
#chain-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
#chain-actions #btn-delete-chain {
  margin-left: auto; /* schiebt Delete nach rechts */
}

/* Modal-Titel + X-Button */
.modal-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.icon-btn.close {
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
}
.icon-btn.close:hover { background: rgba(0,0,0,.05); }

/* Modal-Titlebar + X (wie Settings) */
.modal { position: relative; }
.modal-titlebar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-right: 40px;
}
.icon-btn.close {
  position: absolute; top: 8px; right: 8px;
  border: 0; background: transparent;
  font-size: 20px; line-height: 1; width: 32px; height: 32px;
  border-radius: 8px; cursor: pointer; color: var(--muted);
}
.icon-btn.close:hover { background: rgba(0,0,0,.05); }

/* Kompakte Buttons (schon genutzt in Settings) */
.btn-slim { height: 32px; padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.soft-btn { border: 1px solid var(--border); background: var(--card); }
.soft-btn:hover { filter: brightness(0.98); }
.soft-btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.soft-btn.secondary { background: #f3f4f6; }
.link-btn { background: transparent; border: 0; padding: 0; height: auto; font-size: 13px; cursor: pointer; }
.link-btn.danger { color: #ef4444; }
.link-btn.danger:hover { text-decoration: underline; }

/* Gemeinsame Action-Leiste unten im Modal */
.modal-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 10px; flex-wrap: wrap;
}
.modal-actions .left,
.modal-actions .right {
  display: flex; align-items: center; gap: 8px;
}
.modal-actions .right { margin-left: auto; } /* schiebt rechts zusammen */

/* Titlebar + X (wie Settings) */
.modal { position: relative; }
.modal-titlebar { display:flex; align-items:center; justify-content:space-between; gap:8px; padding-right:40px; }
.icon-btn.close {
  position:absolute; top:8px; right:8px;
  border:0; background:transparent; font-size:20px; line-height:1;
  width:32px; height:32px; border-radius:8px; cursor:pointer; color:var(--muted);
}
.icon-btn.close:hover { background:rgba(0,0,0,.05); }

/* Buttons (kompakt) */
.btn-slim { height:32px; padding:6px 10px; font-size:13px; border-radius:8px; }
.soft-btn { border:1px solid var(--border); background:var(--card); }
.soft-btn:hover { filter:brightness(0.98); }
.soft-btn.primary { background:var(--accent); color:#fff; border-color:transparent; }
.soft-btn.secondary { background:#f3f4f6; }
.link-btn { background:transparent; border:0; padding:0; height:32px; font-size:13px; cursor:pointer; }
.link-btn.danger { color:#ef4444; }
.link-btn.danger:hover { text-decoration:underline; }
/* Vollbreite-Schaltfläche in Gridzelle */
.btn-block { width:100%; }

/* Actions-Sektion: zwei Reihen */
.modal-actions { display:flex; flex-direction:column; gap:10px; margin-top:12px; }

/* Reihe 1: DC + kurze Erklärung + Status */
.dc-row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.settings-desc.inline { color:var(--muted); font-size:12px; }

/* Reihe 2: drei Buttons gleichmäßig über die volle Breite */
.btn-row.grid-3 {
  display:grid; grid-template-columns:repeat(3, 1fr); gap:10px;
}

/* DC-Zeile: Erklärung rechts neben dem Button (gleiche Zeile) */
.modal-actions { grid-column: 1 / -1; } /* über beide Form-Spalten! */
.dc-row{
  display:flex; align-items:center; gap:10px;
  flex-wrap: nowrap;                 /* bleibt in einer Zeile */
}
.dc-row .settings-desc.inline{
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;               /* nicht unter den Button rutschen */
}

/* Drei gleich breite Spalten über die komplette Modalbreite */
.btn-row.grid-3{
  display:grid; grid-template-columns:repeat(3,1fr); gap:10px;
}

/* Buttons in der Reihe: volle Zellbreite, gleiche Höhe */
.btn-row.grid-3 .soft-btn,
.btn-row.grid-3 .link-btn { width:100%; height:32px; }

/* DC-Zeile: Button etwas breiter, Text rechts darf umbrechen */
.dc-row {
  display: flex;
  align-items: flex-start;   /* passt, wenn der Text 2-zeilig wird */
  gap: 10px;
  flex-wrap: wrap;           /* erlaubt Umbruch, wenn der Platz knapp wird */
}

#btn-doublecheck {
  min-width: 150px;          /* Button etwas breiter */
  padding: 6px 14px;         /* dezent mehr horizontaler Platz */
}

.dc-row .settings-desc.inline {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;       /* WICHTIG: darf umbrochen werden */
  flex: 1 1 260px;           /* nimmt restlichen Platz, 2 Zeilen möglich */
}

/* (Optional) Status rechts ausrichten, bleibt klein */
#doublecheck-status.hint {
  margin-left: auto;
  font-size: 12px;
}


/* Bei schmalen Screens untereinander */
@media (max-width:720px){
  .btn-row.grid-3{ grid-template-columns:1fr; }
}


/* Bei schmalen Screens darf's umbrechen */
@media (max-width: 720px){
  .dc-row{ flex-wrap: wrap; }
  .dc-row .settings-desc.inline{ white-space: normal; }
}


/* responsive: bei schmalen Screens 1 Spalte */
@media (max-width: 720px) {
  .btn-row.grid-3 { grid-template-columns: 1fr; }
}


@media (max-width: 720px) {
  .modal-actions { flex-direction: column; align-items: stretch; }
  .modal-actions .right { margin-left: 0; justify-content: flex-end; flex-wrap: wrap; }
}


@media (max-width: 900px) {
.app {
  grid-template-columns: 1fr;
}

.prompt-overlay {
  left: 12px;
}
}

@media (prefers-reduced-motion: reduce) {
* {
  transition: none !important;
  animation: none !important;
}
}
