/* CTRL branding on top of the Liam ERD build (@liam-hq/cli 0.7.24, pinned in deploy-docs.yml).
   Liam hashes its class names, so these match on the stable prefix or on the link target. */

/* Liam's logo, header icons, version badge, its own links, and the "Related tables" section */
[class*="_logoWrapper_"],
[class*="_iconButtonGroup_"],
[class*="_versionWrapper_"],
[class*="_relatedTables_"],
[class*="_sidebarMenuItem_"]:has(a[href*="liambx.com"]),
[class*="_sidebarMenuItem_"]:has(a[href*="github.com/liam-hq"]) {
  display: none !important;
}

/* "Tips" button and "Back to CTRL docs" link that erd-brand.js adds to the header */
.ctrl-help-toggle,
.ctrl-back,
.ctrl-help-done {
  font: 500 14px/1 system-ui, sans-serif;
  color: #c9d1d9;
  background: none;
  text-decoration: none;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  cursor: pointer;
}
.ctrl-help-toggle:hover,
.ctrl-back:hover,
.ctrl-help-done:hover {
  background: rgba(255, 255, 255, 0.08);
}
.ctrl-back {
  margin-right: 12px;
}

/* The tips panel, top right under the header */
.ctrl-help {
  position: fixed;
  top: 60px;
  right: 12px;
  z-index: 1000;
  width: 300px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 72px);
  overflow-y: auto;
  padding: 14px 16px;
  font: 13px/1.45 system-ui, sans-serif;
  color: #c9d1d9;
  background: #232526;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  /* erd-brand.js moves it left of a table's details while those are open */
  transition: right 0.2s ease;
  /* Opened straight onto a table (a reload or a shared link), Liam's details drawer leaves clicks
     switched off on <body>. The tips stay clickable anyway */
  pointer-events: auto;
}
.ctrl-help[hidden] {
  display: none;
}
.ctrl-help h2 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}
.ctrl-help ul {
  margin: 0 0 12px;
  padding-left: 18px;
  list-style: disc;
}
.ctrl-help li {
  margin: 4px 0;
}
.ctrl-help summary {
  display: list-item;
  margin-bottom: 8px;
  color: #8b949e;
  cursor: pointer;
}
.ctrl-help summary:hover {
  color: #c9d1d9;
}
.ctrl-help b {
  font-weight: 600;
  color: #e6edf3;
}
.ctrl-help-done {
  display: block;
  margin-left: auto;
  font-size: 13px;
}

/* "Licences" link next to it, kept quiet */
.ctrl-licences {
  margin-right: 12px;
  font: 400 13px/1 system-ui, sans-serif;
  color: #8b949e;
  text-decoration: none;
}
.ctrl-licences:hover {
  color: #c9d1d9;
  text-decoration: underline;
}

/* Enum boxes from customise.py get a dashed border so they don't read as tables */
[aria-label$="(enum) table"] > div {
  border-color: #b48ead !important;
  border-style: dashed !important;
}

/* Enum values aren't columns, so no nullable/not-null icons */
[aria-label$="(enum) table"] [class*="_diamondIcon_"] {
  display: none !important;
}

/* Rows erd-brand.js hides, currently each foreign key's "On Update" */
[data-ctrl-hidden] {
  display: none !important;
}

/* Panel for an enum box: keep the note and the values, drop the per-value Type/Nullable
   blocks and the empty Indexes and Constraints sections */
section[data-ctrl-enum-panel] dl,
section[data-ctrl-enum-panel] [class*="_body_"] > :nth-child(n+4) {
  display: none !important;
}
