/* BOLT, the Bonus Orchestration Launch Tool: the brand, drawn on top of styles.css, which is pinned and never edited.
   Mark A, a lightning bolt in an Electric Blue circle, approved on 2026-12-02. The marks and icons are the files in brand/. */

/* The wordmark and the full name, at the top of the left menu. */
.brand { gap: 6px; padding: 2px 8px 4px; }
.brand-lockup { display: flex; align-items: center; gap: 8px; }
.brand-logo { height: 21px; width: auto; }
.brand-desc { font-size: 11px; line-height: 1.3; color: var(--ink-3); }

/* Two copies of the wordmark, one for each theme. The page shows one, by the same rule as styles.css's dark theme. */
.brand-logo.on-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo.on-light { display: none; }
  :root:not([data-theme="light"]) .brand-logo.on-dark { display: block; }
}
:root[data-theme="dark"] .brand-logo.on-light { display: none; }
:root[data-theme="dark"] .brand-logo.on-dark { display: block; }

/* An icon before each item of the left menu, in the item's own colour. */
.nav-list a { justify-content: flex-start; gap: 10px; }
.nav-list a .nav-count { margin-left: auto; }
.nav-list a::before { content: ''; width: 18px; height: 18px; flex: none; background-color: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.nav-list a[href="#home"] { --icon: url(brand/icons/home.svg); }
.nav-list a[href="#audiences"] { --icon: url(brand/icons/audiences.svg); }
.nav-list a[href="#promos"] { --icon: url(brand/icons/promos.svg); }
.nav-list a[href="#bonus-audiences"] { --icon: url(brand/icons/deploy.svg); }
.nav-list a[href="#approvals"] { --icon: url(brand/icons/approvals.svg); }
.nav-list a[href="#reporting"] { --icon: url(brand/icons/reporting.svg); }
.nav-list a[href="#destinations"] { --icon: url(brand/icons/destinations.svg); }
.nav-list a[href="#activity"] { --icon: url(brand/icons/activity.svg); }

/* The page you are on: an Electric Blue edge on its menu item. */
.nav-list a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--brand); border-radius: 0 var(--r) var(--r) 0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav-list a[aria-current="page"] { box-shadow: inset 3px 0 0 #8FA9FF; }
}
:root[data-theme="dark"] .nav-list a[aria-current="page"] { box-shadow: inset 3px 0 0 #8FA9FF; }

/* High-contrast mode drops the masks' colour and the edge's shadow. The icons take the links' own colour and the page you
   are on gets a border, so both still show. */
@media (forced-colors: active) {
  .nav-list a::before { forced-color-adjust: none; background-color: LinkText; }
  .nav-list a[aria-current="page"] { border-left: 3px solid Highlight; }
}

/* On a phone the menu is one line: the wordmark alone, as styles.css hides the menu's other text there. */
@media (max-width: 760px) {
  .brand-desc { display: none; }
}

/* ---------- The SQL tab's editor (sql-editor.js) ---------- */

/* JetBrains Mono joins >= into one sign that looks like ≥, and != into one like ≠. The SQL tab refuses those signs when
   they are typed, so no code text on the page joins them: what is shown is what is typed. */
code, .mono, kbd, pre, textarea.code { font-variant-ligatures: none; font-feature-settings: "calt" 0, "liga" 0; }

.sql-head { display: flex; align-items: center; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; }
.sql-tools { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.sql-tools .btn { padding: 3px 10px; font-size: 12.5px; }
.sql-head label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }

/* A gutter of line numbers, the code, and one line under them that says what the SQL reads as. The code is the
   textarea: it takes the keys, the caret and the selection, and its own text is drawn clear. Over it lies a copy of
   the same text, in the same type and place, that clicks pass through: it draws the text in colour, and the lines under
   the words the reader points at. */
/* A phone's browser can enlarge text it judges too small to read. The textarea and its copy must keep one size, or the
   lines under the words would drift off them, so neither is enlarged. */
.editor { display: grid; grid-template-columns: 44px minmax(0, 1fr); border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); -webkit-text-size-adjust: none; text-size-adjust: none; }
.editor:focus-within { outline: 2px solid var(--brand-text); outline-offset: 2px; }
.gutter { position: relative; overflow: hidden; border-right: 1px solid var(--line); font-family: var(--mono); font-size: 12px; line-height: 20px; text-align: right; color: var(--ink-3); user-select: none; font-variant-numeric: tabular-nums; }
.gutter-in { position: absolute; top: 10px; left: 0; right: 10px; }
.gutter-in span { display: block; position: relative; }
.gutter .is-bad { color: var(--bad); font-weight: 600; }
.gutter .is-warn { color: var(--warn); font-weight: 600; }
.gutter .is-bad::after, .gutter .is-warn::after { content: ''; position: absolute; right: -10px; top: 2px; bottom: 2px; width: 2px; background: var(--bad-mark); }
.gutter .is-warn::after { background: var(--warn); }
.sql-code { position: relative; min-width: 0; overflow: hidden; }
.sql-paint, .editor textarea.code { margin: 0; padding: 10px 12px; font-family: var(--mono); font-size: 12.5px; line-height: 20px; letter-spacing: 0; white-space: pre; tab-size: 4; }
.sql-paint { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; color: var(--ink); background: transparent; }
.sql-paint code { display: block; font: inherit; color: inherit; }
.editor textarea.code { position: relative; z-index: 1; display: block; width: 100%; min-height: 0; border: 0; border-radius: 0; background: transparent; resize: none; overflow: auto; color: transparent; caret-color: var(--ink); }
.editor textarea.code::selection { color: transparent; background: color-mix(in srgb, var(--brand) 24%, transparent); }
/* One colour stands out, for the values the person chose. SQL's own words and signs are quieter than the names. */
.sql-paint .k { color: var(--ink-3); }
.sql-paint .v { color: var(--brand-text); }
.sql-paint .p { color: var(--ink-2); }
.sql-paint .c { color: var(--ink-3); font-style: italic; }
.editor textarea.code:focus-visible { outline: none; }
.mk-bad { text-decoration: underline wavy var(--bad-mark); text-decoration-thickness: 1.5px; text-underline-offset: 4px; text-decoration-skip-ink: none; background: var(--bad-soft); border-radius: 2px; }
.mk-warn { text-decoration: underline dotted var(--warn); text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-skip-ink: none; }
.sql-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 4px 16px; flex-wrap: wrap; padding: 6px 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); min-height: 32px; }
.sql-foot [id$="-status"] { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); }
.sql-foot [id$="-status"]::before { content: ''; width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--line-strong); }
.sql-foot .is-ok::before { background: var(--good-mark); }
.sql-foot .is-warn::before { background: var(--warn); }
.sql-foot .is-bad::before { background: var(--bad-mark); }
.sql-foot .is-bad { color: var(--bad); font-weight: 600; }
.keys { display: inline-flex; gap: 12px; flex-wrap: wrap; }
kbd { font-family: var(--mono); font-size: 11px; color: var(--ink-2); border: 1px solid var(--line-strong); border-bottom-width: 1.5px; border-radius: 4px; padding: 0 4px; line-height: 16px; background: var(--surface); margin-right: 4px; }

