*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design tokens ──────────────────────────────────────────────────────────────────── */
:root {
  --bg:           #1a1a1a;
  --surface:      #242424;
  --surface2:     #2c2c2c;
  --surface3:     #333333;
  --border:       rgba(255,255,255,0.08);
  --border-md:    rgba(255,255,255,0.14);
  --border-focus: rgba(208,132,84,0.7);
  --text:         #f0ece6;
  --muted:        #8a8a8a;
  --muted2:       #555555;
  --accent:       #d08454;
  --accent-hover: #b8703f;
  --accent-dim:   rgba(208,132,84,0.15);
  --danger:       #e05c5c;
  --danger-bg:    rgba(224,92,92,0.1);
  --success:      #4caf7d;
  --success-bg:   rgba(76,175,125,0.1);
  --amber:        #c9953a;
  --warn-bg:      rgba(201,149,58,0.1);
  --radius:       8px;
  --radius-lg:    12px;
  --radius-xl:    16px;
}

/* ── Light mode ─────────────────────────────────────────────────────────────────────── */
body.light,
html.light body {
  --bg:           #f5f4f1;
  --surface:      #ffffff;
  --surface2:     #f0ede8;
  --surface3:     #e8e4de;
  --border:       rgba(0,0,0,0.08);
  --border-md:    rgba(0,0,0,0.14);
  --border-focus: rgba(208,132,84,0.6);
  --text:         #1a1714;
  --muted:        #6b6560;
  --muted2:       #9e9890;
  --accent:       #c06830;
  --accent-hover: #a8561e;
  --accent-dim:   rgba(192,104,48,0.12);
  --danger:       #cc3333;
  --danger-bg:    rgba(204,51,51,0.08);
  --success:      #2d8f5a;
  --success-bg:   rgba(45,143,90,0.1);
  --amber:        #a07020;
  --warn-bg:      rgba(160,112,32,0.1);
}

/* ── Base ───────────────────────────────────────────────────────────────────────────────── */
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.3px; margin-bottom: 0.25rem; }
.sub { font-size: 13px; color: var(--muted); margin-bottom: 2rem; }

/* ── Topbar ────────────────────────────────────────────────────────────────────────────── */
@keyframes topbar-gradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; height: 52px;
  background: linear-gradient(57deg, #e6621c 0%, #d66f6f 25%, #a958b0 50%, #d9e7f5 75%, #d66f6f 88%, #e6621c 100%);
  background-size: 300% 300%;
  animation: topbar-gradient 20s ease infinite;
  border-bottom: none;
  position: sticky; top: 0; z-index: 10;
}
.topbar-left  { display: flex; align-items: center; gap: 10px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.wordmark { font-size: 14px; font-weight: 600; letter-spacing: -0.2px; text-decoration: none; color: var(--text); }
.wordmark-lg { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; margin-bottom: 0.25rem; color: var(--text); }
.username-badge { font-size: 12px; color: var(--muted); background: var(--surface2); border: 1px solid var(--border); padding: 3px 10px; border-radius: 99px; }
.admin-pill { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; background: var(--warn-bg); color: var(--amber); padding: 3px 9px; border-radius: 99px; }

/* ── Global reset ─────────────────────────────────────────────────────────────────────────── */
button {
  -webkit-appearance: none; appearance: none;
  background: transparent; border: none; color: inherit;
  font-family: 'Inter', sans-serif; font-size: inherit;
  cursor: pointer; padding: 0; margin: 0;
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box; -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}
input, textarea, select {
  -webkit-appearance: none; appearance: none;
  font-family: 'Inter', sans-serif; box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
* { -webkit-tap-highlight-color: transparent; }

/* ── Button system ────────────────────────────────────────────────────────────────────────── */
[class*="btn-"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  gap: 6px;
}

.btn-primary {
  height: 38px; padding: 0 16px;
  background: var(--accent); color: #fff;
  border: 1px solid transparent; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  transition: background 0.15s, box-shadow 0.15s;
}
.btn-primary:hover, .btn-primary:active {
  background: var(--accent-hover);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary-lg {
  height: 42px; width: 100%; padding: 0 16px;
  background: var(--accent); color: #fff;
  border: 1px solid transparent; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; margin-top: 0.5rem;
  transition: background 0.15s, box-shadow 0.15s;
}
.btn-primary-lg:hover, .btn-primary-lg:active {
  background: var(--accent-hover);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.btn-primary-lg:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  height: 38px; padding: 0 14px;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border-md); border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.btn-secondary:hover, .btn-secondary:active {
  background: var(--surface2); color: var(--text);
}

.btn-danger {
  height: 38px; padding: 0 14px;
  background: transparent; color: var(--danger);
  border: 1px solid rgba(224,92,92,0.3); border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  transition: background 0.12s, border-color 0.12s;
}
.btn-danger:hover, .btn-danger:active {
  background: var(--danger-bg);
  border-color: rgba(224,92,92,0.5);
}

.btn-sm {
  height: 28px; padding: 0 10px;
  background: var(--surface2); color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; font-weight: 500;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap; gap: 5px;
}
.btn-sm:hover, .btn-sm:active { background: var(--surface3); color: var(--text); }
.btn-sm.danger:hover, .btn-sm.danger:active {
  background: var(--danger-bg); color: var(--danger);
  border-color: rgba(224,92,92,0.25);
}

.btn-copy {
  height: 28px; padding: 0 10px;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(208,132,84,0.25); border-radius: 6px;
  font-size: 12px; font-weight: 600; gap: 5px;
  transition: background 0.12s;
}
.btn-copy:hover, .btn-copy:active { background: rgba(208,132,84,0.22); }

.btn-full { width: 100%; }

.btn-discord {
  height: 38px; padding: 0 16px;
  background: #5865F2; color: #fff;
  border: 1px solid transparent; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  transition: background 0.15s, box-shadow 0.15s;
}
.btn-discord:hover, .btn-discord:active {
  background: #4752c4;
  box-shadow: 0 0 0 3px rgba(88,101,242,.3);
}

.img-delete {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.7); color: #fff; border: none;
  border-radius: 6px; width: 26px; height: 26px; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s;
}
.img-card:hover .img-delete { opacity: 1; }

.editor-close {
  background: transparent; border: none; color: var(--muted);
  font-size: 16px; padding: 4px 8px; border-radius: 6px;
  transition: background 0.12s;
}
.editor-close:hover { background: var(--surface2); }

.btn-action {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 8px; height: 42px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; text-decoration: none;
  transition: background 0.15s;
}
.btn-action-primary { background: var(--accent); color: #fff; border: none; }
.btn-action-primary:hover { background: var(--accent-hover); }
.btn-action-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border-md); }
.btn-action-secondary:hover { background: var(--surface3); }

/* ── Forms ───────────────────────────────────────────────────────────────────────────────── */
label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 6px;
}
input {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--border-md); border-radius: var(--radius);
  background: var(--surface2); color: var(--text);
  font-size: 14px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-dim); }
