:root {
  --bg: #f7f9fc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --line: #cbd5e1;
  --accent: #0f766e;
  --accent-2: #134e4a;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --shadow-soft: 0 12px 24px rgba(2, 6, 23, 0.06);
}

body[data-theme="dark"] {
  --bg: #0f172a;
  --card: #111827;
  --text: #e5eef9;
  --muted: #94a3b8;
  --line: #334155;
  --accent: #14b8a6;
  --accent-2: #0f766e;
  --surface: #111827;
  --surface-soft: #172033;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: radial-gradient(circle at 20% 10%, #e2e8f0 0%, var(--bg) 45%, #eef2ff 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
}

.site-header {
  position: relative;
  z-index: 300;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
}

.logo {
  text-decoration: none;
  color: var(--text);
  display: inline-flex;
  align-items: center;
}

.logo-image {
  height: 48px;
  width: auto;
  display: block;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.profile-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}

.btn:hover {
  background: var(--accent-2);
}

.btn-secondary {
  background: #334155;
}

.site-main {
  flex: 1;
  display: grid;
  align-items: center;
  padding: 1rem;
}

.ki-stepbar {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.ki-stepbar-label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.ki-stepbar-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.ki-stepbar-link {
  min-width: 48px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.95rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: var(--text);
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.ki-stepbar-link:hover {
  transform: translateY(-1px);
  border-color: #94a3b8;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
}

@media (max-width: 720px) {
  .ki-stepbar {
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

.landing,
.auth-section,
.dashboard,
.profile-page,
.impressum {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.06);
}

.page-with-nav {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}

.page-side-nav {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 1rem;
  align-content: start;
  align-self: stretch;
  min-height: 100%;
  padding: 1.25rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-right: none;
  border-radius: 14px 0 0 14px;
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.06);
}

.page-side-nav h2 {
  margin: 0;
  font-size: 0.95rem;
}

.page-side-nav-links {
  display: grid;
  gap: 0.55rem;
  align-content: start;
}

.page-side-nav-links a {
  display: block;
  padding: 0.55rem 0.7rem;
  border: 1px solid #dbe5ef;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.page-side-nav-links a:hover {
  border-color: #94a3b8;
  transform: translateX(2px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.page-content-stack {
  display: grid;
  gap: 1.25rem;
}

.page-with-nav > .dashboard,
.page-with-nav > .profile-page {
  border-radius: 0 14px 14px 0;
}

.page-section-card {
  scroll-margin-top: 1rem;
}

.page-section-title {
  margin: 0 0 0.75rem;
}

.caltarget-wrapper {
  width: min(1400px, 100%);
  margin: 0 auto;
}

.caltarget-frame {
  width: 100%;
  height: 80vh;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.hero-center {
  min-height: 42vh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.8rem;
  text-align: center;
}

.landing-copy {
  max-width: 34rem;
  margin: 0;
  color: var(--muted);
}

.landing-tile-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.landing-tile {
  display: grid;
  justify-items: center;
  gap: 0.65rem;
  padding: 1.1rem;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #dbe5ef;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.landing-tile:hover {
  transform: translateY(-2px);
  border-color: #94a3b8;
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.12);
}

.landing-tile-icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.landing-tile-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.landing-tile-text {
  color: var(--muted);
  line-height: 1.45;
}

.hero-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(145deg, #99f6e4, #60a5fa);
  border: 3px solid #fff;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.15);
}

.auth-form {
  display: grid;
  gap: 0.65rem;
}

.auth-form input {
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.profile-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.profile-meta-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.9rem 1rem;
}

.profile-meta-card strong {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.profile-meta-card span {
  font-size: 1rem;
  color: var(--text);
}

.profile-form {
  display: grid;
  gap: 0.75rem;
}

.profile-form input {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.profile-form select {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.profile-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.profile-status {
  min-height: 1.2rem;
  margin: 0;
  color: #b91c1c;
}

.profile-status.ok {
  color: #0f766e;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.form-message {
  min-height: 1.2rem;
  color: #b91c1c;
}

.hamburger {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  width: 40px;
  height: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
  cursor: pointer;
}

.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: #1e293b;
  border-radius: 999px;
  flex: 0 0 2px;
}

.profile-button {
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: linear-gradient(135deg, #f97316, #ec4899 48%, #3b82f6);
  color: #ffffff;
  border-radius: 50%;
  width: 42px;
  min-width: 42px;
  height: 42px;
  aspect-ratio: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex: 0 0 42px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.22);
}

.profile-button:hover {
  filter: brightness(1.05) saturate(1.05);
}

.profile-button span {
  font-size: 0.82rem;
}

.menu-dropdown {
  position: absolute;
  top: 44px;
  right: 0;
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.16);
  display: grid;
  overflow: hidden;
  z-index: 320;
}

.profile-dropdown {
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
}

.menu-dropdown a,
.menu-dropdown button {
  text-align: left;
  border: none;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  font-size: 0.95rem;
}

.menu-dropdown a:hover,
.menu-dropdown button:hover {
  background: #f1f5f9;
}

.menu-submenu {
  border-top: 1px solid #eef2f7;
  border-bottom: 1px solid #eef2f7;
}

.menu-submenu summary {
  list-style: none;
  cursor: pointer;
  padding: 0.7rem 0.8rem;
  font-size: 0.95rem;
  color: var(--text);
  user-select: none;
}

.menu-submenu summary::-webkit-details-marker {
  display: none;
}

.menu-submenu summary::after {
  content: "▸";
  float: right;
  color: #64748b;
}

.menu-submenu[open] summary::after {
  content: "▾";
}

.menu-submenu summary:hover,
.menu-submenu .submenu-link:hover {
  background: #f1f5f9;
}

.menu-submenu .submenu-link {
  display: block;
  padding-left: 1.5rem;
}

.hidden {
  display: none;
}

.site-footer {
  padding: 0 1rem 1rem;
}

.site-footer hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0 0 0.6rem;
}

.footer-content {
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-content p {
  margin: 0.15rem 0;
}

.footer-link-button {
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.cookie-consent {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: end center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.38);
}

.cookie-consent.hidden {
  display: none;
}

.cookie-consent-panel {
  width: min(480px, 100%);
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
  padding: 1.1rem 1.1rem 1rem;
}

.cookie-consent-eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0f766e;
}

.cookie-consent-panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
}

.cookie-consent-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.cookie-consent-copy-secondary {
  margin-top: 0.55rem;
}

.cookie-consent-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.cookie-consent-status {
  min-height: 1.2rem;
  margin: 0.75rem 0 0;
  color: #0f172a;
  font-size: 0.92rem;
}

@media (max-width: 640px) {
  .cookie-consent {
    place-items: end stretch;
    padding: 0.75rem;
  }

  .cookie-consent-panel {
    width: 100%;
  }
}

.menu-dropdown a,
.menu-dropdown button {
  display: block;
  width: 100%;
}

.menu-submenu {
  display: block;
  border-top: 1px solid #eef2f7;
  border-bottom: 1px solid #eef2f7;
}

.menu-submenu summary {
  display: block;
  list-style: none;
  cursor: pointer;
  padding: 0.7rem 0.8rem;
  font-size: 0.95rem;
  color: var(--text);
  user-select: none;
}

.menu-submenu summary::-webkit-details-marker,
.menu-submenu summary::marker {
  display: none;
}

.menu-submenu summary::after {
  content: "+";
  float: right;
  color: #64748b;
}

.menu-submenu[open] summary::after {
  content: "-";
}

.menu-submenu .submenu-items {
  display: grid;
}

.menu-submenu .submenu-link {
  display: block;
  width: 100%;
  padding-left: 1.5rem;
}

@media (max-width: 900px) {
  .page-with-nav {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .page-side-nav {
    position: static;
    min-height: auto;
    border-right: 1px solid var(--line);
    border-radius: 14px;
  }

  .page-side-nav-links {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .page-with-nav > .dashboard,
  .page-with-nav > .profile-page {
    border-radius: 14px;
  }
}

.campicker-page {
  width: min(1480px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.campicker-layout {
  display: grid;
  gap: 1rem;
}

.campicker-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.06);
}

.campicker-intro {
  margin-top: -0.25rem;
  color: var(--muted);
}

.campicker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}

.campicker-grid label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.campicker-grid input,
.campicker-grid select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}

.campicker-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
}

.campicker-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.campicker-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: #ecfeff;
  color: #155e75;
  border: 1px solid #bae6fd;
  font-size: 0.9rem;
}

.campicker-selected {
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.campicker-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.campicker-table th,
.campicker-table td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}

.campicker-table th {
  background: #f8fafc;
  font-size: 0.9rem;
  color: #334155;
}

.campicker-table tbody tr {
  cursor: pointer;
}

.campicker-table tbody tr:hover {
  background: #f8fafc;
}

.campicker-table tbody tr.is-selected {
  background: #ecfeff;
}

.table-empty {
  text-align: center;
  color: var(--muted);
}

@media (max-width: 768px) {
  .campicker-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .landing-tile-grid {
    grid-template-columns: 1fr;
  }

  .profile-meta {
    grid-template-columns: 1fr;
  }
}

.campicker-hidden {
  display: none !important;
}

.chat-page {
  width: min(1080px, 100%);
  margin: 0 auto;
}

.chat-shell {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(15, 23, 42, 0.04));
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.08);
}

