:root {
  color-scheme: dark;
  --bg: #111314;
  --panel: #1b1f20;
  --panel-2: #222829;
  --text: #eef2f1;
  --muted: #9aa6a3;
  --line: #303738;
  --accent: #48c78e;
  --accent-soft: rgba(72, 199, 142, .14);
  --warning: #f2b84b;
  --danger: #ef6a6a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; }
.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.brand { font-weight: 750; font-size: 20px; letter-spacing: 0; text-decoration: none; }
.user { color: var(--muted); }
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.workspace-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
}
.workspace-switcher label {
  margin: 0;
}
.workspace-switcher select {
  width: auto;
  min-width: 180px;
  padding: 8px 34px 8px 10px;
}
.nav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  padding: 0 14px;
  text-decoration: none;
}
.nav a.active {
  color: #07120d;
  background: var(--accent);
  border-color: transparent;
  font-weight: 750;
}
.subnav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: -4px 0 16px;
}
.subnav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 6px;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 0 12px;
  text-decoration: none;
}
.subnav a:hover {
  border-color: var(--line);
  color: var(--text);
}
.subnav a.active {
  border-color: rgba(72, 199, 142, .42);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 750;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-heading h2 {
  margin-bottom: 0;
}
h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}
h2 {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}
p { color: var(--muted); margin: 6px 0 0; }
.summary {
  display: grid;
  grid-template-columns: 1fr repeat(3, minmax(120px, 150px));
  gap: 12px;
  margin-bottom: 16px;
  align-items: stretch;
}
.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-2);
  min-height: 86px;
}
.metric strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  margin-bottom: 8px;
}
.muted { color: var(--muted); }
.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 16px;
  align-items: start;
}
label {
  display: block;
  color: var(--muted);
  margin-bottom: 7px;
  font-size: 13px;
}
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  padding: 11px 12px;
  font: inherit;
}
input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px rgba(239, 106, 106, .12);
}
.field-error {
  margin-top: 6px;
  color: var(--danger);
  font-size: 12px;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--accent);
}
textarea {
  min-height: 92px;
  resize: vertical;
}
.field { margin-bottom: 14px; }
.field-hint {
  min-height: 18px;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
}
.account-autocomplete {
  position: relative;
}
.account-suggestion-list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #202526;
  box-shadow: 0 16px 36px rgba(0, 0, 0, .38);
  padding: 5px;
}
.edit-form .account-suggestion-list {
  position: static;
  margin-top: 6px;
  max-height: 240px;
}
.account-suggestion-item {
  display: grid;
  width: 100%;
  gap: 2px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.account-suggestion-item:hover,
.account-suggestion-item.active {
  background: var(--accent-soft);
}
.account-suggestion-item strong {
  overflow-wrap: anywhere;
}
.account-suggestion-identity,
.account-suggestion-metadata {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.account-suggestion-item.active .account-suggestion-identity,
.account-suggestion-item.active .account-suggestion-metadata {
  color: #c5d2cf;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0 12px;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.button.primary {
  min-height: 42px;
  width: 100%;
  background: var(--accent);
  color: #07120d;
  border-color: transparent;
  font-weight: 700;
}
.button.warning { color: var(--warning); }
.button.danger { color: var(--danger); }
.button:disabled {
  cursor: wait;
  opacity: .65;
}
.button.disabled {
  cursor: default;
  opacity: .55;
}
.queue-list { overflow-x: auto; }
table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}
th, td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
td:first-child, th:first-child { width: 54px; }
td:nth-child(4), th:nth-child(4) { width: 140px; }
td:last-child, th:last-child { width: 310px; }
.tank {
  font-weight: 700;
  margin-bottom: 4px;
}
.comment {
  color: var(--muted);
  max-width: 360px;
  overflow-wrap: anywhere;
}
.priority {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-top: 6px;
  border-radius: 999px;
  padding: 0 8px;
  background: rgba(242, 184, 75, .12);
  color: var(--warning);
  font-size: 12px;
  font-weight: 700;
}
.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}
.status.done { color: #91d19f; background: rgba(145, 209, 159, .12); }
.status.running,
.status.awaiting_nicks,
.status.nickname_received,
.status.approved { color: #91d19f; background: rgba(145, 209, 159, .12); }
.status.closing,
.status.awaiting_nickname,
.status.expired { color: var(--warning); background: rgba(242, 184, 75, .12); }
.status.skipped,
.status.cancelled,
.status.rejected,
.status.replaced,
.status.replaced_expired { color: var(--danger); background: rgba(239, 106, 106, .12); }
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.filter-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .025);
  padding: 4px;
}
.filter-tabs .button {
  min-height: 32px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
}
.filter-tabs .button.primary {
  width: auto;
  min-height: 32px;
  background: var(--accent);
  color: #07120d;
}
form.inline { display: inline-flex; }
.edit-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .025);
  padding: 14px;
}
.edit-form .field:last-of-type {
  margin-bottom: 12px;
}
.empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 8px;
  background: rgba(255, 255, 255, .018);
}
.empty strong {
  color: var(--text);
  display: block;
  margin-bottom: 4px;
}
.obs-panel { margin-bottom: 16px; }
.obs-url {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}
.obs-url input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}
.integrations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.settings-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.settings-card {
  display: block;
  min-height: 150px;
  text-decoration: none;
}
.settings-card .status {
  margin: 2px 0 8px;
}
.settings-card p {
  overflow-wrap: anywhere;
}
.chat-message-groups {
  display: grid;
  gap: 24px;
}
.chat-message-group {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.chat-message-group-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.chat-message-group-heading h2 {
  margin: 0;
  font-size: 21px;
}
.chat-message-grid {
  margin-bottom: 0;
}
.workspace-settings-form {
  margin-top: 16px;
}
.workspace-section-list {
  display: grid;
  gap: 10px;
}
.management-create-grid {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(420px, 1.2fr);
  gap: 16px;
  align-items: start;
}
.management-section {
  margin-top: 24px;
}
.management-heading,
.workspace-card-heading,
.account-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.management-heading {
  margin-bottom: 12px;
}
.management-heading h2,
.workspace-card-heading h2,
.account-card-heading h2 {
  margin: 0;
}
.workspace-card-list,
.account-card-list {
  display: grid;
  gap: 14px;
}
.workspace-card,
.account-card {
  scroll-margin-top: 14px;
}
.workspace-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}
.capability-details,
.password-details {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.capability-details > summary,
.password-details > summary {
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}
.capability-details form,
.password-details form {
  margin-top: 14px;
}
.capability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.capability-grid h2,
.capability-grid h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.section-toggle.compact {
  min-height: 50px;
  padding: 9px 11px;
}
.section-toggle .mono {
  font-size: 11px;
}
.section-toggle .dependency-note {
  display: block;
  margin-top: 3px;
  font-size: 11px;
}
.capability-actions {
  justify-content: flex-end;
  margin-top: 14px;
}
.membership-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.membership-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 10px 12px;
}
.membership-row > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.membership-row select {
  width: 132px;
  padding: 8px 10px;
}
.membership-add-form {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
@media (max-width: 900px) {
  .management-create-grid,
  .capability-grid {
    grid-template-columns: 1fr;
  }
  .membership-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .topbar,
  .top-actions,
  .workspace-card-heading,
  .account-card-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .workspace-switcher {
    align-items: stretch;
    flex-direction: column;
  }
  .workspace-switcher select {
    width: 100%;
  }
}

/* Reward mapping workspace */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.mapping-section-tabs {
  display: inline-flex;
  gap: 4px;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  padding: 4px;
}
.mapping-section-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border-radius: 6px;
  padding: 0 14px;
  color: var(--muted);
  text-decoration: none;
}
.mapping-section-tabs a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 750;
}
.mapping-catalog,
.integration-connection-summary,
.integration-technical-summary,
.auction-role-panel,
.developer-tools,
.twitch-reward-create {
  margin-bottom: 16px;
}
.mapping-catalog-heading,
.integration-connection-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.mapping-catalog-heading h1,
.integration-connection-summary h1 {
  margin-bottom: 4px;
}
.mapping-catalog-heading > div:first-child,
.integration-connection-summary > div:first-child {
  min-width: 0;
  max-width: 720px;
}
.mapping-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}
.mapping-metric {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, .065);
  border-radius: 8px;
  background: rgba(255, 255, 255, .025);
  padding: 11px 12px;
}
.mapping-metric strong,
.mapping-metric span {
  display: block;
}
.mapping-metric strong {
  font-size: 21px;
  line-height: 1.1;
}
.mapping-metric span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.mapping-toolbar {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.mapping-search input {
  min-height: 42px;
}
.mapping-search {
  margin: 0;
}
.mapping-manual-create,
.mapping-row-editor {
  position: relative;
}
.mapping-manual-create > summary,
.mapping-row-editor > summary {
  list-style: none;
}
.mapping-manual-create > summary::-webkit-details-marker,
.mapping-row-editor > summary::-webkit-details-marker {
  display: none;
}
.mapping-manual-create[open] > summary,
.mapping-row-editor[open] > summary {
  border-color: rgba(72, 199, 142, .45);
  color: var(--accent);
}
.mapping-manual-popover,
.mapping-editor-popover {
  position: absolute;
  z-index: 25;
  top: calc(100% + 8px);
  right: 0;
  width: min(520px, calc(100vw - 48px));
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #181d1e;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .48);
  padding: 16px;
}
.mapping-manual-popover h2,
.mapping-editor-popover h2 {
  margin-bottom: 12px;
}
.mapping-editor-popover > form + form {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.mapping-editor-popover > form + form .button {
  width: 100%;
}
.mapping-role-fields {
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.mapping-role-fields legend {
  color: var(--muted);
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
}
.mapping-advanced-fields {
  margin: 4px 0 12px;
}
.mapping-advanced-fields > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.mapping-advanced-fields[open] > summary {
  margin-bottom: 10px;
  color: var(--text);
}
.mapping-submit {
  width: 100%;
  min-height: 42px;
}
.mapping-sync-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  border: 1px dashed rgba(72, 199, 142, .3);
  border-radius: 8px;
  background: rgba(72, 199, 142, .045);
  padding: 13px 14px;
}
.mapping-sync-prompt p {
  margin-top: 2px;
}
.mapping-catalog-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.mapping-catalog-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  padding: 12px 14px;
}
.mapping-catalog-row.available {
  background: rgba(255, 255, 255, .018);
  border-style: dashed;
}
.mapping-row-main {
  min-width: 0;
}
.mapping-row-title,
.mapping-row-meta,
.mapping-row-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mapping-row-title strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
}
.mapping-row-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}
.mapping-row-meta > span + span::before {
  content: "·";
  margin-right: 8px;
}
.mapping-row-status {
  justify-content: flex-end;
}
.mapping-action-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  padding: 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}
.mapping-action-badge.queue { color: #9fc6ee; background: rgba(94, 156, 219, .12); }
.mapping-action-badge.gold { color: var(--warning); background: rgba(242, 184, 75, .12); }
.mapping-action-badge.memealerts { color: #e6a9ee; background: rgba(203, 111, 216, .12); }
.mapping-action-badge.longest { color: #f1a7a7; background: rgba(239, 106, 106, .1); }
.mapping-action-badge.auction { color: #b9adf1; background: rgba(137, 118, 225, .13); }
.mapping-action-badge.role { color: var(--accent); background: var(--accent-soft); }
.status.neutral {
  color: var(--muted);
  background: rgba(255, 255, 255, .055);
}
.status.unavailable {
  color: var(--warning);
  background: rgba(242, 184, 75, .1);
}
.mapping-technical {
  display: inline-block;
}
.mapping-technical summary {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(154, 166, 163, .45);
  text-underline-offset: 3px;
}
.mapping-technical code {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 11px;
}
.mapping-filter-empty {
  min-height: 110px;
  margin-top: 14px;
}
.mapping-filter-empty[hidden] {
  display: none;
}
[data-mapping-row][hidden] {
  display: none;
}
.mapping-enabled-toggle {
  margin: 2px 0 12px;
}
.mapping-enabled-toggle span {
  color: var(--text);
}
.developer-tools,
.twitch-reward-create {
  padding: 0;
}
.developer-tools > summary,
.twitch-reward-create > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
}
.developer-tools > summary::-webkit-details-marker,
.twitch-reward-create > summary::-webkit-details-marker {
  display: none;
}
.developer-tools > summary strong,
.developer-tools > summary small,
.twitch-reward-create > summary strong,
.twitch-reward-create > summary small {
  display: block;
}
.developer-tools > summary small,
.twitch-reward-create > summary small {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 400;
}
.developer-tools-toggle {
  position: relative;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.developer-tools-toggle::before,
.developer-tools-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 2px;
  border-radius: 2px;
  background: var(--muted);
  transform: translate(-50%, -50%);
}
.developer-tools-toggle::after {
  transform: translate(-50%, -50%) rotate(90deg);
}
.developer-tools[open] .developer-tools-toggle::after,
.twitch-reward-create[open] .developer-tools-toggle::after {
  display: none;
}
.developer-tools-form,
.twitch-reward-create > form,
.twitch-reward-create > .notice {
  border-top: 1px solid var(--line);
  padding: 18px;
}
.optional {
  color: var(--muted);
  font-weight: 400;
}
.integration-connection-summary .actions {
  justify-content: flex-end;
}
.mapping-checkbox-card {
  align-items: flex-start;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 12px;
}
.mapping-checkbox-card input {
  margin-top: 2px;
}
.mapping-checkbox-card strong,
.mapping-checkbox-card small {
  display: block;
}
.mapping-checkbox-card small {
  margin-top: 2px;
  color: var(--muted);
}
.auction-role-create {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.auction-role-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}
.auction-role-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 11px 12px;
}
.auction-role-row > div:first-child strong,
.auction-role-row > div:first-child span {
  display: block;
}
.auction-role-row > div:first-child span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.auction-role-edit {
  display: flex;
  gap: 6px;
}
.auction-role-edit select {
  min-width: 170px;
}
form[aria-busy="true"] {
  opacity: .72;
}

@media (max-width: 880px) {
  .mapping-catalog-heading,
  .integration-connection-summary {
    align-items: stretch;
    flex-direction: column;
  }
  .mapping-catalog-heading > .button {
    align-self: flex-start;
  }
  .mapping-toolbar {
    grid-template-columns: 1fr;
  }
  .mapping-toolbar .filter-tabs {
    width: 100%;
    overflow-x: auto;
  }
  .mapping-toolbar .filter-tabs .button {
    flex: 1 0 auto;
  }
  .mapping-manual-create > summary {
    justify-content: center;
  }
  .mapping-manual-popover,
  .mapping-editor-popover {
    position: static;
    width: 100%;
    margin-top: 8px;
    box-shadow: none;
  }
  .mapping-catalog-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .mapping-row-status {
    justify-content: space-between;
  }
  .mapping-row-editor {
    flex: 1 1 100%;
  }
  .mapping-row-editor > summary {
    width: 100%;
  }
  .mapping-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .auction-role-row {
    grid-template-columns: 1fr auto;
  }
  .auction-role-row > .actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .mapping-section-tabs {
    display: flex;
    width: 100%;
  }
  .mapping-section-tabs a {
    flex: 1;
    justify-content: center;
  }
  .mapping-sync-prompt {
    align-items: stretch;
    flex-direction: column;
  }
  .mapping-sync-prompt .button {
    width: 100%;
  }
  .mapping-row-status {
    align-items: stretch;
    flex-direction: column;
  }
  .mapping-row-status > .status {
    align-self: flex-start;
  }
  .mapping-manual-popover,
  .mapping-editor-popover {
    padding: 13px;
  }
  .auction-role-row {
    grid-template-columns: 1fr;
  }
  .auction-role-row > .status {
    justify-self: start;
  }
  .auction-role-edit,
  .auction-role-row .actions,
  .auction-role-row .actions form {
    width: 100%;
  }
  .auction-role-edit {
    align-items: stretch;
    flex-direction: column;
  }
  .auction-role-edit select,
  .auction-role-row .button {
    width: 100%;
  }
}
.section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 12px 14px;
  color: var(--text);
}
.section-toggle span {
  min-width: 0;
}
.section-toggle strong,
.section-toggle .mono {
  display: block;
}
.section-toggle input {
  flex: 0 0 auto;
}
.longest-role-panel {
  margin-bottom: 16px;
}
.longest-role-config {
  margin: 0 0 16px;
}
.role-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.role-status-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 12px;
  min-width: 0;
}
.role-status-grid span,
.role-status-grid strong {
  display: block;
  overflow-wrap: anywhere;
}
.role-status-grid strong {
  margin-top: 4px;
}
.longest-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.longest-panel table {
  min-width: 460px;
}
.longest-table td:first-child,
.longest-table th:first-child {
  width: 56px;
}
.longest-table td:nth-child(3),
.longest-table th:nth-child(3) {
  width: 112px;
  text-align: right;
}
.longest-table td:last-child,
.longest-table th:last-child {
  width: 112px;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}
