:root {
  --bg: #1a1326;
  --bg-2: #2a1f3d;
  --panel: #2e2440;
  --accent: #f5c542;
  --accent-2: #c97bff;
  --text: #f1ebff;
  --muted: #b3a8c9;
  /* Card surface - theme-swappable so themes can shift the whole panel
     tone (not just the page background). */
  --card-bg:     #3a2c55;
  --card-border: #4a3870;
  /* Chart bar gradient endpoints - separate from --accent so single-hue
     themes can pick more contrasting endpoints without also washing out
     the rest of the chrome. Default matches --accent-2 → --accent. */
  --chart-grad-start: #c97bff;
  --chart-grad-end:   #f5c542;
}

/* Alternate themes. Applied via <html data-theme="…"> - the boot script in
   the header partial reads localStorage.iom_theme and sets the attribute
   before first paint. Only CSS variables change; nothing else in the
   stylesheet references specific hexes for chrome. */
:root[data-theme="slate"] {
  --bg: #0f1218;
  --bg-2: #171b25;
  --panel: #1c2130;
  --accent: #7ba7d9;
  --accent-2: #5985b8;
  --text: #e6e8ef;
  --muted: #8b93a5;
  --card-bg: #1e2634;
  --card-border: #2e3a52;
  --chart-grad-start: #2d4a70;
  --chart-grad-end:   #a8d0f5;
}
:root[data-theme="emerald"] {
  --bg: #0e1a15;
  --bg-2: #14261e;
  --panel: #1a3025;
  --accent: #7ed9a4;
  --accent-2: #4a9b7a;
  --text: #e6efe9;
  --muted: #92a89c;
  --card-bg: #1c3428;
  --card-border: #2a4a38;
  --chart-grad-start: #1e5a3d;
  --chart-grad-end:   #a2f0be;
}
:root[data-theme="ember"] {
  --bg: #1a1210;
  --bg-2: #251814;
  --panel: #30201a;
  --accent: #f5a742;
  --accent-2: #d95a3f;
  --text: #f2e8e2;
  --muted: #b39c93;
  --card-bg: #35221c;
  --card-border: #4a3025;
  --chart-grad-start: #d95a3f;
  --chart-grad-end:   #f5c542;
}
:root[data-theme="ink"] {
  --bg: #0d0f14;
  --bg-2: #14171e;
  --panel: #1a1e28;
  --accent: #b0b4c0;
  --accent-2: #8a90a0;
  --text: #e0e2ea;
  --muted: #7c8290;
  --card-bg: #1c2029;
  --card-border: #2b3040;
  --chart-grad-start: #3a4050;
  --chart-grad-end:   #ccd0dc;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

img { image-rendering: pixelated; }

.hero {
  background:
    radial-gradient(circle at 50% 30%, rgba(201, 123, 255, 0.25), transparent 60%),
    linear-gradient(180deg, #2a1f3d 0%, #1a1326 100%);
  padding: 64px 24px 56px;
  text-align: center;
  border-bottom: 2px solid #3a2c55;
}

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
}

.app-icon {
  width: 128px;
  height: 128px;
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 2.4rem;
  margin: 8px 0 12px;
  color: var(--accent);
  text-shadow: 0 2px 0 #000;
}

.tagline {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0 0 28px;
}

.store-badges {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.store-badges a {
  display: inline-flex;
  align-items: center;
  height: 60px;
}

.store-badges img {
  height: 60px;
  width: auto;
  display: block;
  image-rendering: auto;
  transition: transform 0.15s ease;
}

.store-badges a:hover img {
  transform: translateY(-2px) scale(1.03);
}

.smart-link {
  margin-top: 18px;
  font-size: 0.95rem;
}

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

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 48px 24px;
}

main h2 {
  color: var(--accent);
  font-size: 1.6rem;
  margin-top: 0;
}

.feature-grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.feature-grid li {
  background: var(--panel);
  border: 1px solid #3a2c55;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.feature-grid img {
  height: 64px;
  width: auto;
  margin-bottom: 8px;
}

.feature-grid h3 {
  margin: 6px 0 8px;
  color: var(--accent-2);
  font-size: 1.1rem;
}

.feature-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.why ul {
  padding-left: 20px;
  color: var(--muted);
}
.why strong { color: var(--text); }

.cta {
  text-align: center;
  margin: 56px 0 24px;
}

.cta-btn {
  display: inline-block;
  background: var(--accent);
  color: #2a1f3d;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 999px;
  text-decoration: none;
  margin-top: 8px;
  box-shadow: 0 4px 0 #b3902a;
  transition: transform 0.1s ease;
}
.cta-btn:hover { transform: translateY(-1px); }
.cta-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #b3902a; }

footer {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  border-top: 1px solid #3a2c55;
  font-size: 0.9rem;
}

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

.git-hash {
  font-size: 0.75rem;
  opacity: 0.75;
}

.page-header {
  background: var(--bg-2);
  border-bottom: 2px solid #3a2c55;
}

.page-header-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.page-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.page-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.page-nav a:hover { color: var(--accent-2); }

.page-nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}

