/* ==========================================================================
   Piecewise — Stylesheet
   Die Farbtokens sind exakt die der Original-App (HSL-Tripel wie dort).
   ========================================================================== */

/* Inter liegt im Projekt (fonts/), wird also NICHT von Google geladen.
   Dadurch sieht die App auf macOS, Windows, Linux und Android gleich aus und
   es geht keine IP an Dritte — deshalb braucht es dafür auch kein Cookie-
   Banner. Lizenz: SIL Open Font License, siehe fonts/OFL.txt */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;          /* eine variable Datei für alle Schnitte */
  font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --background: 222 24% 7%;
  --foreground: 210 30% 96%;
  --card: 222 20% 11%;
  --primary: 174 72% 42%;
  --primary-foreground: 222 30% 8%;
  --secondary: 222 16% 17%;
  --muted-foreground: 215 18% 62%;
  --accent: 0 76% 56%;
  --destructive: 0 72% 52%;
  --border: 222 16% 20%;
  --success: 142 62% 48%;
  --muted: 222 16% 17%;

  /* Textfarben mit genug Kontrast (WCAG AA) — je Modus eigens gewählt */
  --primary-text: 174 72% 52%;
  --success-text: 142 62% 55%;
  --danger-text: 0 85% 78%;
  --warn-text: 38 92% 72%;
  --warn-bg: 38 92% 50%;
  --overlay: 0 0% 0%;
  --shadow: 0 10px 30px rgba(0,0,0,.5);
  color-scheme: dark;

  --radius: .75rem;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    ui-sans-serif, system-ui, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --shell: 1600px;
}

* { box-sizing: border-box; }

/* Das hidden-Attribut muss stärker sein als jedes display: aus einer Klasse.
   Ohne !important gewinnt z. B. .btn { display: inline-flex } und ein
   ausgeblendeter Knopf bliebe sichtbar. */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

a { color: hsl(var(--primary-text)); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font-family: inherit; font-size: inherit; }

#app { min-height: 100vh; display: flex; flex-direction: column; }

.shell { max-width: var(--shell); margin: 0 auto; padding-left: 16px; padding-right: 16px; }
@media (min-width: 640px) { .shell { padding-left: 24px; padding-right: 24px; } }

/* ---------- Bausteine ---------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 16px; height: 40px;
  border-radius: calc(var(--radius) - 2px); border: 1px solid transparent;
  font-weight: 500; font-size: 14px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: hsl(var(--primary) / .9); }

.btn-outline { background: transparent; border-color: hsl(var(--border) / .6); color: hsl(var(--foreground)); }
.btn-outline:hover:not(:disabled) { background: hsl(var(--secondary)); }

.btn-ghost { background: transparent; color: hsl(var(--muted-foreground)); }
.btn-ghost:hover:not(:disabled) { color: hsl(var(--foreground)); background: hsl(var(--secondary) / .6); }

.btn-sm { height: 36px; padding: 0 12px; }
.btn-block { width: 100%; }

.input {
  width: 100%; height: 40px; padding: 0 12px;
  background: hsl(var(--secondary) / .6); color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border) / .6); border-radius: calc(var(--radius) - 2px);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: hsl(var(--muted-foreground)); }
.input:focus { border-color: hsl(var(--primary)); box-shadow: 0 0 0 2px hsl(var(--primary) / .35); }

.input-icon { position: relative; flex: 1; }
.input-icon > .icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: hsl(var(--muted-foreground)); pointer-events: none;
}
.input-icon .input { padding-left: 36px; }

.select {
  height: 40px; padding: 0 32px 0 12px; font-size: 14px;
  background: hsl(var(--secondary) / .6); color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border) / .6); border-radius: calc(var(--radius) - 2px);
  cursor: pointer; outline: none; appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2394a3b8' stroke-width='2'><path d='M4 6l4 4 4-4'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
}
.select:focus { box-shadow: 0 0 0 2px hsl(var(--primary) / .5); }

.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border) / .6);
  border-radius: 1rem;
}

.label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.muted { color: hsl(var(--muted-foreground)); }
.mono { font-family: var(--mono); }
.nums { font-variant-numeric: tabular-nums; }

.clamp2 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.spinner {
  width: 16px; height: 16px; border: 2px solid currentColor;
  border-right-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite; display: inline-block;
}
.spinner-lg { width: 32px; height: 32px; border-width: 4px;
  border-color: hsl(var(--border)); border-top-color: hsl(var(--primary)); }
@keyframes spin { to { transform: rotate(360deg); } }

.center-screen {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 32px 20px;
}

/* ---------- Kopfzeile ---------------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: hsl(var(--background) / .8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid hsl(var(--border) / .4);
}
.topbar-row {
  display: flex; align-items: center; gap: 16px;
  padding-top: 12px; padding-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px;
  color: hsl(var(--foreground)); flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  display: grid; place-items: center;
}
.topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* Sprachumschalter */
.lang { position: relative; }
.lang > button {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px;
  border: 0; background: none; border-radius: 8px; cursor: pointer;
  color: hsl(var(--muted-foreground)); font-size: 14px;
}
.lang > button:hover { color: hsl(var(--foreground)); background: hsl(var(--secondary) / .6); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 150px;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px); overflow: hidden; z-index: 50;
  box-shadow: var(--shadow);
}
.lang-menu button {
  display: block; width: 100%; text-align: left; padding: 9px 13px; font-size: 14px;
  background: none; border: 0; color: hsl(var(--foreground)); cursor: pointer;
}
.lang-menu button:hover { background: hsl(var(--secondary)); }
.lang-menu button[aria-current="true"] { color: hsl(var(--primary-text)); font-weight: 600; }

/* ---------- Landing ------------------------------------------------------ */

.landing {
  background-image: radial-gradient(hsl(var(--primary) / .18) 1px, transparent 1px);
  background-size: 34px 34px;
}
.landing-inner { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
/* Kopfzeile der Landing-Page auf dieselbe Breite wie der Inhalt darunter */
.landing .topbar-row { max-width: 1120px; }

.hero { text-align: center; padding: 88px 0 52px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 15px; border-radius: 999px;
  background: hsl(var(--secondary) / .5); border: 1px solid hsl(var(--border));
  font-size: 13px; color: hsl(var(--muted-foreground));
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: hsl(var(--primary)); }
.hero h1 { font-size: clamp(44px, 8vw, 82px); line-height: 1.03; margin: 26px 0 20px; letter-spacing: -.03em; }
.hero-sub { max-width: 620px; margin: 0 auto; font-size: 18px; line-height: 1.6; color: hsl(var(--muted-foreground)); }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.hero-cta .btn { height: 46px; padding: 0 22px; font-size: 15px; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 52px 0 90px; }
.fact { padding: 24px 16px; text-align: center; }
.fact-n { font-size: 30px; font-weight: 700; color: hsl(var(--primary-text)); }
.fact-l { font-size: 13px; color: hsl(var(--muted-foreground)); margin-top: 5px; }

.section-title { text-align: center; font-size: 34px; margin: 0 0 40px; letter-spacing: -.02em; }

.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; padding-bottom: 90px; }
.feature { padding: 28px; }
.feature-icon {
  width: 42px; height: 42px; border-radius: 11px;
  background: hsl(var(--primary) / .12); color: hsl(var(--primary-text));
  display: grid; place-items: center; margin-bottom: 18px;
}
.feature h3 { margin: 0 0 9px; font-size: 18px; }
.feature p { margin: 0; color: hsl(var(--muted-foreground)); line-height: 1.6; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; padding-bottom: 90px; text-align: center; }
.step-n {
  width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 16px;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  color: hsl(var(--primary-text)); font-weight: 700; font-size: 19px;
  display: grid; place-items: center;
}
.step h3 { margin: 0 0 8px; font-size: 17px; }
.step p { margin: 0; color: hsl(var(--muted-foreground)); line-height: 1.6; }

