/* Workspace navigation and feature search share the same shell on every signed-in page. */
.nav-section { display: grid; align-content: start; gap: 2px; }
.nav-heading {
  margin: 0 0 3px;
  padding: 0 12px;
  color: #657187;
  font-size: 12px;
  font-weight: 600;
  line-height: 19px;
}
#sf-rail { background: #fafbfd; }
#sf-rail .primary-nav {
  min-height: 0;
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  gap: 15px;
}
#sf-rail .workspace-picker, #sf-rail .foot-nav { flex-shrink: 0; }
#sf-rail .foot-nav { background: inherit; }
#sf-rail .nav-link:hover { background: #eef1f6; }
#sf-rail .nav-link.active { color: #a91c40; background: #fcebf0; }
#sf-rail .nav-link.active:hover { background: #f9e0e8; }

#sf-rail details.nav-section { display: block; }
#sf-rail summary.nav-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
  padding: 0 10px 0 12px;
  list-style: none;
  cursor: pointer;
  border-radius: 5px;
}
#sf-rail summary.nav-heading::-webkit-details-marker { display: none; }
#sf-rail summary.nav-heading:hover { background: #eef1f6; color: var(--ink); }
#sf-rail summary.nav-heading:focus-visible { outline: 2px solid var(--pink-text); outline-offset: -2px; }
#sf-rail summary.nav-heading .ico { transform: rotate(-90deg); color: #67768a; }
#sf-rail details[open] > summary.nav-heading .ico { transform: none; }
#sf-rail .nav-items { display: grid; gap: 1px; }
@media screen and (min-width:801px) {
  body:not(.admin-mode) #sf-rail .primary-nav { gap: 9px; }
  body:not(.admin-mode) #sf-rail .nav-items .nav-link { min-height: 33px; padding-block: 5px; }
}

