:root {
  --bg: #0f1226;
  --bg-soft: #1a1f3d;
  --card: #1e2444;
  --card-hover: #262d54;
  --text: #eef0ff;
  --muted: #a6abd6;
  --accent: #7c5cff;
  --accent-2: #00d4b8;
  --danger: #ff6b81;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  --maxw: 760px;
  --content-maxw: var(--maxw);
  --name-w: 7rem; /* emoji-name field: ~3 emoji wide (create form + composer) */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", "Apple Color Emoji",
    "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #232a55 0%, var(--bg) 60%);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1em 0.4em;
  border-radius: 6px;
  font-size: 0.95em;
}

main { max-width: var(--content-maxw); width: 100%; margin: 0 auto; padding: 1rem 1rem 0; }

/* Header / footer ---------------------------------------------------------- */
.site-header {
  max-width: var(--content-maxw);
  width: 100%;
  margin: 0 auto;
  padding: 1.2rem 1rem 0.4rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand { font-size: 1.8rem; text-decoration: none; padding: 0.2rem 0.4rem; border-radius: 8px; }
.chat-page .brand { transition: background 0.15s; }
.chat-page .brand:hover { background: var(--card-hover); text-decoration: none; }
.tagline { margin: 0; color: var(--muted); font-size: 1.1rem; letter-spacing: 0.05em; }
.site-footer {
  max-width: var(--content-maxw);
  margin: 2rem auto 0;
  padding: 1rem;
  color: var(--muted);
  text-align: center;
  font-size: 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Intro -------------------------------------------------------------------- */
/* The welcome line doubles as the page H1 (no separate big title). */
.lede { font-size: 1.3rem; font-weight: 400; line-height: 1.5; margin: 0.6rem 0 0.2rem; color: var(--text); }
/* Returning visitors (a saved username) skip the explanatory intro. */
.returning .intro-explain { display: none; }
/* Returning visitors still see the create form, but without the section header. */
.returning .create h2 { display: none; }
.rules { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.5rem; }
.rules li {
  background: var(--bg-soft);
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
/* The "Emoji only" rule doubles as a button that opens the emoji keyboard. */
.rules li.rule-emoji { background: none; padding: 0; border: none; }
.rule-keyboard {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: var(--bg-soft);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  box-shadow: none;
  padding: 0.7rem 0.9rem;
}
.rule-keyboard:hover { filter: none; background: var(--card-hover); }
.rule-keyboard[aria-expanded="true"] { background: var(--card-hover); border-color: var(--accent); }
.rule-keyboard .kbd-hint { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }

/* Sections ----------------------------------------------------------------- */
section { margin: 1.8rem 0; }
h2 { font-size: 1.35rem; margin: 0 0 0.7rem; }
.count { color: var(--muted); font-weight: 400; font-size: 0.9em; }

/* Forms -------------------------------------------------------------------- */
.emoji-form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; }
.create-form .field { display: flex; flex-direction: column; gap: 0.25rem; flex: 1 1 180px; }
/* The emoji name only needs room for ~3 emoji; keep it compact and let the
   title field take the freed space (matches the composer's username field). */
.create-form .field-name { flex: 0 0 auto; }
.create-form .field-name label { white-space: nowrap; }
.create-form .field-name input { width: var(--name-w); }
.field label { font-size: 0.9rem; color: var(--muted); }

input[type="text"] {
  width: 100%;
  font: inherit;
  font-size: 1.3rem;
  padding: 0.55rem 0.7rem;
  color: var(--text);
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  outline: none;
}
input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.25); }
/* Emoji placeholders: faded so they read as hints, not real values. */
input::placeholder { color: var(--text); opacity: 0.5; }

