/* Eiswo Chat: eigener Auftritt (Eisblau/Petrol), keine Web-Fonts, keine externen Dateien. */
:root {
  --bg: #eef4f7; --surface: #ffffff; --surface-2: #e4edf2; --ink: #0f1c24; --muted: #4a5d69; --line: #cfdce4;
  --primary: #0a6c8c; --primary-ink: #ffffff; --primary-soft: #d2eef6;
  --bubble-in: #ffffff; --bubble-out: #cdeaf3; --bubble-ink: #0f1c24;
  --tick: #5b6f7b; --tick-read: #0a7fa6;
  --danger: #b3261e; --danger-soft: #fbe4e2; --warn: #8a5a00; --warn-soft: #fff1d6; --ok: #1b6b3a; --ok-soft: #dff3e6;
  --radius: 16px; --shadow: 0 1px 2px rgb(10 30 40 / .08), 0 4px 14px rgb(10 30 40 / .06);
  --tab-h: 64px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1218; --surface: #121e27; --surface-2: #1a2a35; --ink: #e8f1f5; --muted: #9db2bf; --line: #263944;
    --primary: #4cc3e3; --primary-ink: #06222c; --primary-soft: #11394a;
    --bubble-in: #1a2a35; --bubble-out: #0f4a5e; --bubble-ink: #e8f1f5;
    --tick: #8aa0ad; --tick-read: #5fd0f0;
    --danger: #ff8a80; --danger-soft: #3a1815; --warn: #ffcf70; --warn-soft: #33270a; --ok: #7fdca0; --ok-soft: #12301e;
    --shadow: 0 1px 2px rgb(0 0 0 / .4);
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1.0625rem/1.5 var(--font); min-height: 100vh; min-height: 100dvh; }
h1, h2 { line-height: 1.2; margin: 0; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; }
p { margin: 0; }
a { color: var(--primary); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--primary); color: var(--primary-ink); padding: .75rem 1rem; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.ico { width: 26px; height: 26px; fill: currentColor; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .95rem; }

