/* Neolithx Design System 1.4.0 */
:root {
  color-scheme: light;
  --nx-color-background: #f8f9fa;
  --nx-color-chrome: #ffffff;
  --nx-color-surface: #ffffff;
  --nx-color-surface-elevated: #f1f3f4;
  --nx-color-surface-muted: #eef0f2;
  --nx-color-surface-field: #f1f3f4;
  --nx-color-surface-panel: #f8f9fa;
  --nx-color-surface-hover: #e8eaed;
  --nx-color-border-muted: rgba(60, 64, 67, 0.12);
  --nx-color-border: rgba(60, 64, 67, 0.2);
  --nx-color-border-strong: rgba(60, 64, 67, 0.34);
  --nx-color-text: #202124;
  --nx-color-text-muted: #5f6368;
  --nx-color-text-subtle: #80868b;
  --nx-color-primary: #3c4043;
  --nx-color-primary-hover: #2b2d30;
  --nx-color-primary-contrast: #ffffff;
  --nx-color-success: #25875a;
  --nx-color-success-surface: #e6f4ea;
  --nx-color-success-text: #137333;
  --nx-color-warning: #a76509;
  --nx-color-warning-surface: #fef7e0;
  --nx-color-warning-text: #8d4f00;
  --nx-color-danger: #c43d38;
  --nx-color-danger-surface: #fce8e6;
  --nx-color-danger-text: #b3261e;
  --nx-color-info: #1a73e8;
  --nx-color-info-surface: #e8f0fe;
  --nx-color-info-text: #174ea6;
  --nx-font-sans: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --nx-radius-xs: 5px;
  --nx-radius-sm: 7px;
  --nx-radius-md: 9px;
  --nx-radius-lg: 12px;
  --nx-space-xs: 0.5rem;
  --nx-space-sm: 0.75rem;
  --nx-space-md: 1rem;
  --nx-space-lg: 1.25rem;
  --nx-space-xl: 1.5rem;
  --nx-header-height: 76px;
  --nx-footer-height: 44px;
  --nx-layout-max-width: 104rem;
  --nx-layout-side-gap: clamp(1rem, 3vw, 3rem);
  --nx-control-height: 2.75rem;
  --nx-icon-control-size: 2.375rem;
  --nx-shadow-card: 0 12px 28px -24px rgba(32, 33, 36, 0.3);
  --nx-shadow-elevated: 0 20px 44px -30px rgba(32, 33, 36, 0.4);
  --nx-focus-ring: 0 0 0 3px rgba(60, 64, 67, 0.16), 0 0 0 1px rgba(60, 64, 67, 0.34);
  --nx-transition-fast: 150ms ease;
  --nx-background-gradient:
    radial-gradient(circle at 58% 42%, rgba(255, 255, 255, 0.72), transparent 36%),
    linear-gradient(135deg, var(--nx-color-background) 0%, var(--nx-color-surface-muted) 100%);

  /* Kompatibilitäts-Aliase für bestehende Anwendungen. */
  --color-bg: var(--nx-color-background);
  --color-chrome: var(--nx-color-chrome);
  --color-surface: var(--nx-color-surface);
  --color-surface-elevated: var(--nx-color-surface-elevated);
  --color-surface-muted: var(--nx-color-surface-muted);
  --color-surface-field: var(--nx-color-surface-field);
  --color-surface-panel: var(--nx-color-surface-panel);
  --color-surface-hover: var(--nx-color-surface-hover);
  --color-border-muted: var(--nx-color-border-muted);
  --color-border: var(--nx-color-border);
  --color-border-strong: var(--nx-color-border-strong);
  --color-text: var(--nx-color-text);
  --color-text-muted: var(--nx-color-text-muted);
  --color-text-subtle: var(--nx-color-text-subtle);
  --color-primary: var(--nx-color-primary);
  --color-primary-strong: var(--nx-color-primary-hover);
  --color-success: var(--nx-color-success);
  --color-success-surface: var(--nx-color-success-surface);
  --color-success-text: var(--nx-color-success-text);
  --color-warning: var(--nx-color-warning);
  --color-warning-surface: var(--nx-color-warning-surface);
  --color-warning-text: var(--nx-color-warning-text);
  --color-danger: var(--nx-color-danger);
  --color-danger-surface: var(--nx-color-danger-surface);
  --color-danger-text: var(--nx-color-danger-text);
  --color-info: var(--nx-color-info);
  --color-info-surface: var(--nx-color-info-surface);
  --color-info-text: var(--nx-color-info-text);
  --font-sans: var(--nx-font-sans);
  --radius-xs: var(--nx-radius-xs);
  --radius-sm: var(--nx-radius-sm);
  --radius-md: var(--nx-radius-md);
  --radius-lg: var(--nx-radius-lg);
  --space-xs: var(--nx-space-xs);
  --space-sm: var(--nx-space-sm);
  --space-md: var(--nx-space-md);
  --space-lg: var(--nx-space-lg);
  --space-xl: var(--nx-space-xl);
  --app-header-height: var(--nx-header-height);
  --app-footer-height: var(--nx-footer-height);
  --shadow-card: var(--nx-shadow-card);
  --focus-ring: var(--nx-focus-ring);
  --background-gradient: var(--nx-background-gradient);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --nx-color-background: #202124;
  --nx-color-chrome: #1b1c1f;
  --nx-color-surface: #292a2d;
  --nx-color-surface-elevated: #303134;
  --nx-color-surface-muted: #252629;
  --nx-color-surface-field: #303134;
  --nx-color-surface-panel: #292a2d;
  --nx-color-surface-hover: #3c4043;
  --nx-color-border-muted: rgba(232, 234, 237, 0.1);
  --nx-color-border: rgba(232, 234, 237, 0.16);
  --nx-color-border-strong: rgba(232, 234, 237, 0.28);
  --nx-color-text: #e8eaed;
  --nx-color-text-muted: #bdc1c6;
  --nx-color-text-subtle: #9aa0a6;
  --nx-color-primary: #e8eaed;
  --nx-color-primary-hover: #ffffff;
  --nx-color-primary-contrast: #202124;
  --nx-color-success: #81c995;
  --nx-color-success-surface: #1e3a2b;
  --nx-color-success-text: #a8dab5;
  --nx-color-warning: #fdd663;
  --nx-color-warning-surface: #493b20;
  --nx-color-warning-text: #ffe083;
  --nx-color-danger: #f28b82;
  --nx-color-danger-surface: #4a2927;
  --nx-color-danger-text: #f6aea8;
  --nx-color-info: #8ab4f8;
  --nx-color-info-surface: #253653;
  --nx-color-info-text: #aecbfa;
  --nx-shadow-card: 0 14px 32px -24px rgba(0, 0, 0, 0.68);
  --nx-shadow-elevated: 0 22px 48px -28px rgba(0, 0, 0, 0.74);
  --nx-focus-ring: 0 0 0 3px rgba(189, 193, 198, 0.16), 0 0 0 1px rgba(189, 193, 198, 0.38);
  --nx-background-gradient:
    radial-gradient(circle at 58% 42%, rgba(232, 234, 237, 0.055), transparent 36%),
    linear-gradient(135deg, var(--nx-color-background) 0%, var(--nx-color-surface-muted) 100%);
}

