:root {
  font-family: Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

button,
input {
  font: inherit;
}

.honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* ------------------------------------------------------------------
   Kartenoptik fuer Anmeldung, Registrierung, Bestaetigung, Passwort,
   Einladung (body.tw-auth). Operator-Seiten nutzen weiter .login-card.
   ------------------------------------------------------------------ */
body.tw-auth {
  min-height: 100vh;
  margin: 0;
  background: #f4f7fa;
  color: #1f2d3d;
}

.tw-auth .auth-wrap {
  display: flex;
  min-height: calc(100vh - 72px);
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 0 56px;
}

.tw-auth .auth-card {
  width: calc(100% - 32px);
  max-width: 480px;
  overflow: hidden;
  border: 1px solid #dde5ec;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 28px rgb(11 31 58 / 8%);
}

.tw-auth .auth-card[data-mode="register"] {
  max-width: 560px;
}

.tw-auth .auth-brand {
  padding: 20px 24px 12px;
  text-align: center;
}

.tw-auth .auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0b1f3a;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.tw-auth .auth-logo img {
  width: 26px;
  height: 26px;
}

.tw-auth .auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.tw-auth .auth-tab {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: #f4f7fa;
  color: #5b6778;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.tw-auth .auth-tab[aria-selected="true"] {
  border-bottom-color: #0f9d91;
  background: #fff;
  color: #0b1f3a;
  font-weight: 600;
}

.tw-auth .auth-tab:focus-visible {
  outline: 2px solid #0b1f3a;
  outline-offset: -4px;
}

.tw-auth .auth-panel {
  padding: 20px 24px 8px;
}

.tw-auth .auth-title {
  margin: 0 0 12px;
  color: #0b1f3a;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
}

.tw-auth .auth-panel > p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.5;
}

.tw-auth .auth-form {
  display: grid;
  gap: 12px;
  text-align: left;
}

.tw-auth .auth-grid {
  display: grid;
  gap: 12px;
}

@media (min-width: 600px) {
  .tw-auth .auth-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Registrierung: kompakt, damit Formular samt Button ohne Scrollen auf einen Laptop-Bildschirm passt. */
.tw-auth .auth-card[data-mode="register"] {
  max-width: 640px;
}

.tw-auth #panel-register {
  padding-top: 12px;
}

.tw-auth #panel-register .auth-form {
  gap: 8px;
}

.tw-auth #panel-register .auth-grid {
  gap: 8px 12px;
}

.tw-auth #panel-register .auth-trial-note {
  margin-bottom: 10px;
}

@media (min-width: 720px) {
  .tw-auth #panel-register .auth-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tw-auth .field {
  position: relative;
}

.tw-auth .field > label {
  display: grid;
  gap: 4px;
  color: #0b1f3a;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.tw-auth input[type="text"],
.tw-auth input[type="email"],
.tw-auth input[type="password"],
.tw-auth input:not([type]) {
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #8a96a6;
  border-radius: 8px;
  background: #fff;
  color: #1f2d3d;
  font: inherit;
  font-size: 15px;
  font-weight: 400;
}

.tw-auth input::placeholder {
  color: #6b7686;
}

.tw-auth input:focus-visible,
.tw-auth button:focus-visible,
.tw-auth a:focus-visible {
  outline: 2px solid #0b1f3a;
  outline-offset: 2px;
}

.tw-auth .field input[type="password"],
.tw-auth .field input[type="text"][name="password"] {
  padding-right: 46px;
}

.tw-auth .pw-toggle {
  position: absolute;
  right: 1px;
  bottom: 1px;
  display: grid;
  width: 40px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 0 7px 7px 0;
  background: transparent;
  color: #5b6778;
  cursor: pointer;
}

.tw-auth .field-hint {
  margin: 4px 0 0;
  color: #5b6778;
  font-size: 12px;
  line-height: 1.4;
}

.tw-auth .forgot {
  margin: -4px 0 0;
  font-size: 13px;
  text-align: right;
}

.tw-auth .auth-card a,
.tw-auth .auth-legal a {
  color: #0b7f75;
  text-decoration: underline;
}

.tw-auth .check-label {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  color: #1f2d3d;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
}

.tw-auth .check-label input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: #0b1f3a;
}