.cta-box { padding: 62px 24px; text-align: center; margin-bottom: 80px; }
.cta-box h2 { font-size: 34px; margin: 0 0 12px; letter-spacing: -.02em; }
.cta-box p { color: hsl(var(--muted-foreground)); margin: 0 0 28px; }

.landing-footer {
  border-top: 1px solid hsl(var(--border) / .4);
  padding: 26px 24px; text-align: center; color: hsl(var(--muted-foreground)); font-size: 13px;
}

/* ---------- Auth --------------------------------------------------------- */

.auth-wrap { width: 100%; max-width: 430px; }
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-mark {
  width: 56px; height: 56px; border-radius: 15px; margin: 0 auto 18px;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  display: grid; place-items: center;
}
.auth-head h1 { font-size: 29px; margin: 0 0 7px; letter-spacing: -.02em; }
.auth-head p { margin: 0; color: hsl(var(--muted-foreground)); }
.auth-card { padding: 26px; }
.auth-field { margin-bottom: 16px; }
.auth-field-row { display: flex; justify-content: space-between; align-items: baseline; }
.auth-foot { text-align: center; margin-top: 22px; color: hsl(var(--muted-foreground)); font-size: 14px; }
.auth-card .input-icon { flex: none; }

.divider { display: flex; align-items: center; gap: 14px; margin: 20px 0;
  color: hsl(var(--muted-foreground)); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: hsl(var(--border) / .6); }

.alert { padding: 11px 14px; border-radius: calc(var(--radius) - 2px); font-size: 14px; margin-bottom: 16px; }
.alert-error { background: hsl(var(--destructive) / .12); color: hsl(var(--danger-text)); border: 1px solid hsl(var(--destructive) / .3); }
.alert-ok { background: hsl(var(--primary) / .12); color: hsl(var(--primary-text)); border: 1px solid hsl(var(--primary) / .3); }

/* ---------- Home --------------------------------------------------------- */

.page { flex: 1; width: 100%; padding-top: 24px; padding-bottom: 64px; }

.add-box { padding: 20px; margin-bottom: 24px; }
.add-box h2 { margin: 0 0 14px; font-size: 16px; font-weight: 600; }
.add-form { display: flex; gap: 12px; }
.add-form .input { flex: 1; }

.tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 20px;
  background: hsl(var(--secondary) / .5); border-radius: calc(var(--radius) - 2px); }
.tab { padding: 7px 15px; border: 0; background: none; border-radius: 8px; cursor: pointer;
  color: hsl(var(--muted-foreground)); font-weight: 500; font-size: 14px; }
.tab[aria-selected="true"] { background: hsl(var(--card)); color: hsl(var(--foreground)); font-weight: 600; }

/* Set-Kacheln — Aufbau wie im Original: quadratisches Bild, dann Textblock */
.set-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

.set-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 1rem; border: 1px solid hsl(var(--border) / .6); background: hsl(var(--card));
  cursor: pointer; transition: border-color .2s, transform .2s, box-shadow .2s;
}
.set-card:hover {
  border-color: hsl(var(--primary) / .6); transform: translateY(-2px);
  box-shadow: 0 18px 40px hsl(var(--primary) / .06);
}
.set-thumb {
  aspect-ratio: 1 / 1; background: hsl(var(--secondary) / .4);
  display: grid; place-items: center; overflow: hidden;
}
.set-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 16px;
  transition: transform .3s; }
.set-card:hover .set-thumb img { transform: scale(1.03); }
.set-thumb .icon { color: hsl(var(--muted-foreground) / .4); }

.set-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.set-name { font-weight: 600; font-size: 15px; line-height: 1.35; }
.set-num { font-family: var(--mono); font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 2px; }
.set-meter { display: flex; align-items: center; gap: 12px; }
.set-pct { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; color: hsl(var(--primary-text)); }
.set-pct.done { color: hsl(var(--success-text)); }
.set-progress-text { font-size: 12px; color: hsl(var(--muted-foreground)); }

.progress-track { flex: 1; height: 8px; border-radius: 999px;
  background: hsl(var(--secondary)); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: hsl(var(--primary));
  transition: width .5s; }
.progress-fill.done { background: hsl(var(--success)); }

.set-delete {
  position: absolute; top: 8px; right: 8px; z-index: 10;
  width: 32px; height: 32px; border-radius: 8px; border: 0;
  background: hsl(var(--background) / .7); backdrop-filter: blur(6px);
  color: hsl(var(--muted-foreground));
  display: grid; place-items: center; cursor: pointer;
  opacity: 0; transition: opacity .2s, color .2s, background .2s;
}
.set-card:hover .set-delete { opacity: 1; }
.set-delete:hover { color: hsl(var(--accent)); background: hsl(var(--background) / .9); }

.empty { display: grid; place-items: center; padding: 64px 20px; text-align: center;
  color: hsl(var(--muted-foreground)); }
.empty h3 { margin: 0 0 8px; font-size: 18px; color: hsl(var(--foreground)); }
.empty p { margin: 0; }

/* ---------- Set-Detail --------------------------------------------------- */

.detail-title { min-width: 0; flex: 1; }
.detail-title h1 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.2; }
.detail-title p { margin: 2px 0 0; font-size: 12px; font-family: var(--mono);
  color: hsl(var(--muted-foreground)); }

.detail-meter { padding-bottom: 16px; }
.detail-meter-row { display: flex; align-items: center; gap: 12px; }
.detail-meter-row .progress-track { height: 10px; }
.detail-count { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: hsl(var(--primary-text)); flex-shrink: 0; }
.detail-progress-text { font-size: 12px; color: hsl(var(--muted-foreground)); margin: 6px 0 0; }

.detail-toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
@media (min-width: 640px) { .detail-toolbar { flex-direction: row; } }

/* Teile-Raster — wie im Original: Karten mit quadratischem Bild oben */
.parts-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

.part-card {
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 1rem; border: 1px solid hsl(var(--border) / .6);
  background: hsl(var(--card)); transition: border-color .15s, background .15s;
}
.part-card.complete {
  border-color: hsl(var(--success) / .6);
  background: hsl(var(--success) / .1);
}

.part-img {
  aspect-ratio: 1 / 1; background: hsl(var(--secondary) / .4);
  display: grid; place-items: center; overflow: hidden; padding: 12px;
  border: 0; cursor: zoom-in; transition: background .15s;
}
.part-img:hover:not(:disabled) { background: hsl(var(--secondary) / .6); }
.part-img:disabled { cursor: default; }
.part-img img { width: 100%; height: 100%; object-fit: contain; }
.part-img .icon { color: hsl(var(--muted-foreground) / .4); }