.nx-app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--nx-header-height);
  border-bottom: 1px solid var(--nx-color-border-muted);
  background: var(--nx-color-chrome);
  color: var(--nx-color-text);
}

.nx-app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--nx-layout-max-width);
  min-height: var(--nx-header-height);
  margin: 0 auto;
  padding: 0 var(--nx-layout-side-gap);
  gap: var(--nx-space-lg);
}

.nx-product-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: var(--nx-space-sm);
  color: var(--nx-color-text);
  text-decoration: none;
}

.nx-product-brand-logo {
  display: block;
  width: 4.25rem;
  height: 2.5rem;
  flex: 0 0 auto;
  object-fit: contain;
}

.nx-product-brand-copy {
  display: grid;
  min-width: 0;
  gap: 0.05rem;
  line-height: 1.2;
}

.nx-product-brand-name {
  color: var(--nx-color-text);
  font-size: 0.875rem;
  font-weight: 650;
}

.nx-product-brand-product {
  overflow: hidden;
  color: var(--nx-color-text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nx-header-actions {
  display: flex;
  align-items: center;
  gap: var(--nx-space-xs);
}

.nx-theme-toggle,
.nx-icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: var(--nx-icon-control-size);
  min-width: var(--nx-icon-control-size);
  height: var(--nx-icon-control-size);
  min-height: var(--nx-icon-control-size);
  padding: 0;
  border: 1px solid var(--nx-color-border);
  border-radius: var(--nx-radius-sm);
  background: var(--nx-color-surface-field);
  color: var(--nx-color-text-muted);
  box-shadow: none;
  cursor: pointer;
  transition: background-color var(--nx-transition-fast), border-color var(--nx-transition-fast), color var(--nx-transition-fast);
}

.nx-theme-toggle:hover,
.nx-icon-button:hover {
  border-color: var(--nx-color-border-strong);
  background: var(--nx-color-surface-hover);
  color: var(--nx-color-text);
}

.nx-theme-toggle:focus-visible,
.nx-icon-button:focus-visible {
  outline: none;
  box-shadow: var(--nx-focus-ring);
}

.nx-theme-icon {
  grid-area: 1 / 1;
  font-size: 1.05rem;
  line-height: 1;
}

.nx-theme-icon-light,
:root[data-theme="dark"] .nx-theme-icon-dark {
  display: none;
}

:root[data-theme="dark"] .nx-theme-icon-light {
  display: inline;
}

.nx-ui-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--nx-control-height);
  padding: 0.625rem 1rem;
  border: 1px solid var(--nx-color-border);
  border-radius: var(--nx-radius-sm);
  background: var(--nx-color-surface-field);
  color: var(--nx-color-text);
  font: 600 0.875rem/1.2 var(--nx-font-sans);
  text-decoration: none;
  cursor: pointer;
}