input::placeholder { color: var(--muted2); }
input[type="text"], input[type="password"], input[type="email"], input[type="url"] { border-radius: var(--radius); }

textarea {
  -webkit-appearance: none; appearance: none;
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border-md); border-radius: var(--radius);
  background: var(--surface2) !important; color: var(--text) !important;
  font-family: 'Inter', sans-serif; font-size: 14px;
  line-height: 1.6; outline: none; resize: vertical;
  min-height: 100px;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: none;
}
textarea:focus { border-color: var(--border-focus) !important; box-shadow: 0 0 0 3px var(--accent-dim) !important; }
textarea::placeholder { color: var(--muted2); }

select {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 40px; padding: 0 36px 0 12px;
  border: 1px solid var(--border-md); border-radius: var(--radius);
  background-color: var(--surface2) !important; color: var(--text) !important;
  font-family: 'Inter', sans-serif; font-size: 14px;
  outline: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%238a8a8a' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select:focus { border-color: var(--border-focus) !important; box-shadow: 0 0 0 3px var(--accent-dim) !important; outline: none; }
select option { background: var(--surface2); color: var(--text); }

.field { margin-bottom: 1rem; }
.form-msg { font-size: 12px; margin-top: 6px; min-height: 16px; }
.form-msg.ok  { color: var(--success); }
.form-msg.err { color: var(--danger); }

/* ── Card ───────────────────────────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; max-width: 95vw; overflow: auto; }
.card-title, .section-title, .meta-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted2);
}
.card-title { margin-bottom: 1.25rem; }

/* ── Panel ───────────────────────────────────────────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.panel-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}
.panel-body { padding: 1.25rem 1.5rem; }

/* ── Scrollbar thin ──────────────────────────────────────────────────────────────────────── */
.scrollbar-thin::-webkit-scrollbar { width: 3px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 2px; }

/* ── Badges ────────────────────────────────────────────────────────────────────────────── */
.badge, .type-pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; letter-spacing: 0.03em; }
.badge-active  { background: var(--success-bg); color: var(--success); }
.badge-blocked { background: var(--danger-bg);  color: var(--danger); }
.badge-admin   { background: var(--warn-bg);    color: var(--amber); }
.badge-user    { background: var(--surface3);   color: var(--muted); }

/* ── Table ───────────────────────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted2); padding: 0 12px 10px; border-bottom: 1px solid var(--border); }
td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }
.created { font-size: 11px; color: var(--muted2); }
.uname-strong { font-weight: 600; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.no-users { text-align: center; font-size: 14px; color: var(--muted); padding: 2rem 0; }

/* ── Modal ───────────────────────────────────────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; z-index: 100; }
.overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border-md); border-radius: var(--radius-lg); padding: 1.75rem; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.modal h3 { font-size: 15px; font-weight: 600; margin-bottom: 1.25rem; }
.modal p  { font-size: 13px; color: var(--muted); margin-bottom: 1.4rem; line-height: 1.6; }
.modal p code { font-family: 'Fira Mono', monospace; font-size: 11px; background: var(--surface2); padding: 1px 5px; border-radius: 4px; color: var(--text); }
.modal-actions { display: flex; gap: 8px; margin-top: 1.25rem; flex-wrap: wrap; }
.modal-actions button { flex: 1; min-width: 100px; height: 38px; border-radius: var(--radius); font-size: 13px; font-weight: 500; cursor: pointer; background: var(--surface2); border: 1px solid var(--border-md); color: var(--muted); transition: background 0.12s; }
.modal-actions button:hover { background: var(--surface3); color: var(--text); }
.modal-actions .btn-save,
.modal-actions .btn-save-edit { background: var(--accent); color: #fff; border-color: var(--accent); }
.modal-actions .btn-save:hover,
.modal-actions .btn-save-edit:hover { opacity: 0.88; }
.modal-actions .btn-confirm-del { background: transparent; color: var(--danger); border-color: rgba(224,92,92,0.35); }
.modal-actions .btn-confirm-del:hover { background: var(--danger-bg); border-color: rgba(224,92,92,0.6); }

/* ── Toast ───────────────────────────────────────────────────────────────────────────────── */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-10px); background: var(--surface); color: var(--text); border: 1px solid var(--border-md); padding: 10px 20px; border-radius: 99px; font-size: 13px; font-weight: 500; opacity: 0; pointer-events: none; z-index: 999; transition: opacity 0.2s, transform 0.2s; white-space: nowrap; max-height: 50px; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
/* Varianten mit -- (upload.php, admin etc.) */
.toast.toast--success { background: var(--success-bg); color: var(--success); border-color: rgba(76,175,125,0.3); }
.toast.toast--error   { background: var(--danger-bg);  color: var(--danger);  border-color: rgba(224,92,92,0.3); }
/* Varianten ohne -- (db.php) */
.toast.ok  { background: var(--success-bg); color: var(--success); border-color: rgba(76,175,125,0.3); }
.toast.err { background: var(--danger-bg);  color: var(--danger);  border-color: rgba(224,92,92,0.3); }

