:root {
  --bg: #1e1f22;
  --bg-elevated: #2b2d31;
  --bg-input: #1e1f22;
  --border: #3f4147;
  --text: #dbdee1;
  --text-muted: #949ba4;
  --brand: #5865f2;
  --brand-hover: #4752c4;
  --success: #23a55a;
  --warning: #f0b232;
  --danger: #da373c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "gg sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  font-weight: 700;
  font-size: 18px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 12px;
  flex: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.sidebar-nav a .icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.sidebar-nav a.active {
  background: rgba(88, 101, 242, 0.15);
  color: #fff;
}

.nav-section {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 16px 12px 6px;
}

.nav-section:first-child { padding-top: 4px; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  font-size: 13px;
}

.sidebar-user {
  color: var(--text);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-badge {
  display: inline-block;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 2px 7px;
  margin-bottom: 6px;
}

.sidebar-logout {
  color: var(--danger);
}

.main {
  flex: 1;
  padding: 32px 40px 60px;
  min-width: 0;
  max-width: 1680px;
  margin: 0 auto;
}

.main > * {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.main > *:first-child { margin-top: 0; }

.content {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

h1 {
  font-size: 24px;
  margin: 0 0 16px;
}

h2 {
  font-size: 16px;
  margin: 0 0 16px;
  color: var(--text);
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.card.warning {
  border-color: var(--warning);
}

.banner {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}

.banner.success {
  background: rgba(35, 165, 90, 0.15);
  border: 1px solid var(--success);
  color: #8fe3ae;
}

.banner.warning {
  background: rgba(240, 178, 50, 0.12);
  border: 1px solid var(--warning);
  color: #f6cd7a;
}

.login-wrap {
  display: flex;
  justify-content: center;
  padding-top: 60px;
}

.login-card {
  text-align: center;
  max-width: 380px;
}

.login-card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.btn {
  display: inline-block;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary, .btn-discord {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn-primary:hover, .btn-discord:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.settings-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.settings-form label.checkbox {
  text-transform: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}

.settings-form select,
.settings-form input[type="number"],
.settings-form input[type="password"],
.settings-form input[type="text"],
.settings-form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  text-transform: none;
  font-weight: 400;
}

.settings-form small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  font-size: 12px;
}

.settings-form select:focus,
.settings-form input:focus,
.settings-form textarea:focus {
  outline: none;
  border-color: var(--brand);
}

code {
  background: rgba(255,255,255,0.08);
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 12px;
}

.muted { color: var(--text-muted); font-size: 13px; }

.back-link {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 13px;
}
.back-link:hover { color: #fff; }

.btn-small {
  padding: 5px 12px;
  font-size: 13px;
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 8px 16px;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
}

.tab.active {
  color: #fff;
  border-bottom-color: var(--brand);
}

.table-card { padding: 0; overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
}

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

.thread {
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
}

.msg-bot { background: rgba(88, 101, 242, 0.08); }

.msg-meta { font-size: 13px; margin-bottom: 4px; }

.msg-body {
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-attachments {
  margin-top: 6px;
  font-size: 12px;
}

.reply-form textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
  margin-top: 6px;
}

.reply-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.form-actions { margin-top: 12px; }

.search-form {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  max-width: 420px;
}

.search-form input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
}

.search-form input:focus {
  outline: none;
  border-color: var(--brand);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  max-width: none !important;
}

.stat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.stat-list > div {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  gap: 12px;
}

.stat-list dt { color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }
.stat-list dd { margin: 0; text-align: right; min-width: 0; overflow-wrap: break-word; }
.stat-list dd code { word-break: break-all; }

.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
  table-layout: fixed;
}

.mini-table th, .mini-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  white-space: normal;
}

.mini-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
}

.mini-table tbody tr:last-child td { border-bottom: none; }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  max-width: none !important;
}

.stat-card { text-align: center; }

.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  color: #fff;
}

