/* Farben und Schrift angelehnt an mobilnetzwerk.de – hier zentral anpassbar */
:root {
  --primary: #005159;      /* dunkles Petrol */
  --secondary: #009a9d;    /* Türkis */
  --accent: oklch(75.45% 0.1737 57.28); /* Orange */
  --orange: #e66400;
  --dark: #000;
  --light: #fff;
  --grey: #71777d;
  --line: #dfe5e6;
  --soft: #f1f6f6;
  --danger: #c8321e;
  --radius: 8px;
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/roboto-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/roboto-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--dark);
  background: var(--soft);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3 { margin: 0; line-height: 1.15; text-wrap: balance; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Kopf ---------- */
.topbar {
  background: var(--secondary);
  color: var(--light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
}
.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; min-width: 0; }
.brand img { height: 40px; width: auto; display: block; }
.brand-text { font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; font-size: 1.15rem; line-height: 1.1; }
.brand-text small { display: block; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 0.8rem; opacity: 0.9; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { color: inherit; text-decoration: none; padding: 8px 12px; border-radius: var(--radius); white-space: nowrap; }
.topbar nav a:hover, .topbar nav a:focus-visible { background: var(--accent); color: var(--primary); outline: none; }

.hero {
  background: var(--primary);
  color: var(--light);
  display: flex;
  align-items: stretch;
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.18);
  position: relative;
  z-index: 1;
}
.zebra {
  flex: 0 0 clamp(20px, 5vw, 72px);
  background: repeating-linear-gradient(180deg, var(--accent) 0 9px, transparent 9px 18px);
}
.hero-inner { padding: clamp(18px, 3.5vw, 40px) clamp(18px, 4vw, 48px); }
.hero h1 { font-size: clamp(1.5rem, 4.2vw, 3rem); font-weight: 600; text-transform: uppercase; }
.hero p { margin: 10px 0 0; max-width: 60ch; font-size: clamp(1rem, 1.6vw, 1.2rem); }

/* ---------- Layout ---------- */
main.app {
  flex: 1;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: clamp(14px, 2.5vw, 32px);
  display: grid;
  gap: clamp(16px, 2.5vw, 32px);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1000px) {
  main.app { grid-template-columns: minmax(360px, 460px) minmax(0, 1fr); align-items: start; }
  .chat { position: sticky; top: 16px; height: calc(100dvh - 32px); max-height: 860px; }
}

/* ---------- Chat ---------- */
.chat {
  background: var(--light);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgb(0 81 89 / 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 520px;
}
.chat-head { background: var(--primary); color: var(--light); padding: 12px 16px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; }
.messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.msg { max-width: 92%; padding: 10px 14px; border-radius: 14px; overflow-wrap: anywhere; }
.msg.bot { background: var(--soft); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.user { background: var(--primary); color: var(--light); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.error { background: #fdecea; color: #7a1c10; align-self: flex-start; }
.msg img { display: block; width: 100%; border-radius: 8px; margin-bottom: 8px; cursor: zoom-in; aspect-ratio: 16 / 9; object-fit: cover; background: var(--line); }
.msg .hint { font-size: 0.9rem; color: #33474a; }
.pending { display: flex; align-items: center; gap: 12px; }
.spinner { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--orange); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { border: 1px solid var(--secondary); background: var(--light); color: var(--primary); border-radius: 48px; padding: 6px 12px; font-size: 0.9rem; cursor: pointer; text-align: left; }
.chip:hover, .chip:focus-visible { background: var(--secondary); color: var(--light); outline: none; }

.mode { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: #fff4e8; border-top: 1px solid var(--line); font-size: 0.9rem; }
.mode img { width: 56px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; }
.mode span { flex: 1; }

.composer { border-top: 1px solid var(--line); padding: 12px 16px 14px; display: grid; gap: 8px; }
.composer textarea { width: 100%; resize: none; border: 2px solid var(--line); border-radius: var(--radius); padding: 10px 12px; min-height: 76px; background: var(--light); }
.composer textarea:focus, .field input:focus { outline: none; border-color: var(--secondary); }
.composer-row { display: flex; gap: 8px; align-items: center; }
.composer-row input { flex: 1; min-width: 0; border: 2px solid var(--line); border-radius: var(--radius); padding: 9px 12px; }
.counter { font-size: 0.8rem; color: var(--grey); text-align: right; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--primary); background: var(--primary); color: var(--light);
  border-radius: var(--radius); padding: 10px 20px; font-weight: 500; cursor: pointer; text-decoration: none;
  transition: transform 0.08s, filter 0.15s;
}
.btn:hover { filter: brightness(0.9); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--secondary) 55%, transparent); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--dark); font-weight: 600; }
.btn.ghost { background: transparent; color: var(--primary); }
.btn.small { padding: 5px 12px; font-size: 0.88rem; }
.btn.danger { background: var(--danger); border-color: var(--danger); }

/* ---------- Galerie ---------- */
.gallery-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.gallery-head h2 { font-size: clamp(1.25rem, 2.4vw, 1.9rem); font-weight: 600; text-transform: uppercase; color: var(--primary); }
.gallery-head span { color: var(--grey); font-size: 0.95rem; white-space: nowrap; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.card {
  color: var(--dark);
  background: var(--light); border-radius: var(--radius); overflow: hidden; border: 0; padding: 0; text-align: left; cursor: pointer;
  box-shadow: 0 2px 8px rgb(0 81 89 / 0.12); display: flex; flex-direction: column; transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover, .card:focus-visible { transform: translateY(-3px); box-shadow: 0 8px 20px rgb(0 81 89 / 0.22); outline: none; }
.card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--line); }
.card .cap { padding: 10px 12px 12px; font-size: 0.92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .who { padding: 0 12px 10px; font-size: 0.8rem; color: var(--grey); margin-top: auto; }
.card.new { animation: pop 0.6s ease-out; }
@keyframes pop { from { transform: scale(0.92); opacity: 0; } to { transform: none; opacity: 1; } }
.empty { background: var(--light); border: 2px dashed var(--line); border-radius: var(--radius); padding: 40px 20px; text-align: center; color: var(--grey); }

/* ---------- Dialoge ---------- */
dialog { border: 0; padding: 0; border-radius: var(--radius); max-width: min(1200px, 94vw); width: 100%; box-shadow: 0 20px 60px rgb(0 0 0 / 0.4); }
dialog::backdrop { background: rgb(0 40 44 / 0.75); }
.lightbox img { width: 100%; display: block; background: var(--line); max-height: 72dvh; object-fit: contain; }
.lightbox .body { padding: 16px 20px 20px; display: grid; gap: 12px; }
.lightbox .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lightbox .meta { color: var(--grey); font-size: 0.88rem; }

dialog.login { max-width: 420px; }
.login form { padding: 0; }
.login .head { background: var(--primary); color: var(--light); padding: 20px 24px; }
.login .head h2 { text-transform: uppercase; font-weight: 600; font-size: 1.3rem; }
.login .body { padding: 20px 24px 24px; display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 500; }
.field input, .field textarea { border: 2px solid var(--line); border-radius: var(--radius); padding: 10px 12px; width: 100%; }
.err { color: var(--danger); font-size: 0.92rem; min-height: 1.3em; }

/* ---------- Fuß ---------- */
footer.site { background: var(--primary); color: var(--light); padding: 16px 20px; font-size: 0.88rem; display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: space-between; }
footer.site a { color: inherit; }

/* ---------- Beamer-Ansicht ---------- */
body.beamer { background: var(--primary); color: var(--light); }
.beamer-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 28px; }
.beamer-head h1 { font-size: clamp(1.6rem, 3vw, 3rem); font-weight: 600; text-transform: uppercase; }
.beamer-head p { margin: 6px 0 0; font-size: clamp(1rem, 1.4vw, 1.4rem); opacity: 0.9; }
.join { display: flex; align-items: center; gap: 16px; text-align: right; font-size: clamp(0.95rem, 1.2vw, 1.25rem); }
.join img { width: clamp(90px, 9vw, 150px); border-radius: 6px; background: #fff; padding: 6px; }
.join strong { display: block; color: var(--accent); font-size: 1.15em; overflow-wrap: anywhere; }
body.beamer .grid { padding: 0 28px 28px; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
body.beamer .card { cursor: zoom-in; }
body.beamer .card .cap { font-size: 1.05rem; }
body.beamer .empty { background: transparent; border-color: rgb(255 255 255 / 0.4); color: var(--light); margin: 0 28px; }

/* ---------- Admin ---------- */
.admin { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; display: grid; gap: 24px; width: 100%; }
.panel { background: var(--light); border-radius: var(--radius); padding: 20px; box-shadow: 0 2px 8px rgb(0 81 89 / 0.12); display: grid; gap: 12px; }
.panel h2 { font-size: 1.2rem; text-transform: uppercase; color: var(--primary); font-weight: 600; }
.panel textarea { min-height: 320px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9rem; line-height: 1.45; }
.stats { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.stats b { color: var(--primary); }
.admin-list { display: grid; gap: 10px; }
.admin-item { display: grid; grid-template-columns: 140px 1fr auto; gap: 12px; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; }
.admin-item img { width: 140px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; }
.admin-item small { color: var(--grey); display: block; }
@media (max-width: 600px) { .admin-item { grid-template-columns: 90px 1fr; } .admin-item img { width: 90px; } .admin-item .btn { grid-column: 1 / -1; } .topbar nav a.optional { display: none; } }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
