:root {
  color-scheme: dark;
  --bg: #0a0a0b;
  --bg-2: #101013;
  --flaeche: #141418;
  --flaeche-2: #1b1b20;
  --rand: #232329;
  --rand-2: #2f2f37;
  --text: #ececed;
  --text-2: #9a9aa3;
  --text-3: #6a6a73;
  --ton: #e9ede9;
  --ton-text: #0a0b0a;
  --ton-schwach: rgba(255, 255, 255, 0.09);
  --warn: #e5a44b;
  --rot: #e5544b;
  --schrift: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

/* Die eigenen Knopfregeln setzen display, das schlaegt sonst das hidden des Browsers */
[hidden] { display: none !important; }

input[type=checkbox] { accent-color: var(--ton); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ton); }

.marke-zeichen {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--ton);
  display: grid;
  place-items: center;
  flex: none;
}
.marke-zeichen svg { width: 17px; height: 17px; display: block; }
.marke-zeichen.gross { width: 56px; height: 56px; border-radius: 15px; }
.marke-zeichen.gross svg { width: 30px; height: 30px; }

/* Kopf */

.kopf {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 60px;
  border-bottom: 1px solid var(--rand);
  background: var(--bg-2);
}
.kopf .wort {
  font-weight: 650;
  font-size: 15.5px;
  letter-spacing: -0.01em;
}
.kopf .rechts {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--text-2);
}

main { max-width: 780px; margin: 0 auto; padding: 28px 24px 70px; display: grid; gap: 14px; }

.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 20px;
}
.karte h2 {
  font-size: 14px;
  font-weight: 650;
  margin: 0 0 3px;
  letter-spacing: 0.01em;
}
.karte .sub { font-size: 13px; color: var(--text-2); margin: 0 0 18px; }

/* Ablegefeld */

.ablage {
  border: 1px dashed var(--rand-2);
  border-radius: 10px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.ablage.zieht { border-color: var(--ton); background: var(--ton-schwach); }
.ablage-titel { font-size: 14.5px; font-weight: 600; margin-bottom: 5px; }
.ablage-sub { font-size: 12.5px; color: var(--text-3); font-family: var(--mono); }
.ablage input { display: none; }

.zeile-oben { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.zeile-oben label { font-size: 13px; color: var(--text-2); }

/* Clerk bringt eigene Stile mit. Die eigenen Feldregeln duerfen dort nicht
   hineinreichen, sonst sitzen Eingabefeld und Knopf im Widget schief. */
select:not([class*="cl-"]),
input[type=text]:not([class*="cl-"]),
input[type=password]:not([class*="cl-"]) {
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--rand-2);
  border-radius: 7px;
  padding: 8px 11px;
  outline: none;
}
select:not([class*="cl-"]):focus, input:not([class*="cl-"]):focus { border-color: var(--ton); }
input::placeholder { color: var(--text-3); }

/* Knöpfe: flach, eckiger, klar von Spectator getrennt */

.knopf {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--ton);
  border-radius: 7px;
  padding: 8px 16px;
  cursor: pointer;
  background: var(--ton);
  color: var(--ton-text);
  text-decoration: none;
  display: inline-block;
  line-height: 1.35;
}
.knopf.still {
  background: transparent;
  border-color: var(--rand-2);
  color: var(--text);
  font-weight: 500;
  padding: 6px 12px;
  font-size: 12.5px;
}
.knopf.gefahr { background: transparent; border-color: rgba(229, 84, 75, 0.4); color: var(--rot); }
.knopf:disabled { cursor: default; }

/* Fortschritt */

.lauf { margin-top: 16px; display: grid; gap: 12px; }
.lauf-zeile { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.lauf-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.balken { height: 3px; border-radius: 3px; background: var(--flaeche-2); overflow: hidden; margin-top: 6px; }
.balken i { display: block; height: 100%; background: var(--ton); width: 0; transition: width 0.2s; }

/* Liste */

.datei {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--rand);
}
.datei:first-of-type { border-top: 0; padding-top: 0; }
.datei-name { font-size: 13.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.datei-neben { font-size: 12px; color: var(--text-3); font-family: var(--mono); margin-top: 3px; }
.datei-mitte { flex: 1; min-width: 0; }
.datei-knoepfe { display: flex; gap: 6px; flex: none; }

.marke {
  font-size: 11px;
  font-family: var(--mono);
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--rand-2);
  color: var(--text-2);
  flex: none;
  white-space: nowrap;
}
.marke.gut { color: var(--text); border-color: var(--rand-2); background: var(--ton-schwach); }
.marke.warn { color: var(--warn); border-color: rgba(229, 164, 75, 0.35); }
.marke.schlecht { color: var(--rot); border-color: rgba(229, 84, 75, 0.4); }

.leer { font-size: 13px; color: var(--text-3); }

/* Anmeldung */

/* Die Kopfleiste steht ueber der Anmeldung, deshalb etwas weniger Hoehe */
.tor { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 30px; }
.tor-kasten { width: min(330px, 100%); }
.tor-kasten .marke-zeichen { margin: 0 auto 20px; }
.tor-kasten h1 { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 6px; text-align: center; }
.tor-kasten p { font-size: 13px; color: var(--text-2); margin: 0 0 24px; text-align: center; }
/* Nur das eigene Formular, nicht das von Clerk weiter unten im Baum */
.tor-kasten > form { display: grid; gap: 9px; }
.tor-kasten > form input { width: 100%; }
.tor-kasten > form .knopf { width: 100%; margin-top: 5px; }
.fehler { color: var(--warn); font-size: 12.5px; min-height: 18px; margin-top: 12px; text-align: center; }

/* Teilen-Seite */

.teilen { min-height: 100vh; display: grid; place-items: center; padding: 30px; }
.teilen-kasten {
  width: min(400px, 100%);
  text-align: center;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 12px;
  padding: 32px 28px;
}
.teilen-kasten .marke-zeichen { margin: 0 auto 18px; }
.teilen-name { font-size: 16px; font-weight: 600; word-break: break-all; }
.teilen-neben { font-size: 12.5px; color: var(--text-3); font-family: var(--mono); margin: 6px 0 20px; }
.teilen-hinweis { font-size: 12px; color: var(--text-3); margin-top: 16px; line-height: 1.6; }

/* Inhalt eines Pakets auf der Teilen-Seite */

.paket-liste {
  margin: 4px 0 18px;
  border: 1px solid var(--rand);
  border-radius: 8px;
  text-align: left;
  max-height: 220px;
  overflow: auto;
}
.paket-zeile {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 7px 11px;
  font-size: 12.5px;
  border-top: 1px solid var(--rand);
  color: var(--text-2);
}
.paket-zeile:first-child { border-top: 0; }
.paket-zeile span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paket-zeile span:last-child { color: var(--text-3); font-family: var(--mono); flex: none; }

/* Trennlinie zwischen Clerk und der Anmeldung mit Passwort */

.tor-kasten { width: min(420px, 100%); }
.trenner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 18px;
  color: var(--text-3);
  font-size: 12px;
}
.trenner::before, .trenner::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rand);
}
#clerkZiel { display: flex; justify-content: center; }
#clerkZiel .cl-rootBox, #clerkZiel .cl-card { width: 100%; }