.badge-ban { background: #e24c5b; }
.badge-kick { background: #e2a64c; }
.badge-mute { background: #ecbf32; color: #1e1f22; }
.badge-unmute { background: #85bb65; }
.badge-unban { background: #85bb65; }
.badge-warn { background: #e2a64c; }

/* Embed builder */
.embed-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 20px;
  align-items: start;
  max-width: none !important;
}

.embed-form { min-width: 0; }

.color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-row input[type="color"] {
  width: 44px;
  height: 38px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-input);
  cursor: pointer;
  flex-shrink: 0;
}

.color-row input[type="text"] {
  flex: 1;
  margin-top: 0 !important;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.field-row input[type="text"] {
  margin-top: 0;
}

.field-inline-check {
  text-transform: none;
  font-weight: 400;
  font-size: 13px;
  white-space: nowrap;
  margin-bottom: 0 !important;
}

#addFieldBtn { margin-top: 4px; }

.embed-preview-pane {
  position: sticky;
  top: 20px;
}

.embed-preview-pane h2 {
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Discord-style embed card */
.dc-embed {
  display: flex;
  background: #2b2d31;
  border-radius: 4px;
  max-width: 100%;
  font-size: 14px;
  overflow: hidden;
}

.dc-embed-accent {
  width: 4px;
  flex-shrink: 0;
  background: #ecbf32;
}

.dc-embed-body {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  flex: 1;
  min-width: 0;
}

.dc-embed-main { min-width: 0; flex: 1; }

.dc-embed-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}

.dc-embed-author-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.dc-embed-title {
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.dc-embed-description {
  color: #dbdee1;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 8px;
}

.dc-embed-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 8px;
}

.dc-field-block { flex: 0 0 100%; }
.dc-field-inline { flex: 1 1 30%; min-width: 100px; }

.dc-field-name {
  font-weight: 600;
  color: #fff;
  font-size: 13px;
  margin-bottom: 2px;
}

.dc-field-value {
  color: #dbdee1;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}

.dc-embed-image {
  max-width: 100%;
  max-height: 260px;
  border-radius: 4px;
  margin-top: 8px;
  display: block;
}

.dc-embed-thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.dc-embed-footer {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 8px;
}

/* ==================== Mobile ==================== */

.mobile-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 110;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
}

.mobile-menu-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.mobile-topbar-brand {
  font-weight: 700;
  font-size: 16px;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 880px) {
  .mobile-topbar { display: flex; }

  .shell { display: block; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 120;
    width: 260px;
    max-width: 80vw;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 2px 0 16px rgba(0,0,0,0.4);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 115;
  }

  .sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .main, .content {
    padding: 20px 16px 40px;
  }

  .main > *, .content > * {
    max-width: 100% !important;
  }

  h1 { font-size: 20px; }

  th, td { padding: 10px 12px; }

  .embed-editor {
    grid-template-columns: 1fr !important;
  }

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

  .field-row {
    grid-template-columns: 1fr 1fr !important;
    row-gap: 6px;
  }

  .stat-cards {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  /* Denser than .stat-cards (full dt/dd info lists, not just a number) -- needs more room
     per card so labels and values like timestamps/IDs don't wrap awkwardly. */
  .profile-grid, .action-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .search-form {
    max-width: 100%;
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .stat-cards {
    grid-template-columns: 1fr 1fr;
  }

  .profile-grid, .action-grid {
    grid-template-columns: 1fr;
  }

  .field-row {
    grid-template-columns: 1fr !important;
  }
}

/* ==================== UCP: quests & settings ==================== */

.quest-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.quest-row-top {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 4px;
}

.quest-complete .quest-row-top { color: var(--success); }

.quest-bar-track {
  height: 8px;
  border-radius: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  overflow: hidden;
}

.quest-bar-fill {
  height: 100%;
  background: var(--brand);
}

.quest-complete .quest-bar-fill { background: var(--success); }

.milestone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.milestone {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
}

.milestone.earned {
  border-color: var(--warning);
  background: rgba(240, 178, 50, 0.08);
}

.milestone.locked { opacity: 0.55; }

.milestone-name { font-weight: 600; margin-bottom: 4px; }

.color-swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 8px;
  margin: 6px 0 16px;
  max-width: 420px;
}

.color-swatch {
  position: relative;
  display: block;
  cursor: pointer;
}

.color-swatch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.color-swatch span {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 2px solid var(--border);
}

.color-swatch input:checked + span {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand);
}

/* ==================== Shared ACP/UCP components ==================== */

.page-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 18px;
}

.page-header h1 { margin: 0; }

.page-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: -10px;
  margin-bottom: 18px;
  max-width: 720px;
  line-height: 1.5;
}

/* Tinted status pills -- used for admin rank, online status, and severity in the admin log.
   Deliberately a different visual language from the older solid-fill .badge-* classes (used by
   Mod Log's Discord actions) so neither page's styling shifts underneath it. */
.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: 1px solid transparent;
  line-height: 1.6;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.32);
}

.online-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25);
}

.level-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: 1px solid transparent;
  line-height: 1.6;
}

.level-badge.level-1, .level-badge.level-2, .level-badge.level-3 {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.32);
}

.level-badge.level-4, .level-badge.level-5 {
  color: #ffb454;
  background: rgba(255, 180, 84, 0.14);
  border-color: rgba(255, 180, 84, 0.35);
}

