/* LIRENO Mandanten Login — CSS v0.9.25
   Vollständig dynamisch: clamp() für alle Größen.
   Container-Queries statt Media-Queries.
   Zentrierter Max-Width-Container.
   KPI immer rechts, kein Jump, kein Overlap. */

/* ═══════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════ */
.tbml-wrap {
  --tbml-bg:          #F5F4EE;
  --tbml-surface:     #FFFFFF;
  --tbml-surface-2:   #EDECE6;
  --tbml-border:      #DEDAD4;
  --tbml-text:        #1A1A1A;
  --tbml-muted:       #6B6A63;
  --tbml-accent:      #059669;
  --tbml-warning:     #D97706;
  --tbml-danger:      #DC2626;
  --tbml-radius:      10px;
  --tbml-shadow-sm:   0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --tbml-shadow:      0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
  --tbml-font:        system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  box-sizing: border-box;
  font-family: var(--tbml-font);
  color: var(--tbml-text);
  line-height: 1.5;
}

.tbml-wrap *, .tbml-wrap *::before, .tbml-wrap *::after {
  box-sizing: border-box;
}

/* ═══════════════════════════════════════
   AUTH — Schritt 1 + 2
═══════════════════════════════════════ */
#tbml-root[data-active-step="1"],
#tbml-root[data-active-step="2"],
#tbml-root[data-active-step="25"],
#tbml-root[data-active-step="30"],
.tbml-wrap--login,
.tbml-wrap--register {
  background: radial-gradient(120% 80% at 50% 0%, #e8f5ef 0%, var(--tbml-bg) 55%);
  padding: clamp(32px, 6vw, 64px) 16px;
  min-height: min(100vh, 720px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
/* Login: Theme-Shell neutralisieren + Maske viewport-zentriert */
body.tbml-auth-screen {
  margin: 0;
}

body.tbml-auth-screen .site-content,
body.tbml-auth-screen .entry-content,
body.tbml-auth-screen .wp-block-post-content,
body.tbml-auth-screen main,
body.tbml-auth-screen #content,
body.tbml-auth-screen .content-area {
  max-width: none !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* WP-Theme (tb-site-shell): Login im sichtbaren Bereich unter Topnav zentrieren */
body.tbml-auth-screen.tb-site-shell .tb-main--auth-app,
body.tbml-auth-screen.tb-site-shell .tb-main--no-hero:has(#tbml-root) {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  min-height: calc(100dvh - clamp(88px, 22vw, 118px));
  padding: 12px 0 28px;
  box-sizing: border-box;
}

body.admin-bar.tbml-auth-screen.tb-site-shell .tb-main--auth-app,
body.admin-bar.tbml-auth-screen.tb-site-shell .tb-main--no-hero:has(#tbml-root) {
  min-height: calc(100dvh - clamp(120px, 26vw, 154px));
}

body.tb-lireno-standart.tbml-auth-screen.tb-site-shell .tb-main--auth-app,
body.tb-lireno-standart.tbml-auth-screen.tb-site-shell .tb-main--no-hero:has(#tbml-root) {
  min-height: calc(100dvh - clamp(122px, 28vw, 168px));
}

body.tbml-auth-screen .tb-main .tb-section {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 0 !important;
}

body.tbml-auth-screen .tb-main .tb-container,
body.tbml-auth-screen .tb-main .tb-container.tb-content {
  max-width: none !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 16px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

body.tbml-auth-screen .entry-header,
body.tbml-auth-screen .tb-page-header--no-hero {
  display: none !important;
}

body.tbml-auth-screen .entry-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Standalone (Passwort-Reset): volle Viewport-Hoehe */
body.tbml-auth-screen:not(.tb-site-shell) .tbml-wrap--login,
body.tbml-auth-screen:not(.tb-site-shell) #tbml-root.tbml-wrap--login {
  min-height: 100dvh;
}

/* Im Theme: Hoehe vom Parent — nicht nochmals 100vh */
body.tbml-auth-screen.tb-site-shell #tbml-root.tbml-wrap--login,
body.tbml-auth-screen.tb-site-shell .tbml-wrap.tbml-wrap--login#tbml-root {
  width: 100%;
  max-width: none;
  min-height: auto;
  box-sizing: border-box;
  padding: clamp(16px, 3vw, 32px) 16px;
}

.tbml-wrap--login .tbml-auth-layout {
  width: min(440px, calc(100% - 32px));
  margin: 0 auto;
  flex: 0 0 auto;
}

.tbml-wrap--login > #tbml-error {
  flex: 0 0 auto;
  width: min(440px, calc(100% - 32px));
  margin: 12px auto 0;
}

/* Kopfbereich der Login-Karte zentrieren */
.tbml-wrap--login .tbml-card--auth .tbml-auth-brand {
  justify-content: center;
}

.tbml-wrap--login .tbml-card--auth .tbml-auth-eyebrow,
.tbml-wrap--login .tbml-card--auth .tbml-auth-title,
.tbml-wrap--login .tbml-card--auth > .tbml-auth-lead {
  text-align: center;
}


.tbml-auth-layout {
  width: 100%;
  max-width: 440px;
}

/* Login-Screen: nur den zweiten Header-Bereich ausblenden (Modul-Leiste). */
body.tbml-auth-screen #tb-site-shell-nav .tb-mod-rail,
body.tbml-auth-screen #tb-landing-nav .tb-mod-rail {
  display: none !important;
}

.tbml-card {
  background: var(--tbml-surface, #ffffff);
  border: 1px solid var(--tbml-border, #dedad4);
  border-radius: var(--tbml-radius);
  box-shadow: var(--tbml-shadow);
  padding: 28px 32px;
}

.tbml-card--auth {
  width: 100%;
  max-width: 440px;
  padding: clamp(28px, 4vw, 36px) clamp(24px, 4vw, 36px);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(26, 26, 26, 0.08), 0 2px 8px rgba(26, 26, 26, 0.04);
}

.tbml-auth-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 22px;
}
.tbml-auth-progress__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tbml-border);
  flex-shrink: 0;
}
.tbml-auth-progress__dot.is-active { background: var(--tbml-accent); box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.15); }
.tbml-auth-progress__dot.is-done { background: var(--tbml-accent); }
.tbml-auth-progress__line {
  width: 36px;
  height: 2px;
  background: var(--tbml-border);
  margin: 0 4px;
}
.tbml-auth-progress__line.is-done { background: var(--tbml-accent); }