.doc {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px;
}

.doc h1 {
  color: var(--accent);
  font-size: 2rem;
  margin-top: 0;
  margin-bottom: 24px;
}

.doc h2 {
  color: var(--accent-2);
  font-size: 1.3rem;
  margin-top: 32px;
  margin-bottom: 8px;
}

.doc h3 {
  color: var(--text);
  font-size: 1.05rem;
  margin-top: 18px;
  margin-bottom: 6px;
}

.doc p, .doc ul {
  color: var(--muted);
}

.doc ul {
  padding-left: 22px;
}

.doc a {
  color: var(--accent-2);
}

.bot-policy-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 24px;
}

.bot-policy-nav [aria-current="page"] { font-weight: 700; }
.bot-policy { overflow-wrap: anywhere; }
.bot-policy li + li { margin-top: 8px; }
.bot-policy .policy-table { overflow-x: auto; margin: 24px 0; }
.bot-policy table { width: 100%; border-collapse: collapse; }
.bot-policy th, .bot-policy td {
  padding: 12px;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--muted);
}
.bot-policy th { color: var(--accent-2); }
/* The screenshots are shown at the size they were taken, never stretched:
   resampling makes their text jagged. They only shrink on a narrow window. */
.bot-review { max-width: 1400px; }
.bot-review > p, .bot-review figcaption { max-width: 760px; }
.bot-review figure { margin: 16px 0 40px; }
.bot-review img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 0 0 1px var(--card-border);
}
.bot-review figcaption { margin-top: 12px; color: var(--muted); }

.campaigns-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.95rem;
}
.campaigns-table th,
.campaigns-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #3a2c55;
}
.campaigns-table th {
  color: var(--accent-2);
  font-weight: 600;
}
.campaigns-table code { color: var(--accent); }

.muted { color: var(--muted); }
.error {
  color: #ffb4b4;
  background: rgba(180, 60, 60, 0.18);
  padding: 8px 12px;
  border-radius: 6px;
}

.campaign-form fieldset {
  border: 1px solid #3a2c55;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 16px 0;
}
.campaign-form legend { color: var(--accent-2); padding: 0 6px; }
.campaign-form label,
.campaign-form .form-field {
  display: block;
  margin: 8px 0;
  color: var(--muted);
}
.campaign-form .form-field > label {
  margin: 0 0 4px;
}
.campaign-form input[type="text"],
.campaign-form textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  background: #1a1326;
  color: var(--text);
  border: 1px solid #3a2c55;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
}
.lifecycle-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }

/* Admin-area surfaces. The marketing pages keep the deep-purple background;
   data-heavy admin pages need a lighter, higher-contrast surface to read on. */
.page-main {
  max-width: 960px;
  margin: 32px auto 64px;
  padding: 0 16px;
}
.page-main .card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 24px 28px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.page-main .card + .card { margin-top: 20px; }
.page-main .card h1 { color: var(--accent); margin-top: 0; }
.page-main .card h2 {
  color: var(--accent-2);
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: 1.15rem;
}
.page-main .card a:not(.btn) { color: var(--accent-2); }
.page-main .card a:not(.btn):hover { color: var(--accent); }

