/* webble Kundenportal: helles, ruhiges Portal. Einzige Markennote ist die Wortmarke (Almarai 700).
   Kontrast (WCAG 2.1), gemessen auf den Flächen, auf denen die Farbe vorkommt:
     --text      #1c1b18  auf #fff 17.2:1, auf --bg #f7f6f2 15.9:1
     --text-2    #5c5a53  auf #fff  6.9:1, auf --bg 6.4:1, auf --surface-2 #f3f2ed 6.2:1
     --muted     #6b6962  auf #fff  5.5:1, auf --bg 5.1:1, auf --surface-2 4.9:1
     --field     #918e85  Rand von Feldern, Zweitknöpfen, Auswahlkarten, Dateiknopf:
                          3.3:1 zu #fff, 3.0:1 zu --bg, 3.1:1 zu #fbfaf7 (1.4.11 Nicht-Text-Kontrast)
     --line      #e6e3da / --line-strong #d6d2c7  nur Deko-Trennlinien und Kartenränder
     Knopf: #fff auf --ink #1c1b18 17.2:1, auf Hover #34322d 12.8:1; Fokusring --ink 15.9:1 zu --bg
     Fehler: --danger #a1301c auf #fff 7.1:1, auf #fcf0ed 6.4:1; Titel #8a2a18 auf #fcf0ed 7.8:1
     Erfolg: #1d5a31 auf #eef7f1 7.5:1
     Status (Text auf Pille): eingegangen 8.4:1, in Arbeit 8.3:1, Rückfrage (violett) 8.5:1,
       Vorschau bereit (bernstein, einzige Warmfarbe) 7.2:1, freigegeben/live 7.0:1, abgelehnt 5.9:1 */
:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #f3f2ed;
  --surface-hover: #fbfaf7;
  --line: #e6e3da;
  --line-strong: #d6d2c7;
  --field: #918e85;
  --text: #1c1b18;
  --text-2: #5c5a53;
  --muted: #6b6962;
  --ink: #1c1b18;
  --ink-hover: #34322d;
  --danger: #a1301c;
  --danger-strong: #8a2a18;
  --danger-line: #c4472f;
  --danger-bg: #fcf0ed;
  --danger-border: #f0c4ba;
  --success: #1d5a31;
  --success-bg: #eef7f1;
  --success-border: #cfe5d6;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-brand: "Almarai", var(--font);

  --fs-xs: 0.8125rem;
  --fs-sm: 0.875rem;
  --fs-ui: 0.9375rem;
  --fs-body: 1rem;
  --fs-card: 1.0625rem;
  --fs-h1: 1.75rem;

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 10px;
  --r-card: 12px;

  --shadow: 0 1px 2px rgba(28, 27, 24, 0.04);
  --arrow-back: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235c5a53' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3C/svg%3E");
  --arrow-out: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c1b18' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M8 7h9v9'/%3E%3C/svg%3E");
}
@media (min-width: 48rem) { :root { --fs-h1: 2rem; } }

/* Nur die Wortmarke nutzt eine eigene Schrift (selbst gehostet, OFL, siehe static/fonts/) */
@font-face {
  font-family: "Almarai";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/almarai-latin-700-normal.woff2") format("woff2");
}

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

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul, ol, dl, figure { margin: 0; }
h1, h2, h3 { color: var(--text); font-weight: 600; }
p + p { margin-top: 0.75rem; }
strong { font-weight: 600; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(28, 27, 24, 0.35);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}
a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 60;
  padding: 0.625rem 1rem;
  border-radius: var(--r-md);
  background: var(--ink);
  color: #fff;
  font-size: var(--fs-ui);
  font-weight: 500;
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

.wrap {
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1rem;
}
@media (min-width: 40rem) { .wrap { padding: 0 1.5rem; } }
@media (min-width: 64rem) { .wrap { padding: 0 2rem; } }