.tbml-auth-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tbml-accent);
}

.tbml-auth-lead {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--tbml-muted);
}

.tbml-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--tbml-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tbml-auth-divider::before,
.tbml-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--tbml-border);
}

.tbml-member-direct {
  margin-bottom: 8px;
}

.tbml-auth-features {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--tbml-muted);
  border-top: 1px solid var(--tbml-border);
  padding-top: 14px;
}
.tbml-auth-features li {
  padding: 4px 0 4px 18px;
  position: relative;
}
.tbml-auth-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tbml-accent);
  opacity: 0.7;
}

.tbml-input--lg { font-size: 16px; padding: 12px 14px; }
.tbml-input--otp {
  font-size: 28px;
  letter-spacing: 0.35em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding: 14px 12px;
}

.tbml-btn--block { width: 100%; }

.tbml-qr-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px auto 16px;
  padding: 16px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--tbml-border);
  max-width: 280px;
}
.tbml-qr-frame__pulse {
  position: absolute;
  inset: 12px;
  border-radius: 10px;
  border: 2px solid rgba(5, 150, 105, 0.25);
  animation: tbml-qr-pulse 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes tbml-qr-pulse {
  0% { transform: scale(0.98); opacity: 0.9; }
  70% { transform: scale(1.04); opacity: 0; }
  100% { transform: scale(1.04); opacity: 0; }
}

.tbml-auth-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  font-size: 14px;
  color: var(--tbml-muted);
  min-height: 24px;
}
.tbml-auth-status__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--tbml-border);
  border-top-color: var(--tbml-accent);
  border-radius: 50%;
  animation: tbml-spin 0.8s linear infinite;
}
@keyframes tbml-spin { to { transform: rotate(360deg); } }

.tbml-auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.tbml-brand__logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--tbml-text);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .04em;
  flex-shrink: 0;
}

.tbml-brand__logo-img {
  height: 34px;
  width: auto;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.tbml-brand__name,
.tbml-brand .tbml-brand__name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.01em;
}

.tbml-auth-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.tbml-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tbml-muted);
  margin-top: 16px;
  margin-bottom: 6px;
}

/* ═══════════════════════════════════════
   INPUTS + SELECTS
═══════════════════════════════════════ */
.tbml-input,
#tbml-mandant,
.tbml-company-form input,
.tbml-company-form select {
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--tbml-border, #dedad4);
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--tbml-surface, #ffffff);
  color: var(--tbml-text);
  transition: border-color .15s, box-shadow .15s;
}

.tbml-input:focus,
#tbml-mandant:focus,
.tbml-company-form input:focus,
.tbml-company-form select:focus {
  outline: none;
  border-color: var(--tbml-text);
  box-shadow: 0 0 0 3px rgba(26,26,26,.08);
}

.tbml-qr, #tbml-qr {
  width: 100%;
  max-width: 240px;
  height: auto;
  aspect-ratio: 1;
  border: none;
  border-radius: 8px;
  display: block;
  margin: 0;
  position: relative;
  z-index: 1;
}

.tbml-auth-actions { margin-top: 20px; }
.tbml-auth-actions--split {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  align-items: stretch;
}
.tbml-auth-actions--split .tbml-btn {
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
}
.tbml-auth-actions--surfaces .tbml-btn--surface {
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s, color .2s;
}
.tbml-wrap--login .tbml-auth-actions--surfaces .tbml-btn--primary {
  color: #fff;
  background: linear-gradient(180deg, #1a2330 0%, #0d1117 55%, #0a0e14 100%);
  border-color: transparent;
  box-shadow: 0 1px 0 rgba(255,255,255,.14) inset, 0 8px 22px rgba(13,17,23,.14);
}
.tbml-wrap--login .tbml-auth-actions--surfaces .tbml-btn--primary:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #228b4a 0%, #1a6b3c 55%, #14532d 100%);
  border-color: transparent;
  color: #fff;
}
.tbml-wrap--login .tbml-auth-actions--surfaces .tbml-btn--secondary {
  background: rgba(255,255,255,.85);
  border: 1px solid var(--tbml-border, #d6d0c4);
  color: var(--tbml-text, #0d1117);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.tbml-wrap--login .tbml-auth-actions--surfaces .tbml-btn--secondary:hover {
  border-color: var(--tbml-accent, #1a6b3c);
  color: var(--tbml-accent, #1a6b3c);
  background: #fff;
}
@media (max-width: 520px) {
  .tbml-auth-actions--split {
    flex-wrap: wrap;
  }
  .tbml-auth-actions--split .tbml-btn {
    flex: 1 1 100%;
    white-space: normal;
  }
}

.tbml-auth-forgot-wrap {
  margin: 14px 0 0;
  text-align: center;
}

.tbml-auth-forgot-link {
  border: none;
  background: none;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--tbml-accent);
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tbml-auth-forgot-link:hover {
  color: #047857;
}

.tbml-auth-actions--entry {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

.tbml-entry-intent {
  width: 100%;
  margin: 0 0 18px;
}

.tbml-entry-intent__lead {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tbml-text);
  text-align: center;
}

.tbml-entry-grid--step1 {
  margin-bottom: 4px;
}

.tbml-entry-option.is-selected {
  border-color: var(--tbml-accent);
  box-shadow: 0 0 0 1px var(--tbml-accent);
}

.tbml-entry-shell {
  width: 100%;
  margin-top: 4px;
}

.tbml-entry-shell__lead {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tbml-text);
  text-align: center;
}

.tbml-entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.tbml-entry-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 96px;
  padding: 14px 12px;
  border: 1px solid var(--tbml-border);
  border-radius: 12px;
  background: var(--tbml-surface);
  color: var(--tbml-text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  box-shadow: var(--tbml-shadow-sm);
}

.tbml-entry-option:hover {
  border-color: var(--tbml-text);
  box-shadow: var(--tbml-shadow);
}

.tbml-entry-option:focus-visible {
  outline: none;
  border-color: var(--tbml-accent);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.18);
}

.tbml-entry-option--accent {
  border-color: rgba(5, 150, 105, 0.35);
  background: linear-gradient(180deg, #f0fdf8 0%, var(--tbml-surface) 100%);
}

.tbml-entry-option--accent:hover {
  border-color: var(--tbml-accent);
}

.tbml-entry-option__icon {
  font-size: 22px;
  line-height: 1;
}

.tbml-entry-option__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tbml-entry-option__sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--tbml-muted);
  text-align: center;
  line-height: 1.35;
}

.tbml-entry-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--tbml-border);
  border-radius: 10px;
  background: var(--tbml-surface-2);
  color: var(--tbml-muted);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.tbml-entry-back:hover {
  color: var(--tbml-text);
  border-color: var(--tbml-text);
  background: var(--tbml-surface);
}