.part-body { padding: 12px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.part-num { font-size: 12px; font-family: var(--mono); color: hsl(var(--muted-foreground)); margin: 0; }
.part-name { font-size: 14px; font-weight: 500; line-height: 1.35; margin: 2px 0 0; }
.part-color {
  display: flex; align-items: center; gap: 6px; margin: 5px 0 0;
  font-size: 11px; color: hsl(var(--muted-foreground));
}
.color-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, .25);
}

/* Karte, die wegen des Filters gleich verschwindet: kurz ausblenden */
.part-card.leaving {
  opacity: 0; transform: scale(.96);
  transition: opacity .2s ease, transform .2s ease;
}

.part-qty { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qty-btn {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  border: 1px solid hsl(var(--border) / .6); background: hsl(var(--background));
  color: hsl(var(--foreground)); display: grid; place-items: center; cursor: pointer;
  transition: background .15s, opacity .15s;
}
.qty-btn:hover:not(:disabled) { background: hsl(var(--secondary)); }
.qty-btn:disabled { opacity: .3; cursor: not-allowed; }
.qty-val { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.qty-val.done { color: hsl(var(--success-text)); }
.qty-val span { color: hsl(var(--muted-foreground)); font-weight: 400; }

/* ---------- Modal / Lightbox / Toast ------------------------------------- */

.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, .9); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 16px;
  animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } }

.modal { width: 100%; max-width: 480px; padding: 24px; max-height: 84vh; overflow-y: auto; }
.modal h2 { margin: 0 0 6px; font-size: 19px; }
.modal > p { margin: 0 0 20px; color: hsl(var(--muted-foreground)); font-size: 14px; }

.choice {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px; margin-bottom: 8px;
  background: hsl(var(--secondary) / .5); border: 1px solid hsl(var(--border) / .6);
  border-radius: calc(var(--radius) - 2px); color: hsl(var(--foreground)); cursor: pointer;
}
.choice:hover { border-color: hsl(var(--primary)); background: hsl(var(--secondary)); }
.choice-thumb { width: 52px; height: 52px; border-radius: 8px; flex-shrink: 0;
  background: hsl(var(--secondary) / .6); overflow: hidden; display: grid; place-items: center; }
.choice-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.choice-title { font-weight: 600; font-size: 14px; line-height: 1.3; display: block; }
.choice-sub { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 3px; display: block; }

/* Lightbox — Vollbild wie im Original */
.lightbox-close {
  position: absolute; top: 16px; right: 16px;
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: hsl(var(--background) / .2); color: #fff;
  display: grid; place-items: center; cursor: pointer; transition: background .15s;
}
.lightbox-close:hover { background: hsl(var(--background) / .45); }
.lightbox-body { max-width: 42rem; width: 100%; display: flex; flex-direction: column;
  align-items: center; gap: 20px; }
.lightbox-body img { max-height: 70vh; max-width: 100%; object-fit: contain; border-radius: 12px; }
.lightbox-cap { text-align: center; color: #fff; }
.lightbox-cap .n { font-family: var(--mono); font-size: 14px; color: rgba(255,255,255,.7); margin: 0; }
.lightbox-cap .t { font-size: 18px; font-weight: 500; margin: 4px 0 0; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 270px; max-width: 380px; padding: 13px 16px;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px); box-shadow: var(--shadow);
  animation: slide .22s ease-out;
}
@keyframes slide { from { opacity: 0; transform: translateX(24px); } }
.toast-title { font-weight: 600; font-size: 14px; }
.toast-desc { font-size: 13px; color: hsl(var(--muted-foreground)); margin-top: 3px; }
.toast.ok { border-left: 3px solid hsl(var(--primary)); }
.toast.err { border-left: 3px solid hsl(var(--destructive)); }

#confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 300; }

/* ---------- Responsiv ---------------------------------------------------- */

@media (max-width: 860px) {
  .facts { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 34px; }
  .hero { padding: 56px 0 40px; }
}
@media (max-width: 560px) {
  .landing-inner { padding-left: 16px; padding-right: 16px; }
  .add-form { flex-direction: column; }
  .parts-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .set-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .hide-sm { display: none; }
  .toasts { left: 16px; right: 16px; }
  .toast { min-width: 0; max-width: none; }
}

/* ---------- Rechtsseiten -------------------------------------------------- */

.legal-page {
  max-width: 780px; margin: 0 auto;
  padding-left: 20px; padding-right: 20px;
  line-height: 1.65;
}
.legal-page h1 { font-size: 30px; margin: 8px 0 20px; letter-spacing: -.02em; }
.legal-page h2 {
  font-size: 19px; margin: 36px 0 10px;
  padding-top: 20px; border-top: 1px solid hsl(var(--border) / .5);
}
.legal-page h3 { font-size: 16px; margin: 22px 0 8px; color: hsl(var(--foreground)); }
.legal-page p, .legal-page li { color: hsl(var(--muted-foreground)); }
.legal-page strong { color: hsl(var(--foreground)); }
.legal-page ul { padding-left: 20px; }
.legal-page li { margin-bottom: 5px; }
.legal-page code {
  font-family: var(--mono); font-size: .9em;
  background: hsl(var(--secondary) / .6); padding: 1px 5px; border-radius: 4px;
}
.legal-lead { font-size: 16px; }
.legal-stand { margin-top: 44px; font-size: 13px; }

.legal-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; }
.legal-table th, .legal-table td {
  text-align: left; vertical-align: top; padding: 9px 10px;
  border-bottom: 1px solid hsl(var(--border) / .5);
}
.legal-table th { color: hsl(var(--foreground)); font-weight: 600; }
.legal-table td { color: hsl(var(--muted-foreground)); }

.landing-footer p { margin: 4px 0; }
.legal-links { margin-top: 10px !important; }
.legal-links a { color: hsl(var(--muted-foreground)); text-decoration: underline; }
.legal-links a:hover { color: hsl(var(--primary-text)); }

/* Fußzeile innerhalb der App etwas dezenter */
.app-footer { border-top: 1px solid hsl(var(--border) / .4); padding: 20px 24px;
  text-align: center; color: hsl(var(--muted-foreground)); font-size: 12px; }
.app-footer p { margin: 3px 0; }

@media (max-width: 560px) {
  .legal-table, .legal-table thead, .legal-table tbody,
  .legal-table tr, .legal-table td { display: block; width: 100%; }
  .legal-table thead { display: none; }
  .legal-table tr { border-bottom: 1px solid hsl(var(--border)); padding: 8px 0; }
  .legal-table td { border: 0; padding: 3px 0; }
}

/* ---------- Preise auf der Landing-Page ---------------------------------- */

/* Der Verweis in der Kopfzeile soll da sein, aber nicht drängen. */
.landing-nav { display: flex; gap: 4px; margin-left: 22px; }
.landing-nav button {
  border: 0; background: none; cursor: pointer; padding: 6px 10px;
  border-radius: 8px; font-size: 14px; color: hsl(var(--muted-foreground));
}
.landing-nav button:hover { color: hsl(var(--foreground)); background: hsl(var(--secondary) / .6); }

