@font-face { font-family: "Inter"; src: url("fonts/inter-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-600.woff2") format("woff2"); font-weight: 600 800; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --grid: rgba(40, 90, 170, 0.085);
  --card: #ffffff;
  --card-2: #f2efe7;
  --line: #e2ddd1;
  --line-strong: #cfc8b8;
  --ink: #1a2030;
  --muted: #5c6577;
  --faint: #8a91a0;
  --red: #d0372a;
  --red-soft: rgba(208, 55, 42, 0.1);
  --red-ink: #fff;
  --blue: #2a5ba8;
  --green: #23824f;
  --shadow: 0 1px 0 rgba(26, 32, 48, 0.04), 0 8px 24px -12px rgba(26, 32, 48, 0.18);
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hand: "Segoe Print", "Bradley Hand", "Comic Neue", "Chalkboard SE", cursive;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #11141a;
    --grid: rgba(130, 170, 230, 0.06);
    --card: #191d25;
    --card-2: #20252f;
    --line: #2a303b;
    --line-strong: #3a4250;
    --ink: #e9ecf2;
    --muted: #9aa3b2;
    --faint: #6b7381;
    --red: #ff6a5a;
    --red-soft: rgba(255, 106, 90, 0.13);
    --red-ink: #1d0907;
    --blue: #7fa7e8;
    --green: #5fd18f;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 10px 28px -14px rgba(0, 0, 0, 0.7);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--paper);
}
a { color: var(--blue); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
main { flex: 1; padding-bottom: 64px; }
.muted { color: var(--muted); }
.fine { font-size: 14px; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Kopf ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.logo svg { width: 30px; height: 30px; flex: none; }
.logo small { font-weight: 500; color: var(--faint); font-size: 13px; letter-spacing: 0; }
.top nav { display: flex; align-items: center; gap: 6px; }
.top nav a:not(.btn) { color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 9px; font-weight: 500; font-size: 15px; }
.top nav a:not(.btn):hover { color: var(--ink); background: var(--card-2); }
@media (max-width: 560px) {
  .logo small, .top nav .hide-sm { display: none; }
}

/* ---------- Buttons & Formulare ---------- */
.btn {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: 11px;
  background: var(--card); color: var(--ink);
  font: 600 15px/1 var(--font); text-decoration: none; cursor: pointer;
  transition: transform .12s, background .12s, border-color .12s;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--red); border-color: var(--red); color: var(--red-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; border-radius: 9px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn svg { width: 18px; height: 18px; }

label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
label .opt { font-weight: 400; color: var(--faint); }
input[type="text"], input[type="search"], input[type="password"], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font: 16px/1.4 var(--font);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .chip:focus-visible, .drop:focus-within {
  outline: 2px solid var(--blue); outline-offset: 2px;
}
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--red); flex: none; }
.hp { position: absolute; left: -9999px; }

.error { color: var(--red); font-weight: 500; }
.notice {
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card-2); color: var(--muted); font-size: 14px;
}

/* ---------- Hero ---------- */
.hero { padding: clamp(36px, 7vw, 72px) 0 24px; }
.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 7vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 800;
  max-width: 14ch;
}
.hero h1 .mark { position: relative; white-space: nowrap; color: var(--red); }
.hero h1 .mark svg { position: absolute; left: -2%; bottom: -0.16em; width: 104%; height: 0.32em; overflow: visible; }
.hero .lead { margin: 0; max-width: 560px; color: var(--muted); font-size: clamp(17px, 2.2vw, 19px); }
.hero .stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 20px; color: var(--muted); font-size: 14px; }
.hero .stats b { color: var(--ink); font-weight: 700; }

/* ---------- Suche & Filter ---------- */
.search {
  display: flex; gap: 10px; align-items: center;
  margin-top: 28px;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.search svg { width: 20px; height: 20px; margin-left: 8px; color: var(--faint); flex: none; }
.search input { border: 0; min-height: 44px; padding: 8px 4px; background: transparent; }
.search input:focus { outline: none; }
.search:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 18px 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  appearance: none; border: 1px solid var(--line-strong); background: var(--card); color: var(--muted);
  min-height: 34px; padding: 0 12px; border-radius: 999px; font: 500 14px/1 var(--font); cursor: pointer;
}
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.filters select { width: auto; min-height: 36px; padding: 6px 30px 6px 10px; font-size: 14px; border-radius: 999px; }
.filters .grow { flex: 1; }
.result-info { color: var(--muted); font-size: 14px; margin: 14px 0; }