/* ---------- Kopf ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "brand logout" "nav nav";
  align-items: center;
  column-gap: 1rem;
  min-height: 3.5rem;
}
.wordmark { grid-area: brand; }
.main-nav { grid-area: nav; }
.logout-form { grid-area: logout; margin: 0; }
.wordmark, .logout-form { padding: 0.5rem 0; }

@media (min-width: 48rem) {
  .header-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand nav logout";
    column-gap: 2.5rem;
    min-height: 4rem;
  }
}

.wordmark {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 2.5rem;
  color: var(--text);
  text-decoration: none;
}
.wordmark {
  font-family: var(--font-brand);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
}
.wordmark-star {
  align-self: flex-start;
  margin-left: 0.06em;
  margin-top: 0.1em;
  font-size: 0.55em;
  line-height: 1;
  letter-spacing: 0;
}
.wordmark-sub {
  margin-left: 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--line-strong);
  font-family: var(--font);
  font-size: var(--fs-sm);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.25rem;
  color: var(--text-2);
  white-space: nowrap;
}
/* Sehr schmal / 200 % Zoom: Zusatz weg, damit nichts seitlich scrollt */
@media (max-width: 21.99rem) { .wordmark-sub { display: none; } }

.nav-list {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 0.25rem;
  margin-left: -0.75rem;
}
@media (min-width: 48rem) { .nav-list { margin-left: 0; } }
.nav-list a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  color: var(--text-2);
  font-size: var(--fs-ui);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}
@media (min-width: 48rem) { .nav-list a { min-height: 4rem; } }
.nav-list a:hover { color: var(--text); }
.nav-list a[aria-current="page"] { color: var(--text); }
/* Aktiver Reiter: Linie auf der Unterkante der Kopfleiste */
.nav-list a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--ink);
}
.nav-list a:focus-visible { outline-offset: -2px; border-radius: var(--r-md); }

/* ---------- Inhalt ---------- */
main.wrap {
  flex: 1;
  padding-top: 1.75rem;
  padding-bottom: 4rem;
}
@media (min-width: 48rem) { main.wrap { padding-top: 2.5rem; padding-bottom: 5rem; } }
main:focus { outline: none; }

.is-bare main.wrap { padding-top: clamp(2rem, 10vh, 6rem); }

.page-head { margin-bottom: 1.5rem; }
@media (min-width: 48rem) { .page-head { margin-bottom: 2rem; } }
.page-title {
  font-size: var(--fs-h1);
  line-height: 1.25;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.lead {
  max-width: 40rem;
  margin-top: 0.5rem;
  color: var(--text-2);
  font-size: var(--fs-body);
  text-wrap: pretty;
}
.page-head-split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.small { font-size: var(--fs-sm); color: var(--text-2); }
.muted { color: var(--text-2); }
.empty { color: var(--text-2); }
.text-block { white-space: pre-wrap; overflow-wrap: anywhere; }

.back { margin: -0.5rem 0 0.5rem; }
.back a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 2.5rem;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
}
.back a::before {
  content: "";
  width: 1rem;
  height: 1rem;
  margin-left: -0.25rem;
  background: var(--arrow-back) center / contain no-repeat;
}
.back a:hover { color: var(--text); text-decoration: underline; text-decoration-color: rgba(28, 27, 24, 0.35); }

/* Steht allein (nicht im Fliesstext): Trefferfläche 44 px hoch */
.link-quiet { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: var(--fs-sm); font-weight: 500; }

/* ---------- Karten ---------- */
.card {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow);
}
@media (min-width: 40rem) { .card { padding: 1.5rem; } }
.card-flush { padding: 0; overflow: hidden; }
.card-narrow { max-width: 40rem; }

.card-title {
  margin-bottom: 1rem;
  font-size: var(--fs-card);
  line-height: 1.4;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -0.5rem 0 0;
}
.card-head .card-title { margin-bottom: 0; }
.card-action { margin-top: 1.25rem; }