.pricing { padding-bottom: 90px; scroll-margin-top: 80px; }
.pricing-sub {
  text-align: center; color: hsl(var(--muted-foreground));
  margin: -26px auto 36px; max-width: 520px;
}
.pricing-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px; max-width: 780px; margin: 0 auto;
}
.pricing-foot {
  text-align: center; font-size: 12px; color: hsl(var(--muted-foreground));
  max-width: 520px; margin: 26px auto 0;
}

.plan { position: relative; padding: 30px 26px; display: flex; flex-direction: column; }
.plan h3 { margin: 0 0 12px; font-size: 16px; font-weight: 600; color: hsl(var(--muted-foreground)); }
.plan-price { font-size: 40px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.plan-note { margin: 8px 0 0; font-size: 13px; color: hsl(var(--muted-foreground)); }

.plan-hero { border-color: hsl(var(--primary) / .55); }
.plan-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  padding: 4px 12px; border-radius: 999px; white-space: nowrap;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
}

.plan-list { list-style: none; margin: 22px 0; padding: 0; flex: 1; }
.plan-list li {
  display: flex; align-items: flex-start; gap: 10px; padding: 6px 0;
  font-size: 14px; line-height: 1.4;
}
.plan-list .icon { color: hsl(var(--success-text)); flex-shrink: 0; margin-top: 1px; }
.plan-list li.off { color: hsl(var(--muted-foreground)); }
.plan-list li.off .icon { color: hsl(var(--muted-foreground) / .7); }

@media (max-width: 700px) {
  .pricing-grid { grid-template-columns: 1fr; gap: 26px; }
  .landing-nav { margin-left: 8px; }
}

/* ---------- Bestätigungsdialog ------------------------------------------- */

.confirm-box { max-width: 400px; text-align: center; }
.confirm-mark {
  width: 48px; height: 48px; border-radius: 14px; margin: 0 auto 16px;
  display: grid; place-items: center;
  background: hsl(var(--primary) / .14); color: hsl(var(--primary-text));
}
.confirm-mark.danger { background: hsl(var(--destructive) / .14); color: hsl(var(--destructive)); }
.confirm-box h2 { margin: 0 0 8px; font-size: 19px; }
.confirm-box p { margin: 0 0 24px; color: hsl(var(--muted-foreground)); font-size: 14px; line-height: 1.5; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn { flex: 1; }

.btn-danger { background: hsl(var(--destructive)); color: #fff; font-weight: 600; }
.btn-danger:hover:not(:disabled) { background: hsl(var(--destructive) / .88); }

@media (max-width: 420px) {
  .confirm-actions { flex-direction: column-reverse; }
}

/* ---------- Lizenz und Paywall ------------------------------------------- */

.license-badge {
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  padding: 4px 9px; border-radius: 999px;
  background: hsl(var(--secondary)); color: hsl(var(--muted-foreground));
  white-space: nowrap;
}
.license-badge.on { background: hsl(var(--success) / .15); color: hsl(var(--success-text)); }

.paywall { text-align: center; max-width: 420px; }
.paywall-mark {
  width: 56px; height: 56px; border-radius: 15px; margin: 0 auto 16px;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  display: grid; place-items: center;
}
.paywall h2 { margin: 0 0 6px; font-size: 21px; }
.paywall > p { margin: 0 0 20px; }

.paywall-note {
  display: flex; flex-direction: column; gap: 3px; text-align: left;
  padding: 12px 14px; margin-bottom: 20px;
  background: hsl(var(--destructive) / .1);
  border: 1px solid hsl(var(--destructive) / .3);
  border-radius: calc(var(--radius) - 2px);
  font-size: 13px;
}
.paywall-note strong { color: hsl(var(--danger-text)); }
.paywall-note span { color: hsl(var(--muted-foreground)); }

.paywall-price { margin-bottom: 20px; }
.paywall-amount { display: block; font-size: 40px; font-weight: 700; letter-spacing: -.02em; }
.paywall-note-small { display: block; font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 4px; }

.paywall-list { list-style: none; margin: 0 0 22px; padding: 0; text-align: left; }
.paywall-list li {
  display: flex; align-items: center; gap: 10px; padding: 7px 0;
  font-size: 14px; color: hsl(var(--foreground));
}
.paywall-list .icon { color: hsl(var(--success-text)); flex-shrink: 0; }

.paywall-terms {
  font-size: 11px; line-height: 1.5; color: hsl(var(--muted-foreground));
  margin: 12px 0 8px;
}

.legal-note {
  font-size: 13px; padding: 10px 14px; margin-bottom: 18px;
  background: hsl(var(--secondary) / .5);
  border-left: 3px solid hsl(var(--primary));
  border-radius: 6px;
}

/* ---------- Lizenzsperre am PDF-Knopf ------------------------------------- */

.btn-locked {
  opacity: .72;
}
.btn-locked:hover {
  opacity: 1;
}
.lock-mark {
  display: inline-flex;
  align-items: center;
  margin-left: .15rem;
  color: hsl(var(--muted-foreground));
}
.btn-locked:hover .lock-mark {
  color: hsl(var(--primary-text));
}

/* ---------- Konto löschen ------------------------------------------------- */

.link-danger {
  color: hsl(var(--destructive, 0 72% 55%));
}

.danger-box {
  text-align: left;
  max-width: 25rem;
}
.danger-box h2,
.danger-box > p {
  text-align: center;
}
.account-list {
  list-style: none;
  margin: .9rem 0;
  padding: .8rem .9rem;
  border-radius: var(--radius);
  background: hsl(var(--muted) / .45);
  display: grid;
  gap: .45rem;
}
.account-list li {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .86rem;
  line-height: 1.35;
}
.account-list svg {
  flex: none;
  margin-top: .1rem;
  color: hsl(var(--destructive, 0 72% 55%));
}
.account-warn {
  font-size: .82rem;
  line-height: 1.4;
  color: hsl(var(--muted-foreground));
  margin: 0 0 .9rem;
}
.account-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: .35rem;
}
.danger-box .input {
  width: 100%;
  margin-bottom: 1rem;
  letter-spacing: .06em;
}

/* ---------- Hinweis im Testbetrieb ---------------------------------------- */

.paywall-test,
.pricing-test {
  border-radius: var(--radius);
  padding: .6rem .75rem;
  margin-bottom: .9rem;
  font-size: .82rem;
  line-height: 1.4;
  text-align: left;
  background: hsl(var(--warn-bg) / .12);
  color: hsl(var(--warn-text));
  border: 1px solid hsl(var(--warn-bg) / .35);
}
.pricing-test {
  margin: 1rem auto 0;
  max-width: 34rem;
  text-align: center;
}

/* ---------- SumUp-Bezahlformular in der Paywall --------------------------- */
/* Das Formular bringt sein eigenes helles Design mit — deshalb ein heller
   Untergrund, damit es im dunklen Dialog nicht wie ein Fremdkörper wirkt. */
.paywall-sumup {
  text-align: left;
  margin-top: .25rem;
}
.paywall-sumup #sumup-card {
  background: #fff;
  color: #111;
  border-radius: var(--radius);
  padding: .5rem;
}
.paywall-sumup-status {
  min-height: 1.2em;
  margin: .6rem 0 0;
  font-size: .85rem;
  text-align: center;
  color: hsl(var(--muted-foreground));
}
.paywall-sumup-status.is-error { color: hsl(var(--danger-text)); }