.event-retention-form {
  min-width: 300px;
}
.event-retention-form input {
  width: 110px;
}
.event-filter-form {
  margin-top: 16px;
}
.event-filter-actions .button.primary {
  width: auto;
  min-height: 36px;
}
.event-log-panel {
  margin-top: 16px;
}
.event-log-list {
  display: grid;
  gap: 10px;
}
.event-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 34%);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .018);
  padding: 14px;
}
.event-card-main {
  min-width: 0;
}
.event-card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.event-card .status.pending {
  color: var(--warning);
  background: rgba(242, 184, 75, .12);
}
.event-provider,
.event-type {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  padding: 0 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.event-type {
  color: var(--muted);
  font-weight: 600;
}
.event-card-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  margin-bottom: 8px;
}
.event-card-title strong {
  min-width: 0;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.event-card-title .mono {
  flex: 0 1 auto;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.event-message {
  border-left: 3px solid rgba(72, 199, 142, .52);
  color: var(--text);
  margin: 8px 0 12px;
  padding-left: 10px;
  overflow-wrap: anywhere;
}
.event-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.event-facts > div {
  min-width: 0;
  border-top: 1px solid rgba(255, 255, 255, .06);
  padding-top: 8px;
}
.event-facts > .event-user-text {
  grid-column: 1 / -1;
}
.event-facts span,
.event-facts strong {
  display: block;
}
.event-facts strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}
.event-payload summary {
  color: var(--muted);
  cursor: pointer;
  overflow-wrap: anywhere;
}
.event-payload pre {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .18);
  color: var(--text);
  padding: 12px;
  white-space: pre;
  overflow-wrap: normal;
  font-size: 12px;
}
.giveaway-panel {
  overflow-x: auto;
}
.giveaway-main-column {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.giveaway-history-slot:empty {
  display: none;
}
.giveaway-history-panel {
  padding: 14px 16px;
}
.giveaway-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.giveaway-history-head h2 {
  margin-bottom: 0;
  font-size: 16px;
}
.giveaway-history-list {
  display: grid;
  gap: 6px;
}
.giveaway-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
  gap: 12px;
  align-items: center;
  min-height: 46px;
  border-top: 1px solid rgba(255, 255, 255, .06);
  padding-top: 7px;
}
.giveaway-history-item:first-child {
  border-top: 0;
  padding-top: 0;
}
.giveaway-history-viewer,
.giveaway-history-account {
  min-width: 0;
}
.giveaway-history-viewer strong,
.giveaway-history-account strong,
.giveaway-history-viewer span,
.giveaway-history-account span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.giveaway-history-account {
  text-align: right;
}
.giveaway-state {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.giveaway-winners-table {
  min-width: 900px;
}
.giveaway-participants-table {
  min-width: 700px;
}
.giveaway-stats-panel,
.giveaway-links-panel {
  overflow-x: auto;
}
.giveaway-stats-table {
  min-width: 980px;
}
.giveaway-stats-table td:first-child,
.giveaway-stats-table th:first-child {
  width: 220px;
}
.giveaway-stats-table td:nth-child(2),
.giveaway-stats-table th:nth-child(2) {
  width: 300px;
}
.giveaway-stats-table td:nth-child(n+3),
.giveaway-stats-table th:nth-child(n+3) {
  width: 92px;
  text-align: right;
}
.giveaway-stats-table td:last-child,
.giveaway-stats-table th:last-child {
  width: 80px;
}
.probability-diff {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-weight: 750;
}
.probability-diff.positive {
  color: #91d19f;
  background: rgba(145, 209, 159, .12);
}
.probability-diff.negative {
  color: var(--danger);
  background: rgba(239, 106, 106, .12);
}
.probability-diff.neutral {
  color: var(--muted);
  background: rgba(255, 255, 255, .06);
}
.viewer-stat-accounts,
.viewer-link-accounts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.viewer-stats-link {
  color: inherit;
  text-decoration-color: rgba(72, 199, 142, .5);
  text-underline-offset: 3px;
}
.viewer-stats-link:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}
.giveaway-links-page {
  margin-bottom: 16px;
}
.giveaway-links-heading,
.viewer-link-card-heading,
.viewer-link-account-row,
.viewer-history-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.giveaway-links-heading h1,
.viewer-history-header h1 {
  margin-bottom: 4px;
}
.viewer-link-create {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}
.viewer-link-create summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
}
.viewer-link-create summary::-webkit-details-marker {
  display: none;
}
.viewer-link-create summary:hover {
  background: rgba(255, 255, 255, .02);
}
.viewer-link-create-summary {
  display: grid;
  gap: 2px;
}
.viewer-link-create-toggle {
  position: relative;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}