/* A problem or a note, under the editor, on the line it names, with its fix. */
.problems { display: flex; flex-direction: column; gap: 6px; }
.problems:empty { display: none; }
.problem { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 6px 0 6px 12px; border-left: 2px solid var(--bad-mark); }
.problem .at { font-size: 12.5px; font-weight: 600; color: var(--bad); white-space: nowrap; font-variant-numeric: tabular-nums; }
.problem p { font-size: 13px; color: var(--ink); }
.problem code { overflow-wrap: anywhere; }
.problem.is-warn { border-left-color: var(--warn); }
.problem.is-warn .at { color: var(--warn); }
/* The fix reads as one line of words, its code in it, and wraps as words do. */
.btn-sm { display: inline-block; padding: 4px 10px; font-size: 12.5px; white-space: normal; text-align: left; }
.btn-sm code { font-size: 12px; }
/* The definition read from the SQL before the last change. */
.stale { font-size: 12.5px; color: var(--ink-3); }

/* High contrast draws text in the system's colours. The copy is hidden and the textarea draws its own text, so the text
   is drawn once; the gutter's marked lines and the rows under the editor still say where each problem is. */
@media (forced-colors: active) {
  .sql-paint { display: none; }
  .editor textarea.code { color: CanvasText; caret-color: CanvasText; }
  .editor textarea.code::selection { color: HighlightText; background: Highlight; }
  .gutter .is-bad, .gutter .is-warn { text-decoration: underline; }
  .sql-foot [id$="-status"]::before { forced-color-adjust: none; background: CanvasText; }
}

@media (max-width: 760px) {
  .editor { grid-template-columns: 34px minmax(0, 1fr); }
  .gutter-in { right: 8px; }
  .gutter .is-bad::after, .gutter .is-warn::after { right: -8px; }
  .problem { grid-template-columns: auto minmax(0, 1fr); }
  .problem .btn-sm { grid-column: 1 / -1; justify-self: start; }
}

/* The conditions Point and click holds that SQL cannot say, each as code. */
.cannot { margin: 4px 0; padding-left: 18px; font-size: 13px; }
.cannot code { overflow-wrap: anywhere; }

/* ---------- The SQL tab's pane of tables and fields, and the names offered as SQL is typed (sql-fields.js) ---------- */

/* Beside the editor when there is room for both, under it when there is not. Beside it, the pane takes the height of the
   editor and its rows, at least enough to read, and its list of fields scrolls inside it. */