/* ---------- Knöpfe ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 1.125rem;
  border: 1px solid var(--ink);
  border-radius: var(--r-md);
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: var(--fs-ui);
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  /* nur Rand/Farbe, kein background-color-Übergang (in <details> aufgedeckte Knöpfe blendeten sonst ein) */
}
.btn:hover { background: var(--ink-hover); border-color: var(--ink-hover); color: #fff; }
.btn-secondary {
  border-color: var(--field);
  background: var(--surface);
  color: var(--text);
}
.btn-secondary:hover { border-color: var(--text-2); background: var(--surface-hover); color: var(--text); }
.btn-small { min-height: 2.5rem; padding: 0.375rem 0.875rem; font-size: var(--fs-sm); }
.btn-block { width: 100%; }
/* Handy: alle Hauptknöpfe in Formularen und Karten volle Breite, eine Regel für alle */
@media (max-width: 29.99rem) {
  main form .btn, .card-action .btn, .page-head-action, .page-head-action .btn { width: 100%; }
}

/* ---------- Status ---------- */
/* Der Text trägt die Bedeutung; Farbe und Punkt wiederholen ihn nur. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  flex: none;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  background: #efede6;
  color: #45433d;
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.25rem;
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.status-in_arbeit, .status-site-in_arbeit { background: #e6ecf3; color: #2f4560; }
.status-rueckfrage { background: #ecebf7; color: #3f3a78; }
.status-vorschau_bereit { background: #f6dfb3; color: #6b3a04; }
.status-freigegeben, .status-live, .status-site-live { background: #e1f0e5; color: #1d5a31; }
.status-abgelehnt, .status-site-offline { background: #efede6; color: #5c5a53; }
.status-abgelehnt::before, .status-site-offline::before {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px currentColor;
}

/* ---------- Übersicht ---------- */
.overview { display: grid; gap: 1rem; }
@media (min-width: 56rem) {
  .overview {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    grid-template-areas: "tickets site";
    gap: 1.5rem;
    align-items: start;
  }
  .overview-site { grid-area: site; }
  .overview-tickets { grid-area: tickets; }
}

.site-list { list-style: none; padding: 0; display: grid; gap: 0.75rem; }
.site-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}
.site-domain { font-weight: 500; overflow-wrap: anywhere; }

/* Zeilen (Anliegen) */
.rows { list-style: none; padding: 0; }
.row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
  align-items: start;
  padding: 0.875rem 0;
  border-top: 1px solid var(--line);
}
.rows > .row:first-child { border-top: 0; }
.row .status { justify-self: start; }
@media (min-width: 40rem) {
  .row { grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; align-items: center; }
}
.row-main { min-width: 0; }
.row-link {
  display: block;
  color: var(--text);
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.row-link::after { content: ""; position: absolute; inset: 0; }
.row:hover .row-link { text-decoration: underline; text-decoration-color: rgba(28, 27, 24, 0.35); }
.row-link:focus-visible { outline: none; }
.row:has(.row-link:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: var(--r-md); }
.row-meta { margin-top: 0.125rem; color: var(--text-2); font-size: var(--fs-sm); }

/* Ganze Liste in einer Karte ohne Polster: Zeilen bekommen das Polster */
.card-flush .row { padding: 1rem 1.25rem; transition: background-color 0.15s; }
@media (min-width: 40rem) { .card-flush .row { padding: 1rem 1.5rem; } }
.card-flush .row:hover { background: var(--surface-hover); }
.card-flush .row:has(.row-link:focus-visible) { outline-offset: -2px; border-radius: 0; }

/* ---------- Anmelden, Bestätigen, Fehler ---------- */
.auth-card {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
}
@media (min-width: 40rem) { .auth-card { padding: 2.25rem 2.25rem 2rem; } }
.auth-kicker { margin-bottom: 0.375rem; color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; }
.auth-title { font-size: 1.5rem; line-height: 1.3; letter-spacing: -0.01em; }
.auth-text { margin-top: 0.5rem; color: var(--text-2); text-wrap: pretty; }
.auth-foot { margin-top: 1.25rem; }
.auth-card .notice { margin-bottom: 1.25rem; }
.auth-card form { margin-top: 1.5rem; }
.auth-card .field:first-of-type { margin-top: 0; }
.statement-action { margin-top: 1.5rem; }
.statement-action .btn { margin-top: 0; }

/* ---------- Formulare ---------- */
.split { display: grid; gap: 1rem; }
@media (min-width: 64rem) {
  .split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
}

.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 0.875rem; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: 0.75rem;
  color: var(--text-2);
  font-size: var(--fs-ui);
}
.steps li::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
}

.field { margin-top: 1.25rem; }
input[type="hidden"] + .field { margin-top: 0; }

label, legend, .field-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.5rem;
  width: 100%;
  margin-bottom: 0.375rem;
  padding: 0;
  color: var(--text);
  font-size: var(--fs-ui);
  font-weight: 500;
  line-height: 1.4;
}
.optional { color: var(--muted); font-size: var(--fs-sm); font-weight: 400; }