/* ---------- Karten (Testblätter) ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.sheet {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 190px;
  padding: 18px 18px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px 6px var(--radius) var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  overflow: hidden;
}
/* Rand wie bei einem Schularbeitsblatt */
.sheet::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 12px; width: 1px; background: var(--red-soft);
  box-shadow: 3px 0 0 var(--red-soft);
}
.sheet:hover { transform: translateY(-2px) rotate(-0.3deg); border-color: var(--line-strong); }
.sheet .fach { font-size: 13px; font-weight: 600; color: var(--blue); padding-left: 8px; }
.sheet h3 { margin: 0; padding-left: 8px; font-size: 18px; line-height: 1.25; letter-spacing: -0.01em; }
.sheet .meta { margin-top: auto; padding-left: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.sheet .jg {
  position: absolute; top: 12px; right: 14px;
  width: 38px; height: 38px; display: grid; place-items: center;
  color: var(--red); font: 700 19px/1 var(--hand);
  transform: rotate(-8deg);
}
.sheet .jg svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sheet .fach, .sheet h3 { padding-right: 40px; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--card-2); color: var(--muted);
  font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.green { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.tag svg { width: 13px; height: 13px; }

.empty {
  text-align: center; padding: 56px 20px; border: 2px dashed var(--line-strong); border-radius: var(--radius);
  color: var(--muted); background: color-mix(in srgb, var(--card) 60%, transparent);
}
.empty h2 { color: var(--ink); margin: 0 0 6px; font-size: 22px; letter-spacing: -0.02em; }
.empty p { margin: 0 0 18px; }

/* ---------- Detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; margin: 28px 0 18px; color: var(--muted); text-decoration: none; font-weight: 500; }
.back:hover { color: var(--ink); }
.detail-head h1 { margin: 6px 0 12px; font-size: clamp(28px, 5vw, 42px); line-height: 1.1; letter-spacing: -0.03em; }
.detail-head .fach { color: var(--blue); font-weight: 600; }
.detail-head .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.desc { white-space: pre-wrap; max-width: 70ch; margin: 18px 0 0; }
.byline { margin-top: 12px; font-size: 14px; color: var(--faint); }
.files { display: grid; gap: 22px; margin-top: 30px; }
.file {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.file-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.file-bar .name { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-bar .size { font-size: 13px; color: var(--faint); }
.file img { display: block; width: 100%; height: auto; background: #fff; }
.file iframe { display: block; width: 100%; height: 82vh; border: 0; background: #fff; }
@media (max-width: 760px) { .file iframe { display: none; } }
.pdf-mobile { padding: 22px 16px; text-align: center; color: var(--muted); font-size: 14px; }
@media (min-width: 761px) { .pdf-mobile { display: none; } }
.report { margin-top: 36px; }
.report form { display: grid; gap: 10px; max-width: 560px; margin-top: 12px; }

/* ---------- Hochladen ---------- */
.page-title { margin: 36px 0 6px; font-size: clamp(28px, 5vw, 40px); letter-spacing: -0.03em; line-height: 1.1; }
.form-card {
  margin-top: 24px; padding: clamp(18px, 4vw, 30px);
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.drop {
  position: relative;
  display: grid; place-items: center; gap: 6px; text-align: center;
  padding: 30px 16px;
  border: 2px dashed var(--line-strong); border-radius: 14px;
  background: var(--card-2); color: var(--muted); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop.over, .drop:hover { border-color: var(--red); background: var(--red-soft); }
.drop svg { width: 34px; height: 34px; color: var(--red); }
.drop strong { color: var(--ink); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.picked { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.picked li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 14px;
}
.picked .thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--card-2); flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--red); }
.picked .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picked .s { color: var(--faint); font-size: 13px; }
.picked button { appearance: none; border: 0; background: none; color: var(--faint); cursor: pointer; font-size: 20px; line-height: 1; padding: 4px 6px; }
.picked button:hover { color: var(--red); }
.picked progress { width: 80px; accent-color: var(--red); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 22px; }
.success { text-align: center; padding: 34px 10px; }
.success .stamp {
  display: inline-grid; place-items: center; width: 92px; height: 92px; margin-bottom: 14px;
  border: 3px solid var(--green); border-radius: 50%; color: var(--green);
  font: 700 15px/1.1 var(--hand); transform: rotate(-10deg);
}
.success h2 { margin: 0 0 8px; letter-spacing: -0.02em; }

/* ---------- Regeln ---------- */
.prose { max-width: 70ch; }
.prose h2 { margin-top: 32px; font-size: 21px; letter-spacing: -0.02em; }
.prose li { margin: 6px 0; }

/* ---------- Admin ---------- */
.admin-item { padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 10px; }
.admin-item.pending { border-color: var(--red); }
.admin-item h3 { margin: 0; font-size: 17px; }
.admin-item .files-mini { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-item .files-mini a { font-size: 13px; }
.admin-item .reports { font-size: 14px; background: var(--red-soft); padding: 8px 12px; border-radius: 10px; }
.admin-list { display: grid; gap: 12px; margin-top: 18px; }

/* ---------- Fuß ---------- */
footer { border-top: 1px solid var(--line); padding: 22px 0 30px; color: var(--faint); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
footer a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.end { align-self: end; }
.actions.center { justify-content: center; }
.form-card.narrow { max-width: 420px; }

/* ---------- Zurück zu elektronic.online (Pill in der Kopfzeile, gleich auf allen Subdomains) ---------- */
.eo-pill { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 32px; padding: 0 11px 0 9px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, currentColor 20%, transparent); color: inherit; opacity: 0.8; text-decoration: none;
  font: 500 13px/1 system-ui, -apple-system, "Segoe UI", sans-serif; white-space: nowrap; transition: opacity 0.15s, background 0.15s; }
.eo-pill:hover, .eo-pill:focus-visible { opacity: 1; background: color-mix(in srgb, currentColor 8%, transparent); }
.eo-pill svg { width: 18px; height: 18px; border-radius: 5px; }
.eo-pill .eo-arrow { font-size: 14px; }
@media (max-width: 640px) { .eo-pill .eo-txt { display: none; } .eo-pill { padding: 0 9px 0 8px; } }
.top .wrap .logo { margin-right: auto; }
.top nav .btn { white-space: nowrap; }
@media (max-width: 640px) { .top .wrap { gap: 10px; } .logo { font-size: 17px; } }