/* ── Login / Register ───────────────────────────────────────────────────────────────────── */
body.login-page { display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--surface); border: 1px solid var(--border-md); border-radius: var(--radius-xl); padding: 2.25rem 2.5rem; width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.login-card input { height: 42px; }
.tagline { font-size: 13px; color: var(--muted); margin-bottom: 1.75rem; }
.login-error { font-size: 12px; color: var(--danger); margin-top: 0.75rem; margin-bottom: 1rem; text-align: center; }
.login-link { text-align: center; margin-top: 1rem; font-size: 13px; color: var(--muted); }
.login-link a { color: var(--accent); text-decoration: none; font-weight: 500; }
.login-link a:hover { text-decoration: underline; }
.remember-row { margin: 0.25rem 0 1rem; }
.remember-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; font-weight: 400; text-transform: none; letter-spacing: 0; }
.remember-label input[type=checkbox] { display: none; }
.remember-box { width: 15px; height: 15px; flex-shrink: 0; border: 1px solid var(--border-md); border-radius: 4px; background: var(--surface2); transition: background 0.15s, border-color 0.15s; position: relative; }
.remember-label input:checked ~ .remember-box { background: var(--accent); border-color: var(--accent); }
.remember-label input:checked ~ .remember-box::after { content: ''; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: 2px solid #fff; border-top: none; border-left: none; transform: rotate(45deg); }

/* ── Upload page ──────────────────────────────────────────────────────────────────────────── */
.main { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.drop-zone { border: 1px dashed var(--border-md); border-radius: var(--radius-lg); padding: 2.5rem 2rem; text-align: center; background: var(--surface); cursor: pointer; transition: border-color 0.15s, background 0.15s; margin-bottom: 1.5rem; }
.drop-zone:hover, .drop-zone.over { border-color: var(--accent); background: var(--accent-dim); }
.drop-icon { font-size: 28px; margin-bottom: 0.75rem; opacity: 0.25; }
.drop-label { font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.drop-hint { font-size: 12px; color: var(--muted); margin-bottom: 1.1rem; }
.drop-types { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 1.1rem; flex-wrap: wrap; }
.type-pill.img { color: var(--success); border: 1px solid rgba(76,175,125,0.25); background: rgba(76,175,125,0.07); }
.type-pill.arc { color: var(--amber);   border: 1px solid rgba(201,149,58,0.25); background: rgba(201,149,58,0.07); }
#file-input { display: none; }
.progress-wrap { margin-bottom: 1.25rem; display: none; }
.progress-bar-bg { height: 3px; background: var(--surface3); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--accent); width: 0; transition: width 0.2s; border-radius: 99px; }
.progress-label { font-size: 12px; color: var(--muted); margin-top: 7px; }
.section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 0.9rem; margin-top: 2.25rem; }
.section-count { font-size: 11px; color: var(--muted); background: var(--surface2); border: 1px solid var(--border); padding: 1px 8px; border-radius: 99px; font-weight: 600; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.img-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; position: relative; transition: border-color 0.15s; cursor: pointer; }
.img-card:hover { border-color: var(--border-md); }
.img-thumb-wrap { position: relative; overflow: hidden; aspect-ratio: 1; background: var(--surface2); }
.img-thumb { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter 0.2s; }
.img-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0); display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.img-view-btn { opacity: 0; transform: translateY(5px); transition: opacity 0.2s, transform 0.2s; background: rgba(208,132,84,0.85); color: #fff; font-size: 12px; font-weight: 600; padding: 6px 16px; border-radius: 99px; pointer-events: none; }
.img-card:hover .img-thumb    { opacity: 0.5; }
.img-card:hover .img-overlay  { background: rgba(0,0,0,0.2); }
.img-card:hover .img-view-btn { opacity: 1; transform: translateY(0); }
.img-info { padding: 10px 12px 12px; }
.img-name, .arc-name, .page-row-title, .image-original-name {
  font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.img-name { font-size: 12px; color: var(--text); margin-bottom: 4px; }
.img-meta, .arc-sub { font-size: 11px; color: var(--muted2); display: flex; align-items: center; }
.img-meta { gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.arc-sub  { gap: 8px; margin-top: 3px; }
.savings-pill { font-size: 10px; color: var(--success); background: var(--success-bg); padding: 1px 6px; border-radius: 99px; font-weight: 600; }
.img-actions { display: flex; gap: 6px; }
.arc-list { display: flex; flex-direction: column; gap: 8px; }
.arc-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; display: flex; align-items: center; gap: 12px; transition: border-color 0.15s; }
.arc-row:hover { border-color: var(--border-md); }
.arc-icon { font-size: 22px; flex-shrink: 0; }
.arc-body { flex: 1; min-width: 0; }
.arc-name { font-size: 13px; }
.arc-pill { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--warn-bg); color: var(--amber); }
.arc-actions { display: flex; gap: 6px; flex-shrink: 0; }
.empty-state { text-align: center; padding: 2rem 0; color: var(--muted); font-size: 13px; }

/* ── Tabs ───────────────────────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; margin-bottom: 1.75rem; border-bottom: 1px solid var(--border); }
.tab { background: transparent; border: none; border-bottom: 2px solid transparent; padding: 9px 16px; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: -1px; transition: color 0.15s, border-color 0.15s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }

/* ── Admin ───────────────────────────────────────────────────────────────────────────────── */
.admin-main { max-width: 1020px; margin: 0 auto; padding: 2rem 1.5rem; }
.admin-grid { display: grid; grid-template-columns: 280px 1fr; gap: 1.5rem; align-items: start; }

/* ── Pages ───────────────────────────────────────────────────────────────────────────────── */
.pages-toolbar { margin-bottom: 1.1rem; }
.pages-list { display: flex; flex-direction: column; gap: 8px; }
.page-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; display: flex; align-items: center; gap: 12px; transition: border-color 0.15s; }
.page-row:hover { border-color: var(--border-md); }
.page-row-body { flex: 1; min-width: 0; }
.page-row-title { font-size: 13px; margin-bottom: 2px; }
.page-row-url { font-size: 11px; color: var(--muted2); }
.page-slug-link { color: var(--muted); text-decoration: none; }
.page-slug-link:hover { color: var(--accent); }

/* ── Page editor ───────────────────────────────────────────────────────────────────────────── */
.page-editor { margin-top: 1.5rem; background: var(--surface); border: 1px solid var(--border-md); border-radius: var(--radius-lg); padding: 1.5rem; }
.editor-header, .modal-scrollable-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem;
}
.modal-scrollable-header { flex-shrink: 0; }
.editor-title { font-size: 15px; font-weight: 600; }
.page-textarea { width: 100%; min-height: 300px; padding: 12px; background: var(--surface2); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); font-family: 'Fira Mono', monospace; font-size: 13px; line-height: 1.6; resize: vertical; outline: none; transition: border-color 0.15s; }
.page-textarea:focus { border-color: var(--border-focus); }
.slug-preview { font-size: 11px; color: var(--muted2); margin-top: 5px; min-height: 15px; }
.editor-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 1.1rem; }

