/* WeLoveChat — Themes (Standard: Rose Dark) */

:root,
[data-theme="rose"] {
  --bg: #121014;
  --bg-2: #1a151c;
  --bg-3: #211b24;
  --bg-hover: #2a222f;
  --accent: #e8a0bf;
  --accent-2: #d484a8;
  --accent-soft: rgba(232, 160, 191, 0.14);
  --text: #f6eef2;
  --muted: #b9a8b2;
  --danger: #f07178;
  --ok: #7dcea0;
  --border: #2c2430;
  --composer: #2a232e;
  --avatar: #c97b9b;
  --glow: rgba(232, 160, 191, 0.18);
  --radius: 10px;
  --sidebar: 260px;
  --font: "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
}

[data-theme="midnight"] {
  --bg: #0b0e14;
  --bg-2: #111722;
  --bg-3: #161d2b;
  --bg-hover: #1c2536;
  --accent: #7aa2ff;
  --accent-2: #5b86e5;
  --accent-soft: rgba(122, 162, 255, 0.14);
  --text: #e8eefc;
  --muted: #8b97b0;
  --danger: #ff6b7a;
  --ok: #5ddea5;
  --border: #1e2738;
  --composer: #1a2232;
  --avatar: #5b7fd6;
  --glow: rgba(122, 162, 255, 0.16);
}

