/* ============================================================
   Orbit polish — spacing, rail, cards, empty states, controls.
   Applies on top of orbit.css; no feature logic touched.
   ============================================================ */

/* ---- server rail ---- */
.rail-add,
.rail-discover,
.rail-profile {
  width: 46px !important;
  height: 46px !important;
  border-radius: 16px !important;
  background: #252a35 !important;
  color: #cfd4de !important;
  display: grid !important;
  place-items: center !important;
  font-size: 20px !important;
  box-shadow: none !important;
  border: 0 !important;
  flex: none;
}
.rail-add:hover,
.rail-discover:hover,
.rail-profile:hover {
  background: #2f3543 !important;
  color: #fff !important;
  border-radius: 14px !important;
}
.rail-discover svg,
.rail-profile svg { width: 18px; height: 18px; }
.rail-divider {
  width: 30px !important;
  height: 1px !important;
  margin: 2px 0 6px !important;
  background: #2a303c !important;
}
.server-icons {
  gap: 10px !important;
  padding: 4px 0 2px !important;
  align-items: center !important;
}
.server-icon.active::before {
  left: -13px !important;
  height: 26px !important;
  background: #fff !important;
  border-radius: 0 4px 4px 0 !important;
}

/* ---- sidebar ---- */
#sidebar { padding-bottom: 0 !important; }
.sidebar-top h2 { letter-spacing: -.2px; }
.section-label {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  color: #7f899e !important;
}
.section-label .count,
.section-label span { color: #6f7a8d !important; }

.nav-item { gap: 10px !important; font-weight: 550 !important; }
.nav-item .nav-glyph svg { width: 16px; height: 16px; }
.nav-item.active {
  background: #2c2a3c !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(139, 124, 255, .35) !important;
}
.channel-entry .hash { width: 16px; text-align: center; }
.channel-entry.active { background: #343044 !important; }

/* member rows in the sidebar */
#server-members .member-entry {
  height: 32px !important;
  padding: 0 8px !important;
  border-radius: 7px !important;
}
#server-members .member-name { font-size: 12.5px !important; color: #cfd4de !important; }

/* ---- topbar ---- */
.topbar-actions { gap: 8px !important; }
.topbar-pill,
.icon-button {
  height: 30px !important;
  border-radius: 8px !important;
}
.topbar-pill { padding: 0 11px !important; font-size: 11.5px !important; display: inline-flex; align-items: center; }
.icon-button { width: 30px !important; display: inline-grid; place-items: center; }
.icon-button svg { width: 16px; height: 16px; }

/* ---- content headers ---- */
.page-heading,
h1.page-heading {
  font-size: 25px !important;
  font-weight: 780 !important;
  letter-spacing: -.6px !important;
  margin: 0 0 6px !important;
}
.page-subtitle { color: var(--muted) !important; font-size: 12.5px !important; }

/* friends toolbar */
.friends-toolbar,
.tab-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 14px 22px !important;
  border-bottom: 1px solid #252a35 !important;
}
.tab-button {
  height: 30px !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--muted) !important;
  background: transparent !important;
  border: 0 !important;
}
.tab-button:hover { background: #282d38 !important; color: #fff !important; }
.tab-button.active {
  background: #2c2a3c !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(139, 124, 255, .38) !important;
}
.tab-button.tab-add,
.tab-button[data-home-tab="add"] {
  margin-left: auto !important;
  background: var(--accent-2) !important;
  color: #fff !important;
  box-shadow: none !important;
}
.friends-search,
#friend-search {
  max-width: 240px !important;
  margin-left: auto !important;
}