/* ── Download / Image pages ───────────────────────────────────────────────────────────────────── */
body.download-page { display: flex; flex-direction: column; min-height: 100vh; }
.download-topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem; height: 52px; background: var(--surface); border-bottom: 1px solid var(--border); }
.download-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 3rem 1.5rem; }
.download-tagline { text-align: center; padding: 2rem 1.5rem 0; font-size: clamp(18px, 4vw, 28px); font-weight: 700; letter-spacing: -0.3px; color: var(--text); opacity: 0.85; min-height: 3rem; }
.download-card { background: var(--surface); border: 1px solid var(--border-md); border-radius: var(--radius-xl); padding: 2.25rem; width: 100%; max-width: 460px; box-shadow: 0 16px 50px rgba(0,0,0,0.3); }
.file-icon-wrap { width: 60px; height: 60px; background: var(--warn-bg); border: 1px solid rgba(201,149,58,0.2); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 1.25rem; }
.ext-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; color: var(--amber); background: var(--warn-bg); border: 1px solid rgba(201,149,58,0.25); padding: 2px 9px; border-radius: 5px; margin-bottom: 0.6rem; }
.dl-filename { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.3; word-break: break-word; }
.meta { display: flex; gap: 1.5rem; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
.meta-item { display: flex; flex-direction: column; gap: 4px; }
.meta-label { font-size: 10px; }
.meta-value { font-size: 13px; font-weight: 500; }
.meta-avatar { display: inline-flex; align-items: center; gap: 6px; }
.avatar { width: 20px; height: 20px; background: var(--accent-dim); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--accent); }
.btn-download, .btn-pro {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius); font-weight: 600;
  text-decoration: none; transition: background 0.15s;
}
.btn-download:hover, .btn-pro:hover { background: var(--accent-hover); }
.btn-download { width: 100%; height: 44px; margin-top: 1.75rem; font-size: 13px; }
.btn-pro { display: inline-flex; height: 42px; padding: 0 24px; font-size: 14px; }
.state-loading { color: var(--muted); font-size: 14px; padding: 2rem; text-align: center; }
.state-error { text-align: center; padding: 2rem; }
.state-error .err-icon { font-size: 32px; margin-bottom: 1rem; opacity: 0.4; }
.state-error .err-title { font-size: 16px; font-weight: 600; margin-bottom: 0.4rem; }
.state-error .err-sub { font-size: 13px; color: var(--muted); }
.site-footer { text-align: center; padding: 1.5rem; font-size: 12px; color: var(--muted2); }
.image-card { background: var(--surface); border: 1px solid var(--border-md); border-radius: var(--radius-xl); overflow: hidden; width: 100%; max-width: 720px; box-shadow: 0 16px 50px rgba(0,0,0,0.3); }
.image-preview { display: block; width: 100%; max-height: 70vh; object-fit: contain; background: var(--bg); }
.image-meta-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--border); gap: 12px; }
.image-original-name { font-size: 12px; }
.image-size { font-size: 11px; color: var(--muted2); flex-shrink: 0; }
.image-actions { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }

/* ── Welcome / Landing ────────────────────────────────────────────────────────────────────── */
.welcome-text { font-size: clamp(20px, 5vw, 36px); font-weight: 700; letter-spacing: -0.4px; color: var(--text); text-align: center; padding: 0 1.5rem; }

/* ── API Key ───────────────────────────────────────────────────────────────────────────────── */
.api-key-card { background: var(--surface); border: 1px solid var(--border-md); border-radius: var(--radius-lg); padding: 1.1rem 1.25rem; }
.api-key-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 0.7rem; }
.api-key-value { flex: 1; font-family: 'Fira Mono', monospace; font-size: 12px; color: var(--accent); background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 11px; word-break: break-all; min-width: 0; user-select: all; }
.api-key-hint { font-size: 12px; color: var(--muted); line-height: 1.8; }
.api-key-hint code { font-family: 'Fira Mono', monospace; font-size: 11px; background: var(--surface2); padding: 1px 5px; border-radius: 4px; color: var(--text); }

/* ── Quill ───────────────────────────────────────────────────────────────────────────────── */
#quill-editor { border-radius: 0 0 var(--radius) var(--radius); }
.ql-toolbar.ql-snow { border: 1px solid var(--border-md) !important; border-bottom: none !important; border-radius: var(--radius) var(--radius) 0 0; background: var(--surface2); padding: 6px; }
.ql-container.ql-snow { border: 1px solid var(--border-md) !important; border-radius: 0 0 var(--radius) var(--radius); background: var(--surface2); font-family: 'Inter', sans-serif; font-size: 14px; min-height: 260px; }
.ql-editor { min-height: 260px; line-height: 1.7; color: var(--text); }
.ql-editor.ql-blank::before { color: var(--muted2); font-style: normal; }
.ql-snow .ql-stroke          { stroke: var(--muted) !important; }
.ql-snow .ql-fill            { fill: var(--muted) !important; }
.ql-snow .ql-picker-label    { color: var(--muted) !important; }
.ql-snow .ql-picker-options  { background: var(--surface3) !important; border-color: var(--border-md) !important; border-radius: var(--radius); }
.ql-snow .ql-picker-item     { color: var(--text) !important; }
.ql-snow .ql-picker-item:hover { background: var(--surface2) !important; }
.ql-snow.ql-toolbar button:hover .ql-stroke, .ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--accent) !important; }
.ql-snow.ql-toolbar button:hover .ql-fill,   .ql-snow.ql-toolbar button.ql-active .ql-fill   { fill: var(--accent) !important; }
.ql-snow.ql-toolbar button:hover, .ql-snow.ql-toolbar button.ql-active { background: var(--accent-dim) !important; border-radius: 4px; }
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before { content: 'H1'; }
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before { content: 'H2'; }
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before { content: 'H3'; }
.ql-snow .ql-picker.ql-header .ql-picker-label:not([data-value])::before { content: 'Text'; }
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { content: 'Überschrift 1'; font-size: 20px; font-weight: 700; }
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { content: 'Überschrift 2'; font-size: 16px; font-weight: 700; }
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { content: 'Überschrift 3'; font-size: 13px; font-weight: 700; }
.ql-snow .ql-picker.ql-header .ql-picker-item:not([data-value])::before { content: 'Normaler Text'; }
.ql-editor h1 { font-size: 24px; font-weight: 700; margin: .75em 0 .35em; }
.ql-editor h2 { font-size: 19px; font-weight: 700; margin: .75em 0 .35em; }
.ql-editor h3 { font-size: 15px; font-weight: 700; margin: .75em 0 .35em; }
.ql-editor a  { color: var(--accent); }
.ql-editor blockquote { border-left: 3px solid var(--border-md); color: var(--muted); padding-left: 1rem; margin: .5em 0; }
.ql-editor pre.ql-syntax { background: var(--bg); border-radius: 6px; color: var(--success); font-size: 13px; padding: .75rem 1rem; }
.ql-editor img { max-width: 100%; border-radius: 6px; }
.ql-snow .ql-tooltip { background: var(--surface3) !important; border-color: var(--border-md) !important; color: var(--text) !important; border-radius: var(--radius); }
.ql-snow .ql-tooltip input[type=text] { background: var(--surface2) !important; border-color: var(--border-md) !important; color: var(--text) !important; border-radius: 5px; }
.ql-snow .ql-tooltip a.ql-action, .ql-snow .ql-tooltip a.ql-remove { color: var(--accent) !important; }