[data-theme="slate"] {
  --bg: #0f1110;
  --bg-2: #171a18;
  --bg-3: #1d221f;
  --bg-hover: #262c28;
  --accent: #9fd4b0;
  --accent-2: #7fbe94;
  --accent-soft: rgba(159, 212, 176, 0.14);
  --text: #eef3ef;
  --muted: #9aaba0;
  --danger: #e88a8a;
  --ok: #8fd4a4;
  --border: #27302a;
  --composer: #232a26;
  --avatar: #6fa884;
  --glow: rgba(159, 212, 176, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; height: 100dvh; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--accent); color: #1a1014; border: 0;
  padding: .55rem 1rem; border-radius: var(--radius);
  cursor: pointer; font-weight: 650; font-size: .88rem;
  transition: background .15s ease, transform .1s ease;
}
.btn:hover { background: var(--accent-2); }
.btn:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent; border: 1px solid var(--border); color: var(--text);
}
.btn-ghost:hover { background: var(--bg-hover); border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--danger); color: #1a0a0a; }
.btn-sm { padding: .35rem .7rem; font-size: .78rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

input, textarea, select {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: .65rem .75rem; font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { min-height: 90px; resize: vertical; }
label { display: block; margin: .6rem 0 .25rem; color: var(--muted); font-size: .82rem; }

.flash { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.flash.ok { background: rgba(125, 206, 160, 0.12); color: var(--ok); border: 1px solid rgba(125,206,160,.25); }
.flash.err { background: rgba(240, 113, 120, 0.12); color: #ffb4b8; border: 1px solid rgba(240,113,120,.25); }

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background:
    radial-gradient(900px 500px at 15% 10%, var(--glow), transparent 55%),
    radial-gradient(700px 400px at 90% 85%, rgba(80,40,70,.35), transparent 50%),
    var(--bg);
  padding: 1.5rem 1.25rem 2.5rem;
}
.login-shell {
  width: min(720px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}
.login-card {
  width: min(400px, 100%);
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  padding: 2rem 1.75rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0,0,0,.45), 0 0 0 1px var(--accent-soft);
}
.login-card h1 {
  font-size: 1.85rem; margin-bottom: 1.35rem;
  background: linear-gradient(90deg, var(--text), var(--accent));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.login-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.login-logo {
  width: min(220px, 70vw);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  border-radius: 70%;
}
.login-card form > * + * { margin-top: .75rem; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 1.1rem; }

/* Downloads / Mobile install */
.download-desktop,
.download-mobile {
  width: 100%;
  background: linear-gradient(180deg, rgba(33,27,36,.92), rgba(26,21,28,.95));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.35rem 1.4rem;
  box-shadow: 0 12px 30px rgba(0,0,0,.28);
}
.download-desktop h2,
.download-mobile h2 {
  font-size: 1.05rem;
  margin-bottom: .85rem;
  text-align: center;
}
.download-lead {
  color: var(--muted);
  font-size: .88rem;
  margin-bottom: 1rem;
}
.download-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
}
.download-btn {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  padding: .85rem .9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.download-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.dl-icon {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}
.dl-icon--linux .dl-tux {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
}
.dl-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.dl-text strong { font-size: .95rem; }
.dl-text small { color: var(--muted); font-size: .72rem; }

.mobile-guide {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .9rem 1rem;
  margin-bottom: .65rem;
}
.mobile-guide:last-child { margin-bottom: 0; }
.guide-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #1a1014;
  background: var(--accent);
  border-radius: 999px;
  padding: .2rem .55rem;
  margin-bottom: .55rem;
}
.mobile-guide ol {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text);
  font-size: .88rem;
}
.mobile-guide li + li { margin-top: .4rem; }
.mobile-guide strong { color: var(--accent); }

/* Show desktop downloads only on larger screens; mobile guide only on small */
.download-desktop { display: none; }
.download-mobile { display: block; }
@media (min-width: 768px) {
  .download-desktop { display: block; }
  .download-mobile { display: none; }
}
@media (max-width: 700px) {
  .download-grid { grid-template-columns: 1fr; }
}

/* Coming-soon modal */
.dl-modal[hidden] { display: none !important; }
.dl-modal {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 1rem;
}
.dl-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(8, 6, 10, 0.72);
  backdrop-filter: blur(4px);
}
.dl-modal-card {
  position: relative;
  width: min(440px, 100%);
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem 1.4rem 1.35rem;
  box-shadow: 0 24px 60px rgba(0,0,0,.5), 0 0 0 1px var(--accent-soft);
  text-align: center;
}
.dl-modal-icon { font-size: 1.75rem; margin-bottom: .5rem; }
.dl-modal-card h3 {
  font-size: 1.15rem;
  margin-bottom: .65rem;
  color: var(--accent);
}
.dl-modal-card p {
  color: var(--muted);
  font-size: .92rem;
  margin-bottom: 1.15rem;
  line-height: 1.5;
}
.dl-modal-card p strong { color: var(--text); }
.dl-modal-card .btn { width: 100%; justify-content: center; }

/* App shell */
.app {
  display: grid;
  grid-template-columns: 72px var(--sidebar) 1fr;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
.rail {
  background: color-mix(in srgb, var(--bg) 72%, #000);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
  padding: .65rem .35rem;
  z-index: 5;
  overflow: hidden;
}
.rail-logo-wrap {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-bottom: .15rem;
  background: transparent;
  border: none;
}
.rail-logo-full {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.45));
  display: block;
}
.rail-sep {
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: var(--border);
  flex-shrink: 0;
  margin: .15rem 0;
}
.rail-btn,
.rail-logo-wrap {
  position: relative;
}
.rail-btn[data-tip]::after,
.rail-logo-wrap[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: #111;
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  padding: .35rem .55rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
  z-index: 50;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.rail-btn:hover[data-tip]::after,
.rail-logo-wrap:hover[data-tip]::after {
  opacity: 1;
}
.channel-item[data-tip] {
  position: relative;
}
.channel-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.dm-section-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  padding: .65rem .9rem .25rem;
  font-weight: 700;
}
.rail-teams {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
  overflow-y: auto;
  flex: 1;
  width: 100%;
  padding-bottom: .5rem;
  scrollbar-width: none;
}
.rail-teams::-webkit-scrollbar { display: none; }
.rail-btn {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  position: relative;
  transition: border-radius .15s, background .15s;
  flex-shrink: 0;
}
.rail-btn:hover, .rail-btn.active {
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.rail-btn.muted { opacity: .45; pointer-events: none; }
.rail-team-letter {
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1;
}
.rail-dm-icon { font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.rail-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: #e11d48;
  color: #fff;
  font-size: .65rem;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 4px;
}
.sidebar {
  background: var(--bg-2);
  display: flex; flex-direction: column;

  border-right: 1px solid var(--border);
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.brand {
  padding: 1rem 1.1rem;
  font-weight: 800; letter-spacing: .01em;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0;
}
.brand-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
}
.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 70%;
}
.brand small { color: var(--muted); font-weight: 500; display: block; margin-top: .15rem; }
.team-select { padding: .85rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.channel-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: .55rem;
  -webkit-overflow-scrolling: touch;
}
.channel-list h3 {
  color: var(--muted); font-size: .68rem; text-transform: uppercase;
  letter-spacing: .07em; padding: .55rem .55rem .3rem; display: flex;
  justify-content: space-between; align-items: center;
}
.channel-item {
  display: flex; align-items: center; gap: .4rem;
  padding: .48rem .65rem; border-radius: 8px; color: var(--muted);
  cursor: pointer; user-select: none; text-decoration: none;
}
.channel-item:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.channel-item.active {
  background: var(--accent-soft); color: var(--text);
  box-shadow: inset 2px 0 0 var(--accent);
}
.channel-item .hash { opacity: .55; color: inherit; }

.settings-block {
  border-top: 1px solid var(--border);
  padding: .65rem .85rem;
  background: rgba(0,0,0,.12);
  flex-shrink: 0;
}
.theme-grid { display: grid; grid-template-columns: 1fr; gap: .4rem; }
.theme-option {
  display: flex; align-items: center; gap: .55rem;
  padding: .45rem .55rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); cursor: pointer; color: var(--text); font-size: .82rem;
  width: 100%; text-align: left;
}
.theme-option:hover { border-color: var(--accent); }
.theme-option.active { border-color: var(--accent); background: var(--accent-soft); }
.theme-swatch {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.2); flex-shrink: 0;
}
.theme-swatch.rose { background: linear-gradient(135deg, #1a151c, #e8a0bf); }
.theme-swatch.midnight { background: linear-gradient(135deg, #111722, #7aa2ff); }
.theme-swatch.slate { background: linear-gradient(135deg, #171a18, #9fd4b0); }

.user-panel {
  border-top: 1px solid var(--border); padding: .75rem .85rem;
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  background: #100e12;
  flex-shrink: 0;
}
[data-theme="midnight"] .user-panel { background: #0c1018; }
[data-theme="slate"] .user-panel { background: #0d100e; }
.user-panel .meta { font-size: .85rem; }
.user-panel .meta span { color: var(--muted); display: block; font-size: .72rem; }

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg-3);
}
.topbar {
  min-height: 52px; display: flex; align-items: center; gap: .75rem;
  padding: .4rem 1rem; border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,.12); backdrop-filter: blur(8px);
  flex-shrink: 0;
}
.topbar h2 { font-size: 1rem; font-weight: 700; }
.topbar nav { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
#btn-open-side { display: none; }

.news-panel {
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  max-height: 140px;
  overflow-y: auto;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
}

.chat-scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  -webkit-overflow-scrolling: touch;
}
.msg { display: grid; grid-template-columns: 40px 1fr; gap: .75rem; flex-shrink: 0; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--avatar); color: #1a1014;
  display: grid; place-items: center;
  font-weight: 750; font-size: .85rem;
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.msg-head { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.msg-head .name { font-weight: 700; }
.msg-head .realname { color: var(--accent); font-weight: 550; font-size: .85rem; }
.msg-head .time { color: var(--muted); font-size: .72rem; }
.msg-body { white-space: pre-wrap; word-break: break-word; color: #efe6eb; }
[data-theme="midnight"] .msg-body { color: #e3e9f8; }
[data-theme="slate"] .msg-body { color: #e7efe9; }
.msg-body img {
  max-width: min(360px, 100%);
  border-radius: 10px;
  margin-top: .4rem;
  display: block;
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: opacity .15s ease;
}
.msg-body img:hover { opacity: .92; }

.composer {
  padding: .75rem 1rem 1rem;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--bg-3);
}
.composer-box {
  background: var(--composer); border-radius: 12px; padding: .55rem .8rem;
  display: flex; flex-direction: column; gap: .4rem;
  border: 1px solid var(--border);
}
.composer-box textarea {
  background: transparent; border: 0; min-height: 44px; max-height: 160px;
  padding: .35rem 0; resize: none; box-shadow: none;
}
.composer-box textarea:focus { box-shadow: none; border: 0; }
.composer-actions { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.composer-hint { color: var(--muted); font-size: .72rem; }
.readonly-banner {
  background: var(--accent-soft); color: var(--accent);
  padding: .8rem 1rem; border-radius: 10px; text-align: center; font-size: .9rem;
  border: 1px solid var(--border);
}

.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
.admin-wrap h1 { margin-bottom: .25rem; }
.admin-wrap .lead { color: var(--muted); margin-bottom: 1.25rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 900px) {
  .app {
    grid-template-columns: 64px 1fr;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
  }
  .rail { z-index: 30; }
  .sidebar { display: none; }
  .sidebar.open {
    display: flex;
    position: fixed;
    inset: 0 0 0 64px;
    z-index: 20;
    width: min(88vw, 300px);
    height: 100%;
    max-height: 100dvh;
    box-shadow: 8px 0 30px rgba(0,0,0,.45);
  }
  .topbar {
    min-height: 48px;
    padding: .35rem .7rem;
    gap: .45rem;
  }
  .topbar h2 {
    font-size: .92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 42vw;
  }
  .topbar nav {
    gap: .35rem;
  }
  .topbar nav .btn {
    padding: .3rem .55rem;
    font-size: .72rem;
  }
  .news-panel {
    max-height: 96px;
    padding: .55rem .75rem;
  }
  .news-item {
    padding: .55rem;
    font-size: .85rem;
    margin-bottom: .35rem;
  }
  .messages {
    padding: .75rem .8rem 1rem;
    gap: .75rem;
  }
  .msg {
    grid-template-columns: 34px 1fr;
    gap: .55rem;
  }
  .avatar {
    width: 34px;
    height: 34px;
    font-size: .75rem;
  }
  .msg-head .realname { display: none; }
  .msg-body img { max-width: min(100%, 280px); }
  .composer {
    padding: .55rem .7rem calc(.7rem + env(safe-area-inset-bottom, 0px));
  }
  .composer-box { padding: .45rem .65rem; border-radius: 10px; }
  .composer-box textarea { min-height: 38px; font-size: 16px; /* verhindert iOS-Zoom */ }
  .composer-hint { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  #btn-open-side { display: inline-flex !important; }
}
.card {
  background: var(--bg-2); border-radius: 12px; padding: 1rem;
  border: 1px solid var(--border);
}
.card h2 { font-size: 1rem; margin-bottom: .75rem; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; font-size: .72rem; text-transform: uppercase; }
.badge {
  display: inline-block; padding: .15rem .45rem; border-radius: 999px;
  background: var(--bg-hover); font-size: .68rem; color: var(--muted);
}
.badge.admin { background: var(--accent-soft); color: var(--accent); }
.badge.megaadmin { background: rgba(235, 69, 158, 0.2); color: #f5a0cf; }
.badge.assistant { background: rgba(125, 206, 160, 0.15); color: var(--ok); }
.badge.moderator { background: rgba(240, 200, 100, 0.15); color: #f0d27a; }
.perms { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.perms label { display: flex; gap: .35rem; align-items: center; margin: 0; color: var(--text); }
.perms input { width: auto; }

.news-item { background: var(--bg-2); padding: .75rem; border-radius: 10px; margin-bottom: .5rem; border: 1px solid var(--border); }
.news-item strong { display: block; margin-bottom: .25rem; }
.news-item small { color: var(--muted); }

.channel-swatch {
  width: 22px;
  height: 22px;
  min-width: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
  background-repeat: no-repeat;
}
.channel-swatch.has-img {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.75);
}
.msg-actions {
  display: flex;
  gap: .35rem;
  margin-top: .35rem;
  opacity: .7;
}
.msg:hover .msg-actions { opacity: 1; }
.ad-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(900px 500px at 15% 10%, var(--glow), transparent 55%),
    radial-gradient(700px 400px at 90% 85%, rgba(80,40,70,.35), transparent 50%),
    var(--bg);
}
.ad-shell { width: min(560px, 100%); }
.ad-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
  color: var(--text);
}
.ad-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  display: block;
  margin: 0 auto 1rem;
  border-radius: 70%;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.35));
}
.ad-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 .75rem;
  color: var(--text) !important;
  background: none !important;
  -webkit-text-fill-color: var(--text) !important;
  background-clip: border-box !important;
  -webkit-background-clip: border-box !important;
  text-align: center;
}
.ad-card { width: min(520px, 100%); }
.ad-progress { color: var(--muted); font-size: .85rem; margin-bottom: .75rem; text-align: center; }
.ad-body { color: var(--text); margin-bottom: .75rem; line-height: 1.5; text-align: center; }
.ad-image {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-top: .5rem;
  background: rgba(0,0,0,.2);
  cursor: zoom-in;
}
.ad-form { margin-top: 1.25rem; }
.ad-form .btn { width: 100%; justify-content: center; }

/* Image lightbox */
.img-lightbox[hidden] { display: none !important; }
.img-lightbox {
  position: fixed; inset: 0; z-index: 120;
  display: grid; place-items: center;
  padding: 1rem;
}
.img-lightbox-backdrop {
  position: absolute; inset: 0;
  background: rgba(5, 4, 8, 0.88);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
}
.img-lightbox img {
  position: relative;
  max-width: min(96vw, 1200px);
  max-height: 92vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  border: 1px solid var(--border);
  cursor: default;
}
.img-lightbox-close {
  position: absolute; top: 1rem; right: 1rem; z-index: 2;
}

/* Settings modal */
.settings-modal[hidden] { display: none !important; }
.settings-modal {
  position: fixed; inset: 0; z-index: 110;
  display: grid; place-items: center;
  padding: 1rem;
}
.settings-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(8, 6, 10, 0.72);
  backdrop-filter: blur(4px);
}
.settings-modal-card {
  position: relative;
  width: min(480px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.25rem 1.35rem;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.settings-modal-card h2 {
  font-size: 1.15rem;
  margin-bottom: .25rem;
}
.settings-modal-card .settings-sub {
  color: var(--muted);
  font-size: .85rem;
  margin-bottom: 1rem;
}
.settings-section {
  border-top: 1px solid var(--border);
  padding-top: .9rem;
  margin-top: .9rem;
}
.settings-section h3 {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: .65rem;
}
.settings-modal .theme-grid { margin-bottom: .25rem; }
.settings-msg {
  font-size: .85rem;
  margin-top: .55rem;
  min-height: 1.2em;
}
.settings-msg.ok { color: var(--ok); }
.settings-msg.err { color: #ffb4b8; }
.data-grid {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: .35rem .75rem;
  font-size: .9rem;
}
.data-grid dt { color: var(--muted); }
.data-grid dd { margin: 0; word-break: break-word; }
.settings-close-x {
  position: absolute;
  top: .75rem;
  right: .75rem;
}