.tw-auth .auth-trial-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #e4f5f3;
  color: #0b1f3a;
  font-size: 11.5px;
  line-height: 1.4;
}

.tw-auth .auth-legal-note {
  margin: 0;
  color: #5b6778;
  font-size: 12px;
  line-height: 1.45;
}

.tw-auth .auth-submit {
  min-height: 44px;
  margin-top: 2px;
  border: 0;
  border-radius: 8px;
  background: #0b1f3a;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.tw-auth .auth-submit:hover:not(:disabled) {
  background: #17314f;
}

.tw-auth .auth-submit:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.tw-auth .auth-submit--secondary {
  width: 100%;
  border: 1px solid #0b1f3a;
  background: #fff;
  color: #0b1f3a;
}

.tw-auth .auth-submit--secondary:hover:not(:disabled) {
  background: #f4f7fa;
}

.tw-auth .auth-error,
.tw-auth .auth-notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.tw-auth .auth-form .auth-error {
  margin: 0;
}

.tw-auth .auth-error {
  border: 1px solid #e0a39c;
  background: #fff1f0;
  color: #8a1c13;
}

.tw-auth .auth-notice {
  border: 1px solid #0f9d91;
  background: #e7f6f4;
  color: #0b1f3a;
}

.tw-auth .auth-switch {
  margin: 14px 0 6px;
  font-size: 14px;
  text-align: center;
}

.tw-auth .auth-foot {
  margin: 8px 0 0;
  padding: 0 24px 16px;
  color: #5b6778;
  font-size: 12px;
  text-align: center;
}

.tw-auth .auth-legal {
  margin-top: 12px;
  color: #5b6778;
  font-size: 12px;
  text-align: center;
}

@media (max-width: 599px) {
  .tw-auth .auth-panel {
    padding: 16px 16px 8px;
  }

  .tw-auth input[type="text"],
  .tw-auth input[type="email"],
  .tw-auth input[type="password"],
  .tw-auth input:not([type]) {
    min-height: 44px;
    font-size: 16px;
  }

  .tw-auth .pw-toggle {
    height: 42px;
  }

  .tw-auth .auth-wrap {
    justify-content: flex-start;
  }
}

@media (forced-colors: active) {
  .tw-auth .auth-tab[aria-selected="true"] {
    border-bottom-color: Highlight;
  }
}

/* ------------------------------------------------------------------
   Gemeinsame Hilfen, Onboarding und Einstellungen
   ------------------------------------------------------------------ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.tw-auth [hidden] {
  display: none !important;
}

.tw-auth fieldset {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.tw-auth select,
.tw-auth input[type="search"],
.tw-auth input[type="number"] {
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #8a96a6;
  border-radius: 8px;
  background: #fff;
  color: #1f2d3d;
  font: inherit;
  font-size: 15px;
}

.tw-auth select:focus-visible,
.tw-auth summary:focus-visible {
  outline: 2px solid #0b1f3a;
  outline-offset: 2px;
}

.tw-auth .auth-link-button {
  display: grid;
  place-items: center;
  color: #fff;
  text-decoration: none;
}

.tw-onboarding .auth-card {
  max-width: 640px;
}

.tw-onboarding .step-label {
  margin: 0 0 8px;
  color: #5b6778;
  font-size: 13px;
}

.tw-onboarding .step-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.tw-onboarding .step-bar i {
  height: 4px;
  border-radius: 2px;
  background: #dde5ec;
}

.tw-onboarding .step-bar i.is-on {
  background: #0f9d91;
}

.sector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}

.sector-card {
  position: relative;
  display: block;
  cursor: pointer;
}

.sector-card input {
  position: absolute;
  opacity: 0;
}

.sector-card span {
  display: grid;
  min-height: 52px;
  place-items: center;
  padding: 8px 10px;
  border: 1px solid #8a96a6;
  border-radius: 8px;
  color: #1f2d3d;
  font-size: 14px;
  text-align: center;
}

.sector-card input:checked + span {
  border-color: #0b1f3a;
  background: #e7f6f4;
  box-shadow: inset 0 0 0 1px #0b1f3a;
  font-weight: 600;
}

.sector-card input:focus-visible + span {
  outline: 2px solid #0b1f3a;
  outline-offset: 2px;
}

.cpv-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  padding: 4px 2px;
  overflow: auto;
}

.inline-add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}

.inline-add .auth-submit {
  min-height: 40px;
  padding: 0 14px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px 2px 10px;
  border: 1px solid #8a96a6;
  border-radius: 999px;
  color: #1f2d3d;
  font-size: 13px;
}

.chip button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #5b6778;
  font-size: 16px;
  cursor: pointer;
}

.wizard-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.wizard-actions .auth-submit {
  min-width: 120px;
  padding: 0 18px;
}

.onboarding-done {
  text-align: left;
}

/* Einstellungen: Seitenleiste und Hülle kommen aus client.css (wie im Kabinett); hier Unter-Tabs und Inhaltskarte. */
.settings-area {
  max-width: 1600px;
}