.sql-work { container-type: inline-size; }
.sql-work-in { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.sql-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; container: sql-main / inline-size; }
/* With the pane beside it, the SQL's column is narrow on a wide screen too: there a problem's fix goes under its words,
   as on a phone, so the words keep the width to be read. */
@container sql-main (max-width: 640px) {
  .problem { grid-template-columns: auto minmax(0, 1fr); }
  .problem .btn-sm { grid-column: 1 / -1; justify-self: start; }
}
.schema { display: flex; flex-direction: column; gap: 8px; min-width: 0; max-height: 520px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--sunken); }
@container (min-width: 760px) {
  .sql-work.has-schema .sql-work-in { grid-template-columns: minmax(0, 1fr) 300px; }
  .sql-work.has-schema .schema { contain: size; min-height: 560px; max-height: none; }
}
.schema-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.schema-head h3 { font-size: 13px; font-weight: 600; color: var(--ink); }
.schema-head .icon-btn { margin: -6px -6px -6px 0; }
.schema-about h4 { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.schema-about .small { margin-top: 2px; }
.schema-foot { color: var(--ink-3); }
/* The read-back under the SQL: what it reads as, in plain words, and where that is not what SQL would do. */
.readback { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); }
.readback h3, .readback p { margin: 0; }
.readback h3 { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.readback ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; overflow-wrap: anywhere; }
.readback ul ul { margin-top: 2px; }
.readback code { font-size: 12px; }
.schema input[type="search"] { width: 100%; }
.schema-list { flex: 1 1 auto; min-height: 220px; overflow: auto; display: flex; flex-direction: column; gap: 12px; margin: 0 -6px; padding: 0 6px; }
.schema-group h4 { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 2px; }
.schema-group h4 .small { font-weight: 400; }
.schema-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.schema-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.schema-name, .schema-more, .schema-form, .schema-value { font: inherit; cursor: pointer; color: var(--ink); border-radius: 4px; }
.schema-name { flex: 1 1 auto; min-width: 0; text-align: left; border: 0; background: transparent; padding: 3px 4px; }
.schema-name code, .schema-off { font-size: 12px; overflow-wrap: anywhere; }
.schema-name .pre { color: var(--ink-3); }
.schema-off { flex: 1 1 auto; min-width: 0; padding: 3px 4px; color: var(--ink-2); }
/* A container holds what is placed absolutely inside it, so the hidden words in the button are held in the button: else
   they would widen the list sideways. */
.schema-more { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 3px 4px; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.schema-more::after { content: ''; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); }
.schema-more[aria-expanded="true"]::after { transform: rotate(45deg); }
.schema-name:hover, .schema-more:hover { background: var(--surface); }
.schema-detail { display: flex; flex-direction: column; gap: 6px; margin: 2px 0 8px 4px; padding-left: 10px; border-left: 2px solid var(--line-strong); }
/* A form takes the room left by its words, and wraps; the words take at most two fifths. */
.schema-ops { display: grid; grid-template-columns: minmax(0, 1fr) fit-content(40%); gap: 3px 8px; align-items: center; margin: 0; }
.schema-ops > div { display: contents; }
.schema-ops dt { min-width: 0; }
.schema-ops dd { margin: 0; font-size: 11.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.schema-form, .schema-value { max-width: 100%; border: 1px solid var(--line-strong); background: var(--surface); padding: 1px 6px; text-align: left; }
.schema-form:hover, .schema-value:hover { border-color: var(--brand-text); }
.schema-form code, .schema-value code { font-size: 11.5px; overflow-wrap: anywhere; }
.schema-values { display: flex; flex-wrap: wrap; gap: 4px; }
/* Values on a field the SQL tab takes none on, such as a list: there to read, not to click. */
.schema-value-off { font-size: 11.5px; padding: 1px 6px; color: var(--ink-2); border: 1px dashed var(--line-strong); border-radius: 4px; overflow-wrap: anywhere; }
.schema-field .small { padding-left: 4px; }
.schema-detail .small { padding-left: 0; }

/* The names to put in, under the caret. Kept inside the editor: the Claude panel has a list called suggest of its own. */
.editor { position: relative; }
.editor .suggest { position: absolute; z-index: 5; margin: 0; padding: 4px; list-style: none; min-width: 220px; max-width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: 0 6px 20px rgb(0 0 0 / 0.14); }
.editor .suggest li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 3px 8px; border-radius: 4px; cursor: pointer; }
.editor .suggest li code { font-size: 12px; overflow-wrap: anywhere; }
.editor .suggest li span { flex: none; font-size: 11.5px; color: var(--ink-3); }
.editor .suggest li[aria-selected="true"] { background: var(--brand-soft); }

@media (forced-colors: active) {
  .schema-more::after { border-color: CanvasText; }
  .editor .suggest li[aria-selected="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .editor .suggest li[aria-selected="true"] span, .editor .suggest li[aria-selected="true"] code { color: HighlightText; }
}
