@view-transition { navigation: auto; }

:root {
  --cobalt-deep:     #1a2050;
  --cobalt:          #3b4a8c;
  --periwinkle:      #5e7ce6;
  --periwinkle-soft: #7e8fd6;
  --lavender:        #b8b8e8;
  --silver:          #e8e8f2;
  --blush:           #e8c2c2;

  --bg-app: #0a0a0e;
  --bg-app-soft: #0d0d12;
  --bg-surface: #14141b;
  --bg-surface-hover: #1c1c26;
  --bg-active: #1d1f2e;
  --border: #1f1f2a;
  --border-strong: #2c2c3a;

  --text-primary: #eaeaef;
  --text-secondary: #a0a0b0;
  --text-muted: #5a5a6a;

  --accent: var(--periwinkle);
  --accent-hover: #7088e8;
  --teal: #5dcaa5;
  --coral: #f0997b;
  --success: #4ade80;

  --glow-accent: rgba(94, 124, 230, 0.22);
  --glow-soft:   rgba(184, 184, 232, 0.16);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --top-bar-h: 56px;
}

.theme-light {
  --bg-app: #f5f5fa;
  --bg-app-soft: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f0f0f5;
  --bg-active: #e8eaf6;
  --border: #e0e0e8;
  --border-strong: #c8c8d4;

  --text-primary: #14141b;
  --text-secondary: #4a4a5a;
  --text-muted: #8a8a9a;

  --glow-accent: rgba(94, 124, 230, 0.14);
  --glow-soft:   rgba(184, 184, 232, 0.20);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 250ms, color 250ms;
}

.bg-atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%,   rgba(94, 124, 230, 0.10), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(184, 184, 232, 0.06), transparent 60%);
}

.theme-light .bg-atmosphere {
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%,   rgba(94, 124, 230, 0.08), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(232, 194, 194, 0.05), transparent 60%);
}

.shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.shell-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.top-bar {
  height: var(--top-bar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 0.5px solid var(--border);
  background: var(--bg-app-soft);
  flex-shrink: 0;
  position: relative;
  z-index: 50;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  transition: background 150ms;
}

.brand-block:hover {
  background: var(--bg-surface-hover);
}

.brand-block .brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  overflow: hidden;
}

.brand-block .brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-wordmark {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.2px;
  background: linear-gradient(135deg, var(--silver) 0%, var(--periwinkle-soft) 60%, var(--periwinkle) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.theme-light .brand-wordmark {
  background: linear-gradient(135deg, var(--cobalt) 0%, var(--periwinkle) 60%, var(--periwinkle-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.server-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-strong);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
  margin-left: 80px;
}

.server-picker:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent);
}

.server-picker-name { font-weight: 500; }

.server-picker-chev {
  font-size: 14px;
  color: var(--text-muted);
}

.server-dropdown,
.account-dropdown {
  position: absolute;
  top: calc(var(--top-bar-h) - 4px);
  background: var(--bg-surface);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 8px;
  min-width: 240px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(94, 124, 230, 0.05),
              0 0 60px rgba(94, 124, 230, 0.06);
  z-index: 60;
}

.server-dropdown { left: 200px; }
.account-dropdown { right: 14px; min-width: 260px; }

.dropdown-label {
  font-size: 10px;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 500;
  padding: 6px 8px;
  margin: 0;
}

.dropdown-server,
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 8px 8px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 150ms;
}

.dropdown-server:hover,
.dropdown-item:hover {
  background: var(--bg-surface-hover);
}

.dropdown-server.active {
  background: var(--bg-active);
  position: relative;
}

.dropdown-server.active::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  background: var(--glow-soft);
  pointer-events: none;
}

.dropdown-server .ti-check {
  margin-left: auto;
  font-size: 16px;
  color: var(--accent);
}

.dd-server-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--border-strong);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dd-server-icon.add {
  background: transparent;
  border: 0.5px dashed var(--border-strong);
  color: var(--text-muted);
}

.dd-server-icon.add i { font-size: 14px; }

.dropdown-sep {
  height: 0.5px;
  background: var(--border);
  margin: 6px 4px;
}

.dropdown-item i {
  font-size: 16px;
  color: var(--text-muted);
}

.dropdown-item.danger { color: var(--coral); }
.dropdown-item.danger i { color: var(--coral); }