/* Buttons: gold primary for the main action, outlined secondary for
   navigation-shaped links, red-ish danger for destructive. */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.06s ease, filter 0.1s ease;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #2a1f3d;
  border-color: var(--accent);
}
.btn-secondary {
  background: transparent;
  color: var(--accent-2);
  border-color: var(--accent-2);
}
.btn-danger {
  background: transparent;
  color: #ffb4b4;
  border-color: #c45c5c;
}
.btn-link {
  background: transparent;
  color: var(--accent-2);
  border: none;
  padding: 8px 4px;
}
.btn-link:hover { color: var(--accent); text-decoration: underline; }

/* The campaign form's <button> should look like a primary action without
   the template having to add a class to every <button>. */
.campaign-form button[type="submit"] {
  background: var(--accent);
  color: #2a1f3d;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.campaign-form button[type="submit"]:hover { filter: brightness(1.08); }
.lifecycle-actions button {
  background: transparent;
  color: var(--accent-2);
  border: 1px solid var(--accent-2);
  border-radius: 6px;
  padding: 8px 14px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}
.lifecycle-actions form:last-child button { color: #ffb4b4; border-color: #c45c5c; }
.lifecycle-actions button:hover { filter: brightness(1.1); }

.actions-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin: 16px 0 8px;
}

/* Code cells in audit/details tables shouldn't blow up the row height. */
.campaigns-table td code {
  display: inline-block;
  max-width: 460px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

/* Inline field hints - one short line under each input label. Muted so the
   form still scans visually but the meaning is one glance away. */
.campaign-form label .hint {
  display: block;
  margin-top: 2px;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--muted);
  font-style: normal;
}
.campaign-form label .hint code {
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text);
  font-size: 0.78rem;
}
.campaign-form .fieldset-hint {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 4px 0 14px;
}

/* Summary cards on the click-activity dashboard. */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 16px 0 4px;
}
.stat-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid #4a3870;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-label {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-value {
  color: var(--accent);
  font-size: 1.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Horizontal bar lists (platform split, top referrers). */
.bar-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bar-list li {
  display: grid;
  grid-template-columns: 140px 1fr 60px;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
}
.bar-label {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  height: 14px;
  overflow: hidden;
}
.bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 4px;
  min-width: 2px;
}
.bar-count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Daily 30-bar histogram. Each column is one day; the bar fills from the
   bottom up. Hover the column for the exact day + count via the title. */
.day-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  margin: 12px 0 4px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}
.day-bar {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  cursor: default;
}
.day-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 2px 2px 0 0;
  min-height: 1px;
}
.day-bar:hover .day-bar-fill { filter: brightness(1.15); }
.day-chart-axis {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 0 8px;
}

.ua-cell {
  display: inline-block;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  font-size: 0.85rem;
}

/* Campaign list card. The slug + URL is the visual anchor - that's the thing
   you're going to share with a creator. Stats and actions sit below. */
.campaign-card .campaign-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.campaign-card.is-disabled { opacity: 0.65; }
.campaign-card h2 {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 1.4rem;
}
.campaign-card h2 code { background: none; color: inherit; }
.campaign-link .link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.link-url {
  color: var(--accent-2) !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  word-break: break-all;
}
.copy-btn {
  background: transparent;
  border: 1px solid #4a3870;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.copy-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: var(--accent-2);
}
.copy-btn.copied {
  color: #a8e0a0;
  border-color: #6aa860;
  background: rgba(106, 168, 96, 0.1);
}

.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.status-active {
  background: rgba(106, 168, 96, 0.18);
  color: #a8e0a0;
  border: 1px solid #6aa860;
}
.status-disabled {
  background: rgba(180, 60, 60, 0.18);
  color: #ffb4b4;
  border: 1px solid #c45c5c;
}

