/* The database screens' frame, on ui.css's tokens: the header's navigation, the banner, the view beside its side panel.
   The approved appearance uses Rotor’s shared tokens. Shared screen parts are in ../shared/components.css, and each
   screen's own styles are beside it. */

:root {
  --warn-bg: #fbf4dc;
  --warn-fg: #5a4600;
  --warn-rule: #efe2b2;
}
@media (prefers-color-scheme: dark) {
  :root {
    --warn-bg: #2e2810;
    --warn-fg: #efdfa6;
    --warn-rule: #4a3f15;
  }
}

/* ============ Frame ============ */
.banner {
  background: var(--warn-bg);
  color: var(--warn-fg);
  padding: 9px var(--gutter);
  font-size: 14px;
  border-bottom: 1px solid var(--warn-rule);
}
.banner a {
  color: inherit;
  font-weight: 600;
  text-decoration-color: currentColor;
}
.banner > div + div {
  margin-top: 2px;
}
main.db {
  display: flex;
  padding: 0;
  max-width: none;
}
#view {
  flex: 1;
  min-width: 0;
  padding: 36px var(--gutter) 80px;
  max-width: 880px;
}
#view p,
#view .md,
#view .note {
  max-width: 68ch;
}
#side {
  width: 392px;
  flex-shrink: 0;
  padding: 36px 28px 64px;
  border-left: 1px solid var(--rule);
  background: var(--card);
  min-height: calc(100vh - 57px);
}
#side:empty {
  display: none;
}
/* Text shows as it was written: no ligatures, which would draw "->", "!=" or ">=" in code, SQL and values as arrows and
   signs that aren't the characters there (JetBrains Mono and Inter both have them). */
#view,
#view *,
#side,
#side * {
  font-variant-ligatures: none;
}
#view .loading {
  color: var(--muted);
  font-size: 14px;
}
/* A long name under a title (a code version, a run) wraps rather than widening the page on a phone. */
#view h1 + p.sub {
  overflow-wrap: anywhere;
}
#view .failed {
  color: var(--bad);
}
@media (max-width: 860px) {
  main.db {
    flex-direction: column;
  }
  #side {
    width: auto;
    border-left: 0;
    border-top: 1px solid var(--rule);
    min-height: 0;
  }
}

/* Loading feedback sits outside the layout; the previous screen keeps its size until the next one is ready. */
main.db {
  min-height: calc(100svh - 57px);
}
body.reading {
  overflow-anchor: none;
}
body.reading #view[inert],
body.reading #side[inert] {
  opacity: 0.45;
}
.navigation-status {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  box-shadow: var(--shadow);
  pointer-events: none;
}
.navigation-status:empty {
  display: none;
}

/* Bounded read controls share the frame's quiet link treatment and deliberate spacing. */
.inspection-window {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin: 24px 0 8px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13px;
}
.inspection-window button {
  min-height: 32px;
}
.inspection-window span {
  font-variant-numeric: tabular-nums;
}