input[type="email"],
input[type="text"],
textarea {
  display: block;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--field);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-body);
  line-height: 1.5;
  transition: border-color 0.15s;
}
input[type="email"], input[type="text"] { min-height: 2.75rem; }
textarea { resize: vertical; min-height: 7.5rem; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type="email"]:hover, input[type="text"]:hover, textarea:hover { border-color: var(--muted); }
input[type="email"]:focus, input[type="text"]:focus, textarea:focus { border-color: var(--ink); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger-line); }

.hint { margin-top: 0.375rem; color: var(--text-2); font-size: var(--fs-sm); }
label + .hint { margin: -0.125rem 0 0.5rem; }
.field-error {
  margin-top: 0.375rem;
  color: var(--danger);
  font-size: var(--fs-sm);
  font-weight: 500;
}

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
/* Sprung aus der Fehlerliste: Label bzw. Frage über dem Feld bleibt sichtbar */
input, textarea, fieldset { scroll-margin-top: 4.5rem; }
.choice input { scroll-margin-top: 6.5rem; }
fieldset.field { margin-top: 0; }
.choices > legend { margin-bottom: 0.5rem; }

/* Auswahl als zwei Karten: echte Radios, Zustand per :checked */
.choice-grid { display: grid; gap: 0.75rem; }
@media (min-width: 40rem) { .choice-grid { grid-template-columns: 1fr 1fr; } }
.choice { position: relative; }
.choice input {
  position: absolute;
  top: 1.0625rem;
  left: 1rem;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--field);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
}
.choice input:checked {
  border-color: var(--ink);
  background: var(--ink);
  box-shadow: inset 0 0 0 3.5px var(--surface);
}
.choice label {
  display: block;
  height: 100%;
  margin: 0;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  border: 1px solid var(--field);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-body);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.choice label .hint { display: block; margin-top: 0.125rem; font-weight: 400; }
.choice label:hover { border-color: var(--text-2); }
.choice input:checked + label {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
  background: var(--surface-hover);
}
.choice input:focus-visible { outline: none; }
.choice input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 2px; }
.choice input[aria-invalid="true"] + label { border-color: var(--danger-line); }
fieldset .field-error { margin-top: 0.5rem; }

/* Datei-Feld: die ganze Fläche ist das Label; das native Feld bleibt sichtbar,
   weil es ohne Skript als einziges zeigt, welche Dateien gewählt sind */
.dropzone {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: 0.5rem;
  margin: 0;
  padding: 1rem;
  border: 1px dashed var(--field);
  border-radius: var(--r-lg);
  background: var(--surface-hover);
  color: var(--text);
  text-align: left;
  font-weight: 400;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.dropzone:hover { border-color: var(--text-2); background: var(--surface-2); }
.dropzone:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.dropzone:has(input[aria-invalid="true"]) { border-color: var(--danger-line); }
.dropzone-title { font-size: var(--fs-ui); font-weight: 500; }
.dropzone .hint { display: block; margin-top: 0; }
input[type="file"] {
  display: block;
  width: 100%;
  max-width: 100%;
  color: var(--text-2);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
}
input[type="file"]:focus-visible { outline: none; }
input[type="file"]::file-selector-button {
  min-height: 2.5rem;
  margin-right: 0.75rem;
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--field);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
}
input[type="file"]:hover::file-selector-button { border-color: var(--text-2); }

main form .btn { margin-top: 1.5rem; }

.error-summary {
  scroll-margin-top: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--danger-border);
  border-radius: var(--r-lg);
  background: var(--danger-bg);
}
.error-summary:focus { outline: 2px solid var(--danger); outline-offset: 2px; }
.error-summary h2 { margin-bottom: 0.375rem; color: var(--danger-strong); font-size: var(--fs-body); }
.error-summary ul { padding-left: 1.25rem; display: grid; gap: 0.25rem; font-size: var(--fs-ui); }
.error-summary a { color: var(--danger); text-decoration-color: rgba(161, 48, 28, 0.45); }
.error-summary a:hover { text-decoration-color: currentColor; }

.notice {
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-ui);
}
.notice-done { border-color: var(--success-border); background: var(--success-bg); color: var(--success); }
main > .notice, main > .error-summary { margin-bottom: 1.5rem; }