/* Kopfzeile / Navigation */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: calc(env(safe-area-inset-top) + .5rem) max(16px, env(safe-area-inset-right)) .5rem max(16px, env(safe-area-inset-left)); background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; min-height: 44px; }
.brand img { border-radius: 8px; }
.topnav { display: none; gap: .25rem; }
.topnav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .9rem; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 600; }
.topnav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.tabbar a { flex: 1; min-height: var(--tab-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: .8rem; font-weight: 600; }
.tabbar a[aria-current="page"] { color: var(--primary); }
.page { max-width: 720px; margin: 0 auto; padding: 1rem max(16px, env(safe-area-inset-right)) calc(var(--tab-h) + env(safe-area-inset-bottom) + 1.5rem) max(16px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 1rem; }
.page--narrow { max-width: 560px; }
.page--auth { justify-content: center; min-height: 90dvh; padding-bottom: 2rem; max-width: 440px; }
.screen-title { font-size: 1.9rem; }
@media (min-width: 760px) {
  .topnav { display: flex; }
  .tabbar { display: none; }
  .page { padding-bottom: 2rem; }
}

/* Karten, Formulare, Buttons */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; }
label { font-weight: 600; }
input[type=text], input[type=password], select { width: 100%; min-height: 48px; padding: .6rem .85rem; font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--line); border-radius: 12px; }
input:focus, select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
input:disabled { background: var(--surface-2); color: var(--muted); }
.help { color: var(--muted); font-size: .92rem; } .help ul { margin: .25rem 0 0; padding-left: 1.2rem; }
.error { color: var(--danger); font-weight: 600; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 1.2rem; font: inherit; font-weight: 700; color: var(--ink); background: var(--surface-2); border: 2px solid var(--line); border-radius: 14px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--primary); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn--danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn--block { width: 100%; }
.alert { padding: .8rem 1rem; border-radius: 12px; border: 1px solid var(--line); font-weight: 600; }
.alert--error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.alert--warning { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.alert--success { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.alert--info { background: var(--primary-soft); color: var(--primary); }
.notice { background: var(--warn-soft); color: var(--ink); border: 1px dashed var(--warn); border-radius: 12px; padding: .75rem 1rem; font-size: .95rem; }
.notice--slim { font-size: .85rem; padding: .4rem .75rem; }
.authcard { padding: 1.75rem; }
.authcard__brand { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.authcard__brand img { border-radius: 18px; }
.authcard__brand p { color: var(--muted); }
.steps { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: .6rem; }
.secret { font: 700 1.6rem/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; background: var(--surface-2); border: 2px dashed var(--primary); border-radius: 14px; padding: 1rem; text-align: center; word-break: break-all; user-select: all; }

/* Verwaltung */
.userlist, .auditlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.userrow { display: flex; flex-direction: column; gap: .75rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.userrow:first-child { border-top: 0; padding-top: 0; }
.userrow__actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.userrow__actions .inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.userrow__actions input[type=text] { width: 12rem; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; }
.tag { font-size: .85rem; font-weight: 700; padding: .15rem .6rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tag--bad { background: var(--danger-soft); color: var(--danger); } .tag--warn { background: var(--warn-soft); color: var(--warn); }
.auditlist li { padding: .45rem 0; border-top: 1px solid var(--line); font-size: .95rem; } .auditlist li:first-child { border-top: 0; }

/* Chatliste */
.chatlist { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.chatlist li + li { border-top: 1px solid var(--line); }
.chatrow { display: flex; gap: .85rem; align-items: center; padding: .8rem 1rem; min-height: 72px; color: var(--ink); text-decoration: none; }
.chatrow:hover { background: var(--surface-2); }
.avatar { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 1.2rem; color: #fff; background: #0a6c8c; }
.avatar--2 { background: #5b4bb0; } .avatar--3 { background: #a3541f; }
.chatrow__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.chatrow__top, .chatrow__bottom { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.chatrow__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatrow__time { font-size: .85rem; color: var(--muted); flex: none; }
.chatrow__preview { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { flex: none; min-width: 24px; height: 24px; padding: 0 .4rem; border-radius: 12px; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); font-size: .85rem; font-weight: 700; }

/* Unterhaltung */
.page--chat { padding-bottom: 0; gap: .5rem; min-height: calc(100dvh - 70px); }
.chathead { display: flex; align-items: center; gap: .6rem; }
.iconbtn { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: var(--primary); }
.iconbtn:hover { background: var(--primary-soft); }
.chathead__name { font-weight: 700; font-size: 1.15rem; display: flex; flex-direction: column; line-height: 1.2; }
.chathead__name small { font-weight: 400; color: var(--muted); font-size: .85rem; }
.thread { list-style: none; margin: 0; padding: .5rem 0; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.thread__day { align-self: center; margin: .5rem 0; }
.thread__day span { background: var(--surface-2); color: var(--muted); font-size: .85rem; font-weight: 600; padding: .2rem .8rem; border-radius: 999px; }
.bubble { max-width: 82%; padding: .55rem .8rem .35rem; border-radius: 18px; color: var(--bubble-ink); box-shadow: 0 1px 1px rgb(10 30 40 / .1); overflow-wrap: anywhere; }
.bubble--in { align-self: flex-start; background: var(--bubble-in); border-bottom-left-radius: 6px; }
.bubble--out { align-self: flex-end; background: var(--bubble-out); border-bottom-right-radius: 6px; }
.bubble__meta { display: flex; justify-content: flex-end; align-items: center; gap: .3rem; font-size: .75rem; color: var(--muted); margin-top: .1rem; }
.tick { width: 16px; height: 11px; color: var(--tick); } .tick--2 { width: 20px; } .tick--read { color: var(--tick-read); }
.composer { position: sticky; bottom: 0; display: flex; gap: .5rem; padding: .6rem 0 calc(env(safe-area-inset-bottom) + .6rem); background: var(--bg); }
.composer input { flex: 1; border-radius: 24px; }

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