/*
 * Cue brand tokens.
 *
 * Every value below was sampled out of the logo rather than eyeballed, so the
 * admin, the extension panel and the mark on the sign-in page are the same
 * colours rather than three near-misses. Near-misses are the thing that makes
 * a product feel assembled from parts.
 *
 * The palette is one gradient walked end to end: deep navy through blue and
 * cyan into teal and green. That is the logo's own construction — the C
 * sweeps navy to cyan, the play mark inside runs teal to green — so using it
 * as a ramp rather than a set of unrelated swatches keeps everything related.
 *
 *   --cue-navy      #012047   the wordmark. Text, headers, the darkest ink.
 *   --cue-navy-mid  #01436D   secondary navy, borders on dark surfaces
 *   --cue-blue      #0197C4   the C's open end. Primary interactive colour.
 *   --cue-teal      #0AB795   the hinge between blue and green
 *   --cue-green     #14B972   the play mark. Success, positive, "go".
 *   --cue-green-lt  #54DC70   the play mark's tip. Highlights only.
 *
 * Tagline: "Helpful guidance. Wherever you work."
 */

:root {
  /* ---- Brand ramp ------------------------------------------------------ */
  --cue-navy: #012047;
  --cue-navy-mid: #01436d;
  --cue-blue: #0197c4;
  --cue-teal: #0ab795;
  --cue-green: #14b972;
  --cue-green-lt: #54dc70;

  /*
   * The signature gradient. Used on the header rule, primary buttons and
   * nothing else — a gradient everywhere is a gradient nowhere.
   */
  --cue-sweep: linear-gradient(
    90deg,
    var(--cue-navy) 0%,
    var(--cue-navy-mid) 22%,
    var(--cue-blue) 48%,
    var(--cue-teal) 72%,
    var(--cue-green) 100%
  );

  /* ---- Ink ------------------------------------------------------------- */
  --cue-ink: #0d1b2e;
  --cue-ink-2: #45566d;
  --cue-ink-3: #7c8aa0;

  /* ---- Surfaces -------------------------------------------------------- */
  --cue-bg: #f6f8fb;
  --cue-surface: #ffffff;
  --cue-line: #dfe5ee;
  --cue-line-soft: #eef2f7;

  /* ---- Tints, for backgrounds behind brand-coloured text ---------------- */
  --cue-navy-tint: #eef2f8;
  --cue-blue-tint: #e6f5fa;
  --cue-teal-tint: #e6f8f4;
  --cue-green-tint: #e9f8f0;

  /* ---- Status ---------------------------------------------------------- */
  /* Amber and red are NOT in the logo. They are deliberately outside the
     brand ramp: a warning that shares a hue with the primary colour reads as
     decoration. These are tuned to sit beside the ramp without clashing. */
  --cue-warn: #b45309;
  --cue-warn-tint: #fdf3e7;
  --cue-danger: #b42318;
  --cue-danger-tint: #fdeceb;

  --cue-radius: 10px;
  --cue-radius-lg: 14px;
  --cue-shadow: 0 1px 2px rgba(1, 32, 71, 0.06), 0 4px 14px rgba(1, 32, 71, 0.06);
}

/* ---- The header lockup --------------------------------------------------- */

.cue-topbar {
  background: var(--cue-surface);
  border-bottom: 1px solid var(--cue-line);
  position: relative;
}

/* The one place the full sweep appears at full strength: a 3px rule under the
   header, echoing the swoosh in the banner lockup. */
.cue-topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--cue-sweep);
}

.cue-topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.cue-logo {
  height: 34px;
  width: auto;
  display: block;
}

.cue-tagline {
  font-size: 13px;
  color: var(--cue-ink-2);
  letter-spacing: 0.01em;
  padding-left: 16px;
  border-left: 1px solid var(--cue-line);
}
.cue-tagline strong {
  color: var(--cue-green);
  font-weight: 700;
}

.cue-topbar-spacer { flex: 1; }

/* ---- Primary action ------------------------------------------------------ */

.cue-btn-primary {
  background: var(--cue-sweep);
  background-size: 200% 100%;
  background-position: 0% 0;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 9px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-position 0.35s ease;
}
.cue-btn-primary:hover { background-position: 60% 0; }
.cue-btn-primary:disabled { opacity: 0.5; cursor: default; }

.cue-btn {
  background: var(--cue-surface);
  color: var(--cue-navy);
  border: 1px solid var(--cue-line);
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 550;
  cursor: pointer;
}
.cue-btn:hover { border-color: var(--cue-blue); color: var(--cue-blue); }

/* ---- Cards --------------------------------------------------------------- */

.cue-surface {
  /*
   * NOT `.cue-card`. The ported admin.css already defines `.cue-card` — it is
   * the Cue Library's grid row — and reusing the name silently turned every
   * recommendation into a three-column grid with the headline, the evidence
   * and the buttons side by side. It rendered, it typechecked, and it looked
   * like a layout decision rather than a collision.
   *
   * Anything added to this brand layer needs a name that does not already
   * exist in the 12,000 lines of ported CSS. Grep before naming.
   */
  background: var(--cue-surface);
  border: 1px solid var(--cue-line);
  border-radius: var(--cue-radius-lg);
  box-shadow: var(--cue-shadow);
}

.cue-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--cue-ink-3);
  margin: 0 0 10px;
}

/* ---- Chips --------------------------------------------------------------- */

.cue-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
}
.cue-chip-navy  { background: var(--cue-navy-tint);  color: var(--cue-navy); }
.cue-chip-blue  { background: var(--cue-blue-tint);  color: #036f90; }
.cue-chip-teal  { background: var(--cue-teal-tint);  color: #07806a; }
.cue-chip-green { background: var(--cue-green-tint); color: #0b7f4e; }
.cue-chip-warn  { background: var(--cue-warn-tint);  color: var(--cue-warn); }
.cue-chip-danger{ background: var(--cue-danger-tint);color: var(--cue-danger); }

/* ---------------------------------------------------------------------------
 * Form controls — base layer
 *
 * Every input rule in admin.css is scoped to a container: `.field input`,
 * `.create-row input`, `.taxonomy-grid input`, `.skill-editor input[type=text]`
 * and so on. There was no element-level rule anywhere, so any markup that did
 * not happen to sit inside one of those specific wrappers rendered as a raw
 * browser default — square corners, system font, grey bevel — next to fully
 * branded buttons. The Setup wizard and the newer section markup are all in
 * that position, which is why the first screen a new customer sees has
 * unstyled boxes on it.
 *
 * This is deliberately element-level and low specificity: every existing
 * scoped rule in admin.css beats it on specificity, so nothing that was
 * already styled changes. It only fills the gaps.
 *
 * Checkboxes, radios and ranges are excluded — padding and border on those
 * breaks the native control rather than improving it.
 * ------------------------------------------------------------------------- */

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
select,
textarea {
  font: inherit;
  font-size: 14px;
  color: var(--cue-ink);
  background: var(--cue-surface);
  border: 1px solid var(--cue-line);
  border-radius: 8px;
  padding: 9px 11px;
  line-height: 1.4;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  -webkit-appearance: none;
  appearance: none;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

/* The native arrow disappears with appearance:none, so it is drawn back in.
   Inlined as a data URI because a separate asset request for one caret is
   not worth the round trip. */
select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%237c8aa0' d='M1.4 1.6 6 6.2l4.6-4.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 11px;
  cursor: pointer;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--cue-blue);
  box-shadow: 0 0 0 3px rgba(1, 151, 196, 0.16);
}

input::placeholder,
textarea::placeholder {
  color: var(--cue-ink-3);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--cue-line-soft);
  color: var(--cue-ink-3);
  cursor: not-allowed;
}

/* Inputs sitting next to an adjacent button ("+ Add", "Invite") should size to
   their row rather than stretching to full width. */
.row input,
.su-row input,
.create-row input,
.su-add-row input {
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
}

/* A full-width input in a flex row squeezes its neighbouring button until the
   label wraps — "+ Add software" broke across two lines. Buttons in these rows
   keep their intrinsic width and never wrap. */
.row button,
.su-row button,
.create-row button,
.su-add-row button {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
 * v0.3.0 primary navigation — three sections above a secondary tab row.
 * ------------------------------------------------------------------------- */

.cue-nav-primary {
  display: flex;
  gap: 4px;
  align-items: center;
  border-bottom: 1px solid var(--cue-line);
  margin-bottom: 0;
  padding: 0 0 0 2px;
}

.cue-nav-item {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 11px 16px 10px;
  margin-bottom: -1px;
  font: 600 15px/1.2 inherit;
  color: var(--cue-ink-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 6px 6px 0 0;
  transition: color 120ms ease, background 120ms ease;
}

.cue-nav-item:hover { color: var(--cue-navy); background: var(--cue-navy-tint); }

.cue-nav-item.is-active {
  color: var(--cue-navy);
  border-bottom-color: var(--cue-blue);
  background: none;
}

/* The rolled-up count from tabs inside this section. */
.cue-nav-dot {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--cue-green);
  color: #fff;
  font: 700 11px/18px system-ui, sans-serif;
  text-align: center;
}

/* Secondary row: lighter than the primary so the hierarchy reads at a glance. */
.tabs.cue-nav-secondary {
  border-bottom: 1px solid var(--cue-line-soft);
  padding-top: 4px;
}

.tabs.cue-nav-secondary .tab { font-size: 13.5px; }

/* Tabs outside the active section. Deliberately not `hidden`, which admin.js
   owns for permission checks. */
.tab.cue-nav-off { display: none !important; }

/* The page a skill belongs to, on its row in the Skills list. */
.skill-row-page {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-top: 3px;
  font-size: 12px;
}
.skill-row-page-name { color: var(--cue-ink-2); font-weight: 600; }
.skill-row-page code {
  color: var(--cue-ink-3);
  background: var(--cue-line-soft);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11.5px;
}

/* ---------------------------------------------------------------------------
 * `hidden` must actually hide.
 *
 * The browser hides `[hidden]` with a UA rule of `display: none`, and ANY
 * author rule that sets `display` beats it — `.br-add-page { display: flex }`
 * is enough. So an element the code carefully hides stays on screen, and the
 * bug looks like a logic error in whichever module set the attribute.
 *
 * Eleven elements were in that state in v0.3.0, and they were not obscure: the
 * add-a-page form sat permanently open under the page list, the bulk-action
 * bar never went away, the draft banner and both AI strips showed on every
 * skill, and the Review and Problems tab badges rendered a "0" that the nav
 * had explicitly hidden — so the one "something needs you" signal in the
 * product was lying whenever nothing needed anyone.
 *
 * `!important` is load-bearing here rather than lazy: the whole point is to
 * outrank author rules that set `display` on the same element. Anything that
 * genuinely needs to show is shown by removing the attribute, which is what
 * every caller already does.
 * ------------------------------------------------------------------------- */
[hidden] { display: none !important; }