.dropdown-account-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
}

.dropdown-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--periwinkle), var(--lavender));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 14px;
  flex-shrink: 0;
}

.dropdown-account-name { font-size: 13px; color: var(--text-primary); margin: 0; font-weight: 500; }
.dropdown-account-meta { font-size: 11px; color: var(--text-muted); margin: 0; }

.top-bar-spacer { flex: 1; }

.top-bar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  width: 280px;
  transition: border-color 150ms, width 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.top-bar-search i {
  font-size: 14px;
  color: var(--text-muted);
}

.top-bar-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  min-width: 0;
}

.top-bar-search input::placeholder { color: var(--text-muted); }

.top-bar-search:focus-within {
  border-color: var(--accent);
  width: 340px;
}

.icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  background: transparent;
  border: 0.5px solid transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms, color 150ms, border-color 150ms;
}

.icon-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.icon-btn i { font-size: 16px; }

.notif-demo-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--blush);
  color: var(--cobalt-deep);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 2px 5px;
  border-radius: 4px;
  text-transform: uppercase;
}

.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0.5px solid transparent;
  padding: 4px 8px 4px 6px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  transition: background 150ms, border-color 150ms;
}

.account-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

.account-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--periwinkle), var(--lavender));
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}

.account-chev {
  font-size: 12px;
  color: var(--text-muted);
}

.sub-sidebar {
  width: 200px;
  background: var(--bg-app-soft);
  border-right: 0.5px solid var(--border);
  padding: 14px 10px;
  flex-shrink: 0;
}

.category-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
  transition: background 150ms, color 150ms;
}

.nav-item i { font-size: 16px; }

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

.nav-item.active {
  background: var(--bg-active);
  color: var(--text-primary);
}

.nav-item.active i { color: var(--accent); }

.nav-item.active::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  background: radial-gradient(ellipse 80% 100% at 0% 50%, var(--glow-accent), transparent 70%);
  pointer-events: none;
}

.content {
  flex: 1;
  padding: 26px 30px;
  overflow-y: auto;
}

.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  font-size: 20px;
  margin: 0;
  color: var(--text-primary);
  font-weight: 500;
}

.eyebrow {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0 0 4px;
  letter-spacing: 0.4px;
  font-weight: 500;
}

.card {
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 16px;
  transition: border-color 200ms;
}

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

.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
}

.card-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
}

.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--periwinkle) 0%, var(--lavender) 100%);
  border: none;
  color: white;
  padding: 6px 12px 6px 14px;
  border-radius: var(--radius-md);
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(94, 124, 230, 0.25);
  transition: transform 150ms, box-shadow 250ms;
}

.mode-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(94, 124, 230, 0.35);
}

.mode-toggle i { font-size: 13px; }

.section-heading {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 0 0 10px 4px;
}

.num-input {
  background: var(--bg-app);
  border: 0.5px solid var(--border);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  width: 70px;
  outline: none;
  transition: border-color 150ms;
}

.num-input:focus { border-color: var(--accent); }

.num-input::-webkit-inner-spin-button,
.num-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.num-input { -moz-appearance: textfield; }

.input-pair {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-mini-label {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  padding-left: 2px;
}

.input-pair-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.range-sep { color: var(--text-muted); font-size: 11px; }
.unit-label { color: var(--text-muted); font-size: 12px; }
.prefix-label { color: var(--text-muted); font-size: 12px; }

.seg-control {
  display: inline-flex;
  background: var(--bg-app);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.seg-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}

.seg-btn:hover { color: var(--text-primary); }

.seg-btn.active {
  background: var(--bg-active);
  color: var(--text-primary);
}

.select-input {
  background: var(--bg-app);
  border: 0.5px solid var(--border);
  color: var(--text-primary);
  padding: 6px 28px 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3e%3cpath d='M2 4 L5 7 L8 4' stroke='%235a5a64' stroke-width='1.2' fill='none' stroke-linecap='round'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  min-width: 180px;
  transition: border-color 150ms;
}

.select-input:focus { border-color: var(--accent); }

.toggle { display: inline-block; cursor: pointer; }
.toggle input { display: none; }

.toggle-track {
  display: inline-block;
  width: 36px;
  height: 20px;
  background: var(--bg-app);
  border: 0.5px solid var(--border);
  border-radius: 999px;
  position: relative;
  transition: background 150ms, border-color 150ms;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1), background 150ms;
}

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

.toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(16px);
  background: white;
}

.row-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.table-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-app);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border);
}

.table-row .select-input {
  background: transparent;
  border: none;
  padding: 0;
  min-width: 140px;
}

.table-row .num-input {
  background: transparent;
  border: none;
  padding: 2px 4px;
  width: 56px;
}

.row-remove {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px;
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 150ms, background 150ms;
}

.row-remove:hover {
  color: var(--coral);
  background: var(--bg-surface-hover);
}

.row-remove i { font-size: 14px; }

.row-add {
  background: transparent;
  border: 0.5px dashed var(--border-strong);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 150ms, border-color 150ms, background 150ms;
  align-self: flex-start;
}

.row-add:hover {
  color: var(--text-primary);
  border-color: var(--accent);
  background: var(--bg-surface-hover);
}

.row-add i { font-size: 14px; }

.row-arrow {
  color: var(--text-muted);
  font-size: 14px;
  padding: 0 4px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: var(--bg-surface);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6),
              0 0 60px rgba(94, 124, 230, 0.08);
}

.modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-icon.coral {
  background: rgba(240, 153, 123, 0.1);
  color: var(--coral);
}

.modal-icon i { font-size: 24px; }

.modal-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.modal-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 20px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.modal-btn {
  background: var(--bg-app);
  border: 0.5px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: color 150ms, border-color 150ms, background 150ms;
}

.modal-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.modal-btn.primary { color: white; }

.modal-btn.primary.coral {
  background: var(--coral);
  border-color: var(--coral);
}

.modal-btn.primary.coral:hover {
  background: #d97f5f;
  border-color: #d97f5f;
}

.locked-container {
  position: relative;
  cursor: pointer;
  border-color: var(--accent);
  border-width: 1px;
}

.locked-container::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(ellipse at center, var(--glow-accent), transparent 70%),
    linear-gradient(135deg, rgba(94, 124, 230, 0.06) 0%, rgba(184, 184, 232, 0.04) 100%);
  pointer-events: none;
  z-index: 1;
  opacity: 1;
}

.locked-container::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg,
    var(--periwinkle) 0%,
    var(--lavender) 25%,
    var(--silver) 50%,
    var(--lavender) 75%,
    var(--periwinkle) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: shimmer 3.5s linear infinite;
  background-size: 200% 100%;
  z-index: 2;
}

.locked-container:hover {
  box-shadow: 0 0 32px rgba(94, 124, 230, 0.28),
              inset 0 0 24px rgba(94, 124, 230, 0.06);
}

@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 5;
  pointer-events: none;
}

.lock-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(94, 124, 230, 0.6);
}

.lock-icon {
  font-size: 24px;
  color: var(--silver);
  filter: drop-shadow(0 0 8px rgba(184, 184, 232, 0.6));
}

.lock-action {
  font-size: 10px;
  color: var(--text-secondary);
  letter-spacing: 0.4px;
}

.lock-reset-link {
  margin-top: 8px;
  background: transparent;
  border: 0.5px solid var(--coral);
  color: var(--coral);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  pointer-events: auto;
  transition: background 150ms;
  z-index: 6;
}

.lock-reset-link:hover {
  background: rgba(240, 153, 123, 0.10);
}

.lock-reset-link i { font-size: 12px; }

.save-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 120%);
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 10px 12px 10px 18px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(94, 124, 230, 0.06),
    0 0 60px rgba(94, 124, 230, 0.10);
  z-index: 110;
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1),
              opacity 200ms;
  opacity: 0;
  pointer-events: none;
}

.save-bar.visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.save-bar-text {
  font-size: 13px;
  color: var(--text-primary);
  margin: 0;
  font-weight: 500;
}

.save-bar-actions {
  display: flex;
  gap: 6px;
}

.save-bar-btn {
  font-family: inherit;
  font-size: 12px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 0.5px solid transparent;
  transition: background 150ms, color 150ms, border-color 150ms, transform 150ms;
}

.save-bar-btn.cancel {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.save-bar-btn.cancel:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
}