/* ── Burger ───────────────────────────────────────────────────────────────────────────────── */
.burger-btn { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 34px; height: 34px; background: transparent; border: none; padding: 4px; border-radius: var(--radius); transition: background 0.12s; }
.burger-btn:hover { background: var(--surface2); }
.burger-btn span { display: block; width: 18px; height: 1.5px; background: var(--text); border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
.burger-btn.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger-btn.open span:nth-child(2) { opacity: 0; }
.burger-btn.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
.burger-drawer { display: none; position: fixed; top: 52px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); z-index: 99; flex-direction: column; padding: 0.35rem 0; box-shadow: 0 8px 20px rgba(0,0,0,0.3); }
.burger-drawer.open { display: flex; }
.burger-item { display: block; width: 100%; padding: 12px 1.5rem; font-size: 14px; font-weight: 500; color: var(--text); background: transparent; border: none; text-align: left; cursor: pointer; text-decoration: none; transition: background 0.12s; }
.burger-item:hover { background: var(--surface2); }
.burger-item.danger { color: var(--danger); }
.burger-item.danger:hover { background: var(--danger-bg); }
.burger-divider { height: 1px; background: var(--border); margin: 0.3rem 1.5rem; }

/* ── Error page ────────────────────────────────────────────────────────────────────────────── */
.error-wrap { text-align: center; max-width: 420px; }
.error-code { font-size: clamp(72px, 16vw, 120px); font-weight: 800; letter-spacing: -3px; line-height: 1; margin-bottom: 1rem; background: linear-gradient(135deg, var(--accent) 0%, var(--muted2) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.error-title { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 0.5rem; }
.error-desc { font-size: 14px; color: var(--muted); line-height: 1.7; margin-bottom: 2rem; }
.error-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.wordmark-footer { margin-top: 3rem; font-size: 12px; color: var(--muted2); }
.wordmark-footer a { color: var(--muted); text-decoration: none; font-weight: 600; }
.wordmark-footer a:hover { color: var(--text); }

/* ── Login-Log ───────────────────────────────────────────────────────────────────────────── */
.log-main { max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem; }
.log-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 1rem; flex-wrap: wrap; }
.log-filter {
  height: 32px; padding: 0 10px; font-size: 13px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); outline: none;
  width: auto;
}
.log-filter:focus { border-color: var(--border-focus); }
select.log-filter { cursor: pointer; padding-right: 28px; }
.log-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.log-table th {
  position: sticky; z-index: 2;
  text-align: left; padding: 8px 12px;
  font-size: 11px; font-weight: 600; color: var(--muted);
  background: var(--surface2); border-bottom: 1px solid var(--border-md);
  white-space: nowrap;
}
.log-table td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.log-table tr:hover td { background: rgba(255,255,255,0.02); }
.log-count { font-size: 12px; color: var(--muted2); margin-left: auto; }
.log-ts { font-family: 'Fira Mono', monospace; font-size: 11px; color: var(--muted2); white-space: nowrap; }
.log-ip { font-family: 'Fira Mono', monospace; font-size: 11px; color: var(--muted); }
.log-ua { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-family: 'Fira Mono', monospace; font-size: 11px; display: block; }

