:root {
  color-scheme: dark;
  --bg: #0b0d12;
  --surface: #12151d;
  --surface-2: #171b25;
  --surface-3: #1e2330;
  --border: #292f3d;
  --border-soft: #202532;
  --text: #f7f8fb;
  --muted: #969dac;
  --muted-2: #6f7685;
  --accent: #7c6cff;
  --accent-2: #9589ff;
  --accent-soft: rgba(124, 108, 255, 0.14);
  --success: #4ed29a;
  --success-soft: rgba(78, 210, 154, 0.12);
  --warning: #f3b860;
  --warning-soft: rgba(243, 184, 96, 0.12);
  --danger: #ff6b78;
  --danger-soft: rgba(255, 107, 120, 0.12);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled, input:disabled, textarea:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; }
.hidden { display: none !important; }

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  background:
    radial-gradient(circle at 20% 10%, rgba(124, 108, 255, .18), transparent 30%),
    radial-gradient(circle at 80% 90%, rgba(78, 210, 154, .08), transparent 28%),
    var(--bg);
}
.login-card {
  width: min(480px, 100%);
  padding: 42px;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: rgba(18, 21, 29, .94);
  box-shadow: var(--shadow);
  text-align: center;
}
.brand-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--accent), #5e4ef0);
  color: white;
  font-weight: 900;
  letter-spacing: -.04em;
  box-shadow: 0 14px 40px rgba(124, 108, 255, .25);
}
.brand-mark-small { width: 42px; height: 42px; margin: 0; border-radius: 12px; font-size: 14px; box-shadow: none; }
.login-card h1 { margin: 6px 0 14px; font-size: clamp(32px, 7vw, 46px); letter-spacing: -.04em; }
.login-copy { color: var(--muted); line-height: 1.65; margin: 0 auto 28px; max-width: 390px; }
.login-note { color: var(--muted-2); font-size: 12px; line-height: 1.55; margin: 18px auto 0; max-width: 360px; }

