/* ── Fonts, served from this site (no request to Google). IBM Plex Sans and IBM Plex Mono, SIL Open Font License 1.1 —
   the licenses are in /fonts/. Files come from the @fontsource packages (v5.3.0), subsets "latin" and "latin-ext": the browser
   downloads a file only when a page uses characters from its range. */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/ibm-plex-sans-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-display: swap; font-weight: 500; src: url(/fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-display: swap; font-weight: 500; src: url(/fonts/ibm-plex-sans-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-display: swap; font-weight: 600; src: url(/fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-display: swap; font-weight: 600; src: url(/fonts/ibm-plex-sans-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-display: swap; font-weight: 700; src: url(/fonts/ibm-plex-sans-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-display: swap; font-weight: 700; src: url(/fonts/ibm-plex-sans-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/ibm-plex-mono-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 500; src: url(/fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 500; src: url(/fonts/ibm-plex-mono-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 600; src: url(/fonts/ibm-plex-mono-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 600; src: url(/fonts/ibm-plex-mono-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* ── Design tokens ─────────────────────────────────────────────── */
:root {
  --ink: #12161c;
  --paper: #f4f6f9;
  --surface: #ffffff;
  --line: #dde1e8;
  --muted: #6b7280;
  --blueprint: #2554c7;
  --blueprint-dim: #e8eefc;
  --success: #1f7a4d;
  --success-dim: #e6f4ec;
  --warning: #a3690f;
  --warning-dim: #fbf0dd;
  --danger: #b42318;
  --danger-dim: #fcebe9;
  /* Text on a --blueprint / --danger fill, the greyed-out look, and the
     few other colours that used to be hard-coded. */
  --on-accent: #ffffff;
  --blueprint-hover: #1e46a8;
  --danger-hover: #8f1c13;
  --disabled-bg: #c3c8d1;
  --disabled-fg: #ffffff;
  --disabled-link: #c3c8d1;
  --badge-neutral-bg: #eceef2;
  --status-off: #9aa1ad;
  --status-offline: #f2b705;
  --hover-wash: rgba(0, 0, 0, 0.08);
  --overlay: rgba(18, 22, 28, 0.45);
  --shadow: rgba(0, 0, 0, 0.15);
  --success-glow: rgba(31, 122, 77, 0.55);
  --success-glow-0: rgba(31, 122, 77, 0);
  /* Charts (js/dashboards.js reads these). */
  --chart-ink: #12161c;
  --chart-secondary: #52514e;
  --chart-grid: #e8ebf0;
  color-scheme: light;
  --font-sans: "IBM Plex Sans", -apple-system, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 8px;
}

/* ── Medium theme: a softer mid-tone between light and dark ─────── */
:root[data-theme="medium"] {
  --ink: #1a2230;
  --paper: #c5ccd6;
  --surface: #d9dee6;
  --line: #aab3c0;
  --muted: #45505f;
  --blueprint: #1f4bb8;
  --blueprint-dim: #c3d0ee;
  --success: #14683f;
  --success-dim: #bcdcc9;
  --warning: #7f4d06;
  --warning-dim: #ead9b3;
  --danger: #a3200f;
  --danger-dim: #ecc4be;
  --on-accent: #ffffff;
  --blueprint-hover: #17399a;
  --danger-hover: #7e170a;
  --disabled-bg: #aab3c0;
  --disabled-fg: #e9edf2;
  --disabled-link: #8d97a6;
  --badge-neutral-bg: #c0c8d3;
  --status-off: #7f8997;
  --chart-ink: #1a2230;
  --chart-secondary: #3d4756;
  --chart-grid: #b8c0cc;
  color-scheme: light;
}

/* ── Dark theme ─────────────────────────────────────────────────── */
:root[data-theme="dark"] {
  --ink: #e6e9ee;
  --paper: #0e1116;
  --surface: #161b22;
  --line: #2b323c;
  --muted: #9aa4b2;
  --blueprint: #7aa2ff;
  --blueprint-dim: #1b2744;
  --success: #4cc38a;
  --success-dim: #12301f;
  --warning: #e3a64a;
  --warning-dim: #38290f;
  --danger: #f2776c;
  --danger-dim: #3b1a17;
  --on-accent: #0b1220;
  --blueprint-hover: #9bb9ff;
  --danger-hover: #f79a91;
  --disabled-bg: #2a313b;
  --disabled-fg: #6b7482;
  --disabled-link: #4a5260;
  --badge-neutral-bg: #232a33;
  --status-off: #6b7482;
  --status-offline: #f2b705;
  --hover-wash: rgba(255, 255, 255, 0.1);
  --overlay: rgba(0, 0, 0, 0.62);
  --shadow: rgba(0, 0, 0, 0.55);
  --success-glow: rgba(76, 195, 138, 0.55);
  --success-glow-0: rgba(76, 195, 138, 0);
  --chart-ink: #e6e9ee;
  --chart-secondary: #b3bac5;
  --chart-grid: #2b323c;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --ink: #e6e9ee;
    --paper: #0e1116;
    --surface: #161b22;
    --line: #2b323c;
    --muted: #9aa4b2;
    --blueprint: #7aa2ff;
    --blueprint-dim: #1b2744;
    --success: #4cc38a;
    --success-dim: #12301f;
    --warning: #e3a64a;
    --warning-dim: #38290f;
    --danger: #f2776c;
    --danger-dim: #3b1a17;
    --on-accent: #0b1220;
    --blueprint-hover: #9bb9ff;
    --danger-hover: #f79a91;
    --disabled-bg: #2a313b;
    --disabled-fg: #6b7482;
    --disabled-link: #4a5260;
    --badge-neutral-bg: #232a33;
    --status-off: #6b7482;
    --status-offline: #f2b705;
    --hover-wash: rgba(255, 255, 255, 0.1);
    --overlay: rgba(0, 0, 0, 0.62);
    --shadow: rgba(0, 0, 0, 0.55);
    --success-glow: rgba(76, 195, 138, 0.55);
    --success-glow-0: rgba(76, 195, 138, 0);
    --chart-ink: #e6e9ee;
    --chart-secondary: #b3bac5;
    --chart-grid: #2b323c;
    color-scheme: dark;
  }
}

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

* { box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  margin: 0;
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
}

.container { max-width: 760px; margin: 0; padding: 2.5rem 1.5rem; flex: 1; }
.container-wide { max-width: 960px; }

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  min-height: 100vh;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
/* The open project — one switcher for every page (nav.js). */
.sidebar-project { display: flex; flex-direction: column; gap: 0.35rem; margin: -0.75rem 0 1.25rem; }
.sidebar-project label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.sidebar-project select { width: 100%; min-width: 0; font-weight: 600; }
.sidebar-license option.is-greyed { color: var(--disabled-link); font-style: italic; }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
.sidebar-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
}
.sidebar-link:hover:not(.disabled) { background: var(--blueprint-dim); color: var(--blueprint); }
.sidebar-link.active { background: var(--blueprint); color: var(--on-accent); }
.sidebar-link.disabled { color: var(--disabled-link); cursor: not-allowed; }
/* "Admins" section (license admins, project admins) under the main links. */
.sidebar-section { display: flex; flex-direction: column; gap: 0.15rem; margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0 0.7rem 0.35rem;
}
.sidebar-sublink { padding-left: 1.3rem; }
/* My Connections, bottom left above who's signed in + Sign out. */
.sidebar-footer .sidebar-footer-link { align-self: stretch; margin-bottom: 0.35rem; }

@media (max-width: 720px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; min-height: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-section { flex-direction: row; flex-wrap: wrap; align-items: center; flex-basis: 100%; }
  .sidebar-section-label { padding-bottom: 0; }
  .sidebar-sublink { padding-left: 0.7rem; }
}

/* ── Header ─────────────────────────────────────────────────────── */
.app-header { margin-bottom: 2rem; }
.app-header-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.app-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.bridge-glyph {
  color: var(--blueprint);
  font-weight: 500;
  font-size: 1.1rem;
}
.app-sub { color: var(--muted); margin: 0; font-size: 0.95rem; }

/* ── Issues page: project picker + filters ──────────────────────── */
.project-picker-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
}
.filters-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 0.9rem 1.25rem;
  padding: 1rem 1.25rem;
}
.filters-header { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; margin-bottom: -0.3rem; }
/* Setup page's auto-sync filter grid is nested inside a .card already, so
   it skips .filters-card's own card-level padding to avoid double-indent. */
#auto-sync-filters-card { padding: 0; margin-bottom: 0.9rem; transition: opacity 0.15s ease; }
/* Greyed out and non-interactive until the toggle above it is on. */
#auto-sync-filters-card.filters-locked { opacity: 0.45; pointer-events: none; }

/* ── iOS-style oval toggle switch ────────────────────────────────── */
.ios-toggle { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; font-weight: 600; margin: 0.75rem 0; cursor: pointer; }
.ios-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.ios-toggle-track {
  position: relative;
  width: 2.6rem;
  height: 1.5rem;
  flex: none;
  background: var(--line);
  border-radius: 999px;
  transition: background 0.15s ease;
}
.ios-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.25rem;
  height: 1.25rem;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}
.ios-toggle input:checked + .ios-toggle-track { background: var(--success); }
.ios-toggle input:checked + .ios-toggle-track .ios-toggle-thumb { transform: translateX(1.1rem); }
.ios-toggle input:focus-visible + .ios-toggle-track { outline: 2px solid var(--blueprint); outline-offset: 2px; }
.filter-count { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.filter-group { display: flex; flex-direction: column; gap: 0.25rem; }
.filter-group label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ── Multi-select filter dropdown ────────────────────────────────── */
.ms { position: relative; }
.ms-toggle {
  width: 100%;
  text-align: left;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 500;
  font-size: 0.88rem;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-toggle::after { content: "\25BE"; font-size: 1rem; line-height: 1; color: var(--muted); flex: none; }
.ms-toggle:hover { background: var(--blueprint-dim); }
.ms-toggle.active { border-color: var(--blueprint); color: var(--blueprint); }
.ms-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  max-height: 240px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 14px var(--shadow);
  padding: 0.35rem;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.ms-panel.hidden { display: none; }
.ms-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  padding: 0.3rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.ms-option:hover { background: var(--blueprint-dim); }
.ms-option input { margin: 0; }
.ms-empty { font-size: 0.82rem; color: var(--muted); padding: 0.3rem 0.4rem; }

/* ── Board (two-column Revizto/ACC list) ────────────────────────── */
.board-card { padding: 1rem 1.25rem; }
.board-header, .board-row {
  display: grid;
  /* Revizto · connector · ACC · Linked date · actions (Unlink) */
  grid-template-columns: 1fr 32px 1fr 96px 90px;
  gap: 0.75rem;
  align-items: center;
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}
.board-header {
  font-family: var(--font-mono);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blueprint);
  font-weight: 600;
}
.board-row:last-child { border-bottom: none; }
.board-row.row-synced { background: var(--success-dim); border-radius: 6px; }
.board-row em { color: var(--muted); font-style: normal; font-family: var(--font-mono); font-size: 0.78rem; }
/* When the issue was first linked — its own sortable column. */
.board-row .linked-date { color: var(--muted); font-family: var(--font-mono); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.bridge-connector { color: var(--blueprint); font-family: var(--font-mono); text-align: center; }
.link-checkbox { font-size: 0.85rem; color: var(--muted); }
.board-select-all-bar { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--line); }
.select-all-group { display: flex; align-items: center; gap: 0.75rem; }
/* Search the list by Revizto # or title — on the right of the Select all bar. */
.issue-search { margin-left: auto; width: min(280px, 100%); min-width: 0; }
/* Column headers double as sort toggles — styled as the header text
   itself, not as a button, with an arrow showing the active sort. */
.sort-btn {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.sort-btn:hover { text-decoration: underline; }
.sort-btn:focus-visible { outline: 2px solid var(--blueprint); outline-offset: 2px; border-radius: 3px; }
.sort-arrow { font-size: 0.8em; min-width: 0.8em; }
.board-pager { display: flex; align-items: center; justify-content: center; gap: 0.9rem; padding: 0.8rem 0.4rem 0.2rem; }

/* ── Activity Log (audit trail) ────────────────────────────────── */
/* Eight columns don't fit the standard wide container, so this page gets
   its own wider one, and below that the table scrolls sideways inside its
   card (.log-table) rather than squeezing Detail down to nothing. */
/* min-width: 0 — as a flex child of body, the container otherwise refuses
   to shrink below the table's min-width and the whole page scrolls. */
.container-log { max-width: 1320px; min-width: 0; }
.log-table { overflow-x: auto; }
.log-header, .log-row {
  display: grid;
  grid-template-columns: 118px 96px 78px 60px 100px minmax(200px, 1fr) 132px 72px;
  min-width: 920px;
  gap: 0.6rem;
  align-items: start;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}
/* Grid items default to min-width: auto, which lets one long unbroken
   value (a URL, an email) push its column wider than the track. */
.log-header > span, .log-row > span { min-width: 0; overflow-wrap: anywhere; }
.log-header > span { overflow-wrap: normal; white-space: nowrap; }
.log-row .badge { white-space: nowrap; overflow-wrap: normal; }
.log-header {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blueprint);
  font-weight: 600;
}
.log-row:last-child { border-bottom: none; }
.log-row.log-row-error { background: var(--danger-dim); border-radius: 6px; }
.log-row .log-timestamp { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.log-row .log-field-change { word-break: break-word; }
.log-row .log-old { color: var(--muted); text-decoration: line-through; }
.log-row .log-new { color: var(--blueprint); font-weight: 600; }
.log-empty { padding: 1.5rem 0.4rem; color: var(--muted); text-align: center; }
.log-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1.25rem; }
.log-filters .filter-group label { margin: 0; }
.log-filter-actions { display: flex; gap: 0.6rem; }
#log-date-hint { flex-basis: 100%; margin: 0; }
#log-date-hint:empty { display: none; }
#board-actions { margin-top: 0.9rem; display: flex; align-items: center; gap: 0.75rem; }

/* ── Cards / steps ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  position: relative;
}
.step-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blueprint);
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.card h2 { font-size: 1.05rem; font-weight: 600; margin: 0 0 0.9rem; }
/* !important is deliberate: .hidden is a utility meant to unconditionally
   win regardless of what else is combined with it — without it, an
   equal-specificity class declared later in this file (e.g. .badge's own
   `display: flex`) wins by source order instead, so `class="badge hidden"`
   silently stayed visible. Confirmed by real testing on the Team page's
   header role badge. */
.hidden { display: none !important; }

/* ── Form elements ──────────────────────────────────────────────── */
input, select, textarea {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus, button:focus, a:focus {
  outline: 2px solid var(--blueprint);
  outline-offset: 1px;
}
input[type="text"], input[type="email"], select { min-width: 220px; }
.field-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* ── Chip-list email input (Team page "Add someone") ──────────────
   Paste a whole list — from a spreadsheet, Word doc, email "To:" field,
   however it's separated — and each parsed address becomes its own
   removable chip, so it's unambiguous exactly who's queued to be added
   before clicking Add. */
.chipbox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 320px;
  flex: 1 1 320px;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.chipbox:focus-within { outline: 2px solid var(--blueprint); outline-offset: 1px; }
.chip-list { display: contents; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--blueprint-dim);
  color: var(--blueprint);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.2rem 0.3rem 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.1rem 0.3rem;
  border-radius: 50%;
}
.chip-remove:hover { background: var(--hover-wash); }
.chipbox-input {
  flex: 1 1 160px;
  min-width: 160px;
  border: none;
  outline: none;
  padding: 0.25rem 0.2rem;
  background: transparent;
  font-size: 0.9rem;
}
.chipbox-input:focus { outline: none; }

button, .btn {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: var(--blueprint);
  color: var(--on-accent);
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--blueprint-hover); }
.btn.secondary { background: var(--surface); color: var(--blueprint); border: 1px solid var(--blueprint); }
.btn.secondary:hover { background: var(--blueprint-dim); }
.btn:disabled, .btn:disabled:hover { background: var(--disabled-bg); color: var(--disabled-fg); cursor: not-allowed; }

/* ── Status badges ──────────────────────────────────────────────── */
.badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-neutral { background: var(--badge-neutral-bg); color: var(--muted); }
.badge-success { background: var(--success-dim); color: var(--success); }
.badge-success::before { animation: pulse 2s ease-in-out infinite; }
.badge-warning { background: var(--warning-dim); color: var(--warning); }
.badge-danger { background: var(--danger-dim); color: var(--danger); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.whoami { margin-top: 0.75rem; font-size: 0.85rem; color: var(--muted); }
.result-text { margin-top: 0.5rem; font-size: 0.85rem; }

/* ── Connections ────────────────────────────────────────────────── */
.conn-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.conn-row:last-child { border-bottom: none; }
.conn-label { font-weight: 600; min-width: 140px; font-size: 0.9rem; }

.subpanel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.9rem;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.88rem;
}
.subpanel p { margin: 0.3rem 0; }

/* ── Projects & forms ───────────────────────────────────────────── */
.project-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.project-row strong { font-size: 0.95rem; }
.project-row span { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }

form { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.75rem; }
form label { font-size: 0.82rem; font-weight: 600; color: var(--muted); margin-top: 0.3rem; }
details summary { cursor: pointer; font-weight: 600; color: var(--blueprint); margin-top: 0.5rem; }

/* ── License/project pairing (two-column Revizto/ACC layout) ──────── */
.pairing-column-headers {
  display: grid;
  grid-template-columns: 1fr 28px 1fr;
  gap: 1rem;
  font-weight: 700;
  font-size: 1.05rem;
  padding-bottom: 0.5rem;
}
.pairing-row {
  display: grid;
  grid-template-columns: 1fr 28px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.pairing-row:last-child { border-bottom: none; }
.pairing-row-name { font-weight: 600; font-size: 0.92rem; }
.pairing-row-editing select { width: 100%; }
.pairing-extra-fields { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.4rem 0 0.6rem; font-size: 0.85rem; }
.pairing-extra-fields select { max-width: 320px; }
.pairing-actions { display: flex; align-items: center; gap: 0.6rem; padding-bottom: 0.6rem; }
.pairing-missing-id { padding-bottom: 0.6rem; }

/* Connection status dot — grey/still when not connected, a pulsing green
   ring when it is. Respects the site-wide prefers-reduced-motion rule
   near the top of this file, which already zeroes animation-duration. */
.pairing-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--line);
  justify-self: center;
}
.pairing-dot.connected {
  background: var(--success);
  animation: pairing-pulse 1.8s infinite;
}
@keyframes pairing-pulse {
  0% { box-shadow: 0 0 0 0 var(--success-glow); }
  70% { box-shadow: 0 0 0 7px var(--success-glow-0); }
  100% { box-shadow: 0 0 0 0 var(--success-glow-0); }
}
/* The sidebar's role badge: its dot shows the connection (nav.js) —
   pulsing green = Revizto and ACC connected, gray = one isn't, yellow =
   no internet. */
.status-badge::before { width: 7px; height: 7px; }
.status-badge[data-status="connected"]::before { background: var(--success); animation: pairing-pulse 1.8s infinite; }
.status-badge[data-status="disconnected"]::before { background: var(--status-off); }
.status-badge[data-status="offline"]::before { background: var(--status-offline); box-shadow: 0 0 0 1px var(--shadow); }

.hint { color: var(--muted); font-size: 0.78rem; }

/* ── Issue selection panel ──────────────────────────────────────── */
.issues-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem;
  margin: 0.35rem 0 0.9rem;
}
.issue-row {
  display: block;
  font-size: 0.88rem;
  padding: 0.3rem 0;
}
.issue-row strong { color: var(--success); font-weight: 600; }
.sync-result { margin-top: 0.5rem; font-size: 0.85rem; }

/* ── Linked issues — the "bridge" view ──────────────────────────── */
.linked-panel {
  background: var(--surface);
  border: 1px solid var(--blueprint-dim);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 0.35rem 0 0.9rem;
}
.linked-header, .linked-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}
.linked-header {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blueprint);
  font-weight: 600;
}
.linked-row:last-child { border-bottom: none; }
.linked-row .bridge-connector {
  color: var(--blueprint);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-align: center;
}
.linked-row em { color: var(--muted); font-style: normal; font-family: var(--font-mono); font-size: 0.78rem; }

.webhook-result { font-size: 0.8rem; color: var(--muted); }

/* ── Team page ──────────────────────────────────────────────────── */
.team-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.team-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--line);
}
.team-table td { padding: 0.6rem 0.4rem; border-bottom: 1px solid var(--line); }
/* flex-direction: row explicitly overrides the generic `form { flex-direction:
   column }` rule below (element selector, still wins on any property this
   class doesn't set) — without it the chip box inherited a vertical main
   axis, turning its flex-basis into a HEIGHT instead of a width. */
.invite-form { display: flex; flex-direction: row; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.25rem; }
.invite-form label { display: flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; color: var(--muted); font-weight: 500; }

.invite-link-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.invite-link-row:last-child { border-bottom: none; }
.invite-link-url {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  overflow-wrap: anywhere;
  flex: 1 1 auto;
}

/* ── Field mapping ──────────────────────────────────────────────── */
.mapping-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}
.mapping-row .subtype-select,
.mapping-row .revizto-status-select { flex: 1; min-width: 220px; }
#mapping-panels h3 { font-size: 0.92rem; margin: 1.25rem 0 0.4rem; }

/* Unmapped status/issue-type row — flags a status or stamp with no
   configured ACC mapping without requiring the admin to notice it's
   simply missing from the list (it still syncs via the safeguard default
   either way — ACC "Open" for status, the project's default subtype for
   issue type). Shared between the status and type mapping selects. */
.mapping-select-unmapped {
  border: 1px solid var(--danger);
  background: var(--danger-dim);
  color: var(--danger);
}

/* Auto-mapped status rows ("To do"/"Completed" category) — same layout
   as .mapping-row, greyed out to signal "already handled, no action
   needed" without looking like a broken/empty editable row. */
.status-auto-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--muted);
  opacity: 0.7;
}

/* One group per custom Revizto workflow currently in use — separates the
   status mapping rows so a same-named status in two different workflows
   is visibly (and independently) configured, instead of one flat list.
   Generous top margin (rather than just a border) is what actually reads
   as "separate section" next to a busy list of rows above it. */
.workflow-group { margin-top: 2rem; }
.workflow-group-header {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--blueprint);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.4rem;
}

/* Status mapping rows as three aligned columns (Revizto status | ACC
   status | Revizto Status secondary field) rather than a loosely-flexed
   line. Scoped to #status-map-rows only: .mapping-row is shared with the
   type mapping section below, which keeps its own flex layout. */
#status-map-rows .mapping-row,
#status-map-rows .status-auto-row,
#status-map-rows .status-map-column-headers {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(220px, 340px) minmax(220px, 340px);
  align-items: center;
  gap: 2rem;
}
#status-map-rows .status-select,
#status-map-rows .acc-custom-status-select { width: 100%; }

/* Standard-workflow rows have no secondary column (canonical statuses
   aren't ambiguous) — the auto-mapped badge spans both remaining columns
   instead of leaving the third one blank. */
.status-auto-badge { grid-column: 2 / span 2; justify-self: start; }

/* Secondary "Revizto Status" select when that ACC field doesn't exist
   yet — visibly inert rather than looking like an ignored red-flagged
   field. */
.acc-custom-status-select:disabled { opacity: 0.5; cursor: not-allowed; }

/* "Revizto Status" / "ACC Primary Status" / "ACC Secondary Status" column
   titles, once at the top of the whole list — same grid as every row
   below so they sit directly over their column. */
.status-map-column-headers {
  font-weight: 700;
  font-size: 1.1rem;
  padding-bottom: 0.5rem;
}

/* ── Setup page: shared project context bar ─────────────────────── */
.setup-context-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  margin-bottom: 1.25rem;
}
.setup-context-bar label { font-weight: 600; font-size: 0.9rem; }

/* ── Setup page: accordion (one module open at a time) ──────────── */
.accordion-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 0.9rem;
  overflow: hidden;
}
.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border: none;
  padding: 1.1rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.accordion-header:hover { background: var(--paper); }
.accordion-step {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 1.6rem;
  height: 1.6rem;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.accordion-item.open .accordion-step { color: var(--on-accent); background: var(--blueprint); border-color: var(--blueprint); }
.accordion-item.open .accordion-header { color: var(--blueprint); border-bottom: 1px solid var(--line); }
.accordion-caret { margin-left: auto; color: var(--muted); font-size: 1rem; line-height: 1; transition: transform 0.15s ease; }
.accordion-item.open .accordion-caret { transform: rotate(180deg); color: var(--blueprint); }
.accordion-panel { padding: 1.25rem; }
.accordion-item:not(.open) .accordion-panel { display: none; }
.accordion-panel h3:first-child { margin-top: 0; }

/* ── Setup page: sub-accordion (Field mapping's own tiers) ──────── */
.subaccordion-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 0.6rem;
  overflow: hidden;
}
.subaccordion-item:last-child { margin-bottom: 0; }
.subaccordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--paper);
  border: none;
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.subaccordion-header:hover { background: var(--blueprint-dim); }
.subaccordion-item.open .subaccordion-header { color: var(--blueprint); border-bottom: 1px solid var(--line); }
.subaccordion-panel { padding: 1rem; }
.subaccordion-item:not(.open) .subaccordion-panel { display: none; }
.warning-icon { font-size: 0.9rem; }

/* ── Setup page: top-of-page warning banner ─────────────────────── */
.setup-top-warning {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  background: var(--warning-dim);
  color: var(--warning);
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  padding: 0.9rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.setup-top-warning:hover { background: var(--warning-dim); filter: brightness(0.97); }

/* ── Setup page: mapping warnings ───────────────────────────────── */
.dashboard-warning {
  background: var(--warning-dim);
  color: var(--warning);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin-top: 0.4rem;
  font-size: 0.85rem;
}

/* ── Issues page: compact stat strip next to project picker ───────── */
.stat-strip { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-left: auto; }
.stat-pill {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  color: var(--muted);
}
.stat-pill span:first-child { font-weight: 600; color: var(--blueprint); margin-right: 0.3rem; }
.stat-pill-error-active { background: var(--danger-dim); border-color: var(--danger); color: var(--danger); }
.stat-pill-error-active span:first-child { color: var(--danger); }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
  body { padding: 1.25rem 0.9rem; }
  .card { padding: 1.1rem; }
  .conn-label { min-width: 100%; }
  .linked-header, .linked-row { grid-template-columns: 1fr; gap: 0.25rem; }
  .linked-row .bridge-connector { display: none; }
}

/* ── Dashboards ──────────────────────────────────────────────────── */
.dash-presets { display: flex; gap: 0.3rem; }
/* .dash-view-btn: the per-chart Total / By person toggle — same look as
   the range presets, its own class so the preset handler skips it. */
.dash-preset, .dash-view-btn {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.dash-preset:hover, .dash-view-btn:hover { background: var(--blueprint-dim); color: var(--blueprint); }
.dash-preset.active, .dash-view-btn.active { background: var(--blueprint); border-color: var(--blueprint); color: var(--on-accent); }
.dash-chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.dash-view-btn { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
#dash-date-hint { flex-basis: 100%; margin: 0; }
#dash-date-hint:empty { display: none; }
/* Refetch keeps the frame: previous render stays, dimmed, until new data lands. */
#dash-body { transition: opacity 0.15s ease; }
#dash-body.dash-loading { opacity: 0.5; }
.dash-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; margin-bottom: 1rem; }
.dash-tile { margin: 0; padding: 1rem 1.1rem; }
.dash-tile-label { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.dash-tile-value { font-size: 1.9rem; font-weight: 600; line-height: 1.2; margin-top: 0.2rem; }
.dash-tile-sub { font-size: 0.78rem; color: var(--muted); }
.dash-chart-card { padding: 1.1rem 1.25rem; }
.dash-chart-title { font-size: 1.05rem; margin: 0; }
.dash-chart-sub { color: var(--muted); font-size: 0.85rem; margin: 0.15rem 0 0.6rem; }
.dash-chart { width: 100%; }
.dash-chart svg { display: block; overflow: visible; }
.dash-axis { font-family: var(--font-mono); font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.dash-end-label { font-size: 12px; font-weight: 600; fill: var(--ink); }
.dash-empty { font-size: 13px; fill: var(--muted); }
.dash-bar { cursor: default; }
.dash-bar:hover, .dash-bar:focus { opacity: 0.8; outline: none; }
.dash-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; font-size: 0.85rem; color: var(--ink); margin-bottom: 0.4rem; }
.dash-legend-total { font-weight: 600; margin-left: 0.1rem; font-variant-numeric: tabular-nums; }
.dash-legend-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.dash-legend-swatch { width: 10px; height: 10px; border-radius: 2px; }
.dash-table { margin-top: 0.5rem; font-size: 0.85rem; }
.dash-table summary { cursor: pointer; color: var(--blueprint); font-weight: 600; }
.dash-table table { border-collapse: collapse; margin-top: 0.5rem; font-variant-numeric: tabular-nums; }
.dash-table th, .dash-table td { text-align: right; padding: 0.25rem 0.9rem 0.25rem 0; border-bottom: 1px solid var(--line); }
.dash-table th:first-child, .dash-table td:first-child { text-align: left; }
.dash-tooltip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 14px var(--shadow);
  padding: 0.45rem 0.6rem;
  font-size: 0.8rem;
  color: var(--ink);
  min-width: 140px;
}
.dash-tooltip-title { color: var(--muted); margin-bottom: 0.2rem; }
.dash-tooltip-row { display: flex; align-items: center; gap: 0.35rem; }
/* Line keys, not boxes — a short stroke of the series color. */
.dash-tooltip-key { width: 12px; height: 2px; border-radius: 1px; flex: none; }
.dash-tooltip-row span:last-child { color: var(--muted); }
@media (max-width: 900px) {
  .dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Sign-in / set-password forms ─────────────────────────────────── */
.signin-form { display: flex; flex-direction: column; gap: 0.35rem; max-width: 360px; }
.signin-form label { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-top: 0.35rem; }
.signin-form input { width: 100%; }
.signin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin-top: 0.6rem; }
.signin-actions > * { white-space: nowrap; }
.signin-form .hint { margin: 0.5rem 0 0; }
.link-btn { background: none; border: none; padding: 0; font: inherit; font-size: 0.85rem; color: var(--blueprint); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
/* Signed-in user + Sign out, bottom left of the sidebar (nav.js). */
.sidebar-footer { border-top: 1px solid var(--line); padding-top: 0.9rem; margin-top: 0.9rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; font-size: 0.75rem; color: var(--muted); }
.sidebar-user-email { overflow-wrap: anywhere; }
.sidebar-signout { padding: 0.3rem 0.75rem; font-size: 0.78rem; }

/* ── License Administration / Team tables ─────────────────────────── */
.card-header-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.card-header-row h2 { margin: 0; }
.new-project-form { margin: 0.9rem 0 0.4rem; display: flex; flex-direction: column; gap: 0.35rem; }
.new-project-form label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.license-table-wrap { overflow-x: auto; margin-top: 0.8rem; }
.license-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.license-table th { text-align: left; font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; padding: 0.5rem 1.25rem 0.5rem 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.license-table td { padding: 0.7rem 1.25rem 0.7rem 0; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: break-word; }
/* Column sizing: names never break mid-word or wrap; the table scrolls
   sideways (.license-table-wrap) on narrow screens instead. */
.container-roomy { max-width: 1120px; } /* License Administration, Team */
.license-table .col-name { min-width: 13rem; }
.license-table .col-person, .license-table td.person-cell { min-width: 11rem; white-space: nowrap; }
.license-table .col-num { width: 1%; }
.license-table .badge { white-space: nowrap; }

/* ── Team: members table, Edit users panel ─────────────────────────── */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.members-toolbar { display: flex; align-items: center; gap: 1rem; }
.select-all-label { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.88rem; cursor: pointer; }
.members-toolbar input[type="checkbox"], .team-table input[type="checkbox"] { width: 1rem; height: 1rem; margin: 0; padding: 0; cursor: pointer; }
.team-table input[type="checkbox"]:disabled { cursor: not-allowed; opacity: 0.4; }
.license-table .col-check, .license-table td.check-cell { width: 1.5rem; padding-right: 0.75rem; }
.team-table tr.selected td { background: var(--blueprint-dim); }
/* Its last column is a date, not buttons — left-aligned under its header. */
.license-table.team-table td:last-child { text-align: left; white-space: normal; }
tr.pending-row td:not(:last-child) { opacity: 0.55; }
.pending-note { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }
.owner-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; padding: 0.8rem 0; margin-top: 0.4rem; border-bottom: 1px solid var(--line); }
.owner-label { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.owner-change { display: inline-flex; align-items: center; gap: 0.5rem; }
.owner-change select { min-width: 12rem; }
.owner-row .owner-hint { flex-basis: 100%; margin: 0; }
.owner-row .result-text { flex-basis: 100%; margin: 0; }
.owner-row .result-text:empty { display: none; }
.owner-tag { margin-left: 0.5rem; vertical-align: middle; }

.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  width: 360px;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-y: auto;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 32px var(--shadow);
  padding: 1.5rem;
}
.side-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.side-panel-header h2 { margin: 0; }
.side-panel-close { background: none; border: none; font-size: 1.5rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 0.2rem 0.4rem; }
.side-panel-close:hover { color: var(--ink); }
.side-panel-section { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.side-panel-section h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.side-panel-section .hint { margin: 0 0 0.6rem; }
.side-panel .field-row select { min-width: 0; flex: 1; }
.edit-users-list { list-style: none; margin: 0; padding: 0; max-height: 11rem; overflow-y: auto; font-size: 0.88rem; }
.edit-users-list li { padding: 0.3rem 0; border-bottom: 1px solid var(--line); }
.edit-users-list li:last-child { border-bottom: none; }
.side-panel .result-text div { margin-top: 0.25rem; }
.license-table td.person-cell[title] { cursor: help; }
.license-table tr:last-child td { border-bottom: none; }
.license-table td:last-child { text-align: right; white-space: nowrap; }
.inline-check { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); }
.pairing-edit-name { font-size: 0.85rem; color: var(--muted); margin: 0.6rem 0 0.2rem; }

/* ── Blocking pop-up (e.g. "Access denied") ───────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px var(--shadow);
  padding: 1.4rem 1.5rem 1.2rem;
  max-width: 420px;
  width: 100%;
}
.modal h2 { margin: 0 0 0.5rem; font-size: 1.1rem; color: var(--danger); }
.modal p { margin: 0 0 1.1rem; line-height: 1.5; }
.modal-neutral h2 { color: var(--ink); }
.modal label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 0.35rem; }
.modal input[type="text"] { width: 100%; box-sizing: border-box; }
.modal .result-text { margin: 0.4rem 0 0.8rem; min-height: 1.2em; color: var(--danger); }
.modal-actions { display: flex; gap: 0.5rem; }
.btn.btn-danger { background: var(--danger); }
.btn.btn-danger:hover { background: var(--danger-hover); }

/* ── Row "⋯" menu (License Administration project actions) ────────── */
.license-table.projects-table td:last-child { white-space: normal; }
.row-menu { position: relative; display: inline-block; margin-left: 0.4rem; vertical-align: middle; }
button.row-menu-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 0.2rem 0.45rem;
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: 0.05em;
}
button.row-menu-btn:hover,
button.row-menu-btn[aria-expanded="true"] { background: var(--paper); border-color: var(--line); color: var(--ink); }
.row-menu-list {
  position: fixed; /* top/right set from the button (license.js) */
  z-index: 50;
  min-width: 150px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px var(--shadow);
  padding: 0.3rem 0;
  text-align: left;
}
button.row-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--ink);
  font-weight: 500;
  border-radius: 0;
  padding: 0.45rem 0.9rem;
}
button.row-menu-item:hover { background: var(--paper); }
button.row-menu-item.danger { color: var(--danger); }
.license-table tr.archived td { color: var(--muted); }
/* License admins: the "add" row at the bottom of the table — bubble box
   starting under the Email column, button underneath. */