/* ── DB Viewer ───────────────────────────────────────────────────────────────────────────── */
.db-layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 52px); }
.db-sidebar { background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; padding: 1rem 0; }
.db-sidebar-title { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted2); padding: 0 1rem 0.6rem; }
.db-table-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 8px 1rem; font-size: 13px; font-weight: 500; color: var(--muted); background: transparent; border: none; cursor: pointer; transition: background 0.1s, color 0.1s; text-align: left; gap: 8px; }
.db-table-btn:hover { background: var(--surface2); color: var(--text); }
.db-table-btn.active { background: var(--accent-dim); color: var(--accent); }
.db-table-count { font-size: 11px; font-variant-numeric: tabular-nums; background: var(--surface3); border-radius: 99px; padding: 1px 7px; color: var(--muted2); flex-shrink: 0; }
.db-table-btn.active .db-table-count { background: var(--accent-dim); color: var(--accent); }
.db-main { display: flex; flex-direction: column; overflow: hidden; }
.db-toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 1.25rem; border-bottom: 1px solid var(--border); background: var(--surface); flex-shrink: 0; flex-wrap: wrap; }
.db-toolbar-title { font-size: 14px; font-weight: 600; color: var(--text); margin-right: 4px; }
.db-search { flex: 1; min-width: 120px; max-width: 280px; height: 32px; padding: 0 10px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: 13px; font-family: inherit; outline: none; transition: border-color 0.15s; }
.db-search:focus { border-color: var(--border-focus); }
.db-search::placeholder { color: var(--muted2); }
.db-toolbar-right { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.db-page-info { font-size: 12px; color: var(--muted2); white-space: nowrap; }
.db-sql-toggle { font-size: 12px; padding: 0 10px; height: 32px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); cursor: pointer; transition: background 0.12s, color 0.12s; font-family: 'Fira Mono', monospace; }
.db-sql-toggle:hover { background: var(--surface3); color: var(--text); }
.db-sql-toggle.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.db-sql-panel { background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 1.25rem; display: none; flex-shrink: 0; }
.db-sql-panel.open { display: block; }
.db-sql-row { display: flex; gap: 8px; align-items: flex-start; }
.db-sql-input { flex: 1; font-family: 'Fira Mono', monospace; font-size: 13px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); padding: 8px 10px; resize: vertical; min-height: 60px; outline: none; transition: border-color 0.15s; line-height: 1.5; }
.db-sql-input:focus { border-color: var(--border-focus); }
.db-sql-hint { font-size: 11px; color: var(--muted2); margin-top: 6px; }
.db-sql-hint code { font-family: 'Fira Mono', monospace; background: var(--surface3); padding: 1px 5px; border-radius: 4px; }
.db-sql-result { margin-top: 10px; font-size: 12px; font-family: 'Fira Mono', monospace; color: var(--muted); background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; max-height: 160px; overflow: auto; display: none; white-space: pre; }
.db-sql-result.visible { display: block; }
.db-sql-result.err { color: var(--danger); }
.db-sql-result.ok  { color: var(--success); }
.db-table-wrap { flex: 1; overflow: auto; }
.db-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.db-table th { position: sticky; top: 0; z-index: 2; background: var(--surface2); border-bottom: 1px solid var(--border-md); padding: 8px 12px; text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; user-select: none; }
.db-table td { padding: 7px 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: top; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-table tr:hover td { background: rgba(255,255,255,0.02); }
.db-table td.null-val { color: var(--muted2); font-style: italic; font-size: 11px; }
.db-table td.num-val  { color: var(--accent); font-family: 'Fira Mono', monospace; }
.db-table td.actions-col { white-space: nowrap; width: 1%; }
.db-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 240px; color: var(--muted); font-size: 13px; }
.db-state-icon { font-size: 28px; opacity: 0.3; }
.db-pagination { display: flex; align-items: center; gap: 6px; }
/* Edit-Modal Felder (Fira Mono, kompakter als globale inputs) */
.edit-field { margin-bottom: 10px; }
.edit-field label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 4px; font-family: 'Fira Mono', monospace; text-transform: uppercase; letter-spacing: 0.04em; }
.edit-field input, .edit-field textarea { width: 100%; box-sizing: border-box; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: 12px; font-family: 'Fira Mono', monospace; padding: 6px 9px; outline: none; transition: border-color 0.15s; }
.edit-field input:focus, .edit-field textarea:focus { border-color: var(--border-focus); }
.edit-field textarea { resize: vertical; min-height: 56px; line-height: 1.5; }
.null-toggle { font-size: 11px; color: var(--muted2); margin-top: 3px; display: flex; align-items: center; gap: 5px; cursor: pointer; }
.null-toggle input[type=checkbox] { width: auto; }
.edit-err { font-size: 12px; color: var(--danger); margin-top: 8px; display: none; }

/* ── Discord Panel ────────────────────────────────────────────────────────────────────────── */
:root { --discord-bg: #36393f; --discord-embed-bg: #2f3136; }

.dc-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: calc(100vh - 52px);
}

.dc-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.dc-form-block {
  padding: 0 1.25rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dc-form-block label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted2);
  margin-bottom: 3px;
}

.dc-form-block input,
.dc-form-block textarea,
.dc-form-block select {
  font-size: 13px;
  margin: 0;
}

.dc-form-block textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
  font-family: inherit;
}

.dc-color-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dc-color-row input[type="color"] {
  width: 40px;
  height: 36px;
  padding: 2px 4px;
  border-radius: var(--radius);
  border: 1px solid var(--border-md);
  background: var(--surface2);
  cursor: pointer;
  flex-shrink: 0;
}

.dc-color-hex {
  flex: 1;
  font-family: 'Fira Mono', monospace;
  font-size: 13px;
}

.dc-color-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.dc-preset-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.dc-preset-swatch:hover,
.dc-preset-swatch.active {
  transform: scale(1.2);
  border-color: var(--text);
}

.dc-field-row {
  display: flex;
  gap: 8px;
}

.dc-field-row > * { flex: 1; }

.dc-inline-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.dc-inline-toggle input { width: auto; margin: 0; }

.dc-main-area {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.75rem;
  gap: 1.25rem;
}

.dc-preview {
  background: var(--discord-bg);
  border-radius: 8px;
  padding: 20px;
  min-height: 200px;
  font-family: 'Whitney', 'Inter', sans-serif;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.dc-msg {
  display: flex;
  gap: 14px;
  animation: fadeUp 0.2s ease;
}

.dc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #5865F2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
}