/* ---------- Anliegen: Detail ---------- */
.ticket-meta { margin-top: 0.25rem; color: var(--text-2); font-size: var(--fs-ui); }
.ticket-status { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-top: 1rem; }
.ticket-hint { color: var(--text-2); font-size: var(--fs-ui); max-width: 40rem; }

.detail { display: grid; gap: 1rem; }
@media (min-width: 64rem) {
  .detail { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.5rem; align-items: start; }
  .detail-facts { position: sticky; top: 1.5rem; }
}
.description { line-height: 1.6; }

.facts { margin-top: 1.25rem; border-top: 1px solid var(--line); }
.facts div {
  display: grid;
  align-items: baseline;
  gap: 0.125rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.facts div:last-child { border-bottom: 0; padding-bottom: 0; }
@media (min-width: 30rem) { .facts div { grid-template-columns: 9rem minmax(0, 1fr); gap: 1rem; } }
.facts dt { color: var(--text-2); font-size: var(--fs-sm); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.card-narrow .facts { margin-top: 0; border-top: 0; }
.card-narrow .facts div:first-child { padding-top: 0; }
.card-narrow .small { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.konto-stack > .card + .card { margin-top: 1.5rem; }
.card-intro { margin: 0 0 1.25rem; color: var(--text-2); font-size: var(--fs-sm); }

/* Anhänge: Vorschaubild, Name auf einer Zeile, Angaben darunter */
.attachments { list-style: none; padding: 0; margin-top: 1rem; display: grid; gap: 0.5rem; }
.attachment {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem 0.75rem 0.375rem 0.375rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}
.attachment:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.thumb {
  display: block;
  width: 2.75rem;
  height: 2.75rem;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.thumb-file {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.attachment-text { display: grid; min-width: 0; }
/* Lange Namen: höchstens zwei Zeilen, der volle Name steht im title */
.attachment-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.4;
}
.attachment-meta { color: var(--text-2); font-size: var(--fs-xs); }

/* Verlauf: ruhige Zeitleiste, Punkt links, Linie zum nächsten Eintrag */
.thread { list-style: none; padding: 0; }
.message {
  position: relative;
  min-width: 0;
  padding: 0 0 1.25rem 1.5rem;
}
.message::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.4rem;
  width: 0.625rem;
  height: 0.625rem;
  border: 1.5px solid var(--field);
  border-radius: 50%;
  background: var(--surface);
}
.message-webble::before { border-color: var(--ink); background: var(--ink); }
.message::after {
  content: "";
  position: absolute;
  left: calc(0.3125rem - 0.5px);
  top: 1.25rem;
  bottom: 0.125rem;
  width: 1px;
  background: var(--line);
}
.message:last-child { padding-bottom: 0; }
.message:last-child::after { display: none; }
.message-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.5rem;
  margin-bottom: 0.25rem;
}
.message-head strong { font-size: var(--fs-ui); }
.message-head time { color: var(--text-2); font-size: var(--fs-xs); }
.message .text-block { font-size: var(--fs-ui); line-height: 1.6; }
.message .attachments { margin-top: 0.75rem; }

.message-form { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.message-form .field:first-of-type { margin-top: 0; }

/* Vorschau */
.preview { margin-bottom: 1.5rem; }
.preview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}
.preview-head .card-title { margin-bottom: 0; }
.preview-summary { margin-top: 0.375rem; max-width: 40rem; color: var(--text-2); }
.preview-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.5rem;
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--field);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}
.preview-link a::after {
  content: "";
  width: 0.875rem;
  height: 0.875rem;
  background: var(--arrow-out) center / contain no-repeat;
}
.preview-link a:hover { border-color: var(--text-2); background: var(--surface-hover); }

/* Belege kompakt, damit «Passt es so?» nahe bei den Bildern steht. Die Bilder sind auf ein
   festes Format zugeschnitten (oben bündig); ein Klick öffnet das ganze Bild. */