.tbml-entry-back:focus-visible {
  outline: none;
  border-color: var(--tbml-text);
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.08);
}

@media (max-width: 380px) {
  .tbml-entry-grid {
    grid-template-columns: 1fr;
  }
  .tbml-entry-option {
    min-height: 72px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 14px;
  }
  .tbml-entry-option__sub {
    text-align: left;
  }
}

.tbml-auth-tabs,
.tbml-register-tabs {
  display: flex; gap: 4px; margin: 16px 0 12px;
  background: var(--tbml-bg); padding: 4px; border-radius: 8px;
}
.tbml-auth-tabs button,
.tbml-register-tabs button {
  flex: 1 1 0;
  border-radius: 6px; border: none; background: transparent; color: var(--tbml-muted);
  padding: 7px 14px; font-size: 13px; cursor: pointer; font-family: inherit; font-weight: 500;
}
.tbml-auth-tabs button.is-active,
.tbml-register-tabs button.is-active {
  background: var(--tbml-surface, #ffffff); color: var(--tbml-text); box-shadow: var(--tbml-shadow-sm);
}
.tbml-auth-panel,
.tbml-register-panel { display: none; }
.tbml-auth-panel.is-active,
.tbml-register-panel.is-active { display: block; }

.tbml-dev-login__hint,
.tbml-dev-login__meta {
  margin: 0 0 12px;
  font-size: 13px;
}

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.tbml-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
  line-height: 1;
}

.tbml-btn--primary { background: var(--tbml-text); color: #fff; border-color: var(--tbml-text); }
.tbml-btn--primary:hover { background: #333; border-color: #333; }

.tbml-btn--ghost { background: transparent; border-color: transparent; color: var(--tbml-muted); }
.tbml-btn--ghost:hover { color: var(--tbml-text); background: var(--tbml-surface-2); }

.tbml-btn--secondary { background: var(--tbml-surface); border-color: var(--tbml-border); color: var(--tbml-text); }
.tbml-btn--secondary:hover { background: var(--tbml-surface-2); border-color: var(--tbml-accent); color: var(--tbml-accent); }

.tbml-btn--danger { background: #fff; border-color: #fecaca; color: #b91c1c; }
.tbml-btn--danger:hover { background: #fef2f2; border-color: #f87171; color: #991b1b; }

.tbml-btn:focus-visible { outline: 2px solid var(--tbml-accent); outline-offset: 2px; }
.tbml-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ═══════════════════════════════════════
   STATUS + FEHLER
═══════════════════════════════════════ */
.tbml-muted   { color: var(--tbml-muted); font-size: 13px; }
.tbml-text-sm { font-size: 13px; }
.tbml-error   { min-height: 1.2em; font-size: 14px; }
.tbml-status-line { color: inherit; }

.tbml-app-shell > #tbml-error,
.tbml-main > #tbml-error {
  margin: 0 20px 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  font-size: 13px;
}
.tbml-app-shell > #tbml-error.tbml-status-line--ok,
.tbml-main > #tbml-error.tbml-status-line--ok { color: #065f46; }
.tbml-app-shell > #tbml-error.tbml-status-line--err,
.tbml-main > #tbml-error.tbml-status-line--err {
  color: var(--tbml-danger); background: #fef2f2; border-color: #fecaca;
}
.tbml-status-login-link { color: inherit; font-weight: 600; text-decoration: underline; margin-left: 0.35em; }
.tbml-status-login-link:hover { text-decoration: none; }

p.tbml-error:not(#tbml-error):not(#tbml-register-error) { color: var(--tbml-danger); }

#tbml-root[data-active-step="1"] > #tbml-error,
#tbml-root[data-active-step="2"] > #tbml-error,
#tbml-root[data-active-step="25"] > #tbml-error,
#tbml-root[data-active-step="30"] > #tbml-error {
  max-width: 420px; margin: 12px auto 0; padding: 0 8px;
  text-align: center; background: transparent !important; border: none !important;
}
#tbml-root[data-active-step="1"] > #tbml-error.tbml-status-line--ok,
#tbml-root[data-active-step="2"] > #tbml-error.tbml-status-line--ok,
#tbml-root[data-active-step="25"] > #tbml-error.tbml-status-line--ok,
#tbml-root[data-active-step="30"] > #tbml-error.tbml-status-line--ok { color: #065f46; }
#tbml-root[data-active-step="1"] > #tbml-error.tbml-status-line--err,
#tbml-root[data-active-step="2"] > #tbml-error.tbml-status-line--err,
#tbml-root[data-active-step="25"] > #tbml-error.tbml-status-line--err,
#tbml-root[data-active-step="30"] > #tbml-error.tbml-status-line--err { color: #b91c1c; }

#tbml-dev-login-error {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  text-align: center;
}
#tbml-dev-login-error.tbml-status-line--err {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}
#tbml-dev-login-error.tbml-status-line--ok {
  color: #065f46;
}

