:root {
  --sunrise-red: #DA291C;
  --sunrise-red-hover: #b82116;
  --surface-page: #f9fafb;
  --surface-card: #ffffff;
  --surface-hover: #f1f5f9;
  --border-subtle: #e2e8f0;
  --text-color-content: #1e293b;
  --rec-head-bg: #312e81;
  --rec-head-border: #3730a3;
  --rec-head-text: #eef2ff;
  --rec-head-btn-bg: #3730a3;
  --rec-head-btn-border: #818cf8;
  --rec-head-btn-hover: #4338ca;
  --rec-sidebar-bg: #312e81;
  --rec-sidebar-border: #3730a3;
  --rec-sidebar-text: #e0e7ff;
  --rec-sidebar-link-hover: #3730a3;
  --rec-sidebar-link-active: #3730a3;
  --rec-sidebar-toggle-bg: #3730a3;
  --rec-sidebar-toggle-border: #4f46e5;
  --rec-sidebar-toggle-hover: #4338ca;
  --rec-sidebar-shadow: rgba(49, 46, 129, 0.22);
}

html.rec-theme-dark {
  --surface-page: #0f141c;
  --surface-card: #1a2332;
  --surface-hover: #243044;
  --border-subtle: #2e3d52;
  --text-color-content: #e8eef5;
  --rec-head-bg: #1e1b4b;
  --rec-head-border: #312e81;
  --rec-head-text: #e0e7ff;
  --rec-head-btn-bg: #312e81;
  --rec-head-btn-border: #6366f1;
  --rec-head-btn-hover: #3730a3;
  --rec-sidebar-bg: #1e1b4b;
  --rec-sidebar-border: #312e81;
  --rec-sidebar-text: #e0e7ff;
  --rec-sidebar-link-hover: #312e81;
  --rec-sidebar-link-active: #312e81;
  --rec-sidebar-toggle-bg: #312e81;
  --rec-sidebar-toggle-border: #6366f1;
  --rec-sidebar-toggle-hover: #3730a3;
  --rec-sidebar-shadow: rgba(15, 20, 28, 0.45);
}

html {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", system-ui, Arial, sans-serif;
  background: var(--surface-page);
  color: var(--text-color-content);
}

body.rec-app-shell {
  height: 100%;
  overflow: hidden;
}

.rec-dev-head + .rec-service-head {
  top: 22px;
}

.rec-service-head {
  position: sticky;
  top: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 40px;
  flex-shrink: 0;
  padding: 0 14px;
  background: var(--rec-head-bg);
  color: var(--rec-head-text);
  border-bottom: 1px solid var(--rec-head-border);
  box-sizing: border-box;
}

.rec-service-head-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.rec-service-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.rec-head-logout-btn {
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--rec-head-btn-border);
  border-radius: 6px;
  background: var(--rec-head-btn-bg);
  color: var(--rec-head-text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  line-height: 1;
}

.rec-head-logout-btn:hover {
  background: var(--rec-head-btn-hover);
}

html.rec-theme-dark .rec-head-logout-btn:hover {
  background: var(--rec-head-btn-hover);
}

.rec-head-logout-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 2px;
}

.rec-lang-picker {
  position: relative;
  flex-shrink: 0;
}

.rec-lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--rec-head-btn-border);
  border-radius: 50%;
  background: var(--rec-head-btn-bg);
  color: var(--rec-head-text);
  cursor: pointer;
  line-height: 1;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.rec-flag-icon {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.rec-flag-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.rec-flag-btn {
  position: relative;
  width: 20px;
  height: 20px;
}

.rec-flag-btn-item {
  position: absolute;
  inset: 0;
}

.rec-flag-btn-item[hidden] {
  display: none !important;
}

.rec-lang-option-flag .rec-flag-icon {
  width: 18px;
  height: 18px;
}

.rec-lang-btn:hover,
.rec-lang-picker.rec-lang-picker--open .rec-lang-btn {
  background: var(--rec-head-btn-hover);
}

html.rec-theme-dark .rec-lang-btn:hover,
html.rec-theme-dark .rec-lang-picker.rec-lang-picker--open .rec-lang-btn {
  background: var(--rec-head-btn-hover);
}

.rec-lang-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 2px;
}

.rec-lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 132px;
  padding: 4px;
  border: 1px solid var(--rec-head-btn-border);
  border-radius: 10px;
  background: var(--rec-head-bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  z-index: 1001;
}

.rec-lang-menu[hidden] {
  display: none !important;
}

.rec-lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--rec-head-text);
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.rec-lang-option-label {
  flex: 1;
  min-width: 0;
}

.rec-lang-option:hover,
.rec-lang-option.rec-lang-option--active {
  background: rgba(255, 255, 255, 0.14);
}

.rec-lang-option:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 1px;
}

@media (hover: hover) and (pointer: fine) {
  .rec-lang-picker:hover .rec-lang-menu,
  .rec-lang-picker:focus-within .rec-lang-menu {
    display: block;
  }

  .rec-lang-picker:hover .rec-lang-menu[hidden],
  .rec-lang-picker:focus-within .rec-lang-menu[hidden] {
    display: block !important;
  }

  .rec-lang-picker:hover #recLangBtn,
  .rec-lang-picker:focus-within #recLangBtn {
    background: #4338ca;
  }
}

.rec-theme-toggle {
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.rec-theme-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 54px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.rec-theme-floater {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 0 0 1.5px #ffffff,
    0 2px 6px rgba(0, 0, 0, 0.18);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.rec-theme-toggle--dark .rec-theme-floater {
  transform: translateX(26px);
}

.rec-theme-icon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 28px;
  color: #ffffff;
  transition: opacity 0.18s ease;
}

.rec-theme-icon svg {
  width: 15px;
  height: 15px;
  display: block;
}

.rec-theme-toggle:not(.rec-theme-toggle--dark) .rec-theme-icon-moon,
.rec-theme-toggle.rec-theme-toggle--dark .rec-theme-icon-sun {
  opacity: 0.42;
}

.rec-theme-toggle:not(.rec-theme-toggle--dark) .rec-theme-icon-sun,
.rec-theme-toggle.rec-theme-toggle--dark .rec-theme-icon-moon {
  opacity: 1;
}

.rec-theme-toggle:hover .rec-theme-track {
  background: rgba(255, 255, 255, 0.24);
}

.rec-theme-toggle:focus-visible .rec-theme-track {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 2px;
}

.rec-dev-head {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 22px;
  flex-shrink: 0;
  padding: 0 8px;
  background: #0d1b2a;
  color: #cce3f7;
  border-bottom: 1px solid #1b3a5c;
  box-sizing: border-box;
}

.rec-dev-head-label {
  grid-column: 2;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
}

.rec-dev-head-handoff-btn {
  grid-column: 3;
  justify-self: end;
  height: 16px;
  line-height: 14px;
  padding: 0 8px;
  border: 1px solid #3d6a9a;
  border-radius: 4px;
  background: #1b3a5c;
  color: #cce3f7;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.rec-dev-head-handoff-btn:hover {
  background: #254a73;
}

html.rec-theme-dark input[type="text"],
html.rec-theme-dark input[type="password"] {
  background: var(--surface-card);
  color: var(--text-color-content);
}

/* Surface-Buttons: Browser-Default ist oft schwarz — Theme-Farbe erzwingen */
.index-handover-btn {
  color: var(--text-color-content);
}
