/* AI Ops shared page parts: the page base and type defaults, focus ring, and the site's top bar.
   Every page links tokens.css, then this file, then its own CSS. Colour, type, radius and easing
   come from tokens.css; this file states only layout measures. Rules: rules.md, "Page base" and "Top bar". */

/* ---------- Page base and type ---------- */

*, *::before, *::after { box-sizing: border-box; }

:root { --bar-h: 56px; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--bar-h) + 24px);
}

body {
  margin: 0;
  background: var(--aiops-canvas);
  color: var(--aiops-text-body);
  font-family: var(--aiops-font-sans);
  font-size: 16px;
  line-height: 28px;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

svg.i {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
svg.logo { width: 16px; height: 16px; flex: none; fill: var(--aiops-claude); }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--aiops-accent);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: var(--aiops-accent-tint); color: var(--aiops-text); }
:root.dark ::selection { background: var(--aiops-accent-line); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---------- Top bar: wordmark, shelves, search, theme, account ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--bar-h);
  background: var(--aiops-canvas);
  border-bottom: 1px solid var(--aiops-border);
}
.topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px 0 24px;
}
.wordmark {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.4px;
  color: var(--aiops-text);
  text-decoration: none;
  padding: 4px 2px;
  margin-right: 20px;
  white-space: nowrap;
}
.shelves {
  display: flex;
  align-self: stretch;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.shelves a {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 10px;
  font-size: 14px;
  line-height: 20px;
  color: var(--aiops-text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 150ms ease;
}
.shelves a:hover { color: var(--aiops-text); }
.shelves a[aria-current="page"] { color: var(--aiops-text); font-weight: 500; }
.shelves a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--aiops-accent);
}
.shelves a:focus-visible { outline-offset: -6px; }

.search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 280px;
  height: 36px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--aiops-border);
  border-radius: var(--aiops-radius-control);
  background: var(--aiops-canvas);
  color: var(--aiops-text-muted);
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
  transition: border-color 150ms ease, scale 120ms var(--aiops-ease-enter);
}
.search:hover { border-color: var(--aiops-border-strong); }
.search:active { scale: 0.97; }
.search span { flex: 1; text-align: left; }
.search kbd {
  font: 500 12px/1 var(--aiops-font-sans);
  color: var(--aiops-text-muted);
  padding: 4px 6px;
  border: 1px solid var(--aiops-border);
  border-radius: 6px;
  background: var(--aiops-subtle);
}

.theme-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  margin-left: 8px;
  padding: 0;
  border: 1px solid var(--aiops-border);
  border-radius: var(--aiops-radius-control);
  background: var(--aiops-canvas);
  color: var(--aiops-text-muted);
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, scale 120ms var(--aiops-ease-enter);
}
.theme-btn:hover { color: var(--aiops-text); border-color: var(--aiops-border-strong); }
.theme-btn:active { scale: 0.97; }
.theme-btn .moon, :root.dark .theme-btn .sun { display: none; }
:root.dark .theme-btn .moon { display: block; }
html:not(.js) .theme-btn { display: none; }

.avatar {
  margin-left: 12px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--aiops-accent-tint);
  color: var(--aiops-accent-ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--aiops-border);
}

/* Phone: shelves leave the bar (each page puts them where it can), search becomes a 40 square */
@media (max-width: 859px) {
  .topbar-inner { padding: 0 12px 0 8px; gap: 4px; }
  .wordmark { margin-right: 0; }
  .shelves { display: none; }
  .search { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .search span, .search kbd { display: none; }
  .avatar { margin-left: 4px; }
}
