@font-face { font-family: "Chakra Petch"; font-weight: 600; font-display: swap; src: url(/fonts/chakra-petch-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 700; font-display: swap; src: url(/fonts/chakra-petch-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 400; font-display: swap; src: url(/fonts/manrope-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 600; font-display: swap; src: url(/fonts/manrope-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 700; font-display: swap; src: url(/fonts/manrope-latin-700-normal.woff2) format("woff2"); }

:root {
  /* OVERRA-Farben, Akzent in Discord-Blurple */
  --bg: #040812;
  --surface: #0a1430;
  --surface-2: #0d1a3b;
  --line: #1a2a55;
  --line-strong: #2a3d73;
  --text: #eaf7ff;
  --muted: #94a6c8;
  --accent: #5865f2;
  --accent-soft: #8f99ff;
  --accent-rgb: 88, 101, 242;
  --cyan: #00e5ff;
  --ok: #3ddc97;
  --warn: #ffb547;
  --bad: #ff4d5e;
  --display: "Chakra Petch", "Segoe UI", sans-serif;
  --body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --r-s: 6px;
  --r-m: 10px;
  --r-l: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: radial-gradient(1100px 520px at 70% -10%, rgba(var(--accent-rgb), .13), transparent 60%), var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--body);
}
a { color: var(--accent-soft); }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.2; margin: 0 0 .6rem; letter-spacing: .01em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8rem; }
.boot { padding: 3rem; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .88em; background: rgba(255,255,255,.06); padding: .1em .35em; border-radius: 4px; }

/* ---------- Grundlayout ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); background: rgba(5, 10, 26, .75); padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: 1.25rem; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: .6rem; font: 700 1.2rem/1 var(--display); letter-spacing: .08em; padding: 0 .4rem; }
.brand svg { width: 32px; height: 32px; color: var(--accent); flex: none; }
.brand small { display: block; font-size: .7rem; color: var(--accent-soft); letter-spacing: .16em; margin-top: .25rem; }
.nav { display: flex; flex-direction: column; gap: .2rem; }
.nav button { all: unset; cursor: pointer; display: flex; align-items: center; gap: .7rem; padding: .62rem .8rem; border-radius: var(--r-m); color: var(--muted); font-weight: 600; }
.nav button:hover { background: rgba(255,255,255,.04); color: var(--text); }
.nav button.active { background: rgba(var(--accent-rgb), .16); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.nav button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav .ico { width: 1.3rem; text-align: center; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: .6rem; padding: .6rem; border: 1px solid var(--line); border-radius: var(--r-m); }
.side-foot .who { flex: 1; min-width: 0; }
.side-foot .who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--accent-rgb), .25); color: var(--text); font: 700 .9rem var(--display); flex: none; object-fit: cover; }
.main { padding: 2rem clamp(1rem, 3vw, 2.5rem) 4rem; max-width: 1400px; width: 100%; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head p { margin: 0; }
.mobile-top { display: none; }

/* ---------- Karten, Formulare ---------- */
.card { background: rgba(10, 20, 48, .82); border: 1px solid var(--line); border-radius: var(--r-l); padding: 1.25rem; }
.card + .card { margin-top: 1rem; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.stack > * + * { margin-top: .9rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field > span { font-weight: 600; font-size: .88rem; }
.field .hint { font-size: .8rem; color: var(--muted); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input:not([type]), select, textarea {
  width: 100%; background: #060d22; color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--r-s);
  padding: .6rem .7rem; font: inherit; min-width: 0;
}
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .25); }
input[type=color] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--r-s); background: #060d22; cursor: pointer; }
.check { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.counter { font-size: .75rem; color: var(--muted); text-align: right; }
.counter.over { color: var(--bad); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .6rem 1rem; border-radius: var(--r-m); border: 1px solid var(--line-strong);
  background: rgba(255,255,255,.03); color: var(--text); font: 600 .92rem var(--body); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #4752c4; }
.btn-danger { color: #ffd5d9; border-color: rgba(255, 77, 94, .5); }
.btn-danger:hover { background: rgba(255, 77, 94, .15); border-color: var(--bad); }
.btn-sm { padding: .35rem .65rem; font-size: .82rem; border-radius: var(--r-s); }
.btn-icon { padding: .35rem .5rem; }
.badge { display: inline-flex; align-items: center; gap: .35rem; font: 600 .72rem/1 var(--display); letter-spacing: .06em; text-transform: uppercase; padding: .32rem .55rem; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.badge.ok { color: var(--ok); border-color: rgba(61, 220, 151, .45); background: rgba(61, 220, 151, .08); }
.badge.warn { color: var(--warn); border-color: rgba(255, 181, 71, .45); background: rgba(255, 181, 71, .08); }
.badge.bad { color: var(--bad); border-color: rgba(255, 77, 94, .45); background: rgba(255, 77, 94, .08); }
.badge.new { color: var(--accent-soft); border-color: rgba(var(--accent-rgb), .5); background: rgba(var(--accent-rgb), .12); }

.tabs { display: inline-flex; gap: .25rem; padding: .25rem; border: 1px solid var(--line); border-radius: var(--r-m); background: rgba(255,255,255,.02); }
.tabs button { all: unset; cursor: pointer; padding: .45rem .9rem; border-radius: var(--r-s); font-weight: 600; color: var(--muted); font-size: .9rem; }
.tabs button.active { background: rgba(var(--accent-rgb), .2); color: var(--text); }
.tabs button:focus-visible { outline: 2px solid var(--accent); }
details.box { border: 1px solid var(--line); border-radius: var(--r-m); padding: .2rem .9rem; background: rgba(255,255,255,.015); }
details.box > summary { cursor: pointer; font-weight: 600; padding: .55rem 0; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.box > summary::after { content: "▾"; color: var(--muted); transition: transform .15s; }
details.box[open] > summary::after { transform: rotate(180deg); }
details.box[open] { padding-bottom: .9rem; }
.sublist { display: flex; flex-direction: column; gap: .55rem; }
.subitem { display: grid; gap: .5rem; padding: .7rem; border: 1px dashed var(--line-strong); border-radius: var(--r-s); }
.swatches { display: flex; gap: .35rem; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch[aria-pressed=true] { border-color: #fff; }
.dropzone { border: 1px dashed var(--line-strong); border-radius: var(--r-s); padding: .6rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.thumbs { display: flex; gap: .5rem; flex-wrap: wrap; }
.thumb { position: relative; width: 74px; height: 74px; border-radius: var(--r-s); overflow: hidden; border: 1px solid var(--line-strong); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 2px; right: 2px; }
.thumb .tag { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.65); font-size: .65rem; text-align: center; padding: 1px; }

/* ---------- Listen ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: .8rem; align-items: center; padding: .75rem .2rem; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 1.2rem; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r-m); }
.tree-cat { margin-top: .9rem; }
.tree-cat:first-child { margin-top: 0; }
.tree-cat > .row { font: 700 .78rem var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: .2rem .2rem; }
.tree-ch { display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem; border-radius: var(--r-s); }
.tree-ch:hover { background: rgba(255,255,255,.035); }
.tree-ch .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-ch .acts { display: flex; gap: .25rem; opacity: .35; }
.tree-ch:hover .acts, .tree-ch:focus-within .acts { opacity: 1; }
.role-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: #99aab5; }
.check-item { display: flex; gap: .7rem; align-items: flex-start; padding: .65rem 0; border-top: 1px solid var(--line); }
.check-item:first-child { border-top: 0; }
.check-item .state { flex: none; width: 1.5rem; text-align: center; font-size: 1.05rem; }
.stat { font: 700 1.8rem/1 var(--display); }
.copy-row { display: flex; gap: .4rem; }
.copy-row input { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }

/* ---------- Discord-Vorschau ---------- */
.preview-wrap { position: sticky; top: 1rem; }
.dc { background: #313338; color: #dbdee1; border-radius: var(--r-m); padding: 1rem 1rem 1.1rem; font: 16px/1.375 "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; overflow-wrap: anywhere; }
.dc-head { display: flex; align-items: center; gap: .5rem; color: #949ba4; font-size: .8rem; margin-bottom: .25rem; }
.dc-msg { display: grid; grid-template-columns: 40px 1fr; gap: 0 16px; }
.dc-ava { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; overflow: hidden; }
.dc-ava img { width: 100%; height: 100%; object-fit: cover; }
.dc-name { display: flex; align-items: center; gap: .3rem; }
.dc-name strong { color: #f2f3f5; font-weight: 600; }
.dc-app { background: #5865f2; color: #fff; font-size: .62rem; font-weight: 700; padding: 1px 4px; border-radius: 3px; text-transform: uppercase; }
.dc-time { color: #949ba4; font-size: .75rem; margin-left: .25rem; }
.dc-content { white-space: pre-wrap; margin-top: 2px; }
.dc-content p { margin: 0; }
.dc-mention { background: rgba(88, 101, 242, .3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dc-embed { margin-top: .4rem; max-width: 520px; display: grid; background: #2b2d31; border-left: 4px solid #1e1f22; border-radius: 4px; padding: .55rem 1rem .9rem .75rem; gap: .45rem; grid-template-columns: 1fr auto; }
.dc-embed > * { grid-column: 1; min-width: 0; }
.dc-embed > .full { grid-column: 1 / -1; }
.dc-embed-author { font-size: .875rem; font-weight: 600; color: #f2f3f5; }
.dc-embed-title { font-weight: 600; color: #f2f3f5; }
.dc-embed-title a { color: #00a8fc; text-decoration: none; }
.dc-embed-desc { font-size: .875rem; white-space: pre-wrap; }
.dc-embed > .dc-embed-thumb { width: 80px; height: 80px; border-radius: 4px; object-fit: cover; grid-row: 1 / span 3; grid-column: 2; margin-left: 1rem; }
.dc-embed-img { max-width: 100%; border-radius: 4px; margin-top: .2rem; }
.dc-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.dc-field { grid-column: 1 / -1; font-size: .875rem; }
.dc-field.inline { grid-column: auto; }
.dc-field b { display: block; color: #f2f3f5; font-weight: 600; margin-bottom: 2px; }
.dc-footer { font-size: .75rem; color: #b5bac1; }
.dc-buttons { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.dc-btn { display: inline-flex; align-items: center; gap: .35rem; height: 32px; padding: 0 16px; border-radius: 3px; font-size: .875rem; font-weight: 500; color: #fff; background: #4e5058; }
.dc-btn.s1 { background: #5865f2; } .dc-btn.s3 { background: #248046; } .dc-btn.s4 { background: #da373c; }
.dc-attach { max-width: 340px; border-radius: 8px; margin-top: .4rem; display: block; }
.dc-imgph { display: grid; place-items: center; min-height: 120px; background: #1e1f22; border-radius: 4px; color: #949ba4; font-size: .8rem; }
.dc code { background: #1e1f22; color: #dbdee1; }
.dc pre { background: #1e1f22; border: 1px solid #1e1f22; border-radius: 4px; padding: .5rem; margin: .3rem 0; white-space: pre-wrap; font-size: .85rem; }
.dc blockquote { margin: 0; padding-left: .7rem; border-left: 4px solid #4e5058; }
.dc h1, .dc h2, .dc h3 { font-family: inherit; color: #f2f3f5; margin: .35rem 0 .1rem; }
.dc h1 { font-size: 1.5rem; } .dc h2 { font-size: 1.25rem; } .dc h3 { font-size: 1rem; }
.dc a { color: #00a8fc; text-decoration: none; }
.dc ul { margin: .1rem 0; padding-left: 1.3rem; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.login .card { width: min(420px, 100%); padding: 2rem; }
.login .brand { justify-content: center; margin-bottom: 1.5rem; font-size: 1.5rem; }
.login .brand svg { width: 42px; height: 42px; }
.error-box { background: rgba(255, 77, 94, .1); border: 1px solid rgba(255, 77, 94, .45); color: #ffd5d9; padding: .7rem .9rem; border-radius: var(--r-s); }
.info-box { background: rgba(var(--accent-rgb), .1); border: 1px solid rgba(var(--accent-rgb), .4); padding: .7rem .9rem; border-radius: var(--r-s); font-size: .9rem; }
.warn-box { background: rgba(255, 181, 71, .08); border: 1px solid rgba(255, 181, 71, .4); padding: .7rem .9rem; border-radius: var(--r-s); font-size: .9rem; }

/* ---------- Dialog, Toasts ---------- */
dialog { border: 1px solid var(--line-strong); border-radius: var(--r-l); background: var(--surface); color: var(--text); padding: 1.5rem; width: min(460px, calc(100vw - 2rem)); }
dialog::backdrop { background: rgba(2, 5, 14, .7); backdrop-filter: blur(3px); }
#toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 50; }
.toast { background: var(--surface-2); border: 1px solid var(--line-strong); border-left: 4px solid var(--ok); padding: .7rem 1rem; border-radius: var(--r-m); box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: 380px; animation: tin .2s ease-out; }
.toast.err { border-left-color: var(--bad); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
  .preview-wrap { position: static; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.5); }
  .mobile-top { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(4, 8, 18, .92); z-index: 30; }
  .main { padding-top: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.dc-spoiler { background: #1e1f22; border-radius: 3px; padding: 0 2px; }
.dc-sub { color: #949ba4; font-size: .8rem; }
.tpl-select { width: auto; max-width: 230px; }