/* ---------- Länderauswahl in der Paywall ---------------------------------- */
.paywall-country {
  display: block;
  text-align: left;
  margin: 0 0 .8rem;
  font-size: .85rem;
}
.paywall-country > span {
  display: block;
  margin-bottom: .35rem;
  color: hsl(var(--muted-foreground));
}
.paywall-country select {
  width: 100%;
  padding: .6rem .7rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border, 0 0% 30%));
  background: hsl(var(--background, 0 0% 8%));
  color: inherit;
  font: inherit;
}
.paywall-country-note {
  margin: -.3rem 0 .8rem;
  font-size: .82rem;
  text-align: left;
  color: hsl(var(--warn-text));
}
.paywall-country[hidden] { display: none; }

/* ---------- Zustimmungs-Häkchen in der Paywall ---------------------------- */
.paywall-consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .6rem;
  align-items: start;
  text-align: left;
  margin: 0 0 .9rem;
  font-size: .82rem;
  line-height: 1.45;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
}
.paywall-consent[hidden] { display: none; }
.paywall-consent input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: hsl(var(--primary)); cursor: pointer; }
.paywall-consent a { color: hsl(var(--primary-text)); text-decoration: underline; }

/* ==========================================================================
   Umbau Oktober 2026
   ========================================================================== */

/* ---------- Heller Modus -------------------------------------------------- */
/* Automatisch nach Systemeinstellung, oder fest über die Fußzeile
   (data-theme="light" / "dark" am <html>). */
:root[data-theme="light"] {
  --background: 210 24% 97%;
  --foreground: 222 32% 12%;
  --card: 0 0% 100%;
  --primary: 174 72% 40%;
  --primary-foreground: 180 60% 8%;
  --secondary: 214 20% 92%;
  --muted: 214 20% 92%;
  --muted-foreground: 215 16% 34%;
  --accent: 0 72% 46%;
  --destructive: 0 72% 44%;
  --border: 214 18% 80%;
  --success: 142 60% 38%;
  --primary-text: 174 90% 23%;
  --success-text: 142 72% 25%;
  --danger-text: 0 72% 38%;
  --warn-text: 32 95% 28%;
  --warn-bg: 38 92% 50%;
  --shadow: 0 10px 30px rgba(20, 30, 50, .16);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --background: 210 24% 97%;
    --foreground: 222 32% 12%;
    --card: 0 0% 100%;
    --primary: 174 72% 40%;
    --primary-foreground: 180 60% 8%;
    --secondary: 214 20% 92%;
    --muted: 214 20% 92%;
    --muted-foreground: 215 16% 34%;
    --accent: 0 72% 46%;
    --destructive: 0 72% 44%;
    --border: 214 18% 80%;
    --success: 142 60% 38%;
    --primary-text: 174 90% 23%;
    --success-text: 142 72% 25%;
    --danger-text: 0 72% 38%;
    --warn-text: 32 95% 28%;
    --warn-bg: 38 92% 50%;
    --shadow: 0 10px 30px rgba(20, 30, 50, .16);
    color-scheme: light;
  }
}

/* ---------- Grundlegendes ------------------------------------------------- */

html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
img { max-width: 100%; }

/* Sichtbarer Tastatur-Fokus überall */
:focus-visible {
  outline: 2px solid hsl(var(--primary-text));
  outline-offset: 2px;
  border-radius: 6px;
}
.input:focus-visible, .select:focus-visible { outline-offset: 0; }

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

/* Knöpfe dürfen auf schmalen Bildschirmen umbrechen statt herauszuragen */
.btn { max-width: 100%; }
.btn > span { overflow: hidden; text-overflow: ellipsis; }

.overlay { background: hsl(var(--overlay) / .72); }
:root[data-theme="dark"] .overlay { background: hsl(var(--overlay) / .85); }

.topbar-row { min-width: 0; }
.topbar-actions { min-width: 0; flex-wrap: nowrap; }
.topbar-mail { font-size: 13px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand { min-width: 0; }
.lang-short { display: none; }

/* Sprachumschalter: ab schmal nur das Kürzel */
@media (max-width: 520px) {
  .lang-long { display: none; }
  .lang-short { display: inline; }
  .lang > button { padding: 0 8px; }
}
@media (max-width: 900px) { .hide-md { display: none; } }
@media (max-width: 400px) {
  .hide-xs { display: none; }
  .brand-name { display: none; }
  .topbar-row { gap: 8px; }
  .shell { padding-left: 12px; padding-right: 12px; }
  .btn-sm { padding: 0 10px; }
}

/* ---------- Gast-Hinweis -------------------------------------------------- */

.guest-banner {
  display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 14px 18px; margin-bottom: 18px; border-radius: 1rem;
  background: hsl(var(--primary) / .1); border: 1px solid hsl(var(--primary) / .35);
}
.guest-banner strong { display: block; margin-bottom: 2px; }
.guest-banner p { margin: 0; font-size: 14px; color: hsl(var(--muted-foreground)); max-width: 640px; line-height: 1.45; }
.guest-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Startseite ---------------------------------------------------- */

.add-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.add-head h2 { margin: 0; }
.slot-meter {
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: hsl(var(--secondary)); color: hsl(var(--muted-foreground));
}
.slot-meter.full { background: hsl(var(--warn-bg) / .15); color: hsl(var(--warn-text)); }

.home-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.home-bar .tabs { margin-bottom: 0; }

.set-link { display: flex; flex-direction: column; color: inherit; flex: 1; }
.set-link:hover { text-decoration: none; }
.set-name, .set-num, .set-progress-text { margin: 0; }
.set-delete:focus-visible { opacity: 1; }
/* Auf Touch-Geräten gibt es kein Hover — der Löschknopf muss sichtbar sein */
@media (hover: none) { .set-delete { opacity: 1; } }

/* ---------- Detailseite --------------------------------------------------- */

.readonly-note {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 16px; border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--warn-bg) / .12); border: 1px solid hsl(var(--warn-bg) / .35);
  color: hsl(var(--warn-text)); font-size: 14px; line-height: 1.4;
}
.readonly-note span { flex: 1; min-width: 200px; }

.view-switch { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 18px; flex-wrap: wrap;
  background: hsl(var(--secondary) / .5); border-radius: calc(var(--radius) - 2px); }