#tbml-2fa-status,
#tbml-pw-reset-status {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  text-align: center;
}
#tbml-2fa-status.tbml-status-line--err,
#tbml-pw-reset-status.tbml-status-line--err {
  color: var(--tbml-danger);
  background: #fef2f2;
  border: 1px solid #fecaca;
}
#tbml-2fa-status.tbml-status-line--ok,
#tbml-pw-reset-status.tbml-status-line--ok {
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

#tbml-register-root .tbml-error {
  margin-top: 12px; padding: 10px 14px; border-radius: 8px;
  background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46;
}
#tbml-register-root .tbml-error.tbml-status-line--err {
  background: #fef2f2; border-color: #fecaca; color: var(--tbml-danger);
}

.tbml-step { display: none; }
.tbml-step-active { display: block; }

/* ═══════════════════════════════════════
   DASHBOARD — FULL-WIDTH BREAKOUT
   Bricht aus dem Theme-Container heraus.
   calc(-1*(100vw-100%)/2) funktioniert
   korrekt für zentrierte UND volle Container.
   max-width: 1400px auf app-shell = auf
   sehr breiten Screens nicht überdehnen.
═══════════════════════════════════════ */
#tbml-root[data-active-step="3"],
.tbml-wrap--dashboard#tbml-dashboard-root {
  background: var(--tbml-bg);
  /* Breakout aus Theme-Container */
  position: relative;
  left: calc(-1 * (100vw - 100%) / 2);
  width: 100vw;
  margin: 0;
  border-radius: 0;
  border: none;
  box-shadow: none;
  overflow-x: hidden;
  /* Container-Queries auf Basis der vollen Breite */
  container-type: inline-size;
  container-name: tbml-dash;
}

#tbml-root[data-active-step="3"] .tbml-app-shell,
.tbml-wrap--dashboard .tbml-app-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  /* Zentriert + max-width für sehr breite Screens */
  max-width: 1400px;
  margin: 0 auto;
  min-height: 520px;
}