.nx-ui-button:hover {
  border-color: var(--nx-color-border-strong);
  background: var(--nx-color-surface-hover);
}

.nx-ui-button-primary {
  border-color: var(--nx-color-primary);
  background: var(--nx-color-primary);
  color: var(--nx-color-primary-contrast);
}

.nx-ui-button-primary:hover {
  border-color: var(--nx-color-primary-hover);
  background: var(--nx-color-primary-hover);
}

.nx-ui-card,
.nx-ui-panel {
  border: 1px solid var(--nx-color-border);
  border-radius: var(--nx-radius-md);
  background: var(--nx-color-surface);
  color: var(--nx-color-text);
  box-shadow: var(--nx-shadow-card);
}

.nx-ui-input,
.nx-ui-select {
  width: 100%;
  min-height: var(--nx-control-height);
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--nx-color-border);
  border-radius: var(--nx-radius-sm);
  background: var(--nx-color-surface-field);
  color: var(--nx-color-text);
  font: inherit;
}

.nx-ui-select {
  padding-right: 2.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2380868b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.15rem;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.nx-ui-select:hover {
  border-color: var(--nx-color-border-strong);
  background-color: var(--nx-color-surface-hover);
}

.nx-ui-input:focus-visible,
.nx-ui-select:focus-visible {
  outline: none;
  box-shadow: var(--nx-focus-ring);
}

.nx-select-root {
  position: relative;
  display: inline-block;
  width: 100%;
  min-width: 0;
}

.nx-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.nx-select-trigger {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--nx-control-height);
  padding: 0.625rem 2.75rem 0.625rem 0.875rem;
  border: 1px solid var(--nx-color-border);
  border-radius: var(--nx-radius-sm);
  background: var(--nx-color-surface-field);
  color: var(--nx-color-text);
  font: inherit;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.nx-select-trigger::after {
  position: absolute;
  right: 0.75rem;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--nx-color-text-subtle);
  border-bottom: 2px solid var(--nx-color-text-subtle);
  content: "";
  transform: translateY(-0.15rem) rotate(45deg);
  transition: transform var(--nx-transition-fast);
}

.nx-select-root[data-open="true"] .nx-select-trigger::after {
  transform: translateY(0.15rem) rotate(225deg);
}

.nx-select-trigger:hover {
  border-color: var(--nx-color-border-strong);
  background: var(--nx-color-surface-hover);
}

.nx-select-trigger:focus-visible {
  outline: none;
  box-shadow: var(--nx-focus-ring);
}

.nx-select-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.nx-select-overlay {
  position: fixed;
  z-index: 2147483000;
  max-height: min(20rem, calc(100vh - 1rem));
  padding: 0.4rem;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--nx-color-border-strong);
  border-radius: var(--nx-radius-sm);
  background: var(--nx-color-surface-elevated);
  color: var(--nx-color-text);
  box-shadow: var(--nx-shadow-elevated);
}

.nx-select-option {
  display: block;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.6rem 0.75rem;
  border: 0;
  border-radius: var(--nx-radius-xs);
  background: transparent;
  color: var(--nx-color-text);
  font: inherit;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.nx-select-option:hover,
.nx-select-option:focus-visible {
  outline: none;
  background: var(--nx-color-surface-hover);
}

.nx-select-option[aria-selected="true"] {
  background: var(--nx-color-info-surface);
  color: var(--nx-color-info-text);
}

.nx-select-option:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.nx-ui-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.25rem;
  padding: var(--nx-space-md) var(--nx-space-xl);
  gap: var(--nx-space-md);
  border-bottom: 1px solid var(--nx-color-border-muted);
  background: var(--nx-color-surface-panel);
  color: var(--nx-color-text);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nx-app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--nx-footer-height);
  padding: 0 var(--nx-layout-side-gap);
  gap: var(--nx-space-md);
  border-top: 1px solid var(--nx-color-border-muted);
  background: var(--nx-color-chrome);
  color: var(--nx-color-text-muted);
  font-size: 0.75rem;
}

.nx-app-footer-meta,
.nx-app-footer-links {
  display: flex;
  align-items: center;
  gap: var(--nx-space-sm);
}

.nx-app-footer-separator {
  width: 1px;
  height: 1rem;
  flex: 0 0 auto;
  background: var(--nx-color-border);
}

.nx-app-footer a {
  color: inherit;
  text-decoration: none;
}

.nx-app-footer a:hover {
  color: var(--nx-color-text);
}

@media (max-width: 640px) {
  .nx-product-brand-copy {
    display: none;
  }

  .nx-app-footer {
    align-items: flex-start;
    padding-top: var(--nx-space-sm);
    padding-bottom: var(--nx-space-sm);
  }

  .nx-app-footer-meta {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nx-theme-toggle,
  .nx-icon-button,
  .nx-ui-button {
    transition: none;
  }
}
