/**
 * Domainless shared chrome stylesheet.
 *
 * Uses theme CSS variables where available; falls back to hard defaults
 * so the bar still looks right on services that haven't adopted the
 * variable system yet.
 *
 * 48px tall bar, fixed to the top of the viewport, always visible.
 * Body content on every page is pushed down by 48px via the
 * html.dl-chrome-present selector (set by chrome.js).
 */

/* Push page content down when the chrome bar is present */
html.dl-chrome-present body {
  padding-top: 48px !important;
}

#dl-chrome-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  z-index: 9999;
  background: var(--card, #16161e);
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  font-family:
    "DM Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 13px;
  color: var(--text, #c0c0cc);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  -webkit-font-smoothing: antialiased;
}

.dl-chrome-inner {
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Logo */
.dl-chrome-logo {
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--bright, #f0f0f6);
  text-decoration: none;
  letter-spacing: -0.01em;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.15s;
}
.dl-chrome-logo:hover {
  background: var(--accent-tint, rgba(200, 168, 110, 0.1));
}
.dl-chrome-logo span {
  color: var(--accent, #c8a86e);
}

/* Service switcher pills */
.dl-chrome-tabs {
  flex: 1;
  display: flex;
  gap: 4px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  min-width: 0;
}
.dl-chrome-tabs::-webkit-scrollbar {
  display: none;
}

.dl-chrome-tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 14px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 600;
  color: var(--dim, #7a7a88);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  transition:
    color 0.15s,
    background 0.15s,
    border-color 0.15s;
}
.dl-chrome-tab:hover {
  color: var(--bright, #f0f0f6);
  background: var(--accent-tint, rgba(200, 168, 110, 0.08));
}
.dl-chrome-tab.active {
  color: #000;
  background: var(--accent, #c8a86e);
  border-color: var(--accent, #c8a86e);
  font-weight: 800;
}

/* User slot (right side) */
.dl-chrome-user {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.dl-chrome-signin {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 14px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent, #c8a86e);
  text-decoration: none;
  border: 1px solid var(--accent, #c8a86e);
  transition: background 0.15s;
}
.dl-chrome-signin:hover {
  background: var(--accent-tint, rgba(200, 168, 110, 0.12));
}

.dl-chrome-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--card, #16161e);
  color: var(--accent, #c8a86e);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  border: 2px solid var(--accent, #c8a86e);
  overflow: hidden;
  transition:
    transform 0.1s,
    box-shadow 0.15s;
}
.dl-chrome-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 3px var(--accent-tint, rgba(200, 168, 110, 0.2));
}
.dl-chrome-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mobile: tighten spacing and hide the logo text beyond "dl" */
@media (max-width: 640px) {
  #dl-chrome-bar {
    height: 44px;
  }
  html.dl-chrome-present body {
    padding-top: 44px !important;
  }
  .dl-chrome-inner {
    padding: 0 10px;
    gap: 8px;
  }
  .dl-chrome-logo {
    font-size: 14px;
    padding: 4px 8px;
  }
  .dl-chrome-tab {
    height: 28px;
    padding: 0 10px;
    font-size: 11px;
  }
  .dl-chrome-avatar {
    width: 28px;
    height: 28px;
    border-width: 2px;
  }
  .dl-chrome-signin {
    height: 28px;
    padding: 0 10px;
    font-size: 11px;
  }
}

@media (max-width: 420px) {
  .dl-chrome-logo {
    display: none;
  }
}
