:root {
  --accent: #4ecdb8;
  --ink: #0a0e12;
  --panel: #141a21;
  --muted: #1b232c;
  --line: #334050;
  --text: #edf2f6;
  --muted-text: #94a3b8;
  --scroll-track: #0f141a;
  --scroll-thumb: #334050;
  --scroll-thumb-hover: #4ecdb8;
  --sidebar-w: 16rem;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }

html {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
  -webkit-text-size-adjust: 100%;
}

html, body {
  min-height: 100%;
  min-height: 100dvh;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(78, 205, 184, 0.08), transparent 50%),
    var(--ink);
}

#app {
  min-height: 100dvh;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: var(--scroll-track);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 999px;
  border: 2px solid var(--scroll-track);
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

.field,
textarea.field,
select.field {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) #1b232c;
}
.field::-webkit-scrollbar,
textarea.field::-webkit-scrollbar,
select.field::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.field::-webkit-scrollbar-track,
textarea.field::-webkit-scrollbar-track,
select.field::-webkit-scrollbar-track {
  background: #1b232c;
}
.field::-webkit-scrollbar-thumb,
textarea.field::-webkit-scrollbar-thumb,
select.field::-webkit-scrollbar-thumb {
  background: #3a4a5a;
  border: 2px solid #1b232c;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle input { display: none; }
.toggle span {
  position: absolute;
  inset: 0;
  background: #334050;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease;
}
.toggle span::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #edf2f6;
  border-radius: 50%;
  transition: transform 0.18s ease;
}
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(20px); }

.field {
  width: 100%;
  background: #1b232c;
  border: 1px solid #334050;
  color: #edf2f6;
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  outline: none;
  font: inherit;
  min-height: 44px;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
textarea.field {
  min-height: 5.5rem;
  resize: vertical;
}
.field:hover:not(:disabled):not(:focus) {
  border-color: #4a5d70;
  background: #202933;
}
.field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(78, 205, 184, 0.15);
  background: #1b232c;
}
.field:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

select.field {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  color-scheme: dark;
  padding-right: 2.4rem;
  background-color: #1b232c;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px;
}
select.field:hover:not(:disabled):not(:focus) {
  border-color: #4a5d70;
  background-color: #202933;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px;
}
select.field:focus {
  border-color: var(--accent);
  background-color: #1b232c;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%234ecdb8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px;
  box-shadow: 0 0 0 3px rgba(78, 205, 184, 0.15);
}
select.field option,
select.field optgroup {
  background-color: #141a21;
  color: #edf2f6;
}
select.field option:checked {
  background-color: #1f3a36;
  color: #4ecdb8;
}
select.field::-ms-expand {
  display: none;
}

/* ===== Dashboard shell ===== */
.dash-shell {
  display: flex;
  min-height: 100dvh;
  width: 100%;
}

.dash-sidebar {
  display: none;
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: rgba(20, 26, 33, 0.92);
  padding: 1rem;
  height: 100dvh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

.dash-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: calc(0.75rem + var(--safe-top)) 1rem 0.75rem;
  border-bottom: 1px solid var(--line);
  background: rgba(20, 26, 33, 0.88);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.dash-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.dash-back,
.dash-logout {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted-text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.45rem 0.7rem;
  border-radius: 0.65rem;
  cursor: pointer;
  white-space: nowrap;
}
.dash-back:hover,
.dash-logout:hover {
  color: #fff;
  background: var(--muted);
  border-color: var(--line);
}

.dash-guild {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  margin-bottom: 1.25rem;
}
.dash-guild--compact {
  margin-bottom: 0;
}
.dash-guild-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--muted);
}
.dash-guild-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-guild-sub {
  font-size: 0.75rem;
  color: var(--muted-text);
}
.dash-guild-meta {
  min-width: 0;
}

.dash-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dash-tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 18, 0.55);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.dash-tabs::-webkit-scrollbar {
  height: 6px;
}

.dash-main {
  flex: 1;
  width: 100%;
  max-width: 56rem;
  padding: 1rem 1rem calc(1.5rem + var(--safe-bottom));
}
.dash-main--dirty {
  padding-bottom: calc(7.5rem + var(--safe-bottom));
}

.dash-warn {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: #fbbf24;
  line-height: 1.4;
}

.nav-item {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  white-space: nowrap;
  color: #cbd5e1;
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}
.nav-item:hover {
  background: var(--muted);
  color: #fff;
}
.nav-item.active {
  background: rgba(78, 205, 184, 0.14);
  color: #4ecdb8;
}
.nav-item.locked {
  opacity: 0.45;
  cursor: not-allowed;
}
.dash-tabs .nav-item {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--panel);
}
.dash-tabs .nav-item.active {
  border-color: rgba(78, 205, 184, 0.45);
}