.dc-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.dc-content { flex: 1; min-width: 0; }
.dc-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.dc-name { font-weight: 600; color: #fff; font-size: 15px; }

.dc-bot-badge {
  background: #5865F2;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dc-time { font-size: 11px; color: #72767d; }

.dc-embed {
  border-radius: 4px;
  overflow: hidden;
  background: var(--discord-embed-bg);
  max-width: 520px;
  display: flex;
  margin-top: 4px;
}

.dc-accent-bar { width: 4px; flex-shrink: 0; }

.dc-embed-body {
  padding: 12px 14px 14px;
  flex: 1;
  min-width: 0;
}

.dc-author-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.dc-author-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #72767d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.dc-author-icon img { width: 100%; height: 100%; object-fit: cover; }
.dc-author-name { font-size: 12px; font-weight: 600; color: #dcddde; }
.dc-author-name a { color: inherit; text-decoration: none; }
.dc-author-name a:hover { text-decoration: underline; }

.dc-embed-title {
  font-size: 15px;
  font-weight: 700;
  color: #00b0f4;
  margin-bottom: 8px;
  line-height: 1.4;
  word-break: break-word;
}

.dc-embed-title a { color: inherit; text-decoration: none; }
.dc-embed-title a:hover { text-decoration: underline; }

.dc-embed-desc {
  font-size: 13px;
  color: #dcddde;
  line-height: 1.6;
  margin-bottom: 12px;
  word-break: break-word;
  white-space: pre-wrap;
}

.dc-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.dc-field { min-width: 0; }
.dc-field-name { font-size: 12px; font-weight: 700; color: #dcddde; margin-bottom: 2px; }
.dc-field-value { font-size: 13px; color: #b9bbbe; }

.dc-image {
  width: 100%;
  border-radius: 4px;
  max-height: 300px;
  object-fit: cover;
  margin-bottom: 12px;
}

.dc-thumbnail {
  width: 80px;
  height: 80px;
  border-radius: 4px;
  object-fit: cover;
  float: right;
  margin-left: 12px;
  flex-shrink: 0;
}

.dc-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.dc-footer-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #72767d;
}

.dc-footer-icon img { width: 100%; height: 100%; object-fit: cover; }
.dc-footer-text { font-size: 11px; color: #72767d; flex: 1; min-width: 0; }

.dc-send-log {
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.dc-log-entry {
  padding: 7px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-family: 'Fira Mono', monospace;
  animation: fadeUp 0.2s ease;
}

.dc-log-time { color: var(--muted2); white-space: nowrap; }
.dc-log-ok   { color: #4caf7d; }
.dc-log-err  { color: #e05c5c; }
.dc-log-info { color: var(--accent); }

.dc-webhook-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px solid var(--border);
  margin-top: 4px;
}

.dc-webhook-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted2);
  flex-shrink: 0;
}

.dc-webhook-dot.ok  { background: #4caf7d; }
.dc-webhook-dot.err { background: #e05c5c; }

.dc-fields-editor .dc-field-entry {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 8px;
  position: relative;
}

.dc-field-entry-inner { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.dc-field-entry-inner input { margin: 0; font-size: 12px; }

.dc-field-remove {
  background: var(--danger-bg);
  border: none;
  color: var(--danger);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition: background 0.15s;
}
.dc-field-remove:hover { background: rgba(224,92,92,.25); }

/* ── Mobile ───────────────────────────────────────────────────────────────────────────────── */
@media (max-width: 800px) {
  .dc-layout { grid-template-columns: 1fr; }
  .dc-sidebar { border-right: none; border-bottom: 1px solid var(--border); max-height: none; }
  .dc-fields { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  input, textarea, select { font-size: 16px !important; }
  .username-badge { display: none; }
  .topbar { padding: 0 1rem; }
  .topbar-right { gap: 6px; }
  .topbar > .btn-secondary { display: none; }
  #topbar-action .btn-secondary { display: none; }
  body.login-page { align-items: flex-start; }
  .login-card { width: 100%; border-radius: 0; border-left: none; border-right: none; min-height: 100vh; box-shadow: none; padding: 2rem 1.25rem; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-main { padding: 1.5rem 1rem; }
  .main { padding: 1.5rem 1rem 3rem; }
  .arc-row { flex-wrap: wrap; }
  .arc-actions { width: 100%; margin-top: 8px; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .modal { width: calc(100vw - 2rem); }
  .download-card { padding: 1.5rem; }
  .image-card { border-radius: var(--radius-lg); }
  .toast { left: 1rem; right: 1rem; transform: translateY(-10px); width: auto; white-space: normal; text-align: center; }
  .toast.show { transform: translateY(0); }
  .image-actions { flex-direction: column; }
  .meta { gap: 1rem; }
  .page-row { flex-wrap: wrap; }
  .page-row .arc-actions { margin-top: 8px; }
  .log-filter { font-size: 16px !important; }
  /* DB Viewer mobile */
  .db-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .db-sidebar { border-right: none; border-bottom: 1px solid var(--border); padding: 0.5rem 0; display: flex; flex-direction: row; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .db-sidebar-title { display: none; }
  .db-table-btn { display: inline-flex; width: auto; flex-shrink: 0; padding: 8px 14px; border-bottom: 2px solid transparent; }
  .db-table-btn.active { border-bottom-color: var(--accent); background: var(--accent-dim); }
  .db-search { max-width: 100%; flex: 1 1 100%; order: 2; }
  .db-toolbar-title { order: 1; }
  .db-sql-toggle { order: 3; }
  .db-toolbar-right { order: 4; width: 100%; justify-content: space-between; margin-left: 0; }
  .db-sql-row { flex-direction: column; }
  .db-sql-input { min-height: 48px; }
  .db-table td { max-width: 120px; }
  .db-table td.actions-col { white-space: normal; }
  .db-table td.actions-col .btn-sm { display: block; width: 100%; margin-bottom: 3px; text-align: center; }
  .db-table td.actions-col .btn-sm:last-child { margin-bottom: 0; }
}
@media (max-width: 380px) {
  .gallery { grid-template-columns: 1fr; }
  h1 { font-size: 20px; }
}

/* ── Video type pill ──────────────────────────────────────────────────────────────────────────── */
.type-pill.vid { color: #818cf8; border: 1px solid rgba(129,140,248,0.25); background: rgba(129,140,248,0.07); }

/* ── Register hint ───────────────────────────────────────────────────────────────────────────── */
.register-hint {
  margin-top: 1.5rem;
  font-size: 12px;
  color: var(--muted2);
  text-align: center;
  line-height: 1.6;
}

/* ── Scrollable modal variant ────────────────────────────────────────────────────────────────────────── */
.modal-scrollable {
  width: 600px;
  max-width: calc(100vw - 2rem);
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}
.modal-scrollable-body {
  overflow-y: auto;
  flex: 1;
  padding-right: 4px;
  line-height: 1.75;
  font-size: 14px;
}

/* ── Section head spacing variants ────────────────────────────────────────────────────────────────────── */
.section-head--md { margin-top: 2.5rem; }
.section-head--lg { margin-top: 3rem; }

/* ── Code / monospace input ──────────────────────────────────────────────────────────────────────────── */
.input-code {
  font-family: 'Fira Mono', 'Courier New', monospace;
  font-size: 12px;
}

/* ── Admin API-key row ───────────────────────────────────────────────────────────────────────────── */
.apikey-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.apikey-row .btn-sm { flex-shrink: 0; }

/* ── Admin card with two sections ────────────────────────────────────────────────────────────────────────── */
.card-divided {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.card-section + .card-section {
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
  padding-top: 1.5rem;
}

/* ── Content (Quill output) ──────────────────────────────────────────────────────────────────────────── */
.page-content { color: var(--text); font-size: 14px; line-height: 1.75; }
.page-content p   { margin: 0 0 1em; }
.page-content h1, .page-content h2, .page-content h3,
.page-content h4, .page-content h5, .page-content h6 {
  font-weight: 700; margin: 1.5em 0 0.5em; letter-spacing: -0.2px; color: var(--text);
}
.page-content h1 { font-size: 1.8em; }
.page-content h2 { font-size: 1.4em; }
.page-content h3 { font-size: 1.1em; }
.page-content a   { color: var(--accent); text-decoration: underline; }
.page-content a:hover { opacity: 0.8; }
.page-content strong, .page-content b { font-weight: 700; }
.page-content em, .page-content i     { font-style: italic; }
.page-content u   { text-decoration: underline; }
.page-content s   { text-decoration: line-through; }
.page-content hr  { border: none; border-top: 1px solid var(--border); margin: 1.5em 0; }
.page-content img { max-width: 100%; border-radius: 8px; margin: 0.5em 0; display: block; }
.page-content ul, .page-content ol { margin: 0.5em 0 1em 1.75em; }
.page-content ul { list-style-type: disc; }
.page-content ol { list-style-type: decimal; }
.page-content li { margin-bottom: 0.25em; }
.page-content blockquote { border-left: 3px solid var(--border-md); padding-left: 1rem; color: var(--muted); margin: 1em 0; font-style: italic; }
.page-content pre { font-family: 'Fira Mono', monospace; background: var(--surface2); color: var(--success); border: 1px solid var(--border-md); border-radius: var(--radius); padding: 1rem; overflow-x: auto; margin: 1em 0; font-size: 13px; white-space: pre; line-height: 1.6; }
.page-content pre.ql-syntax { background: var(--surface2); color: var(--success); border-radius: var(--radius); padding: 1rem; font-size: 13px; font-family: 'Fira Mono', monospace; overflow-x: auto; margin: 1em 0; white-space: pre-wrap; }
.page-content code { font-family: 'Fira Mono', monospace; background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; font-size: 13px; }
.page-content pre code { background: none; border: none; padding: 0; border-radius: 0; }
.page-content table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.page-content th, .page-content td { padding: 8px 12px; border: 1px solid var(--border-md); font-size: 13px; }
.page-content th { background: var(--surface2); color: var(--muted); font-weight: 600; }
.page-content .ql-align-center  { text-align: center; }
.page-content .ql-align-right   { text-align: right; }
.page-content .ql-align-justify { text-align: justify; }
.page-content .ql-indent-1 { padding-left: 2em; }
.page-content .ql-indent-2 { padding-left: 4em; }
.page-content .ql-indent-3 { padding-left: 6em; }
.page-content ol > li { list-style-type: decimal; }

/* ── Topbar gradient overrides ──────────────────────────────────────────────────────────────────────────── */
.topbar .wordmark,
.topbar .wordmark-lg { color: #fff; }
.topbar .username-badge {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  color: #fff;
}
.topbar .btn-ghost,
.topbar .btn-secondary {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  color: #fff;
}
.topbar .btn-ghost:hover,
.topbar .btn-secondary:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
}
.topbar .btn-danger {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.3);
  color: #fff;
}
.topbar .btn-danger:hover { background: rgba(255,255,255,0.2); }
.topbar .admin-pill {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
.topbar .burger-btn span { background: #fff; }

/* ── Theme toggle button ──────────────────────────────────────────────────────────────────────────────── */
.btn-theme {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius);
  color: #fff; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: background 0.15s;
  white-space: nowrap;
}
.btn-theme:hover { background: rgba(255,255,255,0.25); }

/* ════════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Keyframes ──────────────────────────────────────────────────────────────── */
@keyframes page-enter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes modal-enter {
  from { opacity: 0; transform: scale(0.95) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes drawer-enter {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Page-load: .main, .login-card, .download-card, .image-card ─────────────── */
.main,
.login-card,
.download-card,
.image-card,
.admin-main {
  animation: page-enter 0.28s ease both;
}

/* ── Buttons: lift on hover, press on active ─────────────────────────────────── */
.btn-primary,
.btn-primary-lg,
.btn-discord,
.btn-download,
.btn-pro {
  transition: background 0.15s, box-shadow 0.15s, transform 0.12s;
}
.btn-primary:hover:not(:disabled),
.btn-primary-lg:hover:not(:disabled),
.btn-discord:hover,
.btn-download:hover,
.btn-pro:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.btn-primary:active:not(:disabled),
.btn-primary-lg:active:not(:disabled),
.btn-discord:active,
.btn-download:active,
.btn-pro:active {
  transform: scale(0.97) translateY(0);
  box-shadow: none;
}

.btn-secondary,
.btn-danger,
.btn-sm,
.btn-copy,
.btn-action,
.btn-theme {
  transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.1s, box-shadow 0.1s;
}
.btn-secondary:hover,
.btn-danger:hover,
.btn-sm:hover,
.btn-copy:hover,
.btn-action:hover,
.btn-theme:hover {
  transform: translateY(-1px);
}
.btn-secondary:active,
.btn-danger:active,
.btn-sm:active,
.btn-copy:active,
.btn-action:active,
.btn-theme:active {
  transform: scale(0.97);
}

/* ── Cards: lift + shadow on hover ──────────────────────────────────────────── */
.img-card {
  transition: border-color 0.15s, transform 0.18s, box-shadow 0.18s;
}
.img-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.arc-row,
.page-row {
  transition: border-color 0.15s, transform 0.18s, box-shadow 0.18s;
}
.arc-row:hover,
.page-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

/* ── Image thumb: zoom on hover ──────────────────────────────────────────────── */
.img-thumb {
  transition: transform 0.3s ease, filter 0.2s, opacity 0.2s;
}
.img-card:hover .img-thumb {
  transform: scale(1.04);
}

/* ── Modal: animate in when .open is added ───────────────────────────────────── */
.overlay.open .modal,
.overlay.open .modal-scrollable {
  animation: modal-enter 0.22s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

/* ── Burger drawer: slide in ────────────────────────────────────────────────── */
.burger-drawer.open {
  animation: drawer-enter 0.18s ease both;
}

/* ── Drop-zone: subtle scale on hover/drag ───────────────────────────────────── */
.drop-zone {
  transition: border-color 0.15s, background 0.15s, transform 0.18s;
}
.drop-zone:hover,
.drop-zone.over {
  transform: scale(1.012);
}

/* ── Tabs: animated underline via transform ──────────────────────────────────── */
.tab {
  position: relative;
  border-bottom: none !important;
}
.tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}
.tab.active::after {
  transform: scaleX(1);
}
.tab:hover::after {
  transform: scaleX(0.4);
  background: var(--muted2);
}
.tab.active:hover::after {
  transform: scaleX(1);
  background: var(--accent);
}

/* ── Respect prefers-reduced-motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