.campaign-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  margin: 20px 0 20px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}
.stat-inline {
  display: flex;
  flex-direction: column;
  min-width: 70px;
}
.stat-inline-value {
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat-inline-label {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}
.platform-mini {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: auto;
}
.tag-row-below {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: -8px 0 14px;
}
.platform-chip {
  background: rgba(201, 123, 255, 0.12);
  border: 1px solid #4a3870;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}
.tag-chip-sm {
  padding: 2px 8px;
  font-size: 0.72rem;
  line-height: 1.4;
}

.campaign-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* Heads-up callout on the new-campaign form for operational steps
   that live outside this app (App Store Connect setup, etc.). */
.info-callout {
  background: rgba(245, 197, 66, 0.10);
  border: 1px solid #8a7430;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 12px 0 0;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.5;
}
.info-callout a { color: var(--accent-2); }
.info-callout strong { color: var(--accent); }
.info-callout em { color: var(--text); font-style: normal; font-weight: 600; }

/* Apple-registered checklist pill. Doubles as a clickable toggle - the
   .inline-form removes the default form styling so the pill behaves like
   a button visually. */
.status-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.inline-form { display: inline; margin: 0; padding: 0; }
.status-pill.status-apple-ok,
.status-pill.status-apple-todo {
  background: transparent;
  font: inherit;
  cursor: pointer;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
  transition: filter 0.1s;
}
.status-pill.status-apple-ok:hover,
.status-pill.status-apple-todo:hover {
  filter: brightness(1.15);
}
.status-apple-ok {
  background: rgba(106, 168, 96, 0.18);
  color: #a8e0a0;
  border: 1px solid #6aa860;
}
.status-apple-todo {
  background: rgba(245, 197, 66, 0.15);
  color: var(--accent);
  border: 1px solid #8a7430;
}

.inline-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-top: 12px !important;
  color: var(--text) !important;
  cursor: pointer;
}
.inline-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
}

/* Filter bar on the campaigns list. Fields wrap onto a second row on narrow
   viewports; the tag row sits below and wraps freely. */
.filter-card { padding-top: 16px; padding-bottom: 16px; }
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
  font-size: 0.85rem;
  color: var(--muted);
}
.filter-field > span {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
}
.filter-field input,
.filter-field select {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid #3a3a55;
  border-radius: 6px;
  color: var(--text);
  padding: 6px 10px;
  font: inherit;
  min-width: 140px;
}
.filter-field input:focus,
.filter-field select:focus {
  outline: none;
  border-color: var(--accent-2);
}
.filter-search { flex: 1 1 220px; }
.filter-search input { width: 100%; }
.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}
.filter-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.filter-tags-label {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 4px;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(90, 130, 200, 0.12);
  border: 1px solid #35507a;
  color: var(--text);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  transition: filter 0.1s, background 0.1s;
}
.tag-chip:hover { filter: brightness(1.2); }
/* Active filter chip: a box-shadow ring + bold text so the cue survives
   even when a palette color class overrides the base chip background. */
.tag-chip.tag-chip-active {
  box-shadow:
    0 0 0 2px #0e0e1e,
    0 0 0 4px var(--accent);
  font-weight: 700;
  color: var(--text);
}
.tag-chip.tag-chip-active::before {
  content: "✓ ";
  font-weight: 700;
}
/* Uncolored active chip: also lift the background so it's clearly selected. */
.tag-chip.tag-chip-active:not([class*="tag-color-"]) {
  background: rgba(201, 123, 255, 0.22);
  border-color: var(--accent-2);
}

/* Palette. Each color defines a low-alpha fill and a saturated border/color.
   Chip text stays var(--text) for legibility on any hue. The color-swatch
   buttons on the tag admin page reuse the same classes so what you pick
   there is exactly what appears on the list. */