.view-switch .tab { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.tab-count { font-variant-numeric: tabular-nums; font-size: 12px; padding: 1px 7px; border-radius: 999px;
  background: hsl(var(--secondary)); color: hsl(var(--muted-foreground)); }

.detail-toolbar { flex-wrap: wrap; align-items: stretch; margin-bottom: 10px; }
.detail-toolbar .tb-search { flex: 2 1 220px; }
.detail-toolbar .tb-field { flex: 1 1 150px; min-width: 0; }
.detail-toolbar .select { width: 100%; height: 44px; }
.detail-toolbar .input { height: 44px; }
@media (max-width: 639px) {
  .detail-toolbar { flex-direction: row; }
  .detail-toolbar .tb-search { flex-basis: 100%; }
}
.detail-hint { font-size: 12px; margin: 0 0 18px; }

/* Schalter „Gefundene ausblenden" */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px;
  min-height: 44px; flex: 1 1 200px; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 42px; height: 24px; border-radius: 999px; background: hsl(var(--secondary));
  border: 1px solid hsl(var(--border)); position: relative; flex-shrink: 0; transition: background .15s; }
.switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: hsl(var(--foreground)); transition: transform .15s; }
.switch input:checked + .switch-ui { background: hsl(var(--primary)); border-color: hsl(var(--primary)); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); background: hsl(var(--primary-foreground)); }
.switch input:focus-visible + .switch-ui { outline: 2px solid hsl(var(--primary-text)); outline-offset: 2px; }

.part-section { margin-bottom: 30px; }
.section-head { font-size: 16px; margin: 0 0 12px; display: flex; gap: 8px; align-items: baseline; }
.section-head .muted { font-size: 13px; font-weight: 500; }
.section-note { font-size: 13px; margin: -6px 0 12px; }

/* Große Listen flüssig halten: nicht sichtbare Karten werden nicht gezeichnet */
.part-card { content-visibility: auto; contain-intrinsic-size: auto 330px; }

.part-media { position: relative; }
.part-img { width: 100%; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; color: inherit; }
.part-img img { pointer-events: none; -webkit-user-drag: none; }
.part-zoom {
  position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; border-radius: 9px;
  display: grid; place-items: center; cursor: zoom-in; border: 1px solid hsl(var(--border) / .6);
  background: hsl(var(--card) / .85); color: hsl(var(--muted-foreground));
}
.part-zoom:hover { color: hsl(var(--foreground)); }
.part-card.pressed { transform: scale(.97); transition: transform .12s; }
.part-card.is-fig .part-img { background: hsl(var(--primary) / .06); }
.part-num, .part-name, .part-color { overflow-wrap: anywhere; }

/* Große Tippflächen (mindestens 44 px) */
.qty-btn { width: 44px; height: 44px; border-radius: 10px; }

/* Fehlteile-Ansicht */
.missing-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.missing-head p { margin: 0; font-weight: 600; }
.missing-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.missing-actions .btn { min-height: 44px; }
.missing-list { list-style: none; margin: 0; padding: 0; border: 1px solid hsl(var(--border) / .6);
  border-radius: 1rem; overflow: hidden; background: hsl(var(--card)); }
.missing-list li { display: flex; align-items: center; gap: 12px; padding: 8px 12px;
  border-bottom: 1px solid hsl(var(--border) / .4); content-visibility: auto; contain-intrinsic-size: auto 60px; }
.missing-list li:last-child { border-bottom: 0; }
.ml-img { width: 44px; height: 44px; flex-shrink: 0; background: hsl(var(--secondary) / .4); border-radius: 8px;
  display: grid; place-items: center; overflow: hidden; }
.ml-img img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.ml-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ml-name { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.ml-sub { font-size: 12px; color: hsl(var(--muted-foreground)); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ml-qty { font-weight: 700; font-size: 16px; flex-shrink: 0; }

/* ---------- Export ------------------------------------------------------- */

.export-box { max-width: 520px; }
.export-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.export-actions .btn { flex: 1 1 180px; min-height: 44px; }
.export-steps { margin: 0 0 16px; padding-left: 20px; font-size: 14px; line-height: 1.5; color: hsl(var(--muted-foreground)); }
.export-steps li { margin-bottom: 6px; }
.export-warn { padding: 12px 14px; margin-bottom: 16px; border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--warn-bg) / .1); border: 1px solid hsl(var(--warn-bg) / .35); font-size: 13px; }
.export-warn strong { display: flex; align-items: center; gap: 6px; color: hsl(var(--warn-text)); }
.export-warn p { margin: 6px 0; color: hsl(var(--muted-foreground)); }
.export-unmapped { list-style: none; margin: 0; padding: 0; max-height: 180px; overflow-y: auto; }
.export-unmapped li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; padding: 3px 0;
  border-top: 1px solid hsl(var(--border) / .3); }

.toast { display: flex; align-items: center; gap: 12px; }
.toast-text { flex: 1; min-width: 0; }
.toast-action { flex-shrink: 0; }

/* ---------- Haufen-Modus -------------------------------------------------- */

.pile-sub { font-family: var(--font) !important; }
.pile-locked, .pile-pick { padding: 28px; max-width: 640px; margin: 0 auto; text-align: center; }
.pile-locked h2, .pile-pick h2 { margin: 0 0 8px; }
.pile-locked p { color: hsl(var(--muted-foreground)); line-height: 1.55; }
.pile-how { text-align: left; margin: 18px auto 22px; max-width: 460px; line-height: 1.55; }
.pile-how li { margin-bottom: 6px; }
.pile-pick { text-align: left; }
.pile-pick > .btn { margin-top: 16px; width: 100%; min-height: 46px; }
.pile-choices { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.pile-choice { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer;
  border: 1px solid hsl(var(--border) / .6); border-radius: calc(var(--radius) - 2px); background: hsl(var(--secondary) / .4); }
.pile-choice input { width: 20px; height: 20px; accent-color: hsl(var(--primary)); flex-shrink: 0; }
.pile-choice:has(input:checked) { border-color: hsl(var(--primary)); }
.pile-choice-text { min-width: 0; }

.pile-sets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pile-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 12px;
  border-radius: 999px; background: hsl(var(--card)); border: 1px solid hsl(var(--border) / .7);
  color: hsl(var(--foreground)); font-size: 13px; min-height: 36px; }
.pile-chip:hover { text-decoration: none; border-color: hsl(var(--primary)); }
.pile-chip-name { max-width: 220px; }
.pile-chip-pct { font-weight: 700; color: hsl(var(--primary-text)); }

.pile-search { padding: 18px; margin-bottom: 18px; }
.pile-search h2 { margin: 0 0 12px; font-size: 17px; }
.pile-search-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pile-search-row .input-icon { flex: 2 1 240px; }
.pile-search-row label { flex: 1 1 160px; }
.pile-search-row .input, .pile-search-row .select { height: 46px; width: 100%; }
.pile-tip { font-size: 12px; margin: 10px 0 0; }

.pile-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-bottom: 18px; }
.pile-card { display: grid; grid-template-columns: 110px 1fr; gap: 0; overflow: hidden;
  border-radius: 1rem; border: 1px solid hsl(var(--border) / .6); background: hsl(var(--card)); }