button {
  font: inherit;
  font-size: 1.3rem;
  padding: 0.55rem 1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #b06bff);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}
.post-form { align-items: stretch; }
button:hover { filter: brightness(1.08); }
button:active { transform: translateY(1px); }

.error {
  background: rgba(255, 107, 129, 0.15);
  border: 1px solid var(--danger);
  color: #ffd6dc;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  font-size: 1.1rem;
}

/* Chat list ---------------------------------------------------------------- */
.chat-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.chat-card a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}
.chat-card a:hover { background: var(--card-hover); transform: translateY(-1px); text-decoration: none; }
.chat-title { font-size: 1.7rem; }
.chat-meta { color: var(--muted); font-size: 0.95rem; display: flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
/* Countdown to when the chat (and its messages) is auto-erased. */
.expiry { white-space: nowrap; color: var(--muted); }

/* Sponsored emoji ad ------------------------------------------------------- */
.ad {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.2rem 0 1rem;
  padding: 0.55rem 0.85rem;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.12), rgba(0, 212, 184, 0.08));
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 12px;
}
/* Native ad inside the message stream: vertical bar on left, sits like a message. */
.ad.msg-ad {
  margin: 0;
  padding: 0.6rem 0.8rem;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "user body sep";
  gap: 0.35rem 0.6rem;
  align-items: center;
}
.ad.msg-ad .ad-tag { grid-area: user; font-size: 1rem; color: var(--muted); padding-right: 0.6rem; }
.ad.msg-ad .ad-link { font-size: 1.7rem; display: flex; align-items: center; gap: 0.5rem; }
/* Separator matches the top banner ad: the shared `.ad .ad-sep` `|` glyph
   (not a border on the label), so both ad styles look identical. */
.ad-tag { color: var(--muted); font-size: 0.95rem; white-space: nowrap; }
.ad-tag-text { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; }
.ad-link { display: flex; align-items: center; gap: 0.6rem; flex: 1; color: var(--text); text-decoration: none; }
.ad-link:hover { text-decoration: none; }
.ad-link:hover .ad-creative { transform: scale(1.06); }
.ad-label { font-size: 1.4rem; align-self: stretch; display: flex; align-items: center; }
.ad-creative { font-size: 1.9rem; transition: transform 0.15s; }
.ad-go { margin-left: auto; opacity: 0.7; font-size: 1rem; }
/* Vertical bar separator between label and creative (top banner ad). */
.ad .ad-sep { font-size: 1.5rem; color: rgba(255, 255, 255, 0.3); padding: 0 0.4rem; }

/* Chat page ---------------------------------------------------------------- */
/* Hide tagline on chat pages — only the logo (💬🌍) is shown. */
.chat-page .site-header .tagline { display: none; }
/* Left-align the top emoji on chat pages so the brand lines up with the chat
   content below. body is a flex column, so margin:0 auto would shrink-wrap the
   header to its content and center it; width:100% makes it stretch to the same
   box as <main> (both max-width:760, margin:0 auto), so their left content
   edges coincide. */
.chat-page .site-header { justify-content: flex-start; width: 100%; }
.chat-page main { width: 100%; }
.admin-body .site-header { justify-content: flex-start; width: 100%; }
.admin-body .site-header .tagline { display: none; }
.notfound-page .site-header { justify-content: space-between; width: 100%; }
.notfound-page .brand { transition: background 0.15s; }
.notfound-page .brand:hover { background: var(--card-hover); text-decoration: none; }
.admin-body .brand { transition: background 0.15s; }
.admin-body .brand:hover { background: var(--card-hover); text-decoration: none; }

/* Current user's emoji name — top-right of the chat header; tap to change. */
.user-box { margin-left: auto; align-self: center; display: flex; align-items: center; }
.user-chip {
  display: inline-flex; align-items: center;
  font: inherit; font-size: 1.3rem; line-height: 1;
  padding: 0.3rem 0.6rem;
  color: var(--text); background: var(--bg-soft);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px; box-shadow: none; cursor: pointer;
}
.user-chip[hidden] { display: none; }
.user-chip:hover { filter: none; background: var(--card-hover); }
.user-box .user-chip-input { flex: 0 0 auto; width: 6.5rem; font-size: 1.3rem; padding: 0.3rem 0.5rem; }
/* Single share button, left-aligned above the chat title. */
.crumbs { margin-bottom: 0.5rem; display: flex; align-items: center; justify-content: flex-start; gap: 0.6rem; }
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.55rem;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: none;
  cursor: pointer;
}
.share-btn svg { display: block; }
.share-btn:hover { filter: none; background: var(--card-hover); }
.share-btn:disabled { opacity: 0.8; cursor: default; }

/* Share modal (social targets + copy link) -------------------------------- */
.share-dialog {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  width: min(380px, calc(100vw - 2rem));
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}
.share-dialog::backdrop { background: rgba(8, 10, 24, 0.6); }
.share-dialog-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.share-dialog-head h2 { font-size: 1.1rem; margin: 0; }
.share-close {
  font: inherit; font-size: 1.1rem; line-height: 1;
  padding: 0.25rem 0.45rem;
  color: var(--muted); background: none; border: none; box-shadow: none; cursor: pointer;
}
.share-close:hover { filter: none; color: var(--text); }
.share-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; padding: 1rem; }
.share-target {
  display: flex; align-items: center; justify-content: flex-start; gap: 0.6rem;
  font: inherit; font-size: 1rem; text-align: left;
  padding: 0.55rem 0.7rem;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: none; cursor: pointer;
}
.share-target:hover { filter: none; background: var(--card-hover); }
.share-target-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 20px; width: 20px; height: 20px; color: var(--text); }
.share-target-icon svg { display: block; width: 20px; height: 20px; }
.share-note { margin: 0; padding: 0 1rem 1rem; min-height: 1.2em; color: var(--muted); font-size: 0.9rem; }
.chat-head { margin-bottom: 1rem; }
/* Share button sits to the left of the chat title, on the same row. */
.chat-title-row { display: flex; align-items: center; gap: 0.7rem; }
.chat-title-row .chat-title { margin: 0; }
.chat-head .chat-title { font-size: 2.2rem; display: block; }
.chat-head .chat-meta { text-align: left; color: var(--muted); margin: 0.2rem 0 0; }
/* Chat count displayed below the ad box */
.chat-meta.chat-count { color: var(--muted); font-size: 0.95rem; margin: 0.8rem 0; text-align: left; }
.chat-meta.chat-count .count { font-size: 1rem; }

.messages { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.5rem; }
.msg {
  background: var(--card);
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "user body" "votes votes";
  gap: 0.35rem 0.6rem;
  align-items: center;
}
/* Vertical divider so the username is clearly separated from the message. */
.msg-user { grid-area: user; font-size: 1.5rem; padding-right: 0.6rem; border-right: 2px solid rgba(255, 255, 255, 0.18); }
.msg-body { grid-area: body; font-size: 1.7rem; word-break: break-word; }
.msg-ts { display: none; } /* time kept in datetime attr only, never shown */