/* ═══════════════════════════════════════
   TOPBAR
═══════════════════════════════════════ */
.tbml-ai-quota-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 14px;
  font-size: 13px;
  border-radius: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a5f;
}
.tbml-ai-quota-banner--warn { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.tbml-ai-quota-banner--off { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.tbml-ai-quota-banner a { font-weight: 600; color: inherit; text-decoration: underline; }

.tbml-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: clamp(8px, 1.5vw, 14px) clamp(12px, 2vw, 24px);
  background: var(--tbml-surface, #ffffff);
  border-bottom: 1px solid var(--tbml-border);
  flex-shrink: 0;
}

.tbml-topbar__left { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.tbml-topbar__right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.tbml-brand { display: flex; align-items: center; gap: 8px; }

.tbml-mandant-strip { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.tbml-mandant-strip__label { color: var(--tbml-muted); }
.tbml-mandant-strip__value {
  font-weight: 600;
  background: var(--tbml-bg);
  border: 1px solid var(--tbml-border, #dedad4);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 13px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tbml-user-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-size: 13px; }
.tbml-user-meta__name { font-weight: 600; }
.tbml-user-meta__plan { color: var(--tbml-muted); font-size: 12px; }

/* ═══════════════════════════════════════
   BODY = SIDEBAR + MAIN (flex row)
═══════════════════════════════════════ */
.tbml-body {
  display: flex;
  flex-direction: row;
  flex: 1;
  width: 100%;
  min-height: 0;
}

/* Linke Sidebar — schmal, dynamisch */
.tbml-sidebar {
  flex: 0 0 clamp(120px, 14%, 160px);
  width: clamp(120px, 14%, 160px);
  background: var(--tbml-surface, #ffffff);
  border-right: 1px solid var(--tbml-border);
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.tbml-sidebar .tbml-main-nav__item {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: var(--tbml-muted);
  transition: background .1s, color .1s;
}
.tbml-sidebar .tbml-main-nav__item:hover { background: var(--tbml-bg); color: var(--tbml-text); }
.tbml-sidebar .tbml-main-nav__item.is-active { background: var(--tbml-bg); color: var(--tbml-text); font-weight: 600; }

/* Haupt-Inhaltsbereich */
.tbml-main {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ═══════════════════════════════════════
   SUBHEADER
═══════════════════════════════════════ */
.tbml-subheader {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  padding: clamp(10px, 1.5%, 16px) clamp(14px, 2%, 22px) clamp(8px, 1%, 14px);
  background: var(--tbml-bg);
  flex-shrink: 0;
  border-bottom: 1px solid var(--tbml-border);
}

.tbml-page-title {
  margin: 0 0 3px;
  font-size: clamp(17px, 2.2cqi, 22px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.tbml-page-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--tbml-muted);
  max-width: 520px;
}

.tbml-subheader__right { display: flex; flex-direction: column; gap: 4px; min-width: 130px; }

.tbml-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.tbml-meta-row__label { color: var(--tbml-muted); }
.tbml-meta-row__value { text-align: right; }

/* ═══════════════════════════════════════
   CONTENT-LAYOUT
   flex + nowrap: kein Jump möglich.
   KPI bleibt IMMER rechts.
═══════════════════════════════════════ */
.tbml-layout {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: clamp(10px, 2%, 18px);
  padding: clamp(12px, 2%, 18px) clamp(14px, 2.5%, 22px) clamp(16px, 2.5%, 26px);
  background: var(--tbml-bg);
  flex: 1;
  min-width: 0;
}

.tbml-layout__main {
  flex: 1 1 0;
  min-width: 0;
}

/* KPI-Sidebar: dynamische Breite, immer sichtbar */
.tbml-layout__side {
  flex: 0 0 clamp(160px, 26%, 210px);
  width: clamp(160px, 26%, 210px);
  min-width: 0;
  overflow: hidden;
}

/* KPI-Cards: 1-spaltig (Breite reicht nicht für 2) */
.tbml-layout__side .tbml-card__body--grid {
  grid-template-columns: 1fr;
}

.tbml-dashboard-view { min-width: 0; }

.tbml-card--side          { margin-top: 0; margin-bottom: 0; }
.tbml-card--side + .tbml-card--side { margin-top: 10px; }

/* ═══════════════════════════════════════
   CARDS
═══════════════════════════════════════ */
.tbml-card__header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--tbml-border);
}
.tbml-card__title {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--tbml-muted);
}
.tbml-card__body { padding: 11px 14px 14px; }
.tbml-card__body--grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}

.tbml-stat__label {
  display: block;
  font-size: 10px;
  color: var(--tbml-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 3px;
}
.tbml-stat__value {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.02em;
}

/* ═══════════════════════════════════════
   BADGES
═══════════════════════════════════════ */
.tbml-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  margin-left: 4px;
}
.tbml-badge:first-child { margin-left: 0; }
.tbml-badge--success { background: #d1fae5; color: #065f46; }
.tbml-badge--warning { background: #fef3c7; color: #92400e; }
.tbml-badge--neutral { background: var(--tbml-surface-2); color: #4b5563; border: 1px solid var(--tbml-border); }

/* ═══════════════════════════════════════
   PANELS
═══════════════════════════════════════ */
.tbml-panel {
  background: var(--tbml-surface, #ffffff);
  border: 1px solid var(--tbml-border, #dedad4);
  border-radius: var(--tbml-radius);
  box-shadow: var(--tbml-shadow-sm);
  padding: 14px 16px 16px;
  margin-top: 14px;
}
.tbml-panel:first-child { margin-top: 0; }
.tbml-panel h4, .tbml-panel h5 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
}

/* ═══════════════════════════════════════
   FORMULARE
═══════════════════════════════════════ */
.tbml-company-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.tbml-company-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--tbml-muted);
}
.tbml-company-form label input,
.tbml-company-form label select {
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--tbml-text);
}

.tbml-company-form label.tbml-check {
  grid-column: 1 / -1;
  display: flex !important;
  flex-direction: row !important;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--tbml-text);
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}
.tbml-company-form label.tbml-check input[type="checkbox"] {
  flex: 0 0 auto;
  margin: .15rem 0 0;
  width: auto;
  min-width: 1rem;
}
.tbml-check__text { flex: 1 1 auto; min-width: 0; line-height: 1.45; }

/* IBAN / Swiss QR-Bill — eigene Sektion, volle Formularbreite */
.tbml-iban-section {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--tbml-border, #dedad4);
  border-radius: 8px;
  background: var(--tbml-surface-2, #f8fafc);
}
.tbml-iban-section__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.tbml-iban-section__row > label {
  grid-column: 1 / -1;
  max-width: 100%;
}
.tbml-iban-section__toggle {
  margin: 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--tbml-border);
  align-items: center !important;
}
.tbml-iban-section__hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: 6px;
  background: #fef9c3;
  border: 1px solid #fde047;
  color: #713f12;
}
.tbml-iban-section__hint[hidden] {
  display: none !important;
}
.tbml-iban-section__qr {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--tbml-border);
}
.tbml-iban-section__qr[hidden] {
  display: none !important;
}
.tbml-iban-section__qr > label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--tbml-muted);
}
.tbml-iban-section__qr > label input {
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--tbml-text);
}
.tbml-iban-section__note {
  margin: 0;
  font-size: 12px;
}

.tbml-company-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.tbml-company-actions button:not(.tbml-btn),
#tbml-submit-btn, #tbml-request-key-btn, #tbml-preflight-btn,
#tbml-company-save-btn, #tbml-company-uid-sync-btn,
#tbml-treuhaender-save-btn, .tbml-mini-btn {
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--tbml-border, #dedad4);
  background: var(--tbml-surface, #ffffff);
  color: var(--tbml-text);
  transition: background .12s, border-color .12s;
}
.tbml-company-actions button:not(.tbml-btn):hover,
.tbml-mini-btn:hover { background: var(--tbml-surface-2); }