.license-table tfoot td,
.license-table tfoot td:last-child { border-bottom: none; padding-top: 0.8rem; text-align: left; white-space: normal; }
.add-admin-chipbox { max-width: 440px; min-width: 0; }
.add-admin-btn { display: block; margin-top: 0.6rem; }

/* ── Loading spinner (Project Setup pickers waiting on Revizto/ACC) ── */
.spinner {
  display: inline-block;
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--blueprint);
  border-radius: 50%;
  animation: spinner-turn 0.8s linear infinite;
  vertical-align: -2px;
}
@keyframes spinner-turn { to { transform: rotate(360deg); } }
.select-wrap { position: relative; display: block; min-width: 0; }
.select-wrap .spinner { position: absolute; right: 30px; top: 50%; margin-top: -7px; pointer-events: none; }
.select-wrap select:disabled { background: var(--paper); color: var(--muted); cursor: progress; }
.pairing-loading { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--muted); margin: 0.4rem 0 0; }

/* ── Theme switch (js/theme.js): sun / half circle / moon, top-right ── */
body { position: relative; }
.theme-switch {
  position: absolute;
  top: 0.6rem;
  right: 1rem;
  z-index: 30;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.theme-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 1.9rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.theme-switch button + button { border-left: 1px solid var(--line); }
.theme-switch button:hover { background: var(--blueprint-dim); color: var(--blueprint); }
.theme-switch button[aria-pressed="true"] { background: var(--blueprint); color: var(--on-accent); }
.theme-switch button:focus-visible { outline: 2px solid var(--blueprint); outline-offset: -2px; }

/* A license that isn't active (License Administration banner). */
.license-banner { background: var(--danger-dim); color: var(--danger); border: 1px solid var(--danger); border-radius: 8px; padding: 0.7rem 0.9rem; font-weight: 600; margin: 0 0 1rem; }

/* Operator console */
.operator-license { border-top: 1px solid var(--line); padding-top: 0.9rem; margin-top: 0.9rem; }
.operator-license h3 { font-size: 0.98rem; margin: 0; }
.operator-license h4 { font-size: 0.8rem; margin: 1rem 0 0.3rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.operator-terms { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.6rem 1rem; align-items: end; margin: 0.6rem 0; }
.operator-field { display: flex; flex-direction: column; gap: 0.25rem; }
.operator-field label { font-size: 0.78rem; color: var(--muted); }

/* Operator console: finding things */
.operator-filters { display: flex; flex-direction: column; gap: 0.7rem; }
.operator-filters input[type="search"] { width: 100%; }
.op-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.op-chip { font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; padding: 0.3rem 0.75rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); }
.op-chip:hover { border-color: var(--blueprint); color: var(--blueprint); }
.op-chip[aria-pressed="true"] { background: var(--blueprint); border-color: var(--blueprint); color: var(--on-accent); }
.op-chip .op-count { opacity: 0.75; font-weight: 500; margin-left: 0.25rem; }
.op-date-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.op-inline-label { font-size: 0.8rem; color: var(--muted); }
.op-top-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; }
.op-top-row input[type="search"] { flex: 1 1 280px; width: auto; }
.op-company { flex: 0 1 260px; min-width: 200px; }
.op-company .ms-option { font-family: inherit; font-size: 0.85rem; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 0; }
.mfa-codes { font-family: var(--font-mono, monospace); font-size: 1rem; line-height: 1.7; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 0.6rem 0.9rem; white-space: pre; user-select: all; }
#mfa-qr { background: #fff; padding: 8px; border-radius: 6px; display: block; margin: 0.4rem 0; }
#mfa-setup code { user-select: all; letter-spacing: 0.05em; }
.op-person { border-top: 1px solid var(--line); padding: 0.6rem 0; }
.op-person p { margin: 0.15rem 0; }
.op-lookup-btn { margin-top: 0.5rem; }
/* The Team page's bubble box sizes itself for a row; inside the Disable user panel it is a plain full-width box. */
#offboard-chipbox { flex: 0 0 auto; width: 100%; min-width: 0; box-sizing: border-box; }
#offboard-chipbox .chipbox-input { min-width: 120px; }
.op-admin-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.25rem 0; }
.op-admin-email { font-size: 0.88rem; margin-right: 0.25rem; }
.btn.op-small { padding: 0.2rem 0.55rem; font-size: 0.78rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.op-activity-row { display: grid; grid-template-columns: 11rem 12rem 1fr; gap: 0.75rem; font-size: 0.82rem; padding: 0.3rem 0; border-top: 1px solid var(--line); }
.op-activity-when { color: var(--muted); font-family: var(--font-mono); font-size: 0.75rem; }
.op-activity-who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) { .op-activity-row { grid-template-columns: 1fr; gap: 0.1rem; } }
/* Operator console: gear menu and pop-up panels */
.op-gear { position: absolute; z-index: 30; display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; min-height: 1.9rem; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); cursor: pointer; }
.op-gear:hover { background: var(--blueprint-dim); color: var(--blueprint); }
.op-gear:focus-visible { outline: 2px solid var(--blueprint); outline-offset: 2px; }
.op-gear[aria-expanded="true"] { background: var(--blueprint); color: var(--on-accent); }
.op-menu { position: absolute; z-index: 40; min-width: 12rem; display: flex; flex-direction: column; gap: 0.1rem; padding: 0.3rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 14px var(--shadow); }
.op-menu.hidden { display: none; }
.op-menu button { text-align: left; font: inherit; font-size: 0.88rem; font-weight: 500; color: var(--ink); background: transparent; border: 0; border-radius: 6px; padding: 0.5rem 0.65rem; cursor: pointer; }
.op-menu button:hover, .op-menu button:focus-visible { background: var(--blueprint-dim); outline: none; }
dialog.op-dialog { width: min(680px, calc(100vw - 2rem)); max-height: 80vh; overflow-y: auto; padding: 1.1rem 1.35rem 1.2rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px var(--shadow); }
dialog.op-dialog::backdrop { background: var(--overlay); }
.op-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.op-dialog-head h2 { margin: 0; font-size: 1.1rem; }
.op-dialog-close { font: inherit; font-size: 1rem; line-height: 1; color: var(--muted); background: transparent; border: 0; border-radius: 6px; padding: 0.3rem 0.5rem; cursor: pointer; }
.op-dialog-close:hover { background: var(--blueprint-dim); color: var(--blueprint); }

/* A small "i" that explains a setting on hover, keyboard focus or tap (data-tip), instead of a paragraph of hint text. */
.info-tip {
  position: relative; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  width: 1.15rem; height: 1.15rem; margin-left: 0.35rem; padding: 0; border: 1px solid var(--muted); border-radius: 50%;
  background: transparent; color: var(--muted); font: italic 700 0.7rem/1 Georgia, serif; cursor: help;
}
.info-tip:hover, .info-tip:focus-visible { color: var(--blueprint); border-color: var(--blueprint); outline: none; }
.info-tip::after {
  content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-30%); z-index: 20;
  width: max-content; max-width: min(300px, 70vw); padding: 0.45rem 0.6rem; border-radius: 6px; background: var(--ink, #1a2230); color: var(--paper, #fff);
  font-family: inherit; font-style: normal; font-weight: 400; font-size: 0.78rem; line-height: 1.35; text-align: left; white-space: normal; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.12s;
}
.info-tip:hover::after, .info-tip:focus::after { opacity: 1; visibility: visible; }