.tag-color-red    { background: rgba(196,  92,  92, 0.22); border-color: #c45c5c; }
.tag-color-orange { background: rgba(209, 138,  74, 0.22); border-color: #d18a4a; }
.tag-color-amber  { background: rgba(201, 166,  72, 0.22); border-color: #c9a648; }
.tag-color-yellow { background: rgba(216, 200,  90, 0.22); border-color: #d8c85a; }
.tag-color-lime   { background: rgba(165, 192,  96, 0.22); border-color: #a5c060; }
.tag-color-green  { background: rgba(106, 168,  96, 0.22); border-color: #6aa860; }
.tag-color-teal   { background: rgba( 74, 157, 157, 0.24); border-color: #4a9d9d; }
.tag-color-cyan   { background: rgba( 90, 192, 216, 0.22); border-color: #5ac0d8; }
.tag-color-blue   { background: rgba( 90, 130, 200, 0.22); border-color: #5a82c8; }
.tag-color-indigo { background: rgba(106,  90, 200, 0.24); border-color: #6a5ac8; }
.tag-color-purple { background: rgba(157, 106, 200, 0.22); border-color: #9d6ac8; }
.tag-color-pink   { background: rgba(200, 106, 168, 0.22); border-color: #c86aa8; }
.tag-color-rose   { background: rgba(213,  90, 128, 0.22); border-color: #d55a80; }
.tag-color-brown  { background: rgba(160, 112,  80, 0.24); border-color: #a07050; }

.color-swatch-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.color-swatch-label {
  font-size: 0.85rem;
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.color-swatch-current {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 3.5em;
}
.color-swatch {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  padding: 0;
  transition: transform 0.08s, box-shadow 0.08s;
}
.color-swatch:hover { transform: scale(1.15); }
/* Active swatch: double ring (dark gap + bright accent) plus a check inside.
   Two-layer box-shadow reads clearly against any palette color and against
   the card background. */
.color-swatch.is-active {
  box-shadow:
    0 0 0 2px #0e0e1e,
    0 0 0 4px var(--accent);
  transform: scale(1.05);
}
.color-swatch.is-active::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}
.color-swatch-none {
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed #6a6a80;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* "No color" active state - the × is already the label, so suppress the ✓. */
.color-swatch-none.is-active::after { content: none; }
.tag-count {
  color: var(--muted);
  font-size: 0.72rem;
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 4px;
}

.list-meta-card { padding: 10px 20px; }
.list-meta { margin: 0; }

.pager-card { padding: 12px 20px; }
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: center;
}
.pager-info {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding: 0 8px;
}

/* Bar chart used by the click-activity pages. Layout: a Y-axis label column
   on the left, a plot area with gridlines behind the bars, and an X-axis
   band underneath with absolutely-positioned tick labels. */
.chart {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 6px;
  height: 220px;
  margin-top: 12px;
}
.chart-y-axis {
  display: flex;
  flex-direction: column-reverse;
  justify-content: space-between;
  align-items: flex-end;
  padding: 6px 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}
.chart-y-tick { line-height: 1; }
.chart-plot {
  position: relative;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 6px 6px 6px 6px;
  overflow: hidden;
}
.chart-grid {
  position: absolute;
  inset: 6px;
  display: flex;
  flex-direction: column-reverse;
  justify-content: space-between;
  pointer-events: none;
}
.chart-grid-line {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
}
.chart-bars {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 100%;
}
.chart-bar {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  cursor: pointer;
  min-width: 2px;
}
.chart-bar-fill {
  width: 100%;
  min-height: 2px;
  background: linear-gradient(to top, var(--chart-grad-start), var(--chart-grad-end));
  border-radius: 2px 2px 0 0;
  transition: filter 0.08s;
}
.chart-bar:hover .chart-bar-fill { filter: brightness(1.25); }

.chart-x-axis {
  position: relative;
  height: 20px;
  margin-left: 48px; /* align with plot start */
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}
.chart-x-tick {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
  top: 4px;
}
.chart-x-tick:first-child { transform: translateX(0); }
.chart-x-tick:last-child  { transform: translateX(-100%); }

/* Shared hover tooltip. One instance in <body>; JS moves and populates it. */
.chart-tooltip {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  background: rgba(20, 20, 32, 0.96);
  border: 1px solid var(--accent-2);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 10px));
  transition: opacity 0.08s;
}
.chart-tooltip[hidden] { display: none; }
.chart-tooltip-value {
  color: var(--accent);
  font-weight: 700;
  margin-right: 4px;
}

/* Theme picker: a row of preview swatches on the account page. Each preview
   is a small horizontal stripe of the theme's bg / accent / accent-2 so the
   picker looks like what the theme will render. */
.theme-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}
.theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid #3a3a55;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  min-width: 120px;
  transition: filter 0.08s, box-shadow 0.08s;
}
.theme-swatch:hover { filter: brightness(1.1); }
.theme-swatch.is-active {
  box-shadow:
    0 0 0 2px var(--bg-card, #0e0e1e),
    0 0 0 4px var(--accent);
}
.theme-swatch-preview {
  height: 42px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.theme-swatch-name {
  font-size: 0.85rem;
  text-align: left;
  padding: 0 2px;
}
.theme-swatch-preview.t-obelisk { background: linear-gradient(90deg, #1a1326 0 40%, #c97bff 40% 70%, #f5c542 70% 100%); }
.theme-swatch-preview.t-slate   { background: linear-gradient(90deg, #0f1218 0 40%, #5985b8 40% 70%, #7ba7d9 70% 100%); }
.theme-swatch-preview.t-emerald { background: linear-gradient(90deg, #0e1a15 0 40%, #4a9b7a 40% 70%, #7ed9a4 70% 100%); }
.theme-swatch-preview.t-ember   { background: linear-gradient(90deg, #1a1210 0 40%, #d95a3f 40% 70%, #f5a742 70% 100%); }
.theme-swatch-preview.t-ink     { background: linear-gradient(90deg, #0d0f14 0 40%, #8a90a0 40% 70%, #b0b4c0 70% 100%); }

.range-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 18px;
}
.range-picker label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.range-picker select,
.range-picker input[type="datetime-local"] {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid #3a3a55;
  border-radius: 6px;
  color: var(--text);
  padding: 6px 10px;
  font: inherit;
  /* Ensure the datetime picker calendar icon is legible on dark themes. */
  color-scheme: dark;
}
.range-picker label .hint {
  color: var(--muted);
  font-size: 0.7rem;
  margin-left: 4px;
}
.range-custom-label { font-size: 0.85rem; }
.range-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.range-mode[hidden] { display: none; }

/* Contact page: routing cards in a 2x2 grid, stacking to a single
   column on narrow viewports. Each card holds a subject/description
   pair plus a big click-target email link. */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 560px) {
  .contact-grid { grid-template-columns: 1fr; }
}
.contact-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 16px 18px;
}
.contact-card h2 {
  font-size: 1rem;
  color: var(--accent-2);
  margin: 0 0 6px;
}
.contact-card p { margin: 4px 0; }
.contact-email {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  font-weight: 600;
  word-break: break-all;
}
.range-csv-link { margin-left: auto; }

/* Tag admin page: one <details> card per tag, expanding into a rename form
   and a checkbox grid for bulk-assigning to campaigns. */
.tag-admin-card summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}
.tag-admin-card summary::-webkit-details-marker { display: none; }
.tag-admin-card summary::before {
  content: "▸";
  color: var(--muted);
  font-size: 0.9rem;
  transition: transform 0.1s;
}
.tag-admin-card[open] > details > summary::before,
.tag-admin-card details[open] > summary::before { transform: rotate(90deg); display: inline-block; }
.tag-admin-name {
  color: var(--accent-2);
  font-weight: 600;
  font-size: 1.05rem;
}
.tag-admin-count {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.tag-admin-hint { font-size: 0.78rem; margin-left: auto; }
.tag-admin-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tag-admin-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.inline-add-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.inline-add-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 0.85rem;
}
.inline-add-form input[type="text"] {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid #3a3a55;
  border-radius: 6px;
  color: var(--text);
  padding: 6px 10px;
  font: inherit;
}
.btn-danger {
  background: rgba(180, 60, 60, 0.18);
  color: #ffb4b4;
  border: 1px solid #c45c5c;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
}
.btn-danger:hover { filter: brightness(1.15); }
.assign-form { display: flex; flex-direction: column; gap: 10px; }
.assign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 4px 12px;
  max-height: 340px;
  overflow: auto;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.assign-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}
.assign-cell input { accent-color: var(--accent); }
.assign-cell.is-disabled span { color: var(--muted); text-decoration: line-through; }

/* Chip-based tag editor: chips + a single-tag input side-by-side inside a
   framed container. Wrapping the input in its own line keeps the datalist
   autocomplete correct - the input only holds one pending token. */
.tag-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid #3a3a55;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  min-height: 36px;
  cursor: text;
}
.tag-editor-chips {
  display: contents;
}
.tag-editor-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(90, 130, 200, 0.16);
  border: 1px solid #35507a;
  color: var(--text);
  padding: 2px 6px 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  line-height: 1.4;
}
.tag-editor-remove {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 4px;
}
.tag-editor-remove:hover { color: #ffb4b4; }
.tag-editor-input {
  flex: 1;
  min-width: 120px;
  background: transparent;
  border: none;
  color: var(--text);
  font: inherit;
  padding: 4px 2px;
}
.tag-editor-input:focus { outline: none; }
.tag-editor-invalid { color: #ffb4b4; }

/* Audit details: long JSON blob wrapped + monospaced, capped width so it
   doesn't blow out the table. */
.audit-details {
  display: inline-block;
  max-width: 540px;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.82rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px 8px;
  border-radius: 4px;
}

/* --- Patch notes --- */

/* Inline Discord emoji: sized to the surrounding text like Discord does. */
.d-emoji {
  height: 1.25em;
  width: auto;
  vertical-align: -0.25em;
}

/* Success banner, counterpart to .error. */
.notice-success {
  color: #a8e0a0;
  background: rgba(106, 168, 96, 0.18);
  padding: 8px 12px;
  border-radius: 6px;
}

/* Public patch notes surfaces: darker than the standard card so the gold
   titles and version badges pop instead of purple-on-purple. The overlay
   stacks on the theme's card color, so alternate themes stay coherent. */
.patchnote-card,
.patchnote-surface {
  background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3));
}

/* Public list: the whole card is the link, and looks like one. */
.patchnote-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.patchnote-card:hover {
  border-color: var(--accent-2);
  transform: translateY(-2px);
}
.patchnote-card h2 { margin-bottom: 4px; color: var(--text); }
.patchnote-card:hover h2 { color: var(--accent); }
.patchnote-cta {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}
.patchnote-card:hover .patchnote-cta { text-decoration: underline; }
.patchnote-meta { margin-top: 0; }
.patchnote-version {
  color: var(--accent);
  font-weight: 600;
}

/* Rendered Markdown body of a patch note (public page + admin preview). */
.patch-note-body { line-height: 1.6; }
/* Public note page: sit the body on a darker panel so the accent headings
   pop instead of blending into the card (matches the editor's preview). */
.note-panel {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 6px 20px;
  margin-top: 14px;
}
.patch-note-body h1,
.patch-note-body h2,
.patch-note-body h3 {
  color: var(--accent);
  margin: 1.2em 0 0.4em;
}
.patch-note-body h1 { font-size: 1.5rem; }
.patch-note-body h2 { font-size: 1.25rem; }
.patch-note-body h3 { font-size: 1.05rem; }
.patch-note-body p { margin: 0.6em 0; }
.patch-note-body ul,
.patch-note-body ol { margin: 0.6em 0; padding-left: 1.6em; }
.patch-note-body li { margin: 0.25em 0; }
.patch-note-body a { color: var(--accent-2); }
.patch-note-body code {
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.patch-note-body pre {
  background: rgba(0, 0, 0, 0.25);
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
}
.patch-note-body pre code { background: none; padding: 0; }
.patch-note-body blockquote {
  border-left: 3px solid var(--card-border);
  margin: 0.6em 0;
  padding: 0.2em 0 0.2em 1em;
  color: var(--muted);
}
/* Discord-style "> Section" headers: keep the quote a tight single bar. */
.patch-note-body blockquote p { margin: 0; }
.patch-note-body hr {
  border: none;
  border-top: 1px solid var(--card-border);
  margin: 1.2em 0;
}
.patch-note-body table { border-collapse: collapse; margin: 0.6em 0; }
.patch-note-body th,
.patch-note-body td {
  border: 1px solid var(--card-border);
  padding: 6px 10px;
}

/* Admin editor extras. */
.patchnote-body-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}
/* Write | Preview tabs above the body editor. */
.editor-tabs {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}
.editor-tab {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  color: var(--muted);
  padding: 6px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.editor-tab:hover { color: var(--text); }
.editor-tab.is-active {
  background: #1a1326;
  border-color: #3a2c55;
  color: var(--accent);
  box-shadow: inset 0 2px 0 var(--accent);
}
/* The hidden attribute must actually hide these panes - their display rules
   would otherwise outrank the UA's [hidden] style. */
.patchnote-editor[hidden],
.editor-preview[hidden],
.editor-tabs[hidden] { display: none; }
.editor-tabs + .patchnote-editor,
.editor-preview { border-top-left-radius: 0; }

/* Server-rendered preview pane, same box as the editor. */
.editor-preview {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: #1a1326;
  border: 1px solid #3a2c55;
  border-radius: 6px;
  min-height: 24em;
  max-height: 60vh;
  overflow-y: auto;
}

/* Publish state panel with its action, replacing loose lifecycle buttons. */
.publish-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 20px 0;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.15);
}
.publish-panel.is-live {
  border-color: rgba(106, 168, 96, 0.6);
  background: rgba(106, 168, 96, 0.08);
}
.publish-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 260px;
}
.panel-btn {
  background: transparent;
  color: var(--accent-2);
  border: 1px solid var(--accent-2);
  border-radius: 6px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.panel-btn:hover { filter: brightness(1.1); }
.panel-btn-go {
  background: var(--accent);
  color: #2a1f3d;
  border-color: var(--accent);
}
.panel-btn-danger { color: #ffb4b4; border-color: #c45c5c; }
.panel-btn-quiet { color: var(--muted); border-color: var(--card-border); }

/* Inline confirmation: first click swaps the action button for a styled
   question instead of the browser's confirm() dialog. */
.confirm-form { display: inline-flex; align-items: center; }
.confirm-form .confirm-strip {
  display: none;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.confirm-form.confirming > button { display: none; }
.confirm-form.confirming .confirm-strip { display: inline-flex; }
.confirm-msg { color: var(--text); font-weight: 600; }

.danger-row { margin: 24px 0 8px; }

/* History table: one compact line per changed field. */
.audit-line {
  font-size: 0.84rem;
  max-width: 540px;
  overflow-wrap: anywhere;
}
.audit-line + .audit-line { margin-top: 2px; }
/* Contenteditable body editor: looks like the form textarea, but renders
   emojis inline as images. The real textarea stays as the hidden form field. */
.patchnote-editor {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  background: #1a1326;
  color: var(--text);
  border: 1px solid #3a2c55;
  border-radius: 6px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  overflow-y: auto;
  resize: vertical;
  min-height: 24em;
  max-height: 60vh;
  cursor: text;
}
.patchnote-editor:focus { outline: none; border-color: var(--accent-2); }
.patchnote-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  white-space: pre-wrap;
}
.patchnote-editor .d-emoji {
  height: 1.375em;
  vertical-align: -0.3em;
}

/* Discord-style emoji picker on the note editor. */
.emoji-picker { margin: 4px 0 12px; }
.emoji-picker summary {
  cursor: pointer;
  color: var(--accent-2);
  user-select: none;
}
.emoji-picker summary .d-emoji { height: 1.1em; vertical-align: -0.2em; }
.emoji-picker-panel {
  margin-top: 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 10px;
  max-height: 320px;
  overflow-y: auto;
}
.emoji-search {
  width: 100%;
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  color: var(--text);
  padding: 6px 10px;
  font: inherit;
}
.emoji-search:focus { outline: none; border-color: var(--accent-2); }
.emoji-section-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 8px 0 4px;
}
.emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.emoji-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 0;
  cursor: pointer;
}
.emoji-btn:hover { background: rgba(255, 255, 255, 0.1); }
.emoji-btn .d-emoji {
  height: 28px;
  width: auto;
  max-width: 32px;
}

/* Small screens: reclaim the horizontal space the desktop gutters spend, so
   patch-note lines wrap far less on phones. */
@media (max-width: 560px) {
  .page-main { padding: 0 10px; margin: 20px auto 40px; }
  .page-main .card { padding: 16px 14px; }
  .page-main .card h1 { font-size: 1.5rem; }
  .note-panel { padding: 4px 12px; }
  .patch-note-body { font-size: 0.95rem; line-height: 1.55; }
  .patchnote-card h2 { font-size: 1.15rem; }
  .publish-panel { padding: 12px; }
}