.eyebrow { margin: 0 0 7px; color: var(--accent-2); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.dashboard-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  min-width: 0;
  border-right: 1px solid var(--border-soft);
  background: #0e1118;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 4px 12px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand strong { font-size: 14px; }
.sidebar-brand span { margin-top: 2px; font-size: 11px; color: var(--muted); }
.field-label { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; }
.select, .input, .textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.select, .input { min-height: 44px; padding: 0 12px; }
.textarea { min-height: 100px; padding: 11px 12px; resize: vertical; }
.select:focus, .input:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.guild-select { background-color: var(--surface); font-weight: 700; }
.side-nav { display: grid; gap: 6px; margin-top: 8px; }
.nav-item {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 650;
  text-align: left;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: #dedaff; border-color: rgba(124, 108, 255, .18); }
.nav-icon { width: 20px; display: inline-grid; place-items: center; color: currentColor; }
.sidebar-spacer { flex: 1; }
.bot-status-card, .user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--surface);
}
.bot-status-card strong, .bot-status-card span, .user-card strong, .user-card span { display: block; min-width: 0; }
.bot-status-card strong, .user-card strong { font-size: 12px; }
.bot-status-card span:not(.status-dot), .user-card span { color: var(--muted); font-size: 10px; margin-top: 2px; }
.status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 999px; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.status-dot.offline { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.status-dot-large { width: 11px; height: 11px; }
.avatar { display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--surface-3); color: var(--muted); font-weight: 800; }
.avatar img, .guild-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-small { width: 34px; height: 34px; flex: 0 0 auto; font-size: 12px; }
.user-card-copy { min-width: 0; }
.user-card-copy strong, .user-card-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main-content { min-width: 0; padding: 28px clamp(18px, 4vw, 46px) 56px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 30px; }
.topbar-title h2 { margin: 0; font-size: clamp(25px, 4vw, 34px); letter-spacing: -.035em; }
.topbar-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.button {
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0 15px;
  font-weight: 750;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button-primary { background: var(--accent); color: white; }
.button-primary:hover:not(:disabled) { background: #8a7cff; }
.button-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.button-secondary:hover:not(:disabled) { background: var(--surface-3); }
.button-ghost { background: transparent; color: var(--muted); border-color: var(--border-soft); }
.button-ghost:hover:not(:disabled) { color: var(--text); background: var(--surface); }
.button-danger { background: var(--danger-soft); color: #ff9da6; border-color: rgba(255, 107, 120, .25); }
.button-small { min-height: 34px; padding: 0 10px; font-size: 12px; }
.button-large { min-height: 50px; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 24px; line-height: 1; }

.page-view { min-width: 0; }
.hero-card {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(124, 108, 255, .11), transparent 45%),
    var(--surface);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}
.guild-avatar { width: 66px; height: 66px; border-radius: 18px; display: grid; place-items: center; overflow: hidden; background: var(--surface-3); font-weight: 900; font-size: 22px; }
.hero-copy { min-width: 0; }
.hero-copy h3 { margin: 0 0 5px; font-size: 24px; letter-spacing: -.025em; overflow-wrap: anywhere; }
.hero-copy p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.hero-health { min-width: 170px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: rgba(11, 13, 18, .45); display: flex; gap: 11px; align-items: center; }
.hero-health strong, .hero-health span { display: block; }
.hero-health strong { font-size: 12px; }
.hero-health span:not(.status-dot) { color: var(--muted); font-size: 10px; margin-top: 3px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin: 15px 0; }
.metric-card { min-width: 0; padding: 17px; border: 1px solid var(--border-soft); border-radius: 15px; background: var(--surface); }
.metric-label { color: var(--muted); font-size: 11px; font-weight: 700; }
.metric-value { margin-top: 9px; display: block; font-size: 25px; font-weight: 850; letter-spacing: -.04em; }
.metric-meta { margin-top: 5px; display: block; color: var(--muted-2); font-size: 10px; }
.content-grid { display: grid; gap: 15px; }
.two-columns { grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.panel-heading { padding: 18px 19px 12px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.panel-heading.compact { padding-bottom: 14px; border-bottom: 1px solid var(--border-soft); }
.panel-heading h3, .panel-heading h4 { margin: 0; }
.panel-heading h3 { font-size: 17px; }
.panel-heading h4 { font-size: 14px; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 750; }
.badge-success { color: #83e7bc; background: var(--success-soft); border-color: rgba(78,210,154,.18); }
.badge-warning { color: #ffd28f; background: var(--warning-soft); border-color: rgba(243,184,96,.18); }
.badge-danger { color: #ff9da6; background: var(--danger-soft); border-color: rgba(255,107,120,.18); }
.systems-list { padding: 0 19px 17px; }
.system-row { padding: 12px 0; border-top: 1px solid var(--border-soft); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.system-row:first-child { border-top: 0; }
.system-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.system-name strong, .system-name span { display: block; }
.system-name strong { font-size: 12px; }
.system-name span { color: var(--muted); font-size: 10px; margin-top: 3px; }
.system-count { font-weight: 800; font-size: 13px; }
.definition-list { margin: 0; padding: 0 19px 17px; }
.definition-list div { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border-soft); }
.definition-list div:first-child { border-top: 0; }
.definition-list dt { color: var(--muted); font-size: 12px; }
.definition-list dd { margin: 0; font-size: 12px; font-weight: 750; text-align: right; }

.section-toolbar { margin-bottom: 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.section-toolbar h3 { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.section-copy { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.reaction-layout { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 15px; align-items: start; }
.panel-list-shell { overflow: hidden; }
.panel-list { max-height: 690px; overflow-y: auto; padding: 9px; }
.panel-list-item { width: 100%; border: 1px solid transparent; border-radius: 11px; background: transparent; padding: 12px; color: var(--text); text-align: left; }
.panel-list-item:hover { background: var(--surface-2); }
.panel-list-item.active { background: var(--accent-soft); border-color: rgba(124,108,255,.22); }
.panel-list-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.panel-list-item span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.panel-list-empty { padding: 26px 15px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.6; }
.detail-panel { min-height: 420px; }
.empty-detail { min-height: 418px; display: grid; place-items: center; align-content: center; text-align: center; padding: 34px; }
.empty-detail h4 { margin: 12px 0 6px; }
.empty-detail p { max-width: 330px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.empty-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); font-weight: 900; }
.detail-header { padding: 19px; border-bottom: 1px solid var(--border-soft); display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.detail-header h4 { margin: 0; font-size: 18px; }
.detail-header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.detail-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.detail-body { padding: 19px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.full-width { grid-column: 1 / -1; }
.field { display: grid; gap: 7px; min-width: 0; }
.field > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.field small { color: var(--muted-2); font-size: 10px; line-height: 1.5; }
.color-input { padding: 5px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.mapping-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border-soft); }
.mapping-heading { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 12px; }
.mapping-heading h5 { margin: 0; font-size: 13px; }
.mapping-list { display: grid; gap: 8px; }
.mapping-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 11px; border: 1px solid var(--border-soft); border-radius: 11px; background: var(--surface-2); }
.mapping-info { min-width: 0; display: flex; align-items: center; gap: 10px; }
.emoji-box { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: var(--surface-3); font-size: 17px; overflow: hidden; }
.emoji-box img { width: 24px; height: 24px; object-fit: contain; }
.mapping-copy { min-width: 0; }
.mapping-copy strong, .mapping-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapping-copy strong { font-size: 12px; }
.mapping-copy span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.role-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; background: var(--accent-2); }
.mapping-add { margin-top: 10px; display: grid; grid-template-columns: minmax(270px, 1.35fr) minmax(180px, 1fr) auto; gap: 8px; align-items: start; }
.mapping-emoji-field { min-width: 0; position: relative; }
.mapping-emoji-entry { display: grid; gap: 7px; }
.input-with-action { position: relative; display: block; }
.input-with-button { padding-right: 52px; }
.emoji-inline-toggle { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: 36px; height: 36px; border: 1px solid var(--border-soft); border-radius: 11px; background: var(--surface-3); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.emoji-inline-toggle:hover { border-color: var(--accent-2); background: var(--accent-soft); }
.emoji-inline-toggle:active { transform: translateY(calc(-50% + 1px)); }
.emoji-inline-toggle.active { border-color: var(--accent-2); background: var(--accent-soft); box-shadow: 0 0 0 1px rgba(116,102,255,.2) inset; }
.emoji-inline-toggle:focus-visible { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(116,102,255,.24); }
.emoji-inline-toggle-icon { width: 20px; height: 20px; pointer-events: none; }
.server-emoji-select-row { position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; min-width: 0; border: 1px solid var(--border-soft); border-radius: 11px; background: var(--surface-3); overflow: hidden; transition: border-color .15s ease, box-shadow .15s ease; }
.server-emoji-select-row:focus-within { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(116,102,255,.18); }
.server-emoji-select-icon { width: 42px; height: 42px; display: grid; place-items: center; border-right: 1px solid var(--border-soft); color: var(--muted); background: var(--surface-2); overflow: hidden; }
.server-emoji-select-icon img { width: 26px; height: 26px; object-fit: contain; }
.server-emoji-select-placeholder { width: 19px; height: 19px; }
.server-emoji-select-icon.has-preview .server-emoji-select-placeholder { display: none; }
.server-emoji-select { width: 100%; min-width: 0; height: 42px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.server-emoji-select:focus { outline: none; box-shadow: none; }
.input-help { color: var(--muted); font-size: 10px; line-height: 1.45; }
.server-emoji-picker { grid-column: 1 / -1; margin-top: 8px; padding: 11px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface-2); }
.emoji-picker-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.emoji-picker-toolbar > div { min-width: 0; display: grid; gap: 2px; }
.emoji-picker-toolbar strong { font-size: 11px; }
.emoji-picker-toolbar span { color: var(--muted); font-size: 9px; }
.emoji-search-input { width: min(220px, 50%); min-width: 130px; }
.server-emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 7px; max-height: 260px; overflow-y: auto; padding: 1px; }
.server-emoji-option { min-width: 0; min-height: 68px; padding: 8px 6px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface-3); color: var(--text); cursor: pointer; display: grid; place-items: center; align-content: center; gap: 5px; font: inherit; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.server-emoji-option img { width: 30px; height: 30px; object-fit: contain; }
.server-emoji-option span { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9px; text-align: center; }
.server-emoji-option:hover:not(:disabled), .server-emoji-option.selected { border-color: var(--accent-2); background: var(--accent-soft); }
.server-emoji-option:active:not(:disabled) { transform: translateY(1px); }
.server-emoji-option:disabled { cursor: not-allowed; opacity: .36; }
.emoji-picker-empty { padding: 15px 10px; color: var(--muted); text-align: center; font-size: 10px; }
.notice { margin-bottom: 14px; padding: 12px 14px; border-radius: 11px; font-size: 12px; line-height: 1.55; }
.notice-warning { background: var(--warning-soft); border: 1px solid rgba(243,184,96,.22); color: #ffd8a1; }

.operations-grid { display: grid; gap: 15px; }
.table-panel { overflow: hidden; }
.table-title { padding: 17px 18px 12px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.table-title h4 { margin: 0; font-size: 14px; }
.table-title p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.table-scroll { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 660px; }
.data-table th, .data-table td { padding: 11px 15px; border-top: 1px solid var(--border-soft); text-align: left; vertical-align: middle; }
.data-table th { color: var(--muted); background: rgba(11,13,18,.32); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.data-table td { color: #d7dbe4; font-size: 11px; }
.data-table td.muted-cell { color: var(--muted); }
.table-empty { padding: 25px 18px !important; text-align: center !important; color: var(--muted) !important; }
.severity-low { color: #86d6ff; }
.severity-medium { color: #ffd28f; }
.severity-high, .severity-critical { color: #ff9da6; }

.empty-state { padding: 50px 20px; border: 1px dashed var(--border); border-radius: 16px; text-align: center; }
.empty-state .empty-icon { margin: 0 auto; }
.empty-state h3 { margin: 13px 0 7px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; }

.dialog { width: min(620px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 18px; background: transparent; color: var(--text); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(4, 5, 8, .76); backdrop-filter: blur(4px); }
.dialog-card { margin: 0; padding: 22px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.dialog-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 19px; }
.dialog-heading h3 { margin: 0; font-size: 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.form-error { padding: 10px 12px; border: 1px solid rgba(255,107,120,.25); border-radius: 10px; background: var(--danger-soft); color: #ff9da6; font-size: 11px; line-height: 1.5; }
.toast-region { position: fixed; z-index: 100; top: 16px; right: 16px; width: min(360px, calc(100% - 32px)); display: grid; gap: 8px; pointer-events: none; }
.toast { padding: 12px 14px; border: 1px solid var(--border); border-radius: 11px; background: #171b25; box-shadow: 0 14px 35px rgba(0,0,0,.3); font-size: 12px; line-height: 1.45; animation: toast-in .18s ease-out; }
.toast.success { border-color: rgba(78,210,154,.28); }
.toast.error { border-color: rgba(255,107,120,.35); }
@keyframes toast-in { from { transform: translateY(-5px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 1050px) {
  .dashboard-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reaction-layout { grid-template-columns: 250px minmax(0, 1fr); }
}

@media (max-width: 780px) {
  .dashboard-shell { display: block; }
  .sidebar { position: static; border-right: 0; border-bottom: 1px solid var(--border-soft); padding: 14px; gap: 10px; }
  .sidebar-brand { padding-bottom: 4px; }
  .side-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); overflow-x: auto; }
  .nav-item { justify-content: center; padding: 0 8px; font-size: 11px; }
  .nav-icon { display: none; }
  .sidebar-spacer, .bot-status-card, .user-card { display: none; }
  .main-content { padding: 22px 14px 44px; }
  .topbar { align-items: flex-start; }
  .hero-card { grid-template-columns: auto minmax(0, 1fr); }
  .hero-health { grid-column: 1 / -1; min-width: 0; }
  .two-columns, .reaction-layout { grid-template-columns: 1fr; }
  .panel-list { max-height: 260px; }
}

@media (max-width: 520px) {
  .login-card { padding: 32px 20px; }
  .topbar { display: grid; }
  .topbar-actions { width: 100%; }
  .topbar-actions .button { flex: 1; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-value { font-size: 21px; }
  .section-toolbar { align-items: stretch; flex-direction: column; }
  .section-toolbar .button { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .mapping-add { grid-template-columns: 1fr; }
  .mapping-add .button { width: 100%; }
  .mapping-emoji-entry { grid-template-columns: 1fr; }
  .emoji-picker-toolbar { align-items: stretch; flex-direction: column; }
  .emoji-search-input { width: 100%; }
  .server-emoji-grid { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); max-height: 220px; }
  .mapping-row { grid-template-columns: 1fr; }
  .mapping-row .button { width: 100%; }
  .detail-header { display: grid; }
  .detail-actions { justify-content: stretch; }
  .detail-actions .button { flex: 1; }
  .side-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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