.settings-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  margin: 0 0 16px;
  overflow-x: auto;
  border-bottom: 1px solid #dde5ec;
  scrollbar-width: thin;
}

.settings-nav a {
  display: flex;
  flex: none;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-bottom: 3px solid transparent;
  color: #5b6778;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.settings-nav a:hover {
  color: #0b1f3a;
}

.settings-nav a[aria-current="page"] {
  border-bottom-color: #0b7b72;
  color: #0b1f3a;
  font-weight: 650;
}

.settings-main {
  min-width: 0;
  max-width: 960px;
  padding: 24px;
  border: 1px solid #dde5ec;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(11 31 58 / 5%);
}
.settings-section h2 {
  margin: 0 0 14px;
  color: #0b1f3a;
  font-size: 20px;
  font-weight: 600;
  text-align: left;
}

.settings-section h3 {
  margin: 20px 0 8px;
  color: #0b1f3a;
  font-size: 15px;
  font-weight: 600;
}

.js-sections .settings-section {
  display: none;
}

.js-sections .settings-section.is-active {
  display: block;
}

.kv {
  display: grid;
  gap: 8px;
  margin: 0 0 8px;
}

.kv div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
}

.kv dt {
  color: #5b6778;
  font-size: 14px;
}

.kv dd {
  margin: 0;
  color: #1f2d3d;
  font-size: 15px;
}

.usage {
  margin: 14px 0;
}

.usage-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 6px;
  font-size: 14px;
}

.usage-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: #dde5ec;
}

.usage-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: #0f9d91;
}

.usage-bar.is-high span {
  background: #b42318;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-button {
  min-width: 160px;
  padding: 0 16px;
}

.settings-form {
  max-width: 560px;
}

/* Einstellungen: Eingabefelder und Augen-Knopf mit Touch-Fläche von 44 px */
.tw-settings input:not([type="radio"]):not([type="checkbox"]),
.tw-settings select {
  min-height: 44px;
}

.tw-settings .pw-toggle {
  bottom: 0;
  height: 44px;
  width: 44px;
}

.member-list p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 14px;
}

.tw-auth .member-list select {
  width: auto;
  min-height: 44px;
  font-size: 14px;
}

.member-list button {
  width: auto;
  min-height: 44px;
  padding: 0 14px;
  font-size: 14px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #dde5ec;
  text-align: left;
}

.data-table th {
  color: #5b6778;
  font-size: 13px;
  font-weight: 500;
}

.table-wrap {
  overflow-x: auto;
}

.empty-text {
  margin: 0;
  color: #5b6778;
  font-size: 14px;
}

.access-details summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.tw-modal {
  width: min(480px, calc(100% - 32px));
  padding: 20px 24px;
  border: 1px solid #dde5ec;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgb(11 31 58 / 18%);
  color: #1f2d3d;
}

.tw-modal::backdrop {
  background: rgb(11 31 58 / 45%);
}

.tw-modal h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
}

.plan-options {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.plan-option {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid #8a96a6;
  border-radius: 8px;
  font-size: 14px;
}

.plan-option strong {
  display: block;
  font-size: 15px;
}

.dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.dialog-actions .auth-submit {
  min-width: 120px;
}

.settings-foot {
  padding: 8px 16px 24px;
  color: #5b6778;
  font-size: 12px;
  text-align: center;
}

@media (max-width: 760px) {
  /* Unter-Tabs der Einstellungen bleiben eine wischbare Leiste (siehe oben) */
  .settings-main {
    padding: 16px;
  }

  .kv div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .wizard-actions {
    flex-direction: column-reverse;
  }
}