/* +1 voting: who agrees with this message. */
.msg-votes { grid-area: votes; display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.vote-btn {
  font-size: 1.05rem;
  line-height: 1;
  padding: 0.2rem 0rem;
  background: var(--bg-soft);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  box-shadow: none;
  cursor: pointer;
}
.vote-btn:hover { filter: none; background: var(--card-hover); }
.vote-btn[aria-pressed="true"] { background: var(--bg); border-color: var(--accent); }
.vote-btn[disabled] { background: var(--bg); border-color: var(--accent); cursor: not-allowed; pointer-events: none; }
/* Highlight the vote button when current user has sent it (blue border only, no background) */
.msg.voted .vote-btn { border-color: var(--accent); }
.vote-count { color: var(--muted); font-size: 0.9rem; min-width: 0.5em; }
.voters { display: inline-flex; flex-wrap: wrap; gap: 0.2rem; }
.voter { font-size: 1.15rem; line-height: 1; }
/* Empty <time> elements stay in the HTML (datetime attr for crawlers/JSON-LD)
   but never take up visible space. */
time:empty { display: none; }
.msg.new { animation: pop 0.4s ease; }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.empty { color: var(--muted); font-size: 1.4rem; text-align: center; padding: 1.5rem; }

.post-form { position: sticky; bottom: 0; padding: 0.6rem 0; background: linear-gradient(transparent, var(--bg) 30%); }
.post-form .user-input { flex: 0 0 var(--name-w); }
.post-form .msg-input { flex: 1 1 160px; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 0.4rem 0 0; }

/* Pager -------------------------------------------------------------------- */
.pager { display: flex; align-items: center; gap: 1rem; justify-content: center; margin: 1rem 0; font-size: 1.3rem; }
.page-info { color: var(--muted); font-size: 1rem; }

/* Infinite scroll sentinel (invisible element at bottom of chat list) -------- */
.infinite-sentinel {
  height: 1px;
  width: 100%;
  pointer-events: none;
}

/* Hide server pager when infinite scroll is active */
nav.pager[data-pager-hidden="infinite-scroll"] {
  display: none !important;
}

/* Emoji picker dropdown ---------------------------------------------------- */
.emoji-picker {
  position: absolute;
  z-index: 50;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-height: 240px;
  overflow-y: auto;
  width: 240px;
  padding: 0.25rem;
}
.emoji-picker .opt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text);
}
.emoji-picker .opt .e { font-size: 1.4rem; }
.emoji-picker .opt .n { color: var(--muted); font-size: 0.85rem; }
.emoji-picker .opt.active,
.emoji-picker .opt:hover { background: var(--accent); color: #fff; }
.emoji-picker .opt.active .n,
.emoji-picker .opt:hover .n { color: #f0eaff; }

/* Full emoji palette ------------------------------------------------------- */
.emoji-palette {
  position: absolute;
  z-index: 60;
  width: 300px;
  max-width: calc(100vw - 16px);
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.emoji-palette[hidden] { display: none; }
.ep-head { display: flex; gap: 0.4rem; padding: 0.5rem; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.ep-search {
  flex: 1;
  font: inherit;
  font-size: 1rem;
  padding: 0.4rem 0.55rem;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  outline: none;
}
.ep-search:focus { border-color: var(--accent); }
.ep-close { font-size: 1rem; padding: 0.3rem 0.55rem; background: transparent; box-shadow: none; }
.ep-close:hover { filter: none; background: var(--card-hover); }
.ep-grid {
  max-height: 260px;
  overflow-y: auto;
  padding: 0;
}
.ep-group-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.4rem 0.55rem 0.25rem;
}
.ep-group-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 0 0.4rem 0.4rem;
}
.ep-group[hidden] { display: none; }
.ep-emoji {
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.25rem 0;
  background: transparent;
  border: none;
  border-radius: 8px;
  box-shadow: none;
  cursor: pointer;
}
.ep-emoji:hover { filter: none; background: var(--accent); }
.ep-emoji[hidden] { display: none; }
.ep-empty { color: var(--muted); text-align: center; padding: 1rem; font-size: 1.3rem; }

/* Bottom-sheet variant on narrow screens. */
.emoji-palette.ep-bottom {
  position: fixed;
  left: 0 !important;
  right: 0;
  top: auto !important;
  bottom: 0;
  width: 100%;
  max-width: 100%;
  border-radius: 14px 14px 0 0;
}
.ep-bottom .ep-grid { max-height: 42vh; }
.ep-bottom .ep-group-grid {
  grid-template-columns: repeat(auto-fill, minmax(2.4rem, 1fr));
}

/* Misc --------------------------------------------------------------------- */
.notfound { text-align: center; }
.big-link { font-size: 1.6rem; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

@media (max-width: 480px) {
  .lede { font-size: 1.15rem; }
  .chat-head .chat-title { font-size: 1.8rem; }
  .msg-body { font-size: 1.5rem; }
}

/* Admin page ---------------------------------------------------------------- */
/* Admin is a desktop tool — give it more room than the 760px content column. */
.admin-body { --content-maxw: 1000px; }
.admin-page { max-width: 1000px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.admin-header h1 { font-size: 1.6rem; margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem;
  font: inherit; font-size: 1rem; line-height: 1; padding: 0.55rem 0.9rem;
  color: #fff; background: linear-gradient(135deg, var(--accent), #b06bff);
  border: none; border-radius: 10px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn-ghost { background: transparent; border: 1.5px solid rgba(255,255,255,0.25); box-shadow: none; }
.btn-ghost:hover { filter: none; background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.45); }
.btn-danger { background: linear-gradient(135deg, var(--danger), #ff4060); }
/* Compact, neutral icon buttons for the table action column. */
.btn-sm { font-size: 1.05rem; line-height: 1; padding: 0.4rem 0.5rem; background: var(--bg-soft); border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: none; }
.btn-sm:hover { filter: none; background: var(--card-hover); }
.btn-sm.btn-danger { background: rgba(255, 107, 129, 0.16); border-color: rgba(255, 107, 129, 0.4); }
.btn-sm.btn-danger:hover { background: rgba(255, 107, 129, 0.28); }
.back-link { display: inline-block; margin-top: 1.5rem; color: var(--accent-2); }

/* Summary stat cards */
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; margin: 0 0 1.25rem; }
.admin-stats .stat { display: flex; flex-direction: column; gap: 0.2rem; background: var(--card); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: var(--radius); padding: 0.85rem 1rem; }
.admin-stats .num { font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.admin-stats .lbl { color: var(--muted); font-size: 0.85rem; }

/* Ads table inside a card */
.admin-card { background: var(--card); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: var(--radius); overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.admin-table th { text-align: left; padding: 0.7rem 0.9rem; background: var(--bg-soft); color: var(--muted); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.admin-table td { padding: 0.65rem 0.9rem; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.admin-table tr.inactive { opacity: 0.55; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }

.label-cell { font-size: 1.2rem; white-space: nowrap; }
.creative-cell { white-space: nowrap; }
.creative-emojis { font-size: 1.7rem; }
.creative-url { display: block; color: var(--accent-2); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.status-cell { white-space: nowrap; }

.badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.25rem 0.6rem; border-radius: 999px; font-size: 0.78rem; white-space: nowrap; }
.badge-active { background: rgba(0, 212, 184, 0.15); color: var(--accent-2); }
.badge-inactive { background: rgba(255, 107, 129, 0.15); color: var(--danger); }

.ctr-cell { font-variant-numeric: tabular-nums; }
.actions-col { text-align: right; }
.actions-cell { display: flex; gap: 0.35rem; justify-content: flex-end; white-space: nowrap; }
.actions-cell form { display: inline; margin: 0; }

@media (max-width: 640px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
}

/* Delete confirmation modal */
.confirm-dialog {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  width: min(340px, calc(100vw - 2rem));
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}
.confirm-dialog::backdrop { background: rgba(8, 10, 24, 0.6); }
.confirm-dialog-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.confirm-dialog-head h2 { font-size: 1.05rem; margin: 0; }
.confirm-dialog-body { padding: 1rem; color: var(--muted); font-size: 0.92rem; }
.confirm-dialog-foot { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 0.75rem 1rem; border-top: 1px solid rgba(255, 255, 255, 0.08); }

/* Form */
.ad-form { display: flex; flex-direction: column; gap: 1rem; }
.ad-form-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.form-actions { display: flex; align-items: center; gap: 0.75rem; }
@media (min-width: 640px) {
  .ad-form-grid { grid-template-columns: 1fr 1fr; }
  .ad-form-url { grid-column: 1 / -1; }
}