.level-badge.level-6 {
  color: #5b9dff;
  background: rgba(91, 157, 255, 0.14);
  border-color: rgba(91, 157, 255, 0.35);
}

.level-badge.level-7 {
  color: #ffd700;
  background: rgba(255, 215, 0, 0.16);
  border-color: rgba(255, 215, 0, 0.4);
}

.severity-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
}

.severity-danger { color: #ff8a8a; background: rgba(218, 55, 60, 0.14); border-color: rgba(218, 55, 60, 0.35); }
.severity-warning { color: #f6cd7a; background: rgba(240, 178, 50, 0.14); border-color: rgba(240, 178, 50, 0.35); }
.severity-neutral { color: var(--text-muted); background: rgba(255, 255, 255, 0.06); border-color: var(--border); }
.severity-success { color: #7ee2a8; background: rgba(35, 165, 90, 0.14); border-color: rgba(35, 165, 90, 0.35); }

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* A grid of small self-contained action forms (Live Actions / Admin Actions on a player's
   profile, Server Controls on Live Actions) -- each .action-tile reads as its own distinct
   control rather than a loose flow of labels and buttons. */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  max-width: none !important;
}

.action-tile {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.action-tile:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.action-tile.action-tile-danger:hover { border-color: rgba(218, 55, 60, 0.5); }

.action-tile .settings-form,
.action-tile.settings-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-tile label { margin-bottom: 0 !important; }

.action-tile > .btn,
.action-tile .button-row {
  margin-top: auto;
}

.section-note {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  margin: -4px 0 16px;
}

.avatar-round { border-radius: 50%; display: block; }

.table-scroll { overflow-x: auto; }

.empty-state {
  color: var(--text-muted);
  font-size: 14px;
  padding: 8px 0;
}

/* ==================== Home dashboard ==================== */

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-tile {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--stat-accent, var(--brand));
  border-radius: 8px;
  padding: 16px 18px;
}

.stat-tile .stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}

.stat-tile .stat-label {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.stat-tile .stat-sub {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 6px;
}

.home-columns {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.chart-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.chart-header h2 { margin: 0; }

.chart-meta {
  color: var(--text-muted);
  font-size: 13px;
}

.chart-svg { display: block; width: 100%; height: auto; }
.chart-svg .chart-area { fill: rgba(88, 101, 242, 0.18); }
.chart-svg .chart-line { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }

.chart-axis-labels {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 4px;
}

.activity-feed { display: flex; flex-direction: column; gap: 2px; }

.activity-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  flex-wrap: wrap;
}

.activity-row:last-child { border-bottom: none; }

.activity-row .activity-time {
  color: var(--text-muted);
  font-size: 11px;
  flex-shrink: 0;
  min-width: 68px;
}

.activity-row .activity-detail {
  color: var(--text-muted);
  flex-basis: 100%;
  font-size: 12px;
}

.live-indicator { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 rgba(35, 165, 90, 0.5);
  animation: live-pulse 2s infinite;
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(35, 165, 90, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(35, 165, 90, 0); }
  100% { box-shadow: 0 0 0 0 rgba(35, 165, 90, 0); }
}

/* ==================== Command palette ==================== */

.palette-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 24px);
  margin: 12px 12px 0;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.palette-trigger:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.palette-kbd {
  margin-left: auto;
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--text-muted);
}

.palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 12vh;
  z-index: 100;
}

/* The unconditional `display: flex` above is an author style, which beats the browser's built-in
   `[hidden] { display: none }` UA rule regardless of the hidden attribute being present -- without
   this, JS setting backdrop.hidden = true had no visible effect and the overlay stayed on screen
   permanently. */
.palette-backdrop[hidden] {
  display: none;
}

.palette {
  width: 100%;
  max-width: 520px;
  margin: 0 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.palette-input {
  width: 100%;
  box-sizing: border-box;
  padding: 16px 18px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
}

.palette-input:focus { outline: none; }

.palette-results {
  max-height: 320px;
  overflow-y: auto;
}

.palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 18px;
  color: var(--text);
  font-size: 14px;
}

.palette-item.selected {
  background: rgba(88, 101, 242, 0.15);
}

/* ==================== Toasts ==================== */

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
  width: min(360px, calc(100vw - 40px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--success);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-warning { border-left-color: var(--warning); }
.toast-danger { border-left-color: var(--danger); }

.toast-message {
  flex: 1;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}

.toast-close:hover { color: var(--text); }

/* ==================== Tablet ==================== */

@media (max-width: 1024px) {
  .action-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .home-columns { grid-template-columns: 1fr; }
}