.topbar .platforms {
  display: flex;
  gap: 2px;
  border: 1px solid #e1e5ed;
  border-radius: 10px;
  padding: 3px;
  background: #f0f2f6;
}
.topbar .platforms button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #4d586d;
  line-height: 20px;
}
.topbar .platforms .chosen {
  color: var(--pink-text);
  border-color: #e6cfd6;
  background: #fff;
  box-shadow: 0 1px 3px #19213b12;
}
.platform-count {
  min-width: 17px;
  padding: 0 4px;
  border-radius: 4px;
  background: #e1e5ec;
  color: #536075;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
}
.chosen .platform-count { background: #ffebf0; color: var(--pink-text); }
.feature-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid #dbe0e9;
  border-radius: 8px;
  background: #fafbfd;
  color: #445169;
  font-size: 13px;
  white-space: nowrap;
}
.feature-trigger:hover { border-color: #9ca9bc; background: white; }
.feature-trigger kbd {
  padding: 0 4px;
  border: 1px solid #e0e4ec;
  border-radius: 4px;
  background: #fff;
  color: #59667d;
  font: 11px/18px "Segoe UI", sans-serif;
}
.dialog:has(.feature-field) { width: min(525px, 100%); }
.dialog:has(.feature-field) .dialog-body { padding: 0; }
.feature-field {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 16px 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #6a7589;
}
.feature-field:focus-within { border-color: #b42d53; box-shadow: 0 0 0 2px #fe2c5512; }
input#feature-query { flex: 1; min-width: 0; height: 38px; border: 0; padding: 0; outline: 0; background: transparent; }
.feature-results { max-height: min(50dvh, 352px); overflow: auto; overscroll-behavior: contain; padding: 0 9px 10px; }
.feature-result { display: flex; align-items: center; gap: 10px; padding: 9px; border-radius: 6px; color: var(--ink); font-size: 14px; }
.feature-result > .ico { color: #637087; }
.feature-result > small { margin-left: auto; color: #626e80; font-size: 12px; }
.feature-result:hover, .feature-result:focus-visible { background: #fff0f4; outline-offset: -2px; }
.feature-empty { padding: 22px 10px; text-align: center; color: var(--muted); }

@media screen and (min-width:801px) {
  :root { --rail: clamp(200px, 15.6vw, 220px); --bar: 56px; }
  .topbar {
    display: grid;
    grid-template-columns: calc(var(--rail) - 16px) minmax(0,1fr) auto;
    gap: 14px;
    padding: 0 20px 0 16px;
    border-color: #dde2ec;
  }
  .topbar .platforms { width: max-content; max-width: 100%; }
  .topbar .platforms button { flex: 1 1 auto; padding: 4px 9px; font-size: 13px; }
  .topbar .top-tools { justify-self: end; }
  #sf-rail { padding: 13px 8px 7px; }
  #sf-rail .workspace-picker { margin: 0 2px 15px; border-radius: 9px; }
  #sf-rail .nav-link { padding-left: 12px; min-height: 38px; }
  #sf-rail .primary-nav { flex: 1; }
  #sf-rail .foot-nav { margin-top: 8px; padding-top: 5px; }
}
@media screen and (min-width:801px) and (max-width:1360px) {
  .feature-trigger span, .feature-trigger kbd { display: none; }
  .feature-trigger { width: 34px; padding: 0; justify-content: center; }
  .topbar .platforms button { padding-inline: 7px; gap: 4px; }
  .topbar .platforms button:not(:first-child) .platform-count { display: none; }
}
@media screen and (min-width:801px) and (max-width:980px) {
  .topbar { gap: 8px; padding-right: 12px; }
  .topbar .platforms button { padding-inline: 4px; }
  .topbar .system-state { display:none; }
  .topbar { grid-template-columns: max-content minmax(0,1fr) auto; }
  .topbar .platforms .plat-icon { display: none; }
}
@media screen and (max-width:800px) {
  :root { --bar: 96px; }
  .admin-mode { --bar: 52px; }
  .topbar {
    display: grid;
    grid-template-columns: 32px minmax(0,1fr) auto;
    grid-template-rows: 51px 36px;
    align-content: start;
    gap: 0 6px;
    padding: 0 12px;
  }
  .admin-mode .topbar { grid-template-rows: 51px; }
  .topbar .admin-title { display: none; }
  .topbar .wordmark { justify-self: start; }
  .topbar .platforms { grid-column: 1/-1; grid-row: 2; width: 100%; max-width: none; height: 36px; }
  .topbar .platforms button { font-size: 12px; padding: 2px 3px; }
  .topbar .top-tools { grid-column: 3; grid-row: 1; }
  .feature-trigger { width: 33px; justify-content: center; padding: 0; }
  .feature-trigger span, .feature-trigger kbd { display: none; }
  .platform-count { display: none; }
  #sf-rail .primary-nav { flex: 1; }
  #sf-rail .foot-nav { margin-top: 8px; }
}
@media screen and (max-width:480px) {
  .topbar .platforms .ico, .topbar .platforms .plat-icon { display: none; }
}

/* The store is a separate destination. Keep both units visible on narrow screens. */
.topbar .platforms { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topbar .platforms::-webkit-scrollbar { display: none; }
.topbar .platforms button { flex: 1 0 auto; }
.platform-label { display: grid; align-content: center; }
.platform-totals { font-size: 10px; font-weight: 500; line-height: 12px; color: #526079; }
.topbar .platforms button:has(.platform-totals) { padding-block: 0; }
.topbar .platforms button:focus-visible { outline: 2px solid var(--pink-text); outline-offset: -2px; }
@media screen and (max-width:800px) {
  .topbar .platforms button { padding-inline: 6px; }
  .topbar .platforms button:has(.platform-totals) .platform-label { line-height: 15px; }
}

@media screen and (max-width:600px) {
  body:not(.admin-mode) { --bar: 124px; }
  body:not(.admin-mode) .topbar { grid-template-rows: 47px 72px; }
  .topbar .platforms {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    grid-template-rows: repeat(2,minmax(0,1fr));
    height: 72px;
  }
  .topbar .platforms button:first-child { grid-column: span 2; }
  .topbar .platforms button { min-width: 0; padding: 0 2px; gap: 3px; }
}

@media screen and (min-width:1181px) {
  .topbar .platforms button:not(:first-child) .platform-count { display: inline; }
}
@media screen and (min-width:981px) and (max-width:1180px) {
  .topbar .platforms button[data-platform^="TikTok"] .platform-count { display: inline; }
}
@media screen and (max-width:600px) {
  .topbar .platforms button:not(:first-child) { flex-direction: column; gap: 0; line-height: 15px; }
  .topbar .platforms button:not(:first-child) .platform-count { display: inline; font-size: 10px; line-height: 11px; }
  .topbar .platforms .ico, .topbar .platforms .plat-icon { display: none; }
}