.save-bar-btn.primary {
  background: linear-gradient(135deg, var(--periwinkle) 0%, var(--lavender) 100%);
  color: white;
  border: none;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(94, 124, 230, 0.25);
}

.save-bar-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(94, 124, 230, 0.35);
}

.landing-placeholder {
  max-width: 600px;
  margin: 80px auto;
  text-align: center;
}

.landing-placeholder h1 {
  font-size: 56px;
  margin: 0 0 16px;
  letter-spacing: -1.5px;
  background: linear-gradient(135deg, var(--silver) 0%, var(--periwinkle-soft) 50%, var(--periwinkle) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing-placeholder p {
  color: var(--text-secondary);
  font-size: 16px;
  margin: 0 0 12px;
}

.landing-placeholder .landing-meta {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 24px;
}

.landing-placeholder a {
  color: var(--accent);
  text-decoration: none;
}

.landing-placeholder a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.placeholder-card {
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 40px;
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
}

.placeholder-card code {
  background: var(--bg-app);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: ui-monospace, 'SF Mono', Monaco, monospace;
  font-size: 12px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 6px;
  transition: color 150ms;
}

.back-link:hover {
  color: var(--accent);
}

.back-link i { font-size: 14px; }

.settings-section {
  margin-bottom: 28px;
}

.control-card {
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px 18px;
  margin-bottom: 20px;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 0.5px solid var(--border);
}

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

.control-row.stacked {
  flex-direction: column;
  align-items: stretch;
}

.control-row.stacked .control-label {
  margin-bottom: 12px;
}

.control-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.label-title {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

.label-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

.label-hint code {
  background: var(--bg-app);
  color: var(--text-secondary);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-family: ui-monospace, 'SF Mono', Monaco, monospace;
}

.control-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.hamburger-btn {
  display: none;
  background: transparent;
  border: 0.5px solid var(--border-strong);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 150ms, color 150ms;
}

.hamburger-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.hamburger-btn i { font-size: 18px; }

.mobile-search-btn {
  display: none;
  background: transparent;
  border: 0.5px solid var(--border-strong);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 150ms, color 150ms;
}

.mobile-search-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.mobile-search-btn i { font-size: 16px; }

.mobile-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-app);
  display: flex;
  flex-direction: column;
}

.mobile-search-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 0.5px solid var(--border);
}

.mobile-search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.mobile-search-input-wrap i {
  font-size: 16px;
  color: var(--text-muted);
}

.mobile-search-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.mobile-search-input-wrap input::placeholder { color: var(--text-muted); }

.mobile-search-cancel {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 14px;
  font-family: inherit;
  padding: 8px;
  cursor: pointer;
}

.mobile-search-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.drawer-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 280px;
  z-index: 151;
  background: var(--bg-app-soft);
  border-right: 0.5px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 0.5px solid var(--border);
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.drawer-brand .brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  overflow: hidden;
}

.drawer-brand .brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drawer-close {
  background: transparent;
  border: 0.5px solid var(--border-strong);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.drawer-close i { font-size: 16px; }

.drawer-section {
  padding: 14px 12px;
  border-bottom: 0.5px solid var(--border);
}

.drawer-section:last-child { border-bottom: none; }

.drawer-section-label {
  font-size: 10px;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 500;
  margin: 0 8px 8px;
}

.drawer-server {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-strong);
  color: var(--text-primary);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.drawer-server-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #c084fc, #f472b6);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  flex-shrink: 0;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drawer-nav .nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  text-decoration: none;
}

.drawer-nav .nav-item i { font-size: 18px; }

.drawer-nav .nav-item.active {
  background: var(--bg-active);
  color: var(--text-primary);
}

.drawer-nav .nav-item.active i { color: var(--accent); }

.drawer-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-control {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 11px 12px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  width: 100%;
  text-decoration: none;
}

.drawer-control i { font-size: 18px; }

.drawer-control:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.drawer-control.danger { color: var(--coral); }

.bottom-tab-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-app-soft);
  border-top: 0.5px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}

.bottom-tab-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}

.bottom-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 10px;
  letter-spacing: 0.2px;
  transition: color 150ms;
}

.bottom-tab i { font-size: 19px; }

.bottom-tab.active {
  color: var(--accent);
}

