:root {
  color-scheme: dark;
  --bg: #0b0b0c;
  --surface: #111113;
  --surface-raised: #171719;
  --surface-hover: #1d1d20;
  --border: #2a2a2e;
  --border-strong: #3c3c41;
  --text: #f5f5f2;
  --text-soft: #c7c7cb;
  --muted: #929298;
  --accent: #ffca0a;
  --accent-strong: #ffd52d;
  --accent-ink: #151100;
  --green: #4fd18b;
  --red: #ff626d;
  --blue: #67a7ff;
  --warning: #ffb648;
  --sidebar-width: 248px;
  --topbar-height: 72px;
  --radius-sm: 4px;
  --radius: 6px;
  --shadow-dialog: 0 24px 80px rgba(0, 0, 0, 0.58);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.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 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow--danger {
  color: var(--red);
}

.button,
.icon-button,
.text-button,
.nav-item,
.mobile-nav__item {
  border: 0;
  cursor: pointer;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text);
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.button:hover:not(:disabled) {
  border-color: #55555c;
  background: var(--surface-hover);
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button:disabled,
.button[aria-busy="true"] {
  cursor: wait;
  opacity: 0.55;
}

.button--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.button--primary:hover:not(:disabled) {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.button--danger {
  border-color: rgba(255, 98, 109, 0.55);
  background: rgba(255, 98, 109, 0.1);
  color: #ff9299;
}

.button--danger:hover:not(:disabled) {
  border-color: var(--red);
  background: rgba(255, 98, 109, 0.17);
}

.button--small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.button__icon,
.button__arrow,
.button__save-icon,
.icon-button svg,
.nav-item svg,
.mobile-nav__item svg,
.search-field svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button__icon {
  fill: currentColor;
  stroke: none;
}

.button__arrow {
  margin-left: auto;
}

.button__save-icon {
  width: 17px;
  height: 17px;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-soft);
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.icon-button:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  color: var(--text);
}

.icon-button:disabled {
  cursor: wait;
  opacity: 0.45;
}

.text-button {
  padding: 4px 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.text-button:hover {
  color: var(--accent);
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot--ok {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(79, 209, 139, 0.12);
}

.status-dot--warning {
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(255, 182, 72, 0.12);
}

.status-dot--error {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 98, 109, 0.12);
}

.status-dot--neutral {
  background: var(--muted);
  box-shadow: none;
}

/* Login */

.login-page {
  background: #080809;
}

.auth-layout {
  display: grid;
  min-height: 100svh;
  grid-template-columns: 12px minmax(0, 1.2fr) minmax(420px, 0.8fr);
}

.auth-rail {
  position: relative;
  overflow: hidden;
  background: var(--accent);
}

.auth-rail::after {
  position: absolute;
  top: 35%;
  left: -9px;
  width: 28px;
  height: 120px;
  background: #080809;
  content: "";
  transform: skewY(-24deg);
}

.auth-identity {
  display: flex;
  max-width: 820px;
  align-items: center;
  gap: 48px;
  padding: 64px 9%;
}

.auth-logo {
  width: 148px;
  height: 148px;
  flex: 0 0 148px;
  object-fit: contain;
}

.auth-identity h1 {
  max-width: 620px;
  margin: 0;
  font-size: 56px;
  font-weight: 850;
  line-height: 0.98;
}

.auth-lead {
  max-width: 590px;
  margin: 26px 0 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.7;
}

.auth-command {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  padding: 36px 52px;
  border-left: 1px solid var(--border);
  background: var(--surface);
}

.service-state {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.service-state__time {
  margin-left: auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.auth-command__body {
  width: 100%;
  max-width: 500px;
  margin: auto;
  padding: 72px 0;
}

.auth-command__body h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.auth-command__body > p:not(.eyebrow) {
  margin: 14px 0 28px;
  color: var(--muted);
  line-height: 1.7;
}

.button--login {
  width: 100%;
  min-height: 52px;
  justify-content: flex-start;
  padding: 0 18px;
}

.inline-alert {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 0 0 18px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 98, 109, 0.45);
  border-radius: var(--radius-sm);
  background: rgba(255, 98, 109, 0.08);
  color: #ffb1b6;
  font-size: 13px;
}

.inline-alert svg {
  flex: 0 0 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-footnote {
  max-width: 450px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

/* Application shell */

.skip-link {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.sidebar__brand {
  display: flex;
  height: var(--topbar-height);
  flex: 0 0 var(--topbar-height);
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.sidebar__brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.sidebar__brand span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.2;
}

.sidebar__brand strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__brand small {
  margin-top: 3px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar__nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  padding: 22px 12px;
}

.nav-item {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 44px;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  text-align: left;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.nav-item::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: -13px;
  width: 3px;
  background: transparent;
  content: "";
}

.nav-item svg {
  width: 19px;
  height: 19px;
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text-soft);
}

.nav-item.is-active {
  border-color: var(--border);
  background: var(--surface-raised);
  color: var(--text);
}

.nav-item.is-active::before {
  background: var(--accent);
}

.nav-count {
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.sidebar__session {
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 11px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.sidebar__session > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.sidebar__session strong {
  font-size: 11px;
}

.sidebar__session small {
  color: var(--muted);
  font-size: 10px;
}

.app-shell {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 25;
  top: 0;
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 11, 12, 0.96);
}

.topbar__title,
.topbar__actions,
.user-chip,
.live-status {
  display: flex;
  align-items: center;
}

.topbar__title {
  min-width: 0;
  gap: 10px;
}

.topbar__title p {
  margin: 0 0 1px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar__title h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.mobile-brand {
  display: none;
}

.topbar__actions {
  min-width: 0;
  gap: 9px;
}

.live-status {
  gap: 9px;
  margin-right: 6px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
}

.user-chip {
  min-width: 0;
  gap: 9px;
  margin-right: 6px;
  padding-right: 16px;
  border-right: 1px solid var(--border);
}

.user-chip img,
.avatar-placeholder {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
}

.user-chip img {
  object-fit: cover;
}

.avatar-placeholder {
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  background: var(--surface-raised);
  color: var(--accent);
  font-size: 10px;
  font-weight: 850;
}

.user-chip__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.3;
}

.user-chip__copy strong {
  max-width: 160px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip__copy small {
  color: var(--muted);
  font-size: 10px;
}

.main-content {
  width: 100%;
  max-width: 1580px;
  min-height: calc(100vh - var(--topbar-height));
  margin: 0 auto;
  padding: 28px;
}

.connection-banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  margin: 0 0 22px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 182, 72, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(255, 182, 72, 0.07);
}

.connection-banner strong {
  font-size: 12px;
}

.connection-banner p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.access-state {
  max-width: 560px;
  margin: 10vh auto 0;
  padding: 50px 0;
  text-align: center;
}

.access-state img {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
}

.access-state h2 {
  margin: 0;
  font-size: 27px;
}

.access-state > p:not(.eyebrow) {
  margin: 12px auto 24px;
  color: var(--muted);
}

.view {
  animation: view-in 220ms ease both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-heading {
  display: flex;
  min-height: 58px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 22px;
}

.page-heading h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.page-heading > p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-tile {
  position: relative;
  display: grid;
  min-height: 126px;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 13px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric-tile::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 26px;
  height: 3px;
  background: var(--border-strong);
  content: "";
}

.metric-tile img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.metric-tile > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.metric-tile span {
  overflow-wrap: anywhere;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
}

.metric-value {
  display: block;
  min-height: 36px;
  margin: 4px 0 1px;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.metric-value.is-loading {
  color: var(--border-strong);
}

.metric-tile small {
  color: var(--muted);
  font-size: 10px;
}

.health-band {
  position: relative;
  display: grid;
  min-height: 116px;
  grid-template-columns: minmax(180px, 0.75fr) minmax(0, 3fr);
  align-items: center;
  gap: 28px;
  margin: 14px 0 26px;
  padding: 20px 24px 20px 29px;
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.health-band::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--accent);
  content: "";
}

.health-band::after {
  position: absolute;
  top: -18px;
  left: -2px;
  width: 5px;
  height: 68px;
  background: #080809;
  content: "";
  transform: skewY(-31deg);
}

.health-band__intro {
  min-width: 0;
}

.health-band h3 {
  margin: 0;
  font-size: 17px;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.health-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 4px 16px;
  border-left: 1px solid var(--border);
}

.health-item__marker {
  width: 9px;
  height: 9px;
  flex-basis: 9px;
}

.health-item > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.health-item small {
  color: var(--muted);
  font-size: 10px;
}

.health-item strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.section-block {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.section-heading {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.section-heading h3 {
  margin: 0;
  font-size: 15px;
}

.section-heading > span {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.action-list {
  display: flex;
  flex-direction: column;
}

.action-row {
  display: grid;
  min-height: 62px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  transition: background-color 150ms ease;
}

.action-row:last-child {
  border-bottom: 0;
}

.action-row:hover {
  background: rgba(255, 255, 255, 0.018);
}

.action-row > img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.action-row > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.action-row strong {
  font-size: 12px;
}

.action-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-row--danger {
  background: rgba(255, 98, 109, 0.025);
}

.switch {
  position: relative;
  display: inline-flex;
  width: 38px;
  height: 22px;
  flex: 0 0 38px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch span {
  width: 100%;
  height: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #222225;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.switch span::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
  transition: transform 150ms ease, background-color 150ms ease;
}

.switch input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
}

.switch input:checked + span::after {
  background: var(--accent-ink);
  transform: translateX(16px);
}

.switch input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.switch input:disabled + span {
  cursor: not-allowed;
  opacity: 0.45;
}

.table-shell {
  width: 100%;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: middle;
}

th {
  background: rgba(255, 255, 255, 0.015);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

td {
  color: var(--text-soft);
  font-size: 11px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:not(.table-state-row):hover td {
  background: rgba(255, 255, 255, 0.015);
}

td strong {
  color: var(--text);
  font-size: 11px;
}

.table-shell th:first-child,
.table-shell td:first-child {
  width: 29%;
}

.table-shell th:last-child,
.table-shell td:last-child {
  width: 18%;
  text-align: right;
}

.table-state-row td,
.empty-cell {
  height: 112px;
  color: var(--muted);
  text-align: center !important;
}

.loading-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.loading-line::before {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  content: "";
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface-raised);
  color: var(--text-soft);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.status-badge::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
}

.status-badge--success {
  border-color: rgba(79, 209, 139, 0.3);
  color: #84e7af;
}

.status-badge--success::before {
  background: var(--green);
}

.status-badge--warning {
  border-color: rgba(255, 182, 72, 0.35);
  color: #ffd18b;
}

.status-badge--warning::before {
  background: var(--warning);
}

.status-badge--error {
  border-color: rgba(255, 98, 109, 0.35);
  color: #ff9ca3;
}

.status-badge--error::before {
  background: var(--red);
}

.audit-preview {
  margin-top: 18px;
}

.command-strip {
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 20px;
  padding: 18px 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.command-strip h3 {
  margin: 0;
  font-size: 16px;
}

.command-strip__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
}

.search-field,
.select-field,
.field,
.locked-field {
  display: flex;
}

.search-field {
  position: relative;
  width: min(440px, 100%);
  align-items: center;
}

.search-field svg {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #0e0e10;
  color: var(--text);
  outline: none;
  transition: border-color 150ms ease, background-color 150ms ease;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 128px;
  padding: 11px 12px;
  line-height: 1.55;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #707077;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: #111113;
}

.search-field input {
  padding-left: 40px;
}

.select-field {
  width: 188px;
  flex: 0 0 188px;
}

.channel-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.channel-link:hover {
  text-decoration: underline;
}

/* Systems and operations */

.operations-section {
  margin-bottom: 18px;
}

.operations-heading {
  min-height: 72px;
}

.operations-heading__actions,
.embed-channel-controls {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.fivem-connection-note {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(103, 167, 255, 0.035);
  color: var(--text-soft);
  font-size: 10px;
}

.fivem-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.fivem-summary > div {
  min-width: 0;
  min-height: 74px;
  padding: 13px 14px;
  border-right: 1px solid var(--border);
}

.fivem-summary > div:last-child {
  border-right: 0;
}

.fivem-summary dt,
.fivem-summary dd,
.command-summary dt,
.command-summary dd,
.operation-confirm-details dt,
.operation-confirm-details dd {
  margin: 0;
}

.fivem-summary dt,
.command-summary dt,
.operation-confirm-details dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.fivem-summary dd {
  margin-top: 5px;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.operations-table {
  min-height: 112px;
}

.fivem-player-table th:first-child,
.fivem-player-table td:first-child {
  width: auto;
}

.fivem-player-table th:nth-child(2),
.fivem-player-table td:nth-child(2),
.fivem-player-table th:last-child,
.fivem-player-table td:last-child {
  width: 140px;
}

.table-action-state {
  display: flex;
  min-height: 84px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}

.command-summary {
  display: flex;
  margin: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.command-summary > div {
  display: flex;
  min-width: 106px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 11px;
  border-left: 1px solid var(--border);
}

.command-summary dd {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.command-summary > div:first-child dd {
  color: var(--green);
}

.command-summary > div:last-child dd {
  color: var(--red);
}

.operations-toolbar {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.command-table th:first-child,
.command-table td:first-child {
  width: 23%;
}

.command-table th:nth-child(2),
.command-table td:nth-child(2) {
  width: auto;
}

.command-table th:nth-child(3),
.command-table td:nth-child(3) {
  width: 106px;
}

.command-table th:last-child,
.command-table td:last-child {
  width: 92px;
}

.command-table tr.is-disabled-command td {
  background: rgba(255, 98, 109, 0.018);
}

.command-name,
.command-details {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.command-name strong,
.command-details span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-name small,
.command-details small {
  overflow: hidden;
  color: var(--muted);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-switch {
  margin-left: auto;
}

.embed-manager__heading {
  align-items: center;
}

.embed-channel-select {
  width: min(320px, 30vw);
  flex-basis: min(320px, 30vw);
}

.embed-workspace {
  display: grid;
  min-height: 650px;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
}

.embed-browser,
.embed-editor-pane,
.embed-form,
.embed-preview-region {
  min-width: 0;
}

.embed-browser {
  border-right: 1px solid var(--border);
  background: #0e0e10;
}

.embed-pane-heading {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.embed-pane-heading h4,
.embed-pane-heading p {
  margin: 0;
}

.embed-pane-heading h4 {
  font-size: 12px;
}

.embed-pane-heading p {
  max-width: 340px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.embed-pane-heading > span {
  display: grid;
  min-width: 26px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 800;
}

.embed-list {
  max-height: 680px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--border-strong) #0e0e10;
}

.embed-pane-state {
  display: flex;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.embed-pane-state.is-loading span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.embed-pane-state.is-loading span::before {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  content: "";
  animation: spin 700ms linear infinite;
}

.embed-list-item {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 70px;
  gap: 8px;
  padding: 11px 13px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.embed-list-item:hover {
  background: var(--surface-raised);
}

.embed-list-item.is-selected {
  border-left-color: var(--accent);
  background: rgba(255, 202, 10, 0.055);
}

.embed-list-item__heading,
.embed-list-item__meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.embed-list-item__heading strong {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.managed-marker {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid rgba(255, 182, 72, 0.32);
  border-radius: 3px;
  color: var(--warning);
  font-size: 7px;
  font-weight: 800;
  text-transform: uppercase;
}

.embed-list-item__meta {
  color: var(--muted);
  font-size: 8px;
}

.embed-list-item__meta small {
  max-width: 56%;
  overflow: hidden;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.embed-jump-link {
  color: var(--blue);
}

.managed-embed-warning {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 182, 72, 0.3);
  background: rgba(255, 182, 72, 0.07);
  color: #ffd18b;
  font-size: 10px;
}

.embed-editor-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(250px, 320px);
  align-items: start;
}

.embed-form {
  padding: 16px;
  border-right: 1px solid var(--border);
}

.embed-form fieldset {
  display: grid;
  min-width: 0;
  gap: 13px;
  margin: 0;
  padding: 0;
  border: 0;
}

.embed-form fieldset:disabled {
  opacity: 0.58;
}

.embed-form-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.42fr) minmax(0, 1fr);
  gap: 10px;
}

.embed-fields-editor {
  min-width: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.embed-fields-editor > header,
.embed-field-row > header,
.embed-inline-control,
.embed-form-actions,
.embed-preview-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.embed-fields-editor > header {
  min-height: 52px;
  padding: 7px 0;
}

.embed-fields-editor h5 {
  display: inline;
  margin: 0 7px 0 0;
  font-size: 12px;
}

.embed-fields-editor header span {
  color: var(--muted);
  font-size: 9px;
}

.embed-fields-list {
  display: grid;
}

.embed-field-row {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(130px, 0.65fr) minmax(180px, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.embed-field-row > header {
  grid-column: 1 / -1;
  min-height: 28px;
}

.embed-field-row__number {
  color: var(--text-soft);
  font-size: 10px;
}

.embed-field-remove {
  width: 32px;
  height: 32px;
  color: var(--muted);
  font-size: 20px;
}

.embed-field-value-label textarea {
  min-height: 78px;
}

.embed-inline-control {
  grid-column: 1 / -1;
  min-height: 36px;
  justify-content: flex-end;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 700;
}

.embed-validation-message {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid rgba(255, 98, 109, 0.4);
  background: rgba(255, 98, 109, 0.07);
  color: #ffadb3;
  font-size: 10px;
}

.embed-form-actions {
  min-height: 42px;
}

.embed-form-actions > span {
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.embed-form-actions > span.is-over-limit {
  color: var(--red);
  font-weight: 800;
}

.embed-preview-region {
  position: sticky;
  top: calc(var(--topbar-height) + 16px);
  padding: 16px;
}

.embed-preview-label {
  margin-bottom: 10px;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.embed-preview-label small {
  color: var(--green);
  font-size: 8px;
}

.discord-embed-preview {
  min-width: 0;
  overflow: hidden;
  border-radius: 4px;
  border-left: 4px solid var(--accent);
  background: #2b2d31;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  color: #dbdee1;
}

.discord-embed-preview__body {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 13px 0;
}

.discord-embed-preview__content {
  min-width: 0;
  flex: 1;
}

.discord-embed-preview__content > strong {
  display: block;
  margin-bottom: 5px;
  overflow-wrap: anywhere;
  color: #f2f3f5;
  font-size: 13px;
  line-height: 1.35;
}

.discord-embed-preview__content > p,
.discord-embed-field p {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.discord-embed-preview__content > p {
  font-size: 11px;
  line-height: 1.45;
}

.discord-embed-preview__body > img {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 3px;
  object-fit: cover;
}

.discord-embed-preview__fields {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 9px 6px;
  margin-top: 12px;
}

.discord-embed-field {
  width: 100%;
  min-width: 0;
}

.discord-embed-field.is-inline {
  width: calc(50% - 3px);
}

.discord-embed-field strong {
  display: block;
  margin-bottom: 2px;
  overflow-wrap: anywhere;
  color: #f2f3f5;
  font-size: 10px;
}

.discord-embed-field p {
  font-size: 9px;
  line-height: 1.45;
}

.discord-embed-preview__image {
  width: calc(100% - 26px);
  max-height: 260px;
  margin: 12px 13px 0;
  border-radius: 3px;
  object-fit: cover;
}

.discord-embed-preview footer {
  padding: 10px 13px 13px;
  overflow-wrap: anywhere;
  color: #b5bac1;
  font-size: 8px;
}

.operation-confirm-body {
  gap: 14px;
}

.operation-confirm-details {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--border);
}

.operation-confirm-details > div {
  display: grid;
  min-width: 0;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.operation-confirm-details dd {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 11px;
  font-weight: 750;
}

/* Bot configuration */

.configuration-heading {
  align-items: center;
}

.configuration-channel-note {
  max-width: 560px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.configuration-summary {
  display: flex;
  align-items: stretch;
  margin: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.configuration-summary > div {
  display: grid;
  min-width: 104px;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  border-left: 1px solid var(--border);
}

.configuration-summary dt,
.configuration-summary dd {
  margin: 0;
}

.configuration-summary dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.configuration-summary dd {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.configuration-summary__dirty dd {
  color: var(--accent);
}

.configuration-toolbar {
  margin-bottom: 8px;
  padding: 14px 0 0;
  border-top: 1px solid var(--border);
}

.configuration-search {
  width: 100%;
  max-width: none;
  margin-bottom: 12px;
}

.configuration-group-nav {
  display: flex;
  gap: 2px;
  padding-bottom: 10px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  scrollbar-color: var(--border-strong) transparent;
}

.configuration-group-filter {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease;
}

.configuration-group-filter:hover {
  background: var(--surface-raised);
  color: var(--text-soft);
}

.configuration-group-filter.is-active {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.configuration-load-state,
.configuration-empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  padding: 32px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
}

.configuration-load-state__content {
  display: grid;
  max-width: 440px;
  justify-items: center;
  gap: 12px;
}

.configuration-load-state__content strong {
  color: var(--text);
}

.configuration-load-state__content p {
  margin: 0;
}

.configuration-groups {
  border-bottom: 1px solid var(--border);
}

.configuration-group {
  position: relative;
  border-top: 1px solid var(--border);
}

.configuration-group:first-child {
  border-top: 0;
}

.configuration-group__heading {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-strong);
}

.configuration-group__heading h3,
.configuration-group__heading p {
  margin: 0;
}

.configuration-group__heading h3 {
  font-size: 14px;
}

.configuration-group__heading p {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.configuration-list {
  position: relative;
}

.configuration-group.has-dirty .configuration-list::before {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: rgba(255, 202, 10, 0.62);
  content: "";
}

.configuration-row {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(240px, 1fr) minmax(320px, 0.9fr) 40px;
  align-items: start;
  gap: 22px;
  padding: 16px 12px 16px 18px;
  border-bottom: 1px solid var(--border);
  transition: background-color 150ms ease;
}

.configuration-row:last-child {
  border-bottom: 0;
}

.configuration-row.is-dirty {
  background: rgba(255, 202, 10, 0.025);
}

.configuration-row.is-dirty::before {
  position: absolute;
  z-index: 2;
  top: 22px;
  left: -2px;
  width: 6px;
  height: 6px;
  border: 1px solid var(--bg);
  background: var(--accent);
  content: "";
}

.configuration-row__copy,
.configuration-row__editor {
  min-width: 0;
}

.configuration-row__copy h4 {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.35;
}

.configuration-row__description {
  margin: 0 0 8px;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.5;
}

.configuration-key {
  display: block;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  line-height: 1.4;
}

.configuration-row__editor {
  display: grid;
  gap: 7px;
}

.configuration-control {
  min-width: 0;
}

.configuration-control select,
.configuration-control input[type="text"],
.configuration-control input[type="url"] {
  min-width: 0;
  text-overflow: ellipsis;
}

.configuration-control-meta {
  display: flex;
  min-height: 18px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.configuration-protection-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--warning);
  font-size: 9px;
  font-weight: 750;
  text-align: right;
  text-transform: uppercase;
}

.configuration-protection-state::before {
  width: 7px;
  height: 6px;
  border: 1px solid currentColor;
  border-radius: 1px;
  content: "";
}

.configuration-row.is-protected {
  background: rgba(255, 255, 255, 0.012);
}

.configuration-row.is-protected .configuration-row__copy h4 {
  color: var(--text-soft);
}

.configuration-row.is-protected input:disabled,
.configuration-row.is-protected select:disabled,
.configuration-picker.is-disabled {
  border-color: var(--border);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.68;
}

.configuration-picker.is-disabled > summary {
  cursor: not-allowed;
}

.configuration-override-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.configuration-override-state::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-strong);
  content: "";
}

.configuration-override-state.is-overridden {
  color: var(--text-soft);
}

.configuration-override-state.is-overridden::before {
  background: var(--blue);
}

.configuration-override-state.is-pending {
  color: var(--accent);
}

.configuration-override-state.is-pending::before {
  background: var(--accent);
}

.configuration-current-id {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.configuration-reset {
  width: 40px;
  height: 40px;
}

.configuration-reset:not(:disabled):hover {
  border-color: rgba(255, 202, 10, 0.5);
  color: var(--accent);
}

.configuration-reset:disabled {
  cursor: not-allowed;
  opacity: 0.24;
}

.configuration-multi {
  min-width: 0;
}

.configuration-picker {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #0e0e10;
}

.configuration-picker[open] {
  border-color: rgba(255, 202, 10, 0.58);
}

.configuration-picker > summary {
  position: relative;
  display: flex;
  min-height: 42px;
  align-items: center;
  padding: 0 38px 0 12px;
  overflow: hidden;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  list-style: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.configuration-picker > summary::-webkit-details-marker {
  display: none;
}

.configuration-picker > summary::after {
  position: absolute;
  right: 14px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  content: "";
  transform: rotate(45deg) translateY(-2px);
  transition: transform 150ms ease;
}

.configuration-picker[open] > summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.configuration-picker__menu {
  padding: 10px;
  border-top: 1px solid var(--border);
}

.configuration-picker__search {
  height: 38px;
  margin-bottom: 8px;
  font-size: 11px;
}

.configuration-picker__options {
  max-height: 238px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--border-strong) #0e0e10;
}

.configuration-resource-option {
  display: grid;
  min-height: 38px;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 5px 7px;
  border-bottom: 1px solid rgba(42, 42, 46, 0.65);
  cursor: pointer;
}

.configuration-resource-option:last-child {
  border-bottom: 0;
}

.configuration-resource-option:hover {
  background: var(--surface-hover);
}

.configuration-resource-option input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--accent);
}

.configuration-resource-option__copy {
  display: block;
  min-width: 0;
}

.configuration-resource-option__copy strong,
.configuration-resource-option__copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.configuration-resource-option__copy strong {
  font-size: 11px;
}

.configuration-resource-option__copy small {
  color: var(--muted);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
}

.configuration-selected {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.configuration-token {
  display: inline-grid;
  min-width: 0;
  max-width: 100%;
  min-height: 28px;
  grid-template-columns: minmax(0, auto) auto;
  align-items: center;
  gap: 5px;
  padding: 2px 4px 2px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text-soft);
  font-size: 9px;
}

.configuration-token > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.configuration-token__actions {
  display: flex;
}

.configuration-token button {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.configuration-token button:hover:not(:disabled) {
  color: var(--accent);
}

.configuration-token button:disabled {
  cursor: not-allowed;
  opacity: 0.25;
}

.configuration-token--more {
  display: inline-flex;
  padding: 2px 8px;
  color: var(--muted);
}

.configuration-color-control {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
}

.configuration-emoji-control {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
}

.configuration-emoji-preview {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #0e0e10;
  color: var(--muted);
  font-size: 10px;
}

.configuration-emoji-preview img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.configuration-color-control input[type="color"] {
  width: 44px;
  height: 42px;
  padding: 4px;
  cursor: pointer;
}

.configuration-save-region {
  position: fixed;
  z-index: 40;
  right: 28px;
  bottom: 20px;
  left: calc(var(--sidebar-width) + 28px);
  max-width: 1524px;
  margin: 0 auto;
}

.configuration-save-error {
  margin: 0;
  padding: 9px 12px;
  border: 1px solid rgba(255, 98, 109, 0.48);
  border-bottom: 0;
  background: #241316;
  color: #ffb4b9;
  font-size: 11px;
  font-weight: 700;
}

.configuration-save-bar {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 202, 10, 0.45);
  border-radius: var(--radius);
  background: #171719;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.52);
}

.configuration-save-error:not([hidden]) + .configuration-save-bar {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.configuration-save-count,
.configuration-save-count > span:last-child,
.configuration-save-actions,
.configuration-restart-toggle {
  display: flex;
  align-items: center;
}

.configuration-save-count {
  min-width: 150px;
  gap: 10px;
}

.configuration-save-count__marker {
  width: 3px;
  height: 34px;
  flex: 0 0 3px;
  background: var(--accent);
}

.configuration-save-count > span:last-child {
  align-items: flex-start;
  flex-direction: column;
}

.configuration-save-count strong {
  font-size: 12px;
}

.configuration-save-count small {
  color: var(--muted);
  font-size: 9px;
}

.configuration-save-actions {
  justify-content: flex-end;
  gap: 8px;
}

.configuration-restart-toggle {
  min-height: 40px;
  gap: 10px;
  padding: 0 10px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 700;
}

.configuration-confirm-body {
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
}

.configuration-confirm-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 202, 10, 0.36);
  border-radius: var(--radius-sm);
  background: rgba(255, 202, 10, 0.07);
  color: var(--accent);
}

.configuration-confirm-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.configuration-confirm-body strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.configuration-confirm-body p {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.6;
}

body.has-config-changes .configuration-view {
  padding-bottom: 94px;
}

body.has-config-changes .toast-region {
  bottom: 106px;
}

.mobile-nav {
  display: none;
}

/* Dialogs and notifications */

.dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-dialog);
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.74);
}

.dialog[open] {
  animation: dialog-in 170ms ease both;
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dialog__header,
.dialog__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.dialog__header {
  border-bottom: 1px solid var(--border);
}

.dialog__header h2 {
  margin: 0;
  font-size: 19px;
}

.dialog__body {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.dialog__body > p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.dialog__footer {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.012);
}

.field {
  flex-direction: column;
  gap: 7px;
}

.field > span,
.locked-field > span {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 750;
}

.locked-field {
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #0e0e10;
}

.locked-field strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  display: flex;
  width: min(380px, calc(100vw - 40px));
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #1a1a1d;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  color: var(--text-soft);
  font-size: 12px;
  pointer-events: auto;
  animation: toast-in 180ms ease both;
}

.toast::before {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.toast--error::before {
  background: var(--red);
}

.toast__close {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.noscript-banner {
  position: fixed;
  z-index: 500;
  inset: 0 0 auto;
  padding: 12px;
  background: var(--red);
  color: #170205;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 1180px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-identity {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 28px;
  }

  .configuration-save-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .configuration-save-count {
    min-width: 0;
  }

  .configuration-save-actions {
    justify-content: stretch;
  }

  .fivem-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fivem-summary > div:nth-child(3) {
    border-right: 0;
  }

  .fivem-summary > div:nth-child(-n + 3) {
    border-bottom: 1px solid var(--border);
  }

  .embed-editor-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .embed-form {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .embed-preview-region {
    position: static;
  }
}

@media (max-width: 960px) {
  .auth-layout {
    grid-template-columns: 8px minmax(0, 1fr) minmax(360px, 0.9fr);
  }

  .auth-identity {
    padding: 48px 9%;
  }

  .auth-logo {
    width: 104px;
    height: 104px;
    flex-basis: 104px;
  }

  .auth-identity h1 {
    font-size: 44px;
  }

  .auth-command {
    padding: 30px 34px;
  }
}

@media (max-width: 900px) {
  :root {
    --topbar-height: 64px;
  }

  .sidebar {
    display: none;
  }

  .app-shell {
    margin-left: 0;
  }

  .topbar {
    padding: 0 16px;
  }

  .mobile-brand {
    display: inline-flex;
  }

  .mobile-brand img {
    width: 34px;
    height: 34px;
    object-fit: contain;
  }

  .main-content {
    padding: 22px 18px 92px;
  }

  .mobile-nav {
    position: fixed;
    z-index: 30;
    inset: auto 0 0;
    display: grid;
    height: 68px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 5px max(8px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid var(--border);
    background: #111113;
  }

  .mobile-nav__item {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
  }

  .mobile-nav__item svg {
    width: 20px;
    height: 20px;
  }

  .mobile-nav__item.is-active {
    background: var(--surface-hover);
    color: var(--accent);
  }

  .toast-region {
    bottom: 82px;
  }

  .configuration-save-region {
    right: 14px;
    bottom: 80px;
    left: 14px;
    max-width: none;
  }

  body.has-config-changes .toast-region {
    bottom: 232px;
  }

  .embed-workspace {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .embed-browser {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .embed-list {
    max-height: 300px;
  }
}

@media (max-width: 760px) {
  .auth-layout {
    grid-template-columns: 6px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }

  .auth-rail {
    grid-row: 1 / -1;
  }

  .auth-identity {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    padding: 34px 24px 24px;
  }

  .auth-logo {
    width: 76px;
    height: 76px;
    flex-basis: 76px;
  }

  .auth-identity h1 {
    font-size: 32px;
  }

  .auth-lead {
    display: none;
  }

  .auth-command {
    min-height: 0;
    padding: 24px;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .auth-command__body {
    padding: 58px 0;
  }

  .health-band {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 18px;
  }

  .health-item:nth-child(odd) {
    border-left: 0;
  }

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  tbody tr {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
  }

  tbody tr:last-child {
    border-bottom: 0;
  }

  th,
  td,
  .table-shell th:first-child,
  .table-shell td:first-child,
  .table-shell th:last-child,
  .table-shell td:last-child {
    width: 100%;
  }

  td,
  .table-shell td:last-child {
    display: grid;
    min-height: 34px;
    grid-template-columns: minmax(92px, 38%) minmax(0, 62%);
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border: 0;
    text-align: right;
  }

  td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 9px;
    font-weight: 750;
    text-align: left;
    text-transform: uppercase;
  }

  .table-state-row {
    padding: 0;
  }

  .table-state-row td {
    display: flex;
    width: 100%;
    height: 110px;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .table-state-row td::before {
    display: none;
  }

  .channel-link {
    justify-content: flex-end;
  }

  .configuration-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 16px 52px 16px 16px;
  }

  .configuration-reset {
    position: absolute;
    top: 14px;
    right: 4px;
  }

  .configuration-group.has-dirty .configuration-list::before {
    left: 0;
  }

  .command-table th:first-child,
  .command-table td:first-child,
  .command-table th:nth-child(2),
  .command-table td:nth-child(2),
  .command-table th:nth-child(3),
  .command-table td:nth-child(3),
  .command-table th:last-child,
  .command-table td:last-child,
  .fivem-player-table th:first-child,
  .fivem-player-table td:first-child,
  .fivem-player-table th:nth-child(2),
  .fivem-player-table td:nth-child(2),
  .fivem-player-table th:last-child,
  .fivem-player-table td:last-child {
    width: 100%;
  }

  .command-switch {
    margin-left: auto;
  }
}

@media (max-width: 620px) {
  .button--small {
    min-height: 44px;
  }

  .switch::before {
    position: absolute;
    inset: -11px -3px;
    content: "";
  }

  .topbar__title p,
  .live-status,
  .user-chip__copy,
  .user-chip {
    display: none;
  }

  .topbar__title h1 {
    max-width: 138px;
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .main-content {
    padding-right: 14px;
    padding-left: 14px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .page-heading > p {
    text-align: left;
  }

  .configuration-heading {
    gap: 14px;
  }

  .configuration-summary {
    width: 100%;
  }

  .configuration-summary > div {
    min-width: 0;
    flex: 1;
    gap: 6px;
    padding: 8px;
  }

  .configuration-summary > div:first-child {
    border-left: 0;
  }

  .configuration-summary dt {
    font-size: 8px;
  }

  .configuration-group-filter {
    min-height: 42px;
  }

  .configuration-save-bar {
    padding: 10px;
  }

  .configuration-save-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .configuration-restart-toggle {
    grid-column: 1 / -1;
    justify-content: space-between;
    border: 0;
    border-bottom: 1px solid var(--border);
  }

  .configuration-save-actions .button {
    min-width: 0;
    padding: 0 10px;
    font-size: 10px;
  }

  .configuration-save-count {
    min-height: 32px;
  }

  .configuration-save-count__marker {
    height: 30px;
  }

  body.has-config-changes .configuration-view {
    padding-bottom: 180px;
  }

  .configuration-confirm-body {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .configuration-confirm-icon {
    width: 34px;
    height: 34px;
  }

  .operations-heading,
  .embed-manager__heading {
    align-items: stretch;
    flex-direction: column;
  }

  .operations-heading__actions,
  .embed-channel-controls {
    width: 100%;
  }

  .operations-heading__actions .button {
    margin-left: auto;
  }

  .embed-channel-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .embed-channel-select,
  .embed-channel-controls .button {
    width: 100%;
    flex-basis: auto;
  }

  .fivem-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fivem-summary > div,
  .fivem-summary > div:nth-child(3) {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  .fivem-summary > div:nth-child(even) {
    border-right: 0;
  }

  .fivem-summary > div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .command-summary {
    width: 100%;
  }

  .command-summary > div {
    min-width: 0;
    flex: 1;
  }

  .command-summary > div:first-child {
    border-left: 0;
  }

  .metrics-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .metric-tile {
    min-height: 100px;
  }

  .list-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field,
  .select-field {
    width: 100%;
    flex-basis: auto;
  }

  .command-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .command-strip__actions,
  .command-strip__actions .button {
    width: 100%;
  }

  .section-heading {
    min-height: 62px;
    padding: 12px 14px;
  }

  .dialog__header,
  .dialog__body,
  .dialog__footer {
    padding: 16px;
  }

  .dialog__footer .button {
    flex: 1;
  }

  .embed-form-grid,
  .embed-field-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .embed-field-row > header,
  .embed-inline-control {
    grid-column: 1;
  }

  .embed-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .embed-form-actions .button {
    width: 100%;
  }

  .discord-embed-field.is-inline {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .auth-identity {
    padding-right: 18px;
    padding-left: 18px;
  }

  .auth-logo {
    width: 62px;
    height: 62px;
    flex-basis: 62px;
  }

  .auth-identity h1 {
    font-size: 27px;
  }

  .auth-command {
    padding: 20px 18px;
  }

  .auth-command__body h2 {
    font-size: 24px;
  }

  .service-state__time {
    display: none;
  }

  .action-row {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 10px;
  }

  .action-row > img {
    width: 28px;
    height: 28px;
  }

  .action-row .button--small {
    min-width: 34px;
    padding: 0 9px;
    font-size: 10px;
  }

  .health-band {
    padding-right: 14px;
    padding-left: 22px;
  }

  .health-item {
    padding-right: 8px;
    padding-left: 8px;
  }

  .fivem-connection-note {
    align-items: flex-start;
    padding-right: 12px;
    padding-left: 12px;
  }

  .fivem-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .fivem-summary > div,
  .fivem-summary > div:nth-child(even),
  .fivem-summary > div:nth-last-child(-n + 2) {
    min-height: 62px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .fivem-summary > div:last-child {
    border-bottom: 0;
  }

  .embed-form,
  .embed-preview-region {
    padding: 12px;
  }

  .discord-embed-preview__body > img {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }

  .operation-confirm-details > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

@media (forced-colors: active) {
  .status-dot,
  .status-badge::before,
  .health-band::before {
    forced-color-adjust: none;
  }
}