/* ---- cards ---- */
.discover-card,
.server-card,
.friend-card {
  border: 1px solid #2a303c !important;
  background: #191c24 !important;
  border-radius: 12px !important;
}
.discover-card:hover { border-color: #3a4050 !important; background: #1d2029 !important; }
.discover-card .primary,
.server-card .primary { height: 34px !important; border-radius: 8px !important; }

/* ---- empty states ---- */
.empty-state { padding: 40px 22px !important; }
.empty-state strong { font-size: 18px !important; font-weight: 720 !important; letter-spacing: -.3px; }
.empty-state p { color: var(--muted) !important; font-size: 12.5px !important; margin-top: 6px !important; }
.empty-inline { color: #7f899e !important; font-size: 11.5px !important; }

/* ---- search row ---- */
.message-search-row { display: flex !important; align-items: center !important; gap: 8px !important; }
.message-search-row input { max-width: 380px !important; }
.message-search-row .small-action { height: 30px !important; padding: 0 10px !important; font-size: 11px !important; }

/* ---- composer ---- */
.composer form { min-height: 52px !important; }
.composer form #message-input { font-size: 13.5px !important; }
.composer-plus { width: 32px !important; height: 32px !important; }
.composer-plus svg { width: 17px; height: 17px; }
.send-button { height: 34px !important; min-width: 56px !important; display: inline-flex !important; align-items: center; justify-content: center; }
#composer-hint { text-align: center !important; }

/* ---- member panel rows ---- */
.members-panel-head { padding: 0 4px 8px !important; }
.member-line .member-name { font-size: 12.5px !important; }

/* ---- buttons ---- */
.primary, .secondary, .ghost-button {
  height: 34px !important;
  padding: 0 14px !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.small-action { height: 28px !important; padding: 0 10px !important; font-size: 11px !important; }
.small-action.danger { color: #f7a8b1 !important; border-color: rgba(241, 107, 120, .35) !important; }

/* ---- settings shell ---- */
.us-nav-item,
.ss-nav-item {
  height: 32px !important;
  border-radius: 7px !important;
  font-size: 12.5px !important;
}
.us-nav-item.active,
.ss-nav-item.active { background: #2c2a3c !important; color: #fff !important; }
.us-head h2, .ss-head h2 { font-size: 20px !important; letter-spacing: -.4px; }

/* ---- inputs ---- */
input, textarea, select {
  background: #20242e !important;
  border: 1px solid #303644 !important;
  border-radius: 8px !important;
  color: var(--text) !important;
  font-size: 12.5px !important;
  padding: 8px 10px !important;
}
input::placeholder, textarea::placeholder { color: #6f7a8d !important; }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(139, 124, 255, .16) !important;
  outline: none !important;
}

/* ---- scrollbars ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #2f3543 !important;
  border-radius: 6px;
  border: 3px solid #111318;
}
::-webkit-scrollbar-thumb:hover { background: #3c4353 !important; }

/* friends screen header: one row, tabs left, search + add on the right */

.friends-header {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 0 22px !important;
  height: 58px !important;
  min-height: 58px !important;
  border-bottom: 1px solid #252a35 !important;
  flex-wrap: nowrap !important;
}
.friends-title {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-weight: 750 !important;
  font-size: 14px !important;
  flex: none !important;
}
.friends-glyph { color: var(--accent) !important; font-size: 15px !important; }
.friends-tabs {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: nowrap !important;
}
.friends-tabs .tab-add { margin-left: 6px !important; }
.friends-search { margin-left: auto !important; flex: 0 0 220px !important; }
.friends-search .search-input { width: 100% !important; height: 32px !important; }

.friends-layout { display: flex !important; min-height: 0 !important; }
.friends-body { flex: 1 !important; min-width: 0 !important; overflow-y: auto !important; padding: 0 0 24px !important; }
.friends-section {
  font-size: 10px !important;
  letter-spacing: 1.2px !important;
  color: #7f899e !important;
  font-weight: 800 !important;
  padding: 18px 22px 8px !important;
}
.friend-row {
  height: 46px !important;
  margin: 0 12px 2px !important;
  padding: 0 10px !important;
  border-radius: 9px !important;
}
.friend-row:hover { background: #1d212b !important; }
.friend-row .friend-name,
.friend-row strong { font-size: 12.5px !important; }

.composer { padding: 0 22px 20px !important; }


/* markdown formatting */

.md-code {
  background: #20242e;
  border: 1px solid #303644;
  border-radius: 5px;
  padding: 1px 5px;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 12.5px;
  color: #cfd6e2;
}
.md-pre {
  background: #14161c;
  border: 1px solid #2a303c;
  border-radius: 9px;
  padding: 10px 12px;
  margin: 6px 0;
  overflow-x: auto;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  color: #cfd6e2;
}
.md-pre code { background: none; border: 0; padding: 0; }
.md-quote {
  display: block;
  border-left: 3px solid #3a4050;
  padding-left: 10px;
  color: #b6bdc9;
}
.md-heading { display: block; font-size: 16px; font-weight: 800; margin: 6px 0 2px; color: #f2f4f7; }
.md-spoiler {
  background: #2b303c;
  color: transparent;
  border-radius: 4px;
  padding: 0 3px;
  cursor: pointer;
}
.md-spoiler:hover,
.md-spoiler:focus { color: inherit; background: #343a49; }
.message-text strong { color: #f2f4f7; font-weight: 750; }
.message-text a { color: #a99eff; text-decoration: none; }
.message-text a:hover { text-decoration: underline; }
