/* EK Links – dunkles Theme im Stil von EK Games */
:root {
  --bg: #0b0e12;
  --card: #12171d;
  --card-2: #171d25;
  --line: #222a33;
  --line-2: #2a313b;
  --text: #e7ebf0;
  --muted: #8b95a3;
  --dim: #64748b;
  --accent: #2dd4bf;
  --accent-ink: #042f2e;
  --accent-soft: rgb(45 212 191 / .12);
  --warn: #fbbf24;
  --err: #f87171;
  --ok: #34d399;
  --r: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 0 rgb(255 255 255 / .03) inset, 0 10px 30px -12px rgb(0 0 0 / .6);
  --font: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
.glow {
  position: fixed; inset: 0 0 auto 0; height: 520px; pointer-events: none; z-index: 0;
  background:
    radial-gradient(600px 300px at 50% -80px, rgb(45 212 191 / .14), transparent 70%),
    radial-gradient(400px 240px at 85% 0, rgb(45 212 191 / .05), transparent 70%);
}
body > *:not(.glow):not(.toast):not(dialog) { position: relative; z-index: 1; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 .75rem; }
code, pre, .mono { font-family: var(--mono); font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.ok { color: var(--ok); } .warn { color: var(--warn); }
[hidden] { display: none !important; }
.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.i-lg { width: 2rem; height: 2rem; }
.i-xl { width: 3.5rem; height: 3.5rem; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pre-wrap { white-space: pre-wrap; word-break: break-word; }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.row-gap { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ---------- Karten, Buttons, Felder ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.1rem; box-shadow: var(--shadow);
}
.stack > * + * { margin-top: 1rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .55rem 1rem; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--card-2); color: var(--text);
  font: inherit; font-weight: 550; cursor: pointer; text-decoration: none !important;
  transition: background .15s, border-color .15s, transform .05s;
  user-select: none; white-space: nowrap;
}
.btn:hover { border-color: #3a4450; background: #1b232c; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #5eead4; border-color: #5eead4; }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--err); border-color: rgb(248 113 113 / .35); background: rgb(248 113 113 / .06); }
.btn-sm { min-height: 38px; padding: .4rem .8rem; font-size: .9rem; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; padding: 0;
  list-style: none;
}
.icon-btn::-webkit-details-marker { display: none; }
.icon-btn:hover { background: var(--card-2); color: var(--text); border-color: var(--line); }
.icon-btn.danger:hover { color: var(--err); }
.icon-btn.is-off { color: var(--warn); }
.icon-btn .i { width: 20px; height: 20px; }

.field { display: block; }
.field > label, .field legend { display: block; font-weight: 550; font-size: .92rem; margin-bottom: .35rem; }
.field fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.field-row { display: grid; gap: 1rem; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; min-height: 46px; padding: .6rem .8rem;
  background: #0e1318; color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font: inherit; font-size: 16px; /* verhindert Zoom auf iOS */
}
textarea { resize: vertical; line-height: 1.45; }
textarea.mono { font-family: var(--mono); font-size: 14px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2.2rem; }
input::placeholder, textarea::placeholder { color: var(--dim); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=date] { color-scheme: dark; }
input[type=datetime-local] { color-scheme: dark; }
.help { color: var(--muted); font-size: .85rem; margin: .3rem 0 0; }
.field > .help:first-of-type { margin: -.15rem 0 .45rem; }
.err-msg { color: var(--err); font-size: .87rem; margin: .35rem 0 0; }
.has-err input, .has-err select, .has-err textarea { border-color: var(--err); }
.req { color: var(--accent); }
.static { margin: 0; color: var(--muted); word-break: break-all; }
.check, .choice { display: flex; align-items: center; gap: .6rem; cursor: pointer; min-height: 44px; }
.check input, .choice input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin: 0; }
.choices { display: grid; gap: .1rem; }
.choice { padding: .2rem .7rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: #0e1318; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choices { gap: .45rem; }
.alert { padding: .75rem 1rem; border-radius: var(--r-sm); border: 1px solid; margin-bottom: 1rem; font-size: .95rem; }
.alert-ok { color: #a7f3d0; border-color: rgb(52 211 153 / .3); background: rgb(52 211 153 / .08); word-break: break-word; }
.alert-err { color: #fecaca; border-color: rgb(248 113 113 / .35); background: rgb(248 113 113 / .08); }
.alert-info { color: #bae6fd; border-color: rgb(56 189 248 / .3); background: rgb(56 189 248 / .07); }
.badge {
  display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .5rem; border-radius: 999px;
  font-size: .72rem; font-weight: 600; letter-spacing: .02em; color: var(--muted);
  background: var(--card-2); border: 1px solid var(--line);
}
.badge-warn { color: var(--warn); border-color: rgb(251 191 36 / .3); }
.badge-err { color: var(--err); border-color: rgb(248 113 113 / .3); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.switch { display: flex; align-items: center; gap: .75rem; cursor: pointer; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .slider { width: 46px; height: 28px; border-radius: 99px; background: var(--line-2); position: relative; flex: none; transition: background .15s; }
.switch .slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::after { transform: translateX(18px); background: var(--accent-ink); }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 100;
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: #0f2b28; color: #ccfbf1; border: 1px solid rgb(45 212 191 / .45);
  padding: .6rem 1rem; border-radius: 999px; font-size: .92rem; font-weight: 550;
  transition: opacity .2s, transform .2s; box-shadow: 0 10px 30px rgb(0 0 0 / .5);
  max-width: calc(100vw - 32px); white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Visitenkarte ---------- */
.home .glow { height: 100%; background:
  radial-gradient(520px 360px at 50% 8%, rgb(45 212 191 / .16), transparent 70%),
  radial-gradient(500px 400px at 50% 110%, rgb(45 212 191 / .06), transparent 70%); }
.vcard {
  min-height: 100vh; min-height: 100dvh; max-width: 420px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(2.5rem + env(safe-area-inset-top)) 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
}
.vcard-logo { width: 96px; height: 96px; filter: drop-shadow(0 10px 30px rgb(45 212 191 / .22)); animation: rise .5s ease-out both; }
.vcard-name { font-size: 1.85rem; margin: 1.1rem 0 1.8rem; text-align: center; animation: rise .5s .05s ease-out both; }
.vcard-links { width: 100%; display: grid; gap: .75rem; animation: rise .5s .1s ease-out both; }
.vlink {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .9rem;
  width: 100%; min-height: 60px; padding: .8rem 1.1rem; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important;
  transition: border-color .15s, background .15s, transform .15s;
}
.vlink .i { width: 22px; height: 22px; color: var(--accent); }
.vlink small { color: var(--muted); font-weight: 500; font-size: .82rem; }
.vlink:hover, .vlink[aria-expanded=true] { border-color: rgb(45 212 191 / .45); background: #141b22; }
.vlink:active { transform: scale(.99); }
.wa-panel { background: var(--card); border: 1px solid rgb(45 212 191 / .35); border-radius: var(--r); padding: 1rem 1.1rem; animation: rise .2s ease-out both; }
.wa-label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.wa-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .35rem; }
.wa-user { font-size: 1.2rem; font-weight: 650; color: var(--text); font-family: var(--mono); word-break: break-all; }
.wa-hint { color: var(--muted); font-size: .8rem; margin: .6rem 0 0; }
.vcard-foot { margin-top: 2.5rem; color: var(--dim); font-size: .8rem; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Öffentliche Inhaltsseiten ---------- */
.pub-head { max-width: 760px; margin: 0 auto; padding: calc(1rem + env(safe-area-inset-top)) 1rem .5rem; }
.pub-brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 650; text-decoration: none !important; }
.pub-main { max-width: 640px; margin: 0 auto; padding: .75rem 1rem calc(2rem + env(safe-area-inset-bottom)); }
.pub-main.wide { max-width: 900px; }
.center-card { text-align: center; padding: 2rem 1.25rem; }
.big-code { font-size: 3rem; font-weight: 750; color: var(--accent); opacity: .85; line-height: 1; margin-bottom: .75rem; }
.done-badge { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1rem; background: var(--accent-soft); color: var(--accent); }
.muted-badge { background: var(--card-2); color: var(--muted); }
.meta { color: var(--muted); font-size: .85rem; }

.note-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; padding-bottom: .9rem; border-bottom: 1px solid var(--line); }
.note-actions { display: flex; gap: .5rem; }
.prose { line-height: 1.65; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h1, .prose h2, .prose h3 { margin: 1.4em 0 .5em; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose code { background: #0e1318; border: 1px solid var(--line); border-radius: 6px; padding: .1em .35em; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose blockquote { margin: 1em 0; padding: .2em 1em; border-left: 3px solid var(--accent); color: var(--muted); }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line-2); padding: .4em .7em; }
.prose img { max-width: 100%; }
.prose hr { border: 0; border-top: 1px solid var(--line); }
.prose ul.contains-task-list { list-style: none; padding-left: .5em; }
.hl, .code-wrap .hl { background: #0d1117 !important; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: auto; margin: 1em 0; }
.hl pre { margin: 0; padding: .9rem 1rem; font-size: 13.5px; line-height: 1.55; tab-size: 4; }
.code-wrap .hl { margin: 0; max-height: 75vh; }
pre.plain { white-space: pre-wrap; word-break: break-word; margin: 0; font-size: .92rem; }

.file-card { padding: 0; overflow: hidden; }
.preview { background: #080a0d; border-bottom: 1px solid var(--line); display: grid; place-items: center; }
.preview-img img { display: block; max-width: 100%; max-height: 75vh; margin: 0 auto; }
.preview video { width: 100%; max-height: 75vh; display: block; background: #000; }
.preview-audio { padding: 2rem 1rem; gap: 1rem; color: var(--accent); }
.preview-audio audio { width: 100%; max-width: 480px; }
.preview-pdf iframe { width: 100%; height: 75vh; border: 0; background: #fff; }
.preview.code-wrap { display: block; }
.preview.code-wrap .hl { border: 0; border-radius: 0; }
.file-hero { display: grid; place-items: center; padding: 2.5rem 1rem 1.5rem; color: var(--accent); background: radial-gradient(260px 140px at 50% 40%, rgb(45 212 191 / .1), transparent 70%); }
.file-info { padding: 1.1rem; display: grid; gap: 1rem; }
.file-name { font-size: 1.15rem; word-break: break-word; margin: 0 0 .2rem; }
.file-actions { display: grid; gap: .5rem; }

.pubform h1 { font-size: 1.5rem; }
.form-desc { color: #c6cdd6; margin-bottom: 1.25rem; }
.pubform .field { margin-top: 1.25rem; }
.form-foot { margin-top: 1.75rem; }
.form-foot .muted { margin-top: .6rem; text-align: center; }

/* Upload-Liste */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; text-align: center;
  padding: 1.1rem; border: 1.5px dashed var(--line-2); border-radius: var(--r); background: #0e1318;
  color: var(--text); cursor: pointer; font-weight: 550; transition: border-color .15s, background .15s; min-height: 88px;
}
.drop small { color: var(--muted); font-weight: 400; font-size: .8rem; }
.drop .i { color: var(--accent); width: 24px; height: 24px; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-big { min-height: 150px; }
.up-list { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; }
.up-list:empty { display: none; }
.up-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name rm" "state state" "bar bar" "link link";
  align-items: center; gap: .2rem .6rem;
  padding: .55rem .7rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: #0e1318; font-size: .92rem;
}
.up-name { grid-area: name; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.up-state { grid-area: state; color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.up-item.done .up-state { color: var(--ok); }
.up-item.err .up-state { color: var(--err); }
.up-remove { grid-area: rm; width: 34px; height: 34px; }
.up-item > input[type=hidden] { display: none; }
.up-bar { grid-area: bar; height: 5px; background: var(--line); border-radius: 9px; overflow: hidden; }
.up-bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #14b8a6, var(--accent)); border-radius: 9px; transition: width .2s; }
.up-item.done .up-bar { display: none; }
.up-link { grid-area: link; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.up-link a.slug { margin-right: auto; word-break: break-all; }
.up-list.big .up-item { padding: .75rem .85rem; }

/* ---------- Admin ---------- */
.topbar {
  position: sticky !important; top: 0; z-index: 20 !important;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: calc(.55rem + env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) .55rem max(1rem, env(safe-area-inset-left));
  background: rgb(11 14 18 / .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand img { height: 38px; width: auto; display: block; }
.top-actions { display: flex; align-items: center; gap: .35rem; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; z-index: 30;
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r); padding: .35rem;
  box-shadow: 0 18px 40px -10px rgb(0 0 0 / .75);
}
.menu-pop a, .menu-pop button {
  display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 46px; padding: .5rem .75rem;
  border: 0; background: none; color: var(--text); font: inherit; border-radius: var(--r-sm); cursor: pointer; text-decoration: none !important;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--card-2); }
.menu-pop .i { color: var(--accent); }
.admin-main { max-width: 920px; margin: 0 auto; padding: 1rem max(1rem, env(safe-area-inset-left)) calc(3rem + env(safe-area-inset-bottom)); }
.page-head { display: flex; align-items: center; gap: .5rem; margin: .25rem 0 1rem; }
.page-head h1 { margin: 0; font-size: 1.3rem; }
.head-right { margin-left: auto; }
.section-title { font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.narrow { max-width: 480px; }
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }
.sticky-actions { margin-top: 1rem; }
section.card { margin-bottom: 1rem; }
.linkbar { display: grid; gap: .6rem; margin-bottom: 1rem; }
.linkbar .slug { font-weight: 650; font-size: 1.05rem; word-break: break-all; }
.danger-zone { margin-top: 1.5rem; text-align: right; }
.empty { text-align: center; padding: 2rem 1rem; }

.filters { display: grid; gap: .6rem; margin-bottom: .9rem; }
.search { position: relative; }
.search .i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 2.6rem !important; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: .5rem; }
.count { margin: 0 0 .5rem; }

.items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .6rem; }
.item {
  display: grid; grid-template-columns: auto 1fr; gap: .25rem .8rem; align-items: start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: .85rem .9rem .5rem;
}
.item-off { opacity: .62; }
.item-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.item-icon .i { width: 20px; height: 20px; }
.t-redirect { background: rgb(56 189 248 / .12); color: #7dd3fc; }
.t-note { background: rgb(251 191 36 / .1); color: #fcd34d; }
.t-form { background: rgb(167 139 250 / .12); color: #c4b5fd; }
.item-main { min-width: 0; display: grid; gap: .2rem; }
.item-link { color: inherit; text-decoration: none !important; }
.item-top { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.item-top .slug { font-weight: 650; font-size: 1.02rem; word-break: break-all; }
.item-sub { display: flex; gap: .5rem; min-width: 0; color: #c6cdd6; font-size: .9rem; }
.item-sub b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
.item-meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; color: var(--muted); font-size: .8rem; }
.item-meta .i { width: 14px; height: 14px; margin-right: .2rem; }
.item-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: .1rem; border-top: 1px solid var(--line); margin-top: .45rem; padding-top: .35rem; }
.item-actions form { display: contents; }
.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1rem; }

.slug-input { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #0e1318; overflow: hidden; }
.slug-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.slug-prefix { display: flex; align-items: center; padding: 0 0 0 .8rem; color: var(--muted); font-size: .92rem; white-space: nowrap; }
.slug-input input { border: 0 !important; box-shadow: none !important; padding-left: .1rem !important; background: transparent !important; min-width: 0; }
.has-err .slug-input { border-color: var(--err); }
.expiry-row { display: grid; gap: .5rem; }

/* Formular-Baukasten */
.fields { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .6rem; counter-reset: f; }
.fields:empty::before { content: "Noch keine Felder."; color: var(--muted); font-size: .9rem; }
.fb-field { border: 1px solid var(--line-2); border-radius: var(--r); background: #0e1318; }
.fb-field.dragging { opacity: .5; border-color: var(--accent); }
.fb-field.drop-target { border-color: var(--accent); }
.fb-head { display: flex; align-items: center; gap: .5rem; padding: .4rem .4rem .4rem .6rem; border-bottom: 1px solid var(--line); }
.fb-grip { color: var(--dim); cursor: grab; display: grid; place-items: center; touch-action: none; }
.fb-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; font-size: .92rem; }
.fb-title.placeholder { color: var(--dim); font-weight: 400; }
.fb-tools { display: flex; }
.fb-tools .icon-btn { width: 36px; height: 36px; }
.fb-body { padding: .8rem; display: grid; gap: .75rem; }
.add-field { display: grid; grid-template-columns: 1fr auto; gap: .5rem; }

.answers { margin: 0 0 1.25rem; display: grid; gap: .25rem; }
.answers dt { color: var(--muted); font-size: .82rem; margin-top: .75rem; }
.answers dd { margin: 0; word-break: break-word; }

/* Dialog */
.dialog {
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--card); color: var(--text);
  padding: 1rem; width: min(360px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgb(0 0 0 / .7);
}
.dialog::backdrop { background: rgb(0 0 0 / .65); backdrop-filter: blur(3px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.dialog-head h2 { margin: 0; }
.qr-box { background: #fff; border-radius: var(--r-sm); padding: .75rem; display: grid; place-items: center; }
.qr-box img { width: 100%; max-width: 260px; height: auto; image-rendering: pixelated; }
.qr-url { text-align: center; color: var(--muted); font-size: .88rem; word-break: break-all; margin: .7rem 0; }
.dialog .row-gap { justify-content: center; }

/* Login */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1.25rem; }
.login-card { width: 100%; max-width: 380px; display: grid; gap: 1rem; padding: 1.6rem 1.3rem; }
.login-logo { height: 58px; width: auto; justify-self: center; margin-bottom: .5rem; }
.login .glow { height: 100%; background: radial-gradient(520px 360px at 50% 20%, rgb(45 212 191 / .13), transparent 70%); }

/* ---------- breitere Bildschirme ---------- */
@media (min-width: 640px) {
  h1 { font-size: 1.7rem; }
  .card { padding: 1.4rem; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .file-info { grid-template-columns: 1fr auto; align-items: center; padding: 1.3rem 1.4rem; }
  .file-actions { grid-auto-flow: column; }
  .filters { grid-template-columns: 1fr auto; }
  .filter-row { grid-template-columns: auto auto auto; }
  .item { grid-template-columns: auto 1fr auto; align-items: center; padding: .8rem .9rem; }
  .item-actions { grid-column: auto; border: 0; margin: 0; padding: 0; }
  .expiry-row { grid-template-columns: 1fr 1fr; }
  .sticky-actions {
    position: sticky; bottom: 0; z-index: 5; margin: 1rem 0 0; padding: .75rem 0;
    background: linear-gradient(to top, var(--bg) 70%, transparent);
  }
}
@media (max-width: 380px) {
  .brand img { height: 32px; }
  .new-menu summary span { display: none; }
}

.fb-field, .fb-body, .fb-body .field { min-width: 0; }
.fb-head .badge { flex: none; }