.compare-groups { display: grid; gap: 1.25rem; margin-top: 1.25rem; }
@media (min-width: 64rem) {
  .compare-groups { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
}
.compare-title { margin-bottom: 0.5rem; color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; }
.compare { display: grid; gap: 0.75rem; }
.compare-desktop { grid-template-columns: repeat(2, minmax(0, 20rem)); justify-content: start; }
.compare-mobile { grid-template-columns: repeat(2, minmax(0, 7.5rem)); justify-content: start; }
.shot figcaption {
  margin-bottom: 0.375rem;
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 500;
}
.shot-after figcaption { color: var(--text); font-weight: 600; }
.shot a { display: block; border-radius: var(--r-md); }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.compare-desktop .shot img { aspect-ratio: 16 / 10; }
.compare-mobile .shot img { aspect-ratio: 9 / 16; }

.decision { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.decision-title { font-size: var(--fs-card); line-height: 1.4; }
.decision-text { max-width: 40rem; margin-top: 0.25rem; color: var(--text-2); text-wrap: pretty; }
/* Beide Knöpfe bleiben in ihrer Zeile; das Formular öffnet sich darunter */
.decision-actions {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  justify-items: start;
  gap: 0.75rem;
  margin-top: 1rem;
}
.decision-actions .btn { margin-top: 0; }
.decision-actions > form { display: flex; margin: 0; }
/* Fallback ohne ::details-content: Formular unter dem eigenen Knopf */
.decision-more { grid-column: 2 / -1; display: grid; justify-items: start; gap: 0.75rem; }
/* Geschlossen: der leere Inhaltsbereich zählt sonst als Rasterzeile samt Abstand und schiebt den Knopf hoch */
.decision-more:not([open]) { gap: 0; }
/* Nur offen: display:contents auf ::details-content hebt sonst das Verbergen
   des geschlossenen <details> auf, und das Formular stünde immer da. */
@supports selector(::details-content) {
  .decision-more[open], .decision-more[open]::details-content { display: contents; }
  .decision-more[open] form { grid-column: 1 / -1; }
}
.decision-more summary { list-style: none; }
.decision-more summary::-webkit-details-marker { display: none; }
.decision-more[open] summary { border-color: var(--field); background: var(--surface-2); }
.decision-more form {
  width: min(40rem, 100%);
  margin-top: 0.25rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-hover);
}
.decision-more form .field { margin-top: 0; }
.decision-actions .decision-more form .btn { margin-top: 1rem; }
@media (max-width: 29.99rem) {
  .decision-actions { grid-template-columns: minmax(0, 1fr); justify-items: stretch; }
  .decision-more { grid-column: auto; justify-items: stretch; }
  .decision-actions > form, .decision-actions > form .btn, .decision-more summary { width: 100%; }
}
.preview > .notice { margin-top: 1.5rem; }

/* ---------- Abo, Startseite, Rechtstexte (M4) ----------
   Abo-Status (Text auf Pille): aktiv #1d5a31 auf #e1f0e5 7.0:1, Zahlung offen #6b3a04 auf #f6dfb3 7.2:1,
   gekündigt #2f4560 auf #e6ecf3 8.3:1, beendet #5c5a53 auf #efede6 5.9:1.
   Entwurfs-Banner #6b3a04 auf #fbf0dc 8.0:1; Platzhalter #6b3a04 auf #f6dfb3 7.2:1. */
.overview-aside { display: grid; gap: 1rem; align-content: start; }
@media (min-width: 56rem) { .overview-aside { gap: 1.5rem; } }
.status-abo-active { background: #e1f0e5; color: #1d5a31; }
.status-abo-past_due { background: #f6dfb3; color: #6b3a04; }
.status-abo-canceling, .status-abo-pending { background: #e6ecf3; color: #2f4560; }
.status-abo-ended { background: #efede6; color: #5c5a53; }
.status-abo-ended::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.abo-list { display: grid; gap: 1rem; }
.abo-list .card-head { flex-wrap: wrap; gap: 0.5rem 1rem; }
.abo-list .facts { margin-top: 1rem; }
.abo-portal { margin-top: 1rem; }
.abo-portal form { margin: 0; }
.abo-portal .btn { margin-top: 1.25rem; }

.start .card-title { margin-bottom: 0.25rem; }
.start form { margin-top: 0.5rem; }
.consent {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  margin-top: 1.5rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--field);
  border-radius: var(--r-lg);
  background: var(--surface-hover);
}
.consent input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.125rem 0 0;
  accent-color: var(--ink);
  scroll-margin-top: 6.5rem;
}
.consent label { display: block; margin: 0; font-size: var(--fs-ui); font-weight: 400; line-height: 1.5; color: var(--text); }
.consent:has(input[aria-invalid="true"]) { border-color: var(--danger-line); }
.consent + .field-error { margin-top: 0.5rem; }
.consent + .consent, .field-error + .consent { margin-top: 0.75rem; }
.key-points {
  margin-top: 1.5rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-2);
}
.key-points .sub-title { margin: 0 0 0.5rem; }
.key-points ol { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.375rem; font-size: var(--fs-ui); line-height: 1.5; }
.prose .key-points { margin: 1rem 0 0.5rem; }
.prose ol { padding-left: 1.25rem; display: grid; gap: 0.375rem; }
.prose p + ol, .prose ol + p { margin-top: 0.75rem; }
.form-foot { margin-top: 1rem; }
/* Preis direkt über dem Zahlknopf: auf dem Handy steht die Angebotskarte erst unter dem Formular */
.pay-sum { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin: 1.5rem 0 0.75rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--text-2); }
.pay-sum strong { color: var(--text); font-weight: 600; }
.price { margin: 0.25rem 0 1.25rem; }
/* Schmale Seitenkarte: Angaben untereinander, damit Firma und Domain nicht Wort für Wort umbrechen */
.start aside .facts div { grid-template-columns: minmax(0, 1fr); gap: 0.125rem; }
.price-amount { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; }
.sub-title { margin-bottom: 0.5rem; font-size: var(--fs-ui); }
.check-list { list-style: none; padding: 0; display: grid; gap: 0.5rem; font-size: var(--fs-ui); }
.check-list li { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr); gap: 0.5rem; }
.check-list li::before {
  content: "";
  width: 0.75rem;
  height: 0.4rem;
  margin: 0.45rem 0 0 0.2rem;
  border-left: 2px solid var(--success);
  border-bottom: 2px solid var(--success);
  transform: rotate(-45deg);
}
.start .facts { margin-top: 1.25rem; }
.link-list { list-style: none; padding: 0; margin-top: 1rem; display: grid; gap: 0.25rem; }
.ext-link { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2.75rem; font-weight: 500; }
.ext-link::after { content: ""; width: 0.875rem; height: 0.875rem; background: var(--arrow-out) center / contain no-repeat; }
.start aside .small { margin-top: 1rem; }
.start aside .price { margin-bottom: 0.25rem; }
.start aside .price-note { margin: 0 0 1.25rem; color: var(--text-2); }