@media (min-width: 768px) {
  .dash-sidebar { display: block; }
  .dash-topbar { display: none; }
  .dash-tabs { display: none; }
  .dash-main {
    padding: 1.5rem 1.5rem calc(2rem + var(--safe-bottom));
  }
  .dash-main--dirty {
    padding-bottom: calc(8rem + var(--safe-bottom));
  }
}

@media (min-width: 1024px) {
  .dash-main {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* ===== Save bar ===== */
.save-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 12px 12px calc(14px + var(--safe-bottom));
  background: linear-gradient(180deg, transparent, #0a0e12 28%);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(28px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}
@media (min-width: 768px) {
  .save-bar { left: var(--sidebar-w); }
}
.save-bar.dirty {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.save-bar-inner {
  pointer-events: auto;
  max-width: 56rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: #141a21;
  border: 1px solid #4ecdb8;
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
}
.save-bar-copy {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: #cbd5e1;
  font-size: 0.875rem;
}
.save-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 999px;
  background: #fbbf24;
  flex-shrink: 0;
}
.save-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.save-bar.pulse .save-bar-inner {
  animation: savePulse 0.5s ease;
}
@keyframes savePulse {
  0%, 100% { border-color: #4ecdb8; }
  50% { border-color: #ef4444; box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.25); }
}
.save-bar button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-cancel {
  background: transparent;
  color: #cbd5e1;
  border: 1px solid #334050;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: 0.65rem;
  min-height: 42px;
  cursor: pointer;
  font: inherit;
}
.btn-cancel:hover:not(:disabled) { background: #1b232c; color: #fff; }
.btn-save {
  background: #4ecdb8;
  color: #0a0e12;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: 0.65rem;
  border: 0;
  min-height: 42px;
  cursor: pointer;
  font: inherit;
}
.btn-save:hover:not(:disabled) { background: #3db8a4; }

.toast {
  position: fixed;
  left: 12px;
  right: 12px;
  top: calc(12px + var(--safe-top));
  z-index: 50;
  padding: 10px 14px;
  border-radius: 10px;
  background: #141a21;
  border: 1px solid #334050;
  max-width: 24rem;
  margin-left: auto;
}
@media (min-width: 640px) {
  .toast {
    left: auto;
    right: 16px;
    width: auto;
  }
}
.toast.ok { border-color: rgba(78, 205, 184, 0.45); }
.toast.err { border-color: rgba(248, 113, 113, 0.45); }

/* In-page confirm dialog */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(1rem + var(--safe-top)) 1rem calc(1rem + var(--safe-bottom));
  background: rgba(6, 10, 14, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: confirmFade 0.15s ease;
}
@keyframes confirmFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.confirm-card {
  width: min(100%, 26rem);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.25rem 1.25rem 1.1rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: confirmPop 0.18s ease;
}
@keyframes confirmPop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.confirm-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #edf2f6;
}
.confirm-body {
  margin: 0 0 1.25rem;
  color: #94a3b8;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}
.confirm-actions .btn-cancel,
.confirm-actions .btn-danger,
.confirm-actions .btn-save {
  min-width: 5.5rem;
}

.cmd-hint {
  font-size: 0.75rem;
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  margin-top: 0.25rem;
  overflow-wrap: anywhere;
}
.id-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px solid #334050;
}
.id-row:last-child { border-bottom: 0; }
.id-row > .id-row-main {
  min-width: 0;
  flex: 1 1 auto;
}
.id-row > .id-row-remove {
  margin-left: auto;
  flex-shrink: 0;
}

/* Homepage / server picker */
.home-shell {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100dvh;
  background:
    radial-gradient(900px 420px at 12% -8%, rgba(78, 205, 184, 0.16), transparent 55%),
    radial-gradient(700px 380px at 90% 10%, rgba(88, 101, 242, 0.12), transparent 50%),
    #0a0e12;
}
.home-glow {
  pointer-events: none;
  position: absolute;
  inset: auto auto 10% 50%;
  width: min(70vw, 520px);
  height: 40vh;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(78, 205, 184, 0.12), transparent 70%);
  filter: blur(10px);
}
.home-glow--soft {
  top: -10%;
  bottom: auto;
  opacity: 0.85;
}
.home-card {
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.home-login {
  background: linear-gradient(135deg, #5865f2, #4752c4);
  transition: transform 0.15s ease, filter 0.15s ease;
  min-height: 48px;
}
.home-login:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.picker-wrap {
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: calc(1rem + var(--safe-top)) 1rem calc(1.5rem + var(--safe-bottom));
  position: relative;
  z-index: 1;
}
.picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.picker-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}
.picker-brand-text {
  min-width: 0;
}
.picker-brand-name {
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.2;
}
.picker-brand-user {
  font-size: 0.75rem;
  color: var(--muted-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.picker-logout {
  flex-shrink: 0;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted-text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.55rem 0.85rem;
  min-height: 42px;
  cursor: pointer;
}
.picker-logout:hover {
  color: #fff;
  background: var(--muted);
}
.picker-hero {
  margin-bottom: 1.25rem;
}
.picker-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 5vw, 1.875rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.picker-sub {
  margin: 0;
  color: var(--muted-text);
  font-size: 0.9rem;
  line-height: 1.4;
}
.picker-search {
  margin-bottom: 1rem;
}
.picker-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
.picker-empty {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  background: rgba(20, 26, 33, 0.6);
  border-radius: 1rem;
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--muted-text);
  font-size: 0.9rem;
  line-height: 1.45;
}

.guild-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  min-width: 0;
  min-height: 72px;
  text-align: left;
  cursor: pointer;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.guild-card:hover,
.guild-card:focus-visible {
  border-color: rgba(78, 205, 184, 0.55);
  background: rgba(27, 35, 44, 0.55);
  outline: none;
}
.guild-card:active {
  transform: scale(0.995);
}
.guild-card-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--muted);
  box-shadow: 0 0 0 1px var(--line);
}
.guild-card-meta {
  min-width: 0;
  flex: 1;
}
.guild-card-name {
  font-weight: 600;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.guild-card-role {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--muted-text);
}
.guild-card-chev {
  flex-shrink: 0;
  color: #64748b;
  font-size: 1.1rem;
  line-height: 1;
}

@media (min-width: 480px) {
  .picker-wrap {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}
@media (min-width: 640px) {
  .picker-wrap {
    padding: calc(1.5rem + var(--safe-top)) 1.5rem calc(2rem + var(--safe-bottom));
  }
  .picker-header {
    margin-bottom: 2rem;
  }
  .picker-hero {
    margin-bottom: 1.5rem;
  }
  .picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }
  .guild-card {
    min-height: 76px;
    padding: 1rem 1.1rem;
  }
  .guild-card-icon {
    width: 3rem;
    height: 3rem;
  }
  .guild-card-chev {
    display: none;
  }
}
@media (min-width: 1024px) {
  .picker-wrap {
    padding-left: 2rem;
    padding-right: 2rem;
  }
  .picker-grid {
    gap: 1rem;
  }
}

/* Searchable role/channel pickers */
.ss {
  position: relative;
  width: 100%;
}
.ss .ss-query {
  margin-top: 0;
}
.ss-menu {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: min(240px, 45vh);
  overflow: auto;
  background: #141a21;
  border: 1px solid #334050;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  padding: 4px;
}
.ss-menu.hidden,
.ss-menu[hidden] {
  display: none !important;
}
.ss-option {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: #e2e8f0;
  padding: 10px 10px;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}
.ss-option:hover,
.ss-option.active {
  background: rgba(78, 205, 184, 0.12);
  color: #4ecdb8;
}
.ss-empty {
  padding: 10px;
  color: #94a3b8;
  font-size: 0.875rem;
}

.add-row,
.claim-add-row {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr;
  align-items: stretch;
}
.add-row > .btn-save,
.add-row > .btn-ghost,
.add-row > .btn-danger,
.claim-add-row > .btn-save,
.claim-add-row > .btn-ghost,
.claim-add-row > .btn-danger {
  width: 100%;
}
@media (min-width: 640px) {
  .add-row {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
  .add-row > .btn-save,
  .add-row > .btn-ghost,
  .add-row > .btn-danger {
    width: auto;
  }
  .claim-add-row {
    grid-template-columns: 1fr 140px auto;
    align-items: start;
  }
  .claim-add-row > .btn-save,
  .claim-add-row > .btn-ghost,
  .claim-add-row > .btn-danger {
    width: auto;
  }
}

.panel-pad {
  padding: 1rem;
}
@media (min-width: 640px) {
  .panel-pad {
    padding: 1.25rem;
  }
}

.lock-note {
  font-size: 0.875rem;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
}
.btn-ghost {
  background: transparent;
  color: #cbd5e1;
  border: 1px solid #334050;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 0.65rem;
  min-height: 42px;
  cursor: pointer;
  font: inherit;
}
.btn-ghost:hover { background: #1b232c; color: #fff; }
.btn-ghost.active {
  background: rgba(78, 205, 184, 0.14);
  color: #4ecdb8;
  border-color: #4ecdb8;
}
.btn-ghost:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-danger {
  background: transparent;
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.35);
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 0.65rem;
  min-height: 42px;
  cursor: pointer;
  font: inherit;
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.1); }
.status-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.status-on { background: rgba(78, 205, 184, 0.15); color: #4ecdb8; }
.status-off { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.color-swatch {
  width: 44px;
  height: 42px;
  flex-shrink: 0;
  border: 1px solid #334050;
  border-radius: 10px;
  background: #1b232c;
  padding: 3px;
  cursor: pointer;
}
.color-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.color-swatch::-webkit-color-swatch { border: 0; border-radius: 7px; }
.vars-hint {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.45;
}
.preview-box {
  background: #0f141a;
  border: 1px solid #334050;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.8rem;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
}

.cmd-search-wrap {
  position: relative;
}
.cmd-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
}
.cmd-search {
  padding-left: 2.6rem;
  font-size: 0.95rem;
  height: 48px;
  border-radius: 14px;
}
.cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cat-chip {
  border: 1px solid #334050;
  background: #141a21;
  color: #cbd5e1;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.cat-chip:hover {
  border-color: #4a5d70;
  color: #edf2f6;
}
.cat-chip.active {
  background: rgba(78, 205, 184, 0.16);
  border-color: #4ecdb8;
  color: #4ecdb8;
}
.cat-chip .n {
  opacity: 0.65;
  margin-left: 4px;
  font-weight: 500;
}
.cmd-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: #94a3b8;
  border: 1px dashed #334050;
  border-radius: 16px;
  margin-bottom: 1rem;
}
.censor-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1b232c;
  border: 1px solid #334050;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  color: #edf2f6;
}

/* Panel / section cards on small screens */
.bg-panel {
  overflow-wrap: anywhere;
}

@media (max-width: 639px) {
  .home-card {
    padding: 1.5rem !important;
    border-radius: 1.25rem;
  }
  .save-bar-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .save-bar-actions {
    width: 100%;
    margin-left: 0;
  }
  .save-bar-actions .btn-cancel,
  .save-bar-actions .btn-save {
    flex: 1;
  }
  .dash-tabs {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  .dash-guild-icon {
    width: 2.25rem;
    height: 2.25rem;
  }
  .bg-panel.border.rounded-2xl {
    border-radius: 1rem;
  }
  h2.text-xl {
    font-size: 1.15rem;
  }
  .nav-item {
    min-height: 42px;
  }
  .action-row {
    flex-wrap: wrap;
  }
  .action-row > .btn-save,
  .action-row > .btn-ghost,
  .action-row > .btn-danger {
    flex: 1 1 auto;
    min-width: 7.5rem;
  }
}

@media (min-width: 1280px) {
  .dash-sidebar {
    width: 17.5rem;
  }
  .save-bar {
    left: 17.5rem;
  }
}

.admin-entry {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  margin: 0 0 1rem;
  text-align: left;
  cursor: pointer;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.admin-entry:hover,
.admin-entry:focus-visible {
  border-color: #3d8ea8;
  background: rgba(15, 174, 236, 0.06);
}
.admin-entry-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  background: #123a48;
  color: #7ad4ef;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.admin-entry-mark--lg {
  width: 2.75rem;
  height: 2.75rem;
}
.admin-entry-meta {
  min-width: 0;
  flex: 1;
}
.admin-entry-title {
  font-weight: 600;
  letter-spacing: -0.02em;
}
.admin-entry-sub {
  color: var(--muted-text);
  font-size: 0.8rem;
  margin-top: 0.1rem;
}
.admin-server-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  object-fit: cover;
  flex-shrink: 0;
}
.admin-preview-img {
  max-width: 8rem;
  max-height: 8rem;
  border-radius: 0.75rem;
  object-fit: cover;
  border: 1px solid var(--line);
}
.admin-preview-img--wide {
  max-width: 100%;
  max-height: 9rem;
}

.picker-header-actions,
.dash-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.dash-docs-link,
.picker-docs-link,
.home-docs-link,
.dash-docs-top {
  color: var(--teal);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
.dash-docs-link:hover,
.picker-docs-link:hover,
.home-docs-link:hover,
.dash-docs-top:hover {
  text-decoration: underline;
}

.dash-sidebar-docs {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted-text);
  line-height: 1.5;
}