.pile-card.complete { opacity: .6; }
.pile-card .part-img { height: 100%; min-height: 110px; aspect-ratio: auto; }
.pile-card-body { padding: 10px 12px; min-width: 0; }
.pile-targets { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.pile-targets li { display: flex; gap: 6px; align-items: center; }
.pile-target-pick { flex: 1; min-width: 0; display: flex; justify-content: space-between; gap: 6px; align-items: center;
  min-height: 44px; padding: 0 10px; border-radius: 9px; cursor: pointer; font-size: 13px; text-align: left;
  background: hsl(var(--secondary) / .5); border: 1px solid hsl(var(--border) / .5); color: hsl(var(--foreground)); }
.pile-targets li.is-target .pile-target-pick { border-color: hsl(var(--primary)); background: hsl(var(--primary) / .12); }
.pile-targets li.is-done .pile-target-pick { color: hsl(var(--success-text)); }
.pile-more { text-align: center; }
.pile-end { padding: 20px; margin-top: 8px; }
.pile-end h2 { margin: 0 0 6px; font-size: 17px; }
.pile-end .missing-actions { margin: 12px 0; }

/* ---------- Vorstellungsseite ------------------------------------------- */

.hero h1 { overflow-wrap: anywhere; }
.hero-note { margin-top: 18px; font-size: 13px; }
.features { margin-top: 30px; }
.feature h2 { margin: 0 0 9px; font-size: 18px; }

.cmp-wrap { max-width: 820px; margin: 0 auto; padding: 8px 0 20px; overflow: hidden; }
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp th, .cmp td { padding: 11px 14px; border-bottom: 1px solid hsl(var(--border) / .45); text-align: center; vertical-align: middle; }
.cmp tbody th { text-align: left; font-weight: 500; }
.cmp thead th { padding-top: 26px; vertical-align: bottom; border-bottom-color: hsl(var(--border)); }
.cmp-plan { position: relative; min-width: 96px; }
.cmp-name { display: block; font-size: 14px; color: hsl(var(--muted-foreground)); font-weight: 600; }
.cmp-price { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.cmp-note { display: block; font-size: 11px; font-weight: 500; color: hsl(var(--muted-foreground)); margin-top: 3px; }
.cmp .plan-badge { top: 2px; }
td.cmp-pro, th.cmp-pro { background: hsl(var(--primary) / .07); }
.cmp-yes { color: hsl(var(--success-text)); display: inline-flex; }
.cmp-no { color: hsl(var(--muted-foreground)); display: inline-flex; opacity: .8; }
.cmp-text { font-weight: 600; font-size: 13px; }
.cmp-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; padding: 20px 16px 0; }
.cmp-actions .btn { flex: 1 1 200px; max-width: 320px; min-height: 46px; }
@media (max-width: 560px) {
  .cmp { font-size: 13px; }
  .cmp th, .cmp td { padding: 9px 6px; }
  .cmp tbody th { padding-left: 12px; }
  .cmp-price { font-size: 19px; }
  .cmp-plan { min-width: 70px; }
  .cmp-note { display: none; }
}

/* ---------- Fußzeile: Darstellung --------------------------------------- */

.theme-switch { display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 10px !important; }
.theme-switch button { border: 1px solid hsl(var(--border) / .7); background: none; color: hsl(var(--muted-foreground));
  border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; min-height: 30px; }
.theme-switch button[aria-pressed="true"] { color: hsl(var(--foreground)); border-color: hsl(var(--primary)); }

/* Paywall: Gäste */
.paywall-guest { display: grid; gap: 8px; margin-bottom: 8px; }
.paywall-guest p { font-size: 14px; color: hsl(var(--muted-foreground)); margin: 0 0 6px; line-height: 1.5; }

/* Sehr schmal (320 px): nichts darf herausragen */
@media (max-width: 360px) {
  .hero h1 { font-size: 40px; }
  .hero-cta .btn { width: 100%; white-space: normal; height: auto; min-height: 46px; padding: 10px 16px; }
  .modal { padding: 18px; }
  .paywall-amount { font-size: 32px; }
  .parts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .part-body { padding: 10px; }
  .qty-btn { width: 40px; height: 44px; }
  .pile-card { grid-template-columns: 84px 1fr; }
  .set-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Links im Fließtext unterstreichen — nicht nur über die Farbe erkennbar (WCAG 1.4.1) */
.legal-page p a, .legal-page li a, .auth-foot a, .auth-field-row a, .export-steps a,
.guest-banner p a, .paywall-consent a { text-decoration: underline; text-underline-offset: 2px; }
/* Lange Wörter (z. B. „Geschäftsbedingungen") dürfen umbrechen */
h1, h2, h3 { overflow-wrap: break-word; hyphens: auto; }
@media (max-width: 400px) { .legal-page h1 { font-size: 24px; } }
/* Eingabefeld im Spalten-Layout (Handy) nicht zusammendrücken */
.add-form .input { height: 44px; }
.add-form .btn { height: 44px; }
@media (max-width: 560px) { .add-form .input { flex: none; } }

/* ==========================================================================
   Nachbesserungen 29.10.2026 (Teil 2)
   ========================================================================== */

/* ---------- Set-Karten: Löschen / Laden ------------------------------------ */
.set-card.removing { opacity: .35; pointer-events: none; transform: scale(.98); transition: opacity .2s, transform .2s; }
.set-card.is-loading { cursor: default; }
.set-card.is-loading:hover { transform: none; border-color: hsl(var(--border) / .6); box-shadow: none; }
.set-card.is-loading .set-name { color: hsl(var(--muted-foreground)); }
.progress-fill.shimmer {
  background: linear-gradient(90deg, hsl(var(--secondary)) 0%, hsl(var(--primary) / .55) 50%, hsl(var(--secondary)) 100%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Preise: zwei Karten -------------------------------------------- */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; max-width: 860px; margin: 0 auto; align-items: stretch; }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; max-width: 480px; } }
.plan-card {
  position: relative; display: flex; flex-direction: column; gap: 18px; padding: 30px 28px 26px;
  border-radius: 1.25rem; background: hsl(var(--card)); border: 1px solid hsl(var(--border) / .7);
  box-shadow: var(--shadow);
}
.plan-pro {
  border: 2px solid hsl(var(--primary));
  background:
    radial-gradient(120% 70% at 100% 0%, hsl(var(--primary) / .16), transparent 60%),
    hsl(var(--card));
}
.plan-ribbon {
  position: absolute; top: -13px; right: 22px; padding: 5px 12px; border-radius: 999px;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.plan-head { display: grid; gap: 8px; }
.plan-label { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: hsl(var(--primary-text)); }
.plan-card:not(.plan-pro) .plan-label { color: hsl(var(--muted-foreground)); }
.plan-amount { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.plan-big { font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.plan-per { font-size: 13px; color: hsl(var(--muted-foreground)); }
.plan-lead { margin: 0; color: hsl(var(--muted-foreground)); line-height: 1.5; font-size: 15px; }
.plan-feats { list-style: none; margin: 0; padding: 18px 0 0; border-top: 1px solid hsl(var(--border) / .6); display: grid; gap: 12px; flex: 1; }
.plan-feats li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.4; }
.plan-feats .icon { flex-shrink: 0; color: hsl(var(--success-text)); margin-top: 1px; }
.plan-pro .plan-feats .icon { color: hsl(var(--primary-text)); }
.plan-feats li.plan-all { font-weight: 600; }
.plan-card .btn { min-height: 48px; font-size: 15px; }

/* ---------- Kauf: Ladebildschirm ------------------------------------------ */
.paywall-unlock { min-height: 360px; display: grid; place-items: center; }
.unlock { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 18px 6px; width: 100%; }
.unlock h2 { margin: 4px 0 0; font-size: 22px; }
.unlock p { margin: 0; color: hsl(var(--muted-foreground)); line-height: 1.5; max-width: 330px; }
.unlock-spinner { width: 64px; height: 64px; border-radius: 50%; border: 6px solid hsl(var(--secondary));
  border-top-color: hsl(var(--primary)); animation: spin .8s linear infinite; }
.unlock-steps { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; text-align: left; }
.unlock-steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.unlock-steps li.done { color: hsl(var(--success-text)); }
.unlock-mark { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  background: hsl(var(--success) / .16); color: hsl(var(--success-text)); animation: pop .35s ease-out; }
.unlock-mark.err { background: hsl(var(--destructive) / .14); color: hsl(var(--danger-text)); }
.unlock .btn { margin-top: 8px; min-height: 48px; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* ---------- Sortier-Modus -------------------------------------------------- */
.sort-boxes { margin-bottom: 16px; }
.sort-intro { margin: 0 0 10px; color: hsl(var(--muted-foreground)); font-size: 14px; }
.sort-box-row { display: flex; gap: 10px; flex-wrap: wrap; }
.sort-box { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; padding: 8px 14px 8px 8px;
  border-radius: 14px; background: hsl(var(--card)); border: 1px solid hsl(var(--border) / .7); color: hsl(var(--foreground)); }
.sort-box:hover { text-decoration: none; border-color: hsl(var(--primary)); }
.sort-box-text { display: flex; flex-direction: column; min-width: 0; max-width: 200px; font-size: 13px; line-height: 1.3; }
.box-badge { display: inline-grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 9px;
  background: var(--box); color: #fff; font-weight: 800; font-size: 17px; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.box-badge.big { width: 46px; height: 46px; border-radius: 12px; font-size: 24px; }

.sort-step { padding: 18px; margin-bottom: 16px; }
.sort-step h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 17px; }
.sort-results { padding: 0; }
.sort-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); font-size: 14px; font-weight: 800; }
.sort-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; max-height: 260px; overflow-y: auto; padding: 2px; }
.swatch-btn, .form-btn { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 6px 10px; border-radius: 12px;
  border: 2px solid transparent; background: hsl(var(--secondary) / .6); color: hsl(var(--foreground));
  cursor: pointer; font-size: 13px; text-align: left; min-width: 0; }
.swatch-btn.on, .form-btn.on { border-color: hsl(var(--primary)); background: hsl(var(--primary) / .12); }
.swatch { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(127,127,127,.5); }
.swatch.rainbow { background: conic-gradient(#ef4444, #f59e0b, #eab308, #22c55e, #0ea5e9, #6366f1, #ec4899, #ef4444); }
.swatch-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatch-n { font-size: 11px; color: hsl(var(--muted-foreground)); }
.sort-forms { display: flex; flex-wrap: wrap; gap: 8px; }
.form-btn { padding: 6px 14px; }
.form-ico { width: 26px; height: 18px; flex-shrink: 0; border-radius: 3px; background: currentColor; opacity: .55; }
.form-steine { height: 18px; border-radius: 3px; }
.form-platten { height: 8px; }
.form-fliesen { height: 7px; border-radius: 1px; opacity: .35; }
.form-schraegen { clip-path: polygon(0 100%, 100% 100%, 100% 0); border-radius: 0; }
.form-technic { width: 26px; height: 10px; border-radius: 999px; background: radial-gradient(circle, transparent 3px, currentColor 3.5px); }
.form-figuren { width: 16px; height: 22px; border-radius: 6px 6px 3px 3px; }
.form-sonst { width: 18px; height: 18px; border-radius: 50%; }
.sort-search { margin-top: 14px; }
.sort-search summary { cursor: pointer; font-size: 13px; color: hsl(var(--primary-text)); min-height: 32px; display: flex; align-items: center; }
.sort-search .input-icon { margin-top: 8px; }
.sort-search .input { height: 46px; }
.sort-hint { margin: 0 0 12px; font-size: 13px; }

.sort-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 14px; }
@media (max-width: 400px) { .sort-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.sort-card { display: flex; flex-direction: column; border-radius: 1rem; overflow: hidden;
  border: 1px solid hsl(var(--border) / .6); background: hsl(var(--card)); transition: opacity .3s, transform .3s; }
.sort-card.leaving { opacity: 0; transform: scale(.9); }
.sort-pick { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 0 0 10px; border: 0; background: none;
  color: inherit; text-align: left; cursor: pointer; font: inherit; }
.sort-pick:active { transform: scale(.98); }
.sort-img { aspect-ratio: 1 / 1; display: grid; place-items: center; padding: 12px; background: hsl(var(--secondary) / .4); }
.sort-img img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.sort-target { position: absolute; top: 8px; right: 8px; }
.sort-name { padding: 6px 10px 0; font-size: 13px; font-weight: 500; line-height: 1.3; }
.sort-meta { padding: 0 10px; font-size: 11px; color: hsl(var(--muted-foreground)); }
.sort-alt { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 10px 10px; }
.box-choice { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 3px 8px 3px 3px; border-radius: 10px;
  border: 2px solid transparent; background: hsl(var(--secondary) / .6); color: hsl(var(--foreground)); cursor: pointer; font-size: 12px; }
.box-choice .box-badge { width: 28px; height: 28px; font-size: 15px; }
.box-choice.on { border-color: hsl(var(--primary)); }

.box-flash { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 210;
  display: flex; align-items: center; gap: 12px; width: min(420px, calc(100vw - 24px)); padding: 12px 12px 12px 14px;
  border-radius: 16px; background: hsl(var(--card)); border: 2px solid var(--box); box-shadow: var(--shadow);
  animation: hoch .2s ease-out; }
.box-flash-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.box-flash-text strong { font-size: 18px; }
.box-flash-text span { font-size: 13px; color: hsl(var(--muted-foreground)); }
@keyframes hoch { from { opacity: 0; transform: translate(-50%, 16px); } }
.sort-swatches { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); max-height: none; }
.swatch-btn.more { justify-content: center; color: hsl(var(--primary-text)); font-weight: 600; }
.swatch { width: 30px; height: 30px; }
@media (max-width: 760px) { .plans { grid-template-columns: minmax(0, 1fr); } }
.plan-card { min-width: 0; }
.plan-card .btn { white-space: normal; height: auto; padding-top: 10px; padding-bottom: 10px; text-align: center; }
@media (max-width: 400px) { .plan-card { padding: 24px 18px 20px; } .plan-big { font-size: 38px; } }
/* Beta-Schild */
.beta-badge { display: inline-flex; align-items: center; vertical-align: middle; margin-left: 6px; padding: 1px 7px;
  border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; line-height: 1.6;
  background: hsl(var(--warn-bg) / .18); color: hsl(var(--warn-text)); border: 1px solid hsl(var(--warn-bg) / .45);
  white-space: nowrap; flex-shrink: 0; }
.btn .beta-badge { margin-left: 0; }
h1 .beta-badge { font-size: 10px; }