.draft-banner {
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid #e8c88e;
  border-radius: var(--r-lg);
  background: #fbf0dc;
  color: #6b3a04;
  font-size: var(--fs-ui);
}
.placeholder { padding: 0 0.25rem; border-radius: 4px; background: #f6dfb3; color: #6b3a04; font-weight: 500; }
.prose { max-width: 46rem; }
.prose h2 { margin: 1.75rem 0 0.5rem; font-size: var(--fs-card); }
.prose p + p, .prose ul + p, .prose p + ul { margin-top: 0.75rem; }
.prose ul { padding-left: 1.25rem; display: grid; gap: 0.375rem; }
.prose .page-title { margin-bottom: 0.5rem; }

.dev-sub + .dev-sub { margin-top: 1rem; }
.dev-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.dev-actions form { margin: 0; }
main .dev-actions form .btn, main .abo-portal form .btn { margin-top: 0; }
.abo-portal form { margin-top: 1.25rem; }
.auth-card form + form { margin-top: 0.75rem; }
.auth-card form + form .btn { margin-top: 0; }

/* ---------- Fuss ---------- */
.site-footer { border-top: 1px solid var(--line); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  padding: 1.25rem 0 1.5rem;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.footer-inner p + p { margin-top: 0; }
.footer-inner a { display: inline-block; padding: 0.375rem 0; color: var(--muted); }
.footer-inner a:hover { color: var(--text); }

/* ---------- Hoher Kontrast (Windows) ---------- */
@media (forced-colors: active) {
  .choice input:checked {
    forced-color-adjust: none;
    background: Highlight;
    border-color: Highlight;
    box-shadow: inset 0 0 0 3px Canvas;
  }
  .choice input:checked + label { border: 2px solid Highlight; }
  .status { border: 1px solid CanvasText; }
  .nav-list a[aria-current="page"]::after { background: Highlight; }
}

/* ---------- Weniger Bewegung ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