.tbml-company-actions button:disabled,
#tbml-company-save-btn:disabled,
#tbml-company-uid-sync-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.tbml-company-form--readonly input:not([type="checkbox"]):not([type="radio"]),
.tbml-company-form--readonly select,
.tbml-company-form--readonly textarea {
  background: #f8fafc;
  color: var(--tbml-text, #1e293b);
  cursor: default;
}
.tbml-company-form--readonly input[type="checkbox"],
.tbml-company-form--readonly input[type="radio"] {
  cursor: default;
}

.tbml-company-save-status {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
}
.tbml-company-save-status:empty,
.tbml-company-save-status[hidden] {
  display: none;
}
.tbml-company-save-status.is-ok {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}
.tbml-company-save-status.is-err {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}
.tbml-company-save-status.is-loading {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
}

#tbml-submit-btn { background: var(--tbml-text); color: #fff; border-color: var(--tbml-text); }
#tbml-submit-btn:hover { background: #333; border-color: #333; }
#tbml-preflight-btn { background: var(--tbml-bg); border-color: var(--tbml-border); }
#tbml-start-btn:not(.tbml-btn), #tbml-back-btn:not(.tbml-btn) { border-radius: 8px; }

/* ═══════════════════════════════════════
   GRID + PILLS + CHIPS
═══════════════════════════════════════ */
.tbml-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tbml-pill-ok, .tbml-pill-warn, .tbml-pill-err {
  display: inline-block; border-radius: 5px; padding: 3px 8px;
  font-size: 12px; line-height: 1.3; margin-bottom: 4px; font-weight: 500;
}
.tbml-pill-ok  { background: #d1fae5; border: 1px solid #6ee7b7; color: #065f46; }
.tbml-pill-warn{ background: #fef3c7; border: 1px solid #fcd34d; color: #92400e; }
.tbml-pill-err { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }

.tbml-chip-wrap { display: flex; gap: 6px; flex-wrap: wrap; }
.tbml-chip {
  background: var(--tbml-surface-2); border: 1px solid var(--tbml-border);
  border-radius: 5px; padding: 3px 9px; font-size: 12px;
}

/* ═══════════════════════════════════════
   TABELLEN
═══════════════════════════════════════ */
.tbml-table-wrap {
  width: 100%; overflow-x: auto;
  border: 1px solid var(--tbml-border, #dedad4); border-radius: var(--tbml-radius);
  background: var(--tbml-surface, #ffffff);
}
.tbml-table { width: 100%; border-collapse: collapse; min-width: 600px; font-size: 13px; }
.tbml-table th, .tbml-table td {
  border-bottom: 1px solid var(--tbml-border);
  text-align: left; padding: 9px 8px; vertical-align: top;
}
.tbml-table th {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--tbml-muted); background: var(--tbml-bg);
}

/* ═══════════════════════════════════════
   REGISTER-TABS
═══════════════════════════════════════ */
/* Tab-Styles siehe .tbml-auth-tabs oben (gemeinsam) */

/* ═══════════════════════════════════════
   DIVERSES
═══════════════════════════════════════ */
.tbml-audit-list { margin: 0; padding-left: 18px; }
.tbml-audit-list li { margin-bottom: 6px; }
.tbml-manual-quartal h5 { margin: 0 0 10px; font-size: 14px; }

.tbml-meldung-page { display: flex; flex-direction: column; gap: 12px; }
.tbml-meldung-form .tbml-meldung-core,
.tbml-meldung-form > .tbml-panel.tbml-manual-quartal,
.tbml-meldung-form > .tbml-panel.tbml-meldung-quartal-sync,
.tbml-meldung-form > .tbml-meldung-automation-wrap {
  grid-column: 1 / -1;
}
.tbml-meldung-form .tbml-meldung-core {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 4px;
}
.tbml-meldung-form .tbml-meldung-section-title,
.tbml-meldung-form .tbml-meldung-core > .tbml-muted {
  grid-column: 1 / -1;
}
.tbml-meldung-form .tbml-meldung-device {
  grid-column: 1 / -1;
}
.tbml-meldung-form .tbml-field-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--tbml-muted);
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.4;
}
.tbml-meldung-form .tbml-meldung-ack {
  grid-column: 1 / -1;
  margin-top: 2px;
  padding: 12px 14px;
  background: var(--tbml-surface-2, #f8fafc);
  border: 1px solid var(--tbml-border, #e2e8f0);
  border-radius: var(--tbml-radius, 8px);
}
.tbml-meldung-form .tbml-meldung-ack .tbml-check {
  margin: 0;
}
.tbml-meldung-form .tbml-meldung-ack--agov {
  margin: 4px 0 0;
  background: #fffbeb;
  border-color: #f59e0b;
}
.tbml-meldung-form .tbml-meldung-ack--missing {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}
.tbml-meldung-core { margin-bottom: 4px; }
.tbml-meldung-section-title { margin: 0 0 6px; font-size: 15px; }
.tbml-meldung-primary {
  background: #f0fdf4;
  border-left: 3px solid #16a34a;
  padding: 0.75rem 1rem;
}
.tbml-meldung-fallback {
  background: #f0f7ff;
  border-left: 3px solid #2563eb;
  padding: 0.75rem 1rem;
}
.tbml-meldung-fallback[hidden] { display: none !important; }
.tbml-meldung-automation-wrap { display: flex; flex-direction: column; gap: 10px; }
.tbml-meldung-automation-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
.tbml-meldung-automation-grid--dual {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tbml-meldung-fallback .tbml-meldung-manual-actions {
  flex-wrap: wrap;
}
.tbml-meldung-fallback label input,
.tbml-meldung-fallback label select {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
.tbml-meldung-notfall-collapsed {
  background: #fafaf9;
  border: 1px dashed var(--tbml-border, #d6d0c4);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}
.tbml-meldung-notfall-collapsed h5 { margin: 0; }
.tbml-meldung-notfall-head {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 8px;
}
.tbml-meldung-automation-notfall--closed .tbml-meldung-notfall-collapsed { height: 100%; }
@media (max-width: 960px) {
  .tbml-meldung-automation-grid--dual { grid-template-columns: 1fr; }
}
.tbml-meldung-automation-notfall .tbml-meldung-fallback {
  margin: 0;
  height: 100%;
}
.tbml-meldung-agov-actions { margin-top: 12px; }
.tbml-meldung-steps--compact { font-size: 12px; margin-bottom: 10px; }
.tbml-preflight-box { margin-top: 10px; }
.tbml-preflight-box[data-empty="1"] {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  padding: 10px 12px;
}
#tbml-preflight-btn.tbml-meldung-preflight-btn {
  background: #1a6b3c;
  border-color: #1a6b3c;
  color: #fff;
}
#tbml-preflight-btn.tbml-meldung-preflight-btn:hover:not(:disabled) {
  background: #145a32;
  border-color: #145a32;
}
#tbml-preflight-btn:disabled,
#tbml-submit-btn:disabled,
#tbml-request-key-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.tbml-meldung-fallback-toggle-wrap { margin-top: 4px; }
.tbml-meldung-steps { margin: 0.5rem 0 0.75rem 1.2rem; padding: 0; font-size: 13px; }
.tbml-meldung-portal-status { margin-top: 10px; background: #fff; }
.tbml-meldung-quartal-sync { margin: 12px 0 4px; border-color: rgba(26, 107, 60, 0.25); }
.tbml-meldung-advanced { margin-top: 10px; border: 1px dashed var(--tbml-border, #d6d0c4); background: #fafaf9; }
.tbml-meldung-advanced__summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  padding: 4px 0;
  list-style: none;
}
.tbml-meldung-advanced__summary::-webkit-details-marker { display: none; }
.tbml-meldung-advanced[open] .tbml-meldung-advanced__summary { margin-bottom: 8px; }
.tbml-mwst-progress { margin-bottom: 12px; }
.tbml-mwst-progress__track {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.tbml-mwst-progress__bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1a6b3c, #16a34a);
  transition: width 0.45s ease;
}
.tbml-mwst-progress__label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0 0;
  font-size: 12px;
  color: #475569;
}
.tbml-mwst-progress__pct { font-weight: 700; color: #1a6b3c; }
.tbml-mwst-progress--complete .tbml-mwst-progress__bar {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}
.tbml-mwst-progress--complete .tbml-mwst-progress__pct { color: #15803d; }
.tbml-mwst-portal-status--error .tbml-mwst-progress__bar {
  background: #dc2626;
}
.tbml-meldung-xml-status { background: #f9fafb; border: 1px solid #e2e8f0; margin-top: 10px; }
.tbml-belege-toolbar,
.tbml-wrap .tbml-company-form[style*="margin-bottom"] {
  background: var(--tbml-surface, #ffffff); border: 1px solid var(--tbml-border);
  border-radius: var(--tbml-radius); padding: 12px; margin-bottom: 12px;
}

/* ═══════════════════════════════════════
   RESPONSIVE — Container Queries
   Reagieren auf PLUGIN-BREITE, nicht
   auf den Viewport-Width.
   → Funktioniert korrekt auch wenn der
     Theme-Container schmal ist.
═══════════════════════════════════════ */

/* Linke Sidebar → horizontale Top-Nav
   wenn PLUGIN-Breite < 620px */
/* LIRENO Connect — Datenaustausch */
.tbml-connect-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.tbml-connect-hero h4 { margin: 0 0 6px; }
.tbml-connect-hero--stats-only { justify-content: flex-start; }

/* Outlook / M365 Verbindungsstatus (sichtbar unter Panel-Kopf) */
.tbml-ms365-conn-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--tbml-border, #e5e7eb);
  background: #f8faf9;
  font-size: 13px;
  line-height: 1.35;
}
.tbml-ms365-conn-status__text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
  flex: 1;
}
.tbml-ms365-conn-status__actions {
  flex-shrink: 0;
}
.tbml-ms365-conn-status__badge {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}
.tbml-ms365-conn-status__detail {
  color: var(--tbml-muted, #64748b);
  min-width: 0;
}
.tbml-ms365-conn-status--loading {
  border-color: #e2e8f0;
  background: #f8fafc;
}
.tbml-ms365-conn-status--loading .tbml-ms365-conn-status__badge {
  background: #e2e8f0;
  color: #64748b;
}
.tbml-ms365-conn-status--connected {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.tbml-ms365-conn-status--connected .tbml-ms365-conn-status__badge {
  background: #dcfce7;
  color: #166534;
}
.tbml-ms365-conn-status--synced {
  border-color: #86efac;
  background: #ecfdf5;
}
.tbml-ms365-conn-status--synced .tbml-ms365-conn-status__badge {
  background: #bbf7d0;
  color: #14532d;
}
.tbml-ms365-conn-status--error {
  border-color: #fecaca;
  background: #fef2f2;
}
.tbml-ms365-conn-status--error .tbml-ms365-conn-status__badge {
  background: #fecaca;
  color: #991b1b;
}
.tbml-ms365-conn-status--disconnected {
  border-color: #fde68a;
  background: #fefce8;
}
.tbml-ms365-conn-status--disconnected .tbml-ms365-conn-status__badge {
  background: #fef3c7;
  color: #854d0e;
}
.tbml-ms365-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tbml-ms365-ampel {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.18);
  vertical-align: middle;
}
.tbml-ms365-ampel--ok { background: #2e7d32; }
.tbml-ms365-ampel--warn { background: #f9a825; }
.tbml-ms365-ampel--err { background: #c62828; }
.tbml-ms365-ampel--off { background: #c62828; }
.tbml-ms365-status { font-size: 12px; color: #166534; font-weight: 600; }
.tbml-connect-stats { display: flex; gap: 12px; }
.tbml-connect-stat {
  min-width: 88px;
  padding: 10px 14px;
  border: 1px solid var(--tbml-border);
  border-radius: 10px;
  background: var(--tbml-bg);
  text-align: center;
}
.tbml-connect-stat--warn { border-color: #e8b86a; background: #fff9ed; }
.tbml-connect-stat__val { display: block; font-size: 1.35rem; font-weight: 700; }
.tbml-connect-stat__lbl { font-size: 12px; color: var(--tbml-muted); }
.tbml-connect-systems { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tbml-connect-chip {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--tbml-bg);
  border: 1px solid var(--tbml-border);
}
.tbml-connect-creds-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.tbml-connect-vis-form { margin-top: 8px; }
.tbml-connect-vis-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px 12px;
  margin-bottom: 0;
}
.tbml-connect-vis-actions {
  display: flex !important;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--ld-border, #dedad4);
}
.tbml-connect-vis-actions .ld-config-save,
#tbml-connect-cockpit-vis-save {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 36px;
  min-width: 110px;
}
#tbml-connect-cockpit-vis-save.is-saved {
  background: #166534 !important;
  border-color: #166534 !important;
}
.tbml-connect-vis-feedback {
  margin: 0 !important;
  min-height: 18px;
  font-size: 13px;
  font-weight: 600;
}
.tbml-connect-vis-feedback.is-ok { color: #166534; }
.tbml-connect-vis-feedback.is-error { color: #b91c1c; }
.tbml-connect-vis-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
}
.tbml-connect-vis-row.is-locked {
  opacity: 0.65;
  cursor: not-allowed;
}
.tbml-connect-vis-row input {
  margin-top: 2px;
}
.tbml-connect-io-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.tbml-connect-datev-hint { font-size: 12px; margin: 0 0 8px; }
.tbml-hub-catalog { margin-bottom: 0; }
.tbml-hub-group { margin-bottom: 16px; }
.tbml-hub-group:last-child { margin-bottom: 0; }
.tbml-hub-group__title { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--tbml-ink); }
.tbml-hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tbml-hub-card {
  border: 1px solid var(--tbml-border);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--tbml-paper, #faf9f7);
}
.tbml-hub-card h6 { margin: 0 0 6px; font-size: 14px; }
.tbml-hub-card p { margin: 0 0 10px; font-size: 12px; line-height: 1.45; }
.tbml-hub-empty { margin: 0; }
.ld-setup-connect-host { min-height: 120px; }
.tbml-row--warn td { background: #fff6e8; }
.tbml-error-inline { color: #b45309; font-size: 13px; margin: 0 0 12px; }

.ld-card__teaser { font-size: 13px; color: var(--ld-muted, #64748b); margin: 0 0 10px; line-height: 1.45; }

@container tbml-dash (max-width: 620px) {
  .tbml-body { flex-direction: column; }
  .tbml-sidebar {
    flex: 0 0 auto;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 8px 12px;
    border-right: none;
    border-bottom: 1px solid var(--tbml-border);
    gap: 2px;
    overflow-x: auto;
  }
  .tbml-sidebar .tbml-main-nav__item {
    width: auto;
    padding: 7px 11px;
    font-size: 13px;
    white-space: nowrap;
  }
  .tbml-subheader {
    padding: 10px 14px 8px;
  }
  .tbml-layout {
    padding: 12px 14px 18px;
    gap: 12px;
  }
  .tbml-user-meta { align-items: flex-start; }
}

/* Formulare 1-spaltig wenn PLUGIN-Breite < 560px */
@container tbml-dash (max-width: 560px) {
  .tbml-company-form { grid-template-columns: 1fr; }
  .tbml-grid         { grid-template-columns: 1fr; }
  .tbml-layout       { gap: 10px; padding: 10px 10px 16px; }
}

/* Auth-Karten für kleine Viewports (viewport-basiert ok) */
@media (max-width: 480px) {
  .tbml-card--auth  { padding: 20px; }
  .tbml-auth-title  { font-size: 18px; }
  #tbml-root[data-active-step="1"],
  #tbml-root[data-active-step="2"] { padding: 24px 12px; }
}

.tbml-ja-page { display: flex; flex-direction: column; gap: 14px; }
.tbml-ja-fallback-note { margin: 0; padding: 8px 12px; font-size: 12px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; }
.tbml-ja-hero { background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%); border: 1px solid #bbf7d0; border-radius: 10px; padding: 14px 16px; }
.tbml-ja-hero h4 { margin: 0 0 6px; font-size: 15px; }
.tbml-ja-badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #047857; background: #d1fae5; padding: 3px 8px; border-radius: 20px; margin-bottom: 8px; }
.tbml-ja-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 900px) { .tbml-ja-grid { grid-template-columns: 1fr; } }
.tbml-ja-checklist { list-style: none; margin: 0; padding: 0; }
.tbml-ja-checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--ld-border, #e5e7eb); font-size: 13px; }
.tbml-ja-checklist li:last-child { border-bottom: none; }
.tbml-ja-status { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.tbml-ja-status--ok { background: #d1fae5; color: #065f46; }
.tbml-ja-status--warn { background: #fef3c7; color: #92400e; }
.tbml-ja-status--open { background: #e0f2fe; color: #0369a1; }
.tbml-ja-status--locked { background: #f3f4f6; color: #6b7280; }
.tbml-ja-ki { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px; }
.tbml-ja-ki-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tbml-ja-ki-chip { border: 1px solid #cbd5e1; background: #fff; border-radius: 20px; padding: 6px 12px; font-size: 12px; cursor: pointer; }
.tbml-ja-ki-chip:hover { background: #ecfdf5; border-color: #6ee7b7; }
.ld-company-rechtsform-select { width: 100%; }

/* Steuern-Subnav: Ladezustand (#10 Review) */
.tbml-nav-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 160px;
  text-align: center;
}
.tbml-nav-loading__spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--tbml-border, #dedad4);
  border-top-color: var(--tbml-accent, #059669);
  border-radius: 50%;
  animation: tbml-nav-spin 0.75s linear infinite;
}
@keyframes tbml-nav-spin {
  to { transform: rotate(360deg); }
}