.chat-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #dbe5ef;
  border-radius: 16px;
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.chat-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.chat-panel-head h1 {
  margin: 0.15rem 0 0;
}

.chat-eyebrow,
.chat-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.chat-log {
  min-height: 420px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.25rem;
  display: grid;
  gap: 0.8rem;
}

.chat-message {
  max-width: min(720px, 92%);
  border-radius: 16px;
  padding: 0.85rem 1rem;
  line-height: 1.45;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.chat-message p {
  margin: 0;
  white-space: pre-wrap;
}

.chat-message-user {
  margin-left: auto;
  background: linear-gradient(135deg, #0f766e, #155e75);
  color: #fff;
}

.chat-message-assistant {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.chat-form {
  display: grid;
  gap: 0.75rem;
}

.chat-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 90px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

body[data-theme="dark"] {
  color-scheme: dark;
}

body[data-theme="dark"] .site-header,
body[data-theme="dark"] .landing,
body[data-theme="dark"] .auth-section,
body[data-theme="dark"] .dashboard,
body[data-theme="dark"] .profile-page,
body[data-theme="dark"] .impressum,
body[data-theme="dark"] .page-side-nav,
body[data-theme="dark"] .campicker-card,
body[data-theme="dark"] .chat-panel,
body[data-theme="dark"] .cookie-consent-panel,
body[data-theme="dark"] .menu-dropdown,
body[data-theme="dark"] .profile-meta-card,
body[data-theme="dark"] .privacy-card {
  background: var(--surface) !important;
  color: var(--text);
  border-color: var(--line) !important;
  box-shadow: var(--shadow-soft);
}

body[data-theme="dark"] .page-side-nav-links a,
body[data-theme="dark"] .landing-tile,
body[data-theme="dark"] .ki-stepbar-link,
body[data-theme="dark"] .hamburger,
body[data-theme="dark"] .campicker-grid input,
body[data-theme="dark"] .campicker-grid select,
body[data-theme="dark"] .chat-message-assistant,
body[data-theme="dark"] .chat-form textarea,
body[data-theme="dark"] .profile-form input,
body[data-theme="dark"] .profile-form select,
body[data-theme="dark"] .auth-form input {
  background: var(--surface-soft) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

body[data-theme="dark"] .menu-dropdown a,
body[data-theme="dark"] .menu-dropdown button,
body[data-theme="dark"] .menu-submenu summary,
body[data-theme="dark"] .footer-link-button {
  color: var(--text);
}

body[data-theme="dark"] .menu-dropdown a:hover,
body[data-theme="dark"] .menu-dropdown button:hover,
body[data-theme="dark"] .menu-submenu summary:hover,
body[data-theme="dark"] .menu-submenu .submenu-link:hover {
  background: #1e293b !important;
}

body[data-theme="dark"] [style*="background:#fff"],
body[data-theme="dark"] [style*="background: #fff"],
body[data-theme="dark"] [style*="background:#ffffff"],
body[data-theme="dark"] [style*="background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%)"],
body[data-theme="dark"] [style*="background:linear-gradient(180deg,#ffffff 0%,#f8fafc 100%)"] {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

body[data-theme="dark"] [style*="color:#64748b"],
body[data-theme="dark"] [style*="color: #64748b"],
body[data-theme="dark"] [style*="color:#475569"],
body[data-theme="dark"] [style*="color: #475569"],
body[data-theme="dark"] [style*="color:#334155"] {
  color: var(--muted) !important;
}

body[data-theme="dark"] [style*="border:1px solid #dbe3ef"],
body[data-theme="dark"] [style*="border:1px solid #dbe5ef"],
body[data-theme="dark"] [style*="border:1px solid #e2e8f0"],
body[data-theme="dark"] [style*="border: 1px solid #dbe3ef"],
body[data-theme="dark"] [style*="border: 1px solid #dbe5ef"],
body[data-theme="dark"] [style*="border: 1px solid #e2e8f0"] {
  border-color: var(--line) !important;
}

.chat-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

@media (max-width: 768px) {
  .chat-panel-head,
  .chat-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-message {
    max-width: 100%;
  }
}

