@font-face {
  font-family: 'Geist';
  src: url('/fonts/geist-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  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: 'Geist';
  src: url('/fonts/geist-latin-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  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;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/fonts/geist-mono-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #fff;
  --dim: rgba(255, 255, 255, 0.5);
  --faint: rgba(255, 255, 255, 0.2);
  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, Consolas, monospace;
  --top: env(safe-area-inset-top, 0px);
  --bot: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; border-radius: 0; }
[hidden] { display: none !important; }
.defs { position: absolute; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

html, body { height: 100%; }
body {
  margin: 0;
  background: #000;
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
p { margin: 0; }

#app { position: relative; max-width: 640px; height: 100dvh; margin: 0 auto; }
.view { position: absolute; inset: 0; }

/* ---------- Glas: alles, was über Inhalt liegt, ist unscharf ---------- */
.glass {
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}
.glass-strong {
  background: rgba(0, 0, 0, 0.3);
  -webkit-backdrop-filter: blur(32px) saturate(120%);
  backdrop-filter: blur(32px) saturate(120%);
}

/* ---------- Icons ---------- */
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: miter; }
.i { width: 16px; height: 16px; }

button, input, textarea { font: inherit; color: var(--ink); background: transparent; border: 0; }
.ico {
  width: 44px; height: 44px; padding: 0; flex: none;
  display: grid; place-items: center; cursor: pointer;
}
.ico:hover, .ico:focus-visible { outline: none; background: rgba(255, 255, 255, 0.12); }
.ico:active { background: rgba(255, 255, 255, 0.2); }
.ico.solid { background: var(--ink); color: #000; }
.ico.solid:hover, .ico.solid:focus-visible { background: rgba(255, 255, 255, 0.82); }
.ico.big { width: 96px; height: 96px; }
.ico.big svg { width: 36px; height: 36px; stroke-width: 1.25; }
.ico.huge { width: 120px; height: 120px; color: var(--faint); margin: 24vh auto 0; }
.ico.huge svg { width: 56px; height: 56px; stroke-width: 1; }
.ico.huge:hover { color: var(--ink); background: transparent; }

input, textarea { padding: 10px 0; border-bottom: 1px solid var(--faint); }
input:focus, textarea:focus { outline: none; border-bottom-color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--dim); }
input[readonly] { color: var(--dim); font-family: var(--mono); font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > input { flex: 1; min-width: 0; }

/* ---------- Scrollbar: dünn, eckig, nur Daumen ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.28) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.22); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.6); border-width: 1px; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- Leisten ---------- */
.bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(8px + var(--top)) 8px 8px;
}
.barrow { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.group { display: flex; }
#q { flex: 1; min-width: 0; font-size: 17px; border-bottom: 0; -webkit-appearance: none; appearance: none; }
#q::-webkit-search-cancel-button, #q::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.bar .name { flex: 1; text-align: center; font-weight: 600; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { width: 44px; height: 44px; display: grid; place-items: center; }
.status::before { content: ''; width: 7px; height: 7px; border: 1px solid var(--dim); }
.status.on::before { background: var(--ink); border-color: var(--ink); }

.scroll { position: absolute; inset: 0; overflow-y: auto; padding: calc(68px + var(--top)) 20px calc(20px + var(--bot)); }

/* ---------- Setup ---------- */
.setup { display: grid; place-items: center; padding: 20px; }
.setup .row { width: min(100%, 360px); }
.setup input { font-size: 20px; }

/* ---------- Kontaktliste ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; cursor: pointer; }
.list li:hover .who, .list li:focus-visible .who { text-decoration: underline; text-underline-offset: 4px; }
.list li:focus-visible { outline: none; }
.list .grow { min-width: 0; }
.list .who { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .preview { color: var(--dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .meta { color: var(--dim); font-family: var(--mono); font-size: 11px; flex: none; padding-top: 4px; }
.list .unread { color: #000; background: var(--ink); padding: 1px 6px; align-self: flex-start; margin-top: 4px; }

/* ---------- Suche ---------- */
mark { background: var(--ink); color: #000; padding: 0 1px; }
.hits:not(:empty) { margin-top: 18px; }
.hits .who { font-size: 13px; font-weight: 500; color: var(--dim); }
.hits .preview { color: var(--ink); font-size: 15px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nothing { display: flex; align-items: center; gap: 10px; color: var(--faint); margin-top: 24vh; justify-content: center; }
.nothing svg { width: 40px; height: 40px; stroke-width: 1; }
.msg.hit { outline: 1px solid var(--ink); outline-offset: 6px; }

/* ---------- Hinzufügen: Glas-Ebene über der Liste ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; gap: 28px;
  padding: calc(8px + var(--top)) 8px calc(24px + var(--bot));
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.62);
  -webkit-backdrop-filter: blur(40px);
  backdrop-filter: blur(40px);
}
.sheet-bar { display: flex; justify-content: flex-end; width: min(100%, 624px); }
.choose { display: flex; gap: 16px; }
.choose .ico.on { background: var(--ink); color: #000; }
.pane { width: min(100%, 320px); display: flex; flex-direction: column; gap: 16px; }
.qr { width: 100%; aspect-ratio: 1; background: #fff; padding: 0; }
.qr svg { width: 100%; height: 100%; display: block; stroke: none; }
.video-frame { position: relative; width: 100%; aspect-ratio: 1; background: rgba(255, 255, 255, 0.04); overflow: hidden; }
.video-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.corners { position: absolute; left: 15%; top: 15%; width: 70%; height: 70%; stroke-width: 0.25; pointer-events: none; }
.hint { color: var(--dim); font-size: 13px; min-height: 1em; }

/* ---------- Chat: Nachrichten laufen unter den Glasleisten durch ---------- */
.chat .msgs { display: flex; flex-direction: column; gap: 14px; padding-bottom: calc(96px + var(--bot)); }
.msg { max-width: 82%; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.in { align-self: flex-start; }
.msg.out { align-self: flex-end; text-align: right; color: var(--dim); }
.msg .t { display: flex; gap: 6px; align-items: center; margin-top: 2px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; color: var(--dim); }
.msg.out .t { justify-content: flex-end; }
.msg .wait { width: 6px; height: 6px; border: 1px solid var(--dim); }
.msg .err { width: 6px; height: 6px; background: var(--ink); }
.day { align-self: center; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); margin: 8px 0 2px; }

.pop {
  position: absolute; z-index: 3; top: calc(64px + var(--top)); right: 8px;
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px;
}
.check { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.mono { font-family: var(--mono); letter-spacing: 0.06em; }

.compose {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; gap: 10px; align-items: flex-end;
  padding: 10px 12px calc(10px + var(--bot)) 20px;
}
.compose textarea { flex: 1; resize: none; max-height: 140px; border-bottom: 0; }
.typing { position: absolute; left: 20px; top: -14px; display: flex; gap: 4px; }
.typing i { width: 5px; height: 5px; background: var(--ink); opacity: 0.3; }
@media (prefers-reduced-motion: no-preference) {
  .typing i { animation: blink 1.2s infinite; }
  .typing i:nth-child(2) { animation-delay: 0.2s; }
  .typing i:nth-child(3) { animation-delay: 0.4s; }
}
@keyframes blink { 0%, 100% { opacity: 0.2; } 40% { opacity: 1; } }
