/* Base layer: reset, theme mapping, layout primitives */
:root {
  /* Fallbacks, falls design-tokens.css aus irgendeinem Grund nicht geladen wird */
  --sys-bg: var(--bg-body, #f8fafc);
  --sys-surface: var(--bg-surface, #ffffff);
  --sys-surface-2: var(--bg-surface-subtle, #f1f5f9);
  --sys-text: var(--text-primary, #0f172a);
  --sys-text-muted: var(--text-secondary, #475569);
  --sys-text-inverse: var(--text-inverse, #ffffff);
  --sys-border: var(--border-color, rgba(0, 0, 0, 0.08));
  --sys-primary: var(--c-primary-500, #3b82f6);
  --sys-primary-strong: var(--c-primary-700, #1d4ed8);
  --sys-success: var(--c-success-500, #22c55e);
  --sys-success-strong: var(--c-success-700, #15803d);
  --sys-warning: var(--c-warning-500, #eab308);
  --sys-warning-strong: var(--c-warning-700, #a16207);
  --sys-danger: var(--c-error-500, #ef4444);
  --sys-danger-strong: var(--c-error-700, #b91c1c);
  --sys-shadow-sm: var(--shadow-sm, 0 1px 2px 0 rgb(0 0 0 / 0.05));
  --sys-shadow-md: var(--shadow-md, 0 4px 6px -1px rgb(0 0 0 / 0.1));
  --sys-shadow-lg: var(--shadow-lg, 0 10px 15px -3px rgb(0 0 0 / 0.1));
  --sys-radius-sm: var(--radius-sm, 2px);
  --sys-radius-md: var(--radius-md, 6px);
  --sys-radius-lg: var(--radius-lg, 8px);
  --sys-radius-xl: var(--radius-xl, 12px);
  --sys-radius-2xl: var(--radius-2xl, 16px);
  --sys-radius-full: var(--radius-full, 9999px);
  --sys-focus: color-mix(in srgb, var(--sys-primary) 55%, transparent);
  --page-max: 720px;
  --gutter: 16px;
  --line: var(--sys-border);
  --panel: var(--sys-surface);
  --overlay-strong: rgba(0, 0, 0, 0.45);
  --overlay-soft: rgba(0, 0, 0, 0.25);

  /* Clinic-Look: flacher Hintergrund, keine Ambient-Gradients mehr.
     Beide Variablen werden auf "none" gesetzt, damit etwaige Verbraucher
     keine farbigen Verlaeufe mehr rendern. */
  --ambient-bg: none;
  --ambient-vignette: none;
}

[data-theme="dark"] {
  --ambient-bg: none;
  --ambient-vignette: none;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  background: var(--sys-bg);
  color: var(--sys-text);
  position: relative;
  isolation: isolate;
}

body.modal-open {
  overflow: hidden;
}

/* Body Ambient-Layer deaktiviert (Clinic-Look).
   Frueher: zwei full-screen Pseudo-Elemente mit Radial-Gradients.
   Jetzt: Body-Hintergrund ist die einzige Farbflaeche (var(--sys-bg)). */
body::before,
body::after {
  content: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

input,
select,
textarea {
  background: var(--sys-surface);
  border: 1px solid var(--sys-border);
  border-radius: var(--sys-radius-lg);
  padding: 12px 14px;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--sys-text) 40%, transparent);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid var(--sys-focus);
  outline-offset: 2px;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

.container {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

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

.u-flex {
  display: flex;
}

.u-flex-col {
  display: flex;
  flex-direction: column;
}

.u-inline-flex {
  display: inline-flex;
}

.u-center {
  align-items: center;
  justify-content: center;
}

.u-items-center {
  align-items: center;
}

.u-items-start {
  align-items: flex-start;
}

.u-items-end {
  align-items: flex-end;
}

.u-between {
  align-items: center;
  justify-content: space-between;
}

.u-justify-between {
  justify-content: space-between;
}
.u-justify-start {
  justify-content: flex-start;
}

.u-justify-center {
  justify-content: center;
}

.u-justify-end {
  justify-content: flex-end;
}

.u-gap-8 {
  gap: 8px;
}

.u-gap-6 {
  gap: 6px;
}

.u-gap-10 {
  gap: 10px;
}

.u-gap-12 {
  gap: 12px;
}

.u-gap-14 {
  gap: 14px;
}

.u-gap-16 {
  gap: 16px;
}

.u-gap-20 {
  gap: 20px;
}

.u-gap-24 {
  gap: 24px;
}

.u-gap-32 {
  gap: 32px;
}

.u-mt-6 {
  margin-top: 6px;
}

.u-mt-8 {
  margin-top: 8px;
}

.u-mt-10 {
  margin-top: 10px;
}

.u-mt-12 {
  margin-top: 12px;
}

.u-mt-16 {
  margin-top: 16px;
}

.u-mt-20 {
  margin-top: 20px;
}

.u-mt-24 {
  margin-top: 24px;
}

.u-mb-6 {
  margin-bottom: 6px;
}

.u-mb-8 {
  margin-bottom: 8px;
}

.u-mb-10 {
  margin-bottom: 10px;
}

.u-mb-12 {
  margin-bottom: 12px;
}

.u-mb-16 {
  margin-bottom: 16px;
}

.u-mb-20 {
  margin-bottom: 20px;
}

.u-p-28 {
  padding: 28px;
}

.u-ml-auto {
  margin-left: auto;
}

.u-ml-8 {
  margin-left: 8px;
}

.u-w-full {
  width: 100%;
}

.u-flex-1 {
  flex: 1;
}

.u-min-240 {
  min-width: 240px;
}

.u-text-right {
  text-align: right;
}

.u-text-center {
  text-align: center;
}

.u-leading-150 {
  line-height: 1.5;
}

.u-fw-700 {
  font-weight: 700;
}

.u-fw-900 {
  font-weight: 600;
}

.u-wrap {
  flex-wrap: wrap;
}

.u-grow {
  flex: 1;
}

.safe-bottom {
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

.muted {
  color: var(--sys-text-muted);
}

.small {
  font-size: var(--fs-body-sm);
}

.smallmuted {
  color: var(--sys-text-muted);
  font-size: var(--fs-body-sm);
}

.text-danger {
  color: var(--sys-danger);
}

.title {
  font-weight: 600;
}

@media (min-width: 768px) {
  :root {
    --gutter: 20px;
  }
}
