    :root {
      --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f0f2f5; --text: #1c2126;
      --muted: #626b76; --edge: #dfe3e8; --accent: #2f6bff; --accent-ink: #ffffff;
      --ok: #1f9d4d; --ok-bg: #1f9d4d14; --err: #d64550; --err-bg: #d6455014;
      --warn: #b8730b; --warn-bg: #b8730b14; --radius: 10px; --shadow: 0 1px 3px #0000000f, 0 4px 16px #0000000a;
      --sp: 16px;
    }
    /* Dark palette applies when the OS prefers dark AND the user hasn't forced
       light, OR when the user explicitly picks dark. Light is the bare :root. */
    @media (prefers-color-scheme: dark) {
      :root:not([data-theme="light"]) {
        --bg: #0f1216; --surface: #171b21; --surface-2: #1f242c; --text: #e7ebf0;
        --muted: #97a0ab; --edge: #2a313a; --accent: #5b8bff; --accent-ink: #0b0e12;
        --ok: #4cc677; --ok-bg: #4cc67722; --err: #ff6b74; --err-bg: #ff6b7422;
        --warn: #e0a341; --warn-bg: #e0a34122; --shadow: 0 1px 3px #0000006b, 0 6px 24px #00000040;
      }
    }
    :root[data-theme="dark"] {
      --bg: #0f1216; --surface: #171b21; --surface-2: #1f242c; --text: #e7ebf0;
      --muted: #97a0ab; --edge: #2a313a; --accent: #5b8bff; --accent-ink: #0b0e12;
      --ok: #4cc677; --ok-bg: #4cc67722; --err: #ff6b74; --err-bg: #ff6b7422;
      --warn: #e0a341; --warn-bg: #e0a34122; --shadow: 0 1px 3px #0000006b, 0 6px 24px #00000040;
    }
    * { box-sizing: border-box; }
    body { margin: 0; background: var(--bg); color: var(--text);
      font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; }
    a { color: var(--accent); text-decoration: none; }
    a:hover { text-decoration: underline; }
    code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .86em;
      background: var(--surface-2); padding: .05em .35em; border-radius: 4px; }

    /* app bar */
    /* App bar is always the Tanium brand navy (#101842) — same in light and dark
       theme (matches www.tanium.com). Its contents are styled to read on navy
       regardless of the page theme. */
    .appbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center;
      gap: 12px; padding: 12px 20px; background: #101842; border-bottom: 1px solid #0a0f2b; }
    .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; }
    .brand .logo { height: 26px; width: auto; display: block; }
    .appbar .brand span { color: #ffffff; }
    .env-tag { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
      padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.12); color: #e7ebf0; border: 1px solid rgba(255,255,255,.22); }
    .appbar .spacer { flex: 1; }
    .appbar .user { color: rgba(255,255,255,.66); font-size: .85rem; }
    /* compact icon button for the app bar (theme, help) — styled for the navy bar */
    .icon-btn { font: inherit; font-size: 1rem; line-height: 1; padding: 6px 9px; border-radius: 8px;
      border: 1px solid rgba(255,255,255,.24); background: rgba(255,255,255,.10); color: #ffffff; cursor: pointer; }
    .icon-btn:hover { background: rgba(255,255,255,.18); }
    .appbar .btn.ghost { color: #ffffff; border-color: rgba(255,255,255,.28); }
    .appbar .btn.ghost:hover { background: rgba(255,255,255,.12); }
    .modal h4 { margin: 16px 0 4px; font-size: .95rem; }
    .modal .help-body { max-height: 60vh; overflow: auto; }
    .modal .help-body p, .modal .help-body ul { margin: 4px 0 10px; color: var(--text); }
    .modal .help-body ul { padding-left: 18px; }
    .modal.wide { max-width: 560px; }

    main { max-width: 860px; margin: 0 auto; padding: 24px 20px 64px; }

    .card { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius);
      box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
    .card h2 { font-size: 1.02rem; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
    .step-n { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
      border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: .78rem; font-weight: 700; }

    label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .9rem; }
    .hint { color: var(--muted); font-size: .82rem; margin: 4px 0 0; }
    input[type=text], select { width: 100%; padding: 10px 12px; font: inherit; color: var(--text);
      background: var(--surface); border: 1px solid var(--edge); border-radius: 8px; }
    input[type=text]:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
    select { max-width: 320px; }

    .dropzone { margin-top: 16px; border: 1.5px dashed var(--edge); border-radius: 10px; padding: 22px;
      text-align: center; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
    .dropzone:hover, .dropzone.hot { border-color: var(--accent); background: var(--accent)08; }
    .dropzone input { display: none; }
    .dropzone .big { font-weight: 600; }
    .dropzone .sel { margin-top: 6px; color: var(--muted); font-size: .85rem; }

    .btn { font: inherit; font-weight: 600; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--edge);
      background: var(--surface); color: var(--text); cursor: pointer; transition: filter .12s, opacity .12s; }
    .btn:hover:not(:disabled) { filter: brightness(.97); }
    .btn:disabled { opacity: .45; cursor: default; }
    .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
    .btn.danger { background: var(--err); color: #fff; border-color: transparent; }
    .btn.ghost { background: transparent; }
    .btn.sm { padding: 6px 12px; font-size: .85rem; }
    .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }

    .seg { display: inline-flex; border: 1px solid var(--edge); border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
    .seg-btn { font: inherit; font-weight: 600; padding: 8px 15px; border: none; background: var(--surface); color: var(--muted); cursor: pointer; }
    .seg-btn.active { background: var(--accent); color: var(--accent-ink); }
    .seg-btn + .seg-btn { border-left: 1px solid var(--edge); }

    table { border-collapse: collapse; width: 100%; font-size: .86rem; margin-top: 12px; }
    th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--edge); vertical-align: top; }
    th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
    .tbl-wrap { max-height: 320px; overflow: auto; border: 1px solid var(--edge); border-radius: 8px; margin-top: 12px; }
    .tbl-wrap table { margin: 0; }

    .badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
    .badge.up { background: var(--accent)1a; color: var(--accent); }
    .badge.del { background: var(--err-bg); color: var(--err); }
    .badge.keep { background: var(--surface-2); color: var(--muted); }

    .summary { display: flex; gap: 20px; flex-wrap: wrap; margin: 4px 0 2px; }
    .summary .stat { display: flex; align-items: baseline; gap: 6px; }
    .summary .num { font-size: 1.5rem; font-weight: 700; line-height: 1; }
    .summary .num.del { color: var(--err); } .summary .num.up { color: var(--accent); }
    .summary .lbl { color: var(--muted); font-size: .85rem; }

    .banner { border-radius: 8px; padding: 12px 14px; margin-top: 14px; font-size: .9rem; border: 1px solid; }
    .banner.ok { background: var(--ok-bg); border-color: var(--ok); }
    .banner.err { background: var(--err-bg); border-color: var(--err); }
    .banner.warn { background: var(--warn-bg); border-color: var(--warn); }

    .progress { margin-top: 14px; }
    .progress .bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
    .progress .fill { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
    .progress .txt { color: var(--muted); font-size: .82rem; margin-top: 6px; }

    .empty { color: var(--muted); text-align: center; padding: 18px; font-size: .9rem; }

    /* modal */
    .overlay { position: fixed; inset: 0; background: #0008; display: none; align-items: center;
      justify-content: center; padding: 20px; z-index: 20; }
    .overlay.open { display: flex; }
    .modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); max-width: 460px;
      width: 100%; padding: 22px; border: 1px solid var(--edge); }
    .modal h3 { margin: 0 0 6px; font-size: 1.1rem; }
    .modal p { color: var(--muted); margin: 0 0 16px; }
    .modal .actions { justify-content: flex-end; margin-top: 20px; }

    details.activity { margin-top: 8px; }
    details.activity summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
    #log { white-space: pre-wrap; font-family: ui-monospace, monospace; font-size: 12px;
      background: var(--surface-2); padding: 12px; border-radius: 8px; max-height: 220px; overflow: auto; margin-top: 8px; }
    .status-ok { color: var(--ok); } .status-err { color: var(--err); } .status-warn { color: var(--warn); }

    .spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent;
      border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 6px; }
    @keyframes spin { to { transform: rotate(360deg); } }
    .hidden { display: none !important; }

/* Small layout rules that used to be inline style="..." attributes — kept in
   the stylesheet so the CSP can forbid inline styles (style-src 'self'). */
#signin-card .hint { margin-bottom: 14px; }
#browse-scope { font-weight: 400; }
.actions.flush { margin-top: 0; }

/* Publisher acknowledgment: content is public (GRC). Persistent notice + a
   required per-publish checkbox in the confirm modal. */
.public-notice { background: var(--warn-bg); border: 1px solid var(--warn); border-radius: 8px;
  padding: 10px 14px; margin-bottom: 20px; font-size: .88rem; line-height: 1.45; }
.ack { display: flex; gap: 9px; align-items: flex-start; margin: 4px 0 2px; font-size: .9rem; cursor: pointer; }
.ack input { margin-top: 3px; flex: none; }