.viewer-link-create-toggle::before,
.viewer-link-create-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 2px;
  border-radius: 2px;
  background: var(--muted);
  transform: translate(-50%, -50%);
  transition: opacity .16s ease, transform .16s ease;
}
.viewer-link-create-toggle::after {
  transform: translate(-50%, -50%) rotate(90deg);
}
.viewer-link-create[open] .viewer-link-create-toggle::after {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(0);
}
.viewer-link-create form {
  border-top: 1px solid var(--line);
  padding: 18px;
}
.viewer-link-create-layout {
  display: grid;
  grid-template-columns: minmax(260px, .75fr) minmax(560px, 1.7fr);
  gap: 14px;
  align-items: stretch;
}
.viewer-link-create-group {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}
.viewer-link-create-group legend {
  color: var(--muted);
  padding: 0 7px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.viewer-link-create-account-grid {
  display: grid;
  grid-template-columns: 130px minmax(220px, 1fr) minmax(190px, .8fr);
  gap: 12px;
  align-items: start;
}
.viewer-link-create .field {
  margin-bottom: 0;
}
.viewer-link-create .field-hint {
  margin: 6px 0 0;
  line-height: 1.35;
}
.viewer-link-create-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
.viewer-link-create .button.primary {
  min-width: 190px;
  min-height: 43px;
}
.viewer-link-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.viewer-link-section-heading {
  margin-bottom: 12px;
}
.viewer-link-section-heading p {
  margin: 3px 0 0;
}
.viewer-link-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 30px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 750;
}
.viewer-link-card-list {
  display: grid;
  gap: 10px;
}
.viewer-link-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 14px;
}
.viewer-link-card-heading {
  align-items: end;
}
.viewer-link-name-form {
  flex: 1 1 520px;
  max-width: 620px;
}
.viewer-link-name-form .field {
  margin-bottom: 0;
}
.viewer-link-name-controls {
  display: flex;
  gap: 8px;
}
.viewer-link-name-controls input {
  min-width: 0;
}
.viewer-link-history {
  flex: 0 0 auto;
}
.viewer-link-account-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.viewer-link-account-row {
  align-items: center;
  min-width: 0;
}
.viewer-link-account-identity {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.viewer-link-account-identity strong,
.viewer-link-account-identity span {
  overflow-wrap: anywhere;
}
.viewer-link-account-row .button {
  min-height: 32px;
}
[data-giveaway-links-panel][aria-busy="true"] {
  opacity: .6;
  pointer-events: none;
}
.suggestion-list {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}
.suggestion {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(72, 199, 142, .22);
  border-radius: 8px;
  background: rgba(72, 199, 142, .06);
  padding: 12px;
}
.suggestion > div {
  min-width: 0;
}
.giveaway-links-empty {
  min-height: 120px;
}
.viewer-history-back {
  margin-bottom: 12px;
}
.viewer-history-header {
  align-items: center;
  margin-bottom: 12px;
}
.viewer-history-totals {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.viewer-history-totals > div {
  min-width: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 9px 12px;
  text-align: center;
}
.viewer-history-totals strong,
.viewer-history-totals span,
.viewer-history-totals small {
  display: block;
}
.viewer-history-totals .missed strong {
  color: var(--warning);
}
.viewer-history-totals strong {
  color: var(--accent);
  font-size: 20px;
}
.viewer-history-totals span {
  color: var(--muted);
  font-size: 12px;
}
.viewer-history-totals small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}
.viewer-history-totals > .positive strong {
  color: var(--accent);
}
.viewer-history-totals > .negative strong {
  color: var(--danger);
}
.viewer-history-table {
  min-width: 760px;
}
.viewer-history-table td:first-child,
.viewer-history-table th:first-child {
  width: 250px;
}
.viewer-history-table td:nth-child(2),
.viewer-history-table th:nth-child(2) {
  width: 220px;
}
.viewer-history-table td:nth-child(3),
.viewer-history-table th:nth-child(3) {
  width: 190px;
  text-align: right;
}
.viewer-history-table td:last-child,
.viewer-history-table th:last-child {
  width: 130px;
  text-align: right;
}
.viewer-history-platforms {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.viewer-history-platforms .provider-logo {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
}
.viewer-history-platforms .provider-logo.vk {
  background: rgba(76, 139, 245, .14);
  color: #4c8bf5;
}
.viewer-history-platforms .provider-logo.twitch {
  background: rgba(169, 112, 255, .14);
  color: #a970ff;
}
.viewer-history-platforms .provider-logo.youtube {
  background: rgba(255, 0, 51, .14);
  color: #ff0033;
}
.viewer-history-platforms .provider-icon {
  width: 24px;
  height: 24px;
}
.viewer-history-platforms .provider-icon.vk {
  width: 28px;
  height: 28px;
}
.viewer-history-result {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 750;
}
.viewer-history-result.positive {
  color: var(--accent);
  background: rgba(72, 199, 142, .12);
}
.viewer-history-result.negative {
  color: var(--muted);
  background: rgba(255, 255, 255, .06);
}
.viewer-history-result.pending {
  color: var(--warning);
  background: rgba(242, 184, 75, .12);
}
.viewer-history-result.missed {
  color: var(--warning);
  background: rgba(242, 184, 75, .12);
}
.viewer-history-result.neutral {
  color: var(--muted);
  background: var(--panel-2);
}
@media (max-width: 1100px) {
  .viewer-link-create-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .giveaway-links-heading,
  .viewer-link-card-heading,
  .viewer-link-account-row,
  .viewer-history-header {
    align-items: stretch;
    flex-direction: column;
  }
  .viewer-link-create-account-grid {
    grid-template-columns: 1fr;
  }
  .viewer-link-create form {
    padding: 14px;
  }
  .viewer-link-create .button.primary,
  .viewer-link-history {
    width: 100%;
  }
  .viewer-link-name-form {
    flex-basis: auto;
    max-width: none;
  }
  .viewer-link-name-controls {
    align-items: stretch;
    flex-direction: column;
  }
  .viewer-link-account-row .button {
    width: 100%;
  }
  .viewer-history-totals > div {
    flex: 1 1 80px;
  }
}
.gold-groups {
  display: grid;
  gap: 12px;
}
.gold-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .02);
  overflow: hidden;
}
.gold-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  padding: 14px 16px;
  background: var(--panel-2);
}
.gold-group summary::marker {
  color: var(--muted);
}
.gold-group-title {
  min-width: 0;
}
.gold-group-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.gold-group-title strong {
  display: inline-block;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  user-select: text;
}
.copy-button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}
.gold-group-total {
  flex: 0 0 auto;
  text-align: right;
}
.gold-group-total strong {
  display: block;
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
}
.gold-network-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.network-account {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(72, 199, 142, .28);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  padding: 0 10px;
  font-size: 13px;
}
.gold-claims-table {
  min-width: 1120px;
}
.gold-claims-table td:first-child,
.gold-claims-table th:first-child {
  width: 54px;
}
.gold-claims-table td:nth-child(3),
.gold-claims-table th:nth-child(3) {
  width: 220px;
}
.gold-claims-table td:nth-child(4),
.gold-claims-table th:nth-child(4) {
  width: 140px;
}
.gold-claims-table td:nth-child(5),
.gold-claims-table th:nth-child(5) {
  width: 180px;
}
.gold-claims-table td:last-child,
.gold-claims-table th:last-child {
  width: 310px;
}
.gold-nickname-form {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.gold-nickname-form input {
  min-width: 130px;
  padding: 7px 9px;
}
.gold-nickname-form .button {
  flex: 0 0 auto;
}
.manual-gold-panel {
  margin-bottom: 16px;
}
.manual-gold-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(120px, .7fr) minmax(130px, .7fr) minmax(180px, 1fr) minmax(130px, .7fr);
  gap: 12px;
  align-items: end;
}
.manual-gold-form .field {
  margin-bottom: 0;
}
.manual-gold-form .button.primary {
  min-height: 43px;
}
.auction-entries-table {
  min-width: 980px;
}
.auction-entries-table td:first-child,
.auction-entries-table th:first-child {
  width: 54px;
}
.auction-entries-table td:nth-child(3),
.auction-entries-table th:nth-child(3) {
  width: 90px;
  text-align: right;
}
.auction-entries-table td:nth-child(4),
.auction-entries-table th:nth-child(4) {
  width: 150px;
}
.auction-entries-table td:nth-child(5),
.auction-entries-table th:nth-child(5) {
  width: 180px;
}
.auction-entries-table td:last-child,
.auction-entries-table th:last-child {
  width: 260px;
}
.public-topbar {
  margin-bottom: 20px;
}
.public-filter-form {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}
.public-filter-form .field {
  min-width: min(280px, 100%);
  margin-bottom: 0;
}
.public-filter-form .button {
  min-height: 43px;
}
.public-gold-table {
  min-width: 760px;
}
.public-gold-table td:first-child,
.public-gold-table th:first-child {
  width: 150px;
}
.public-gold-table td:nth-child(3),
.public-gold-table th:nth-child(3) {
  width: 100px;
  text-align: right;
}
.public-gold-table td:last-child,
.public-gold-table th:last-child {
  width: 170px;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.mapping-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.mapping {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 10px 12px;
}
.mapping > div { min-width: 0; }
.mapping .mono { overflow-wrap: anywhere; }
.checkline {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  margin-bottom: 14px;
}
.checkline label {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  padding: 10px 12px;
  margin: 10px 0 0;
}
.notice.error {
  color: var(--danger);
  border-color: rgba(239, 106, 106, .45);
  background: rgba(239, 106, 106, .08);
}
.notice.success {
  color: var(--accent);
  border-color: rgba(72, 199, 142, .45);
  background: rgba(72, 199, 142, .08);
}
.notification-center {
  position: fixed;
  z-index: 1200;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  display: grid;
  width: min(380px, calc(100vw - 36px));
  gap: 10px;
  pointer-events: none;
}
.notification-toast {
  --notification-color: #9fc6ee;
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 28px;
  align-items: start;
  gap: 10px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--notification-color) 42%, var(--line));
  border-radius: 12px;
  background: rgba(28, 34, 33, .97);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .38);
  padding: 13px 12px 14px;
  opacity: 0;
  pointer-events: auto;
  transform: translateY(-8px) scale(.98);
  transition: opacity .18s ease, transform .18s ease;
}
.notification-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.notification-toast.is-leaving {
  opacity: 0;
  transform: translateX(12px) scale(.98);
}
.notification-toast.success { --notification-color: var(--accent); }
.notification-toast.error { --notification-color: var(--danger); }
.notification-toast.warning { --notification-color: var(--warning); }
.notification-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--notification-color) 16%, transparent);
  color: var(--notification-color);
  font-size: 16px;
  font-weight: 850;
}
.notification-icon::before { content: "i"; }
.notification-toast.success .notification-icon::before { content: "✓"; }
.notification-toast.error .notification-icon::before { content: "!"; }
.notification-toast.warning .notification-icon::before { content: "!"; }
.notification-content {
  min-width: 0;
}
.notification-content strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
}
.notification-content p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}
.notification-close {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 20px;
  line-height: 1;
}
.notification-close:hover,
.notification-close:focus-visible {
  background: rgba(255, 255, 255, .07);
  color: var(--text);
}
.notification-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--notification-color);
  transform-origin: left center;
  animation: notification-countdown var(--notification-duration) linear forwards;
}
.notification-toast.is-paused .notification-progress {
  animation-play-state: paused;
}
@keyframes notification-countdown {
  to { transform: scaleX(0); }
}
@media (max-width: 560px) {
  .notification-center {
    top: max(10px, env(safe-area-inset-top));
    right: 10px;
    left: 10px;
    width: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .notification-toast {
    transition: none;
  }
  .notification-progress {
    animation: none;
  }
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}
@media (max-width: 880px) {
  .summary,
  .workspace,
  .integrations,
  .settings-cards,
  .role-status-grid,
  .longest-grid,
  .manual-gold-form,
  .split {
    grid-template-columns: 1fr;
  }
  .obs-url {
    align-items: stretch;
    flex-direction: column;
  }
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .top-actions { justify-content: flex-start; }
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .giveaway-history-head,
  .giveaway-history-item {
    grid-template-columns: 1fr;
  }
  .giveaway-history-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .giveaway-history-account {
    text-align: left;
  }
  .list-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .filter-tabs {
    display: flex;
    overflow-x: auto;
  }
  .filter-tabs .button {
    flex: 0 0 auto;
  }
  .event-card {
    grid-template-columns: 1fr;
  }
  .event-card-title {
    align-items: flex-start;
    flex-direction: column;
  }
  .event-facts {
    grid-template-columns: 1fr;
  }
  .gold-group summary {
    align-items: flex-start;
    flex-direction: column;
  }
  .gold-group-title-line {
    align-items: flex-start;
    flex-direction: column;
  }
  .gold-group-total {
    text-align: left;
  }
}

.movies-summary {
  grid-template-columns: minmax(0, 1fr) 160px;
}
.movies-public-link {
  margin-bottom: 16px;
}
.movies-public-link h2 {
  margin-bottom: 4px;
}
.movies-saved {
  margin: 0 0 16px;
}
.movies-workspace {
  grid-template-columns: minmax(300px, 350px) minmax(0, 1fr);
}
.movies-admin-list {
  min-width: 0;
}
.movies-admin-toolbar {
  align-items: end;
}
.movies-admin-search {
  min-width: min(100%, 360px);
}
.movies-search-row {
  display: flex;
  gap: 8px;
}
.movie-lookup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.movie-lookup-row .button {
  white-space: nowrap;
}
.movie-lookup-status {
  min-height: 16px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.movie-lookup-status[data-state="loading"] {
  color: var(--text);
}
.movie-lookup-status[data-state="success"] {
  color: var(--accent);
}
.movie-lookup-status[data-state="error"] {
  color: var(--danger);
}
.movies-admin-search .button[hidden] {
  display: none !important;
}
.movies-admin-results {
  transition: opacity .15s ease;
}
.movies-admin-results[aria-busy="true"] {
  opacity: .55;
  pointer-events: none;
}
.movie-form-error {
  margin: 0 0 14px;
}
.field.has-error label {
  color: var(--danger);
}
.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 106, 106, .12);
}
.field-error {
  display: block;
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.35;
}
.field-error[hidden] {
  display: none;
}
.movie-delete-form {
  position: relative;
}
.movie-delete-error {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: max-content;
  max-width: 220px;
  padding: 5px 7px;
  border: 1px solid rgba(239, 106, 106, .4);
  border-radius: 5px;
  background: var(--panel-2);
  z-index: 2;
}
[data-movie-form][aria-busy="true"] {
  opacity: .7;
}
.random-index-admin-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}
.random-index-admin-message {
  margin-bottom: 16px;
}
.random-index-admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.random-index-event-create {
  position: sticky;
  top: 16px;
}
.random-index-events-list {
  display: grid;
  gap: 12px;
  transition: opacity .15s ease;
}
.random-index-events-list[aria-busy="true"] {
  opacity: .55;
  pointer-events: none;
}
.random-index-event-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}
.random-index-event-fields {
  display: grid;
  grid-template-columns: minmax(140px, .34fr) minmax(140px, .34fr) minmax(220px, 1fr);
  gap: 12px;
}
.random-index-event-item textarea {
  min-height: 72px;
}
.random-index-event-delete {
  align-self: end;
}
.random-index-form-error {
  margin-bottom: 14px;
}
[data-random-index-event-form][aria-busy="true"],
[data-random-index-event-delete][aria-busy="true"] {
  opacity: .65;
}
@media (max-width: 820px) {
  .random-index-admin-layout {
    grid-template-columns: 1fr;
  }
  .random-index-event-create {
    position: static;
  }
}
@media (max-width: 620px) {
  .random-index-admin-intro,
  .random-index-event-item {
    grid-template-columns: 1fr;
  }
  .random-index-admin-intro {
    display: grid;
  }
  .random-index-event-fields {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .random-index-event-delete {
    justify-self: start;
  }
}
.admin-movies-table {
  min-width: 780px;
}
.admin-movies-table td:first-child,
.admin-movies-table th:first-child {
  width: auto;
}
.admin-movies-table td:nth-child(2),
.admin-movies-table th:nth-child(2) {
  width: 112px;
}
.admin-movies-table td:nth-child(3),
.admin-movies-table th:nth-child(3),
.admin-movies-table td:nth-child(4),
.admin-movies-table th:nth-child(4) {
  width: 84px;
  text-align: right;
}
.admin-movies-table td:last-child,
.admin-movies-table th:last-child {
  width: 220px;
}
.movie-title-link {
  color: var(--text);
  font-weight: 750;
  text-decoration-color: rgba(72, 199, 142, .55);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.movie-title-link:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}
.public-movies-shell {
  width: min(1240px, calc(100% - 32px));
}
.public-movies-heading {
  margin-bottom: 12px;
}
.public-movies-heading p {
  max-width: 760px;
}
.public-movies-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(190px, 240px) minmax(170px, 220px) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  padding: 14px;
}
.public-movies-filters .field {
  margin-bottom: 0;
}
.public-movies-submit {
  min-height: 43px;
}
.public-movies-error {
  margin: 0 0 12px;
}
.public-movies-results {
  padding: 14px 16px 16px;
  transition: opacity .15s ease;
}
.public-movies-results[aria-busy="true"] {
  opacity: .6;
}
.public-movies-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.public-movies-table-wrap {
  overflow-x: auto;
}
.public-movies-table {
  min-width: 680px;
}
.public-movies-table th,
.public-movies-table td {
  padding: 7px 9px;
  vertical-align: middle;
}
.public-movies-table td:first-child,
.public-movies-table th:first-child {
  width: 48px;
  color: var(--muted);
  text-align: right;
}
.public-movies-table td:nth-child(2),
.public-movies-table th:nth-child(2) {
  width: auto;
}
.public-movies-table td:nth-child(3),
.public-movies-table th:nth-child(3) {
  width: 112px;
}
.public-movies-table td:nth-child(4),
.public-movies-table th:nth-child(4),
.public-movies-table td:nth-child(5),
.public-movies-table th:nth-child(5),
.public-movies-table td:nth-child(6),
.public-movies-table th:nth-child(6) {
  width: 92px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.public-movies-table td:last-child,
.public-movies-table th:last-child {
  width: 92px;
}
.rating-difference {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.rating-difference.positive {
  color: var(--accent);
}
.rating-difference.negative {
  color: var(--danger);
}
.rating-difference.zero,
.rating-difference.missing {
  color: var(--muted);
}
.public-movies-pagination {
  justify-content: center;
}
.public-movies-empty {
  min-height: 150px;
}

@media (max-width: 880px) {
  .movies-summary,
  .movies-workspace,
  .public-movies-filters {
    grid-template-columns: 1fr;
  }
  .movies-search-row {
    align-items: stretch;
    flex-direction: column;
  }
  .public-movies-submit {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .public-movies-shell {
    width: min(100% - 20px, 1240px);
    padding-top: 18px;
  }
  .public-movies-heading,
  .public-movies-filters,
  .public-movies-results {
    padding: 12px;
  }
  .public-movies-table {
    display: block;
    min-width: 0;
  }
  .public-movies-table thead {
    display: none;
  }
  .public-movies-table tbody {
    display: grid;
  }
  .public-movies-table tr {
    display: grid;
    grid-template-columns: 28px repeat(4, auto);
    justify-content: start;
    gap: 3px 14px;
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
  }
  .public-movies-table td,
  .public-movies-table td:first-child,
  .public-movies-table td:nth-child(2),
  .public-movies-table td:nth-child(3),
  .public-movies-table td:nth-child(4),
  .public-movies-table td:nth-child(5),
  .public-movies-table td:nth-child(6),
  .public-movies-table td:last-child {
    width: auto;
    border: 0;
    padding: 0;
    text-align: left;
  }
  .public-movie-title {
    grid-column: 2 / -1;
    margin-bottom: 2px;
  }
  .public-movie-number {
    grid-column: 1;
    grid-row: 1;
  }
  .public-movies-table td[data-label]:first-of-type {
    grid-column: 2;
  }
  .public-movies-table td[data-label]::before {
    content: attr(data-label) " ";
    color: var(--muted);
    font-size: 11px;
  }
  .public-movies-results-head,
  .public-movies-pagination {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}