.mobile-toast {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  left: 16px;
  right: 16px;
  z-index: 175;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-toast i {
  color: var(--accent);
  font-size: 16px;
  flex-shrink: 0;
}

@media (max-width: 768px) {

  .hamburger-btn,
  .mobile-search-btn { display: inline-flex; }

  .bottom-tab-bar { display: block; }

  .sub-sidebar { display: none; }
  .brand-wordmark { display: none; }
  .top-bar-search { display: none; }
  .server-picker { display: none; }
  .top-bar .theme-btn { display: none; }
  .server-dropdown { display: none; }

  .top-bar {
    padding: 0 10px;
    gap: 8px;
  }

  .brand-block {
    padding: 4px;
    gap: 0;
  }

  .content {
    padding: 16px 14px calc(84px + env(safe-area-inset-bottom, 0px));
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }

  .page-title { font-size: 18px; }

  .account-dropdown { right: 10px; }

  .top-bar-spacer { flex: 1; }

  .icon-btn { width: 36px; height: 36px; }
  .account-btn { padding: 4px 6px; }
  .account-chev { display: none; }
}

.account-avatar-img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-block;
  flex-shrink: 0;
}

.dropdown-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-block;
  flex-shrink: 0;
}

.dd-server-icon-img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.drawer-server-icon-img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.dropdown-server.install {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  width: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
}

.dropdown-server.install:hover {
  background: var(--bg-surface-hover);
}

.dropdown-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 12px 10px;
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

.server-picker:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.drawer-server:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.notif-wrap {
  position: relative;
  display: inline-flex;
}

.notif-count {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--coral);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  border-radius: 8px;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-width: 88vw;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(94, 124, 230, 0.05),
              0 0 60px rgba(94, 124, 230, 0.06);
  z-index: 60;
  overflow: hidden;
}

.notif-dropdown-head {
  padding: 12px 14px;
  border-bottom: 0.5px solid var(--border);
}

.notif-dropdown-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.notif-dropdown-list {
  max-height: 380px;
  overflow-y: auto;
}

.notif-empty {
  padding: 22px 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}

.notif-row {
  display: flex;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 0.5px solid var(--border);
}

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

.notif-row.notif-unread { background: var(--bg-active); }

.notif-row-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-surface-hover);
  color: var(--text-secondary);
}

.notif-row-icon i { font-size: 15px; }

.notif-row-main { min-width: 0; flex: 1; }

.notif-row-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.notif-row-body {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.notif-row-meta {
  margin: 3px 0 0;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
}

.notif-meta-k { font-weight: 500; }
.notif-meta-v {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}

.notif-row-time {
  margin: 5px 0 0;
  font-size: 10px;
  color: var(--text-muted);
}

.module-switch {
  margin-bottom: 24px;
  padding: 16px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.module-switch-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.module-switch-text { min-width: 0; }

.module-switch-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.module-switch-state {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
}

.module-switch-state.is-on {
  color: var(--teal);
  border-color: var(--teal);
  background: rgba(93, 202, 165, 0.12);
}

.module-switch-hint {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.module-switch-toggle { flex: none; }

.module-switch-toggle input:disabled + .toggle-track {
  cursor: not-allowed;
  opacity: 0.55;
}

.module-switch-error {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: var(--coral);
}

.module-switch-save {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.module-switch-save-text {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.module-switch-save-actions {
  display: flex;
  gap: 6px;
}

.module-switch-save .save-bar-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.settings-modal {
  background: var(--bg-surface);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7),
              0 0 80px rgba(94, 124, 230, 0.10);
  overflow: hidden;
}

.settings-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 0.5px solid var(--border);
  background: linear-gradient(135deg, rgba(94, 124, 230, 0.05) 0%, transparent 100%);
}

.settings-modal-title {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.settings-modal-close {
  background: transparent;
  border: 0.5px solid var(--border);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 150ms, border-color 150ms, background 150ms;
}

.settings-modal-close:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
}

.settings-modal-close i { font-size: 16px; }

.settings-modal-body { padding: 8px 24px 24px; }

.settings-section { padding-top: 16px; }

.settings-section-label {
  font-size: 10px;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin: 0 0 4px;
  font-weight: 500;
  text-transform: uppercase;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 0.5px solid var(--border);
}

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

.settings-row-text { flex: 1; min-width: 0; }

.settings-row-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.settings-row-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}
