/* ============================================================
   Petasos Console — visual system
   Operator console with CRT soul. Dark-on-dark, Discord-disciplined
   neutrals, severity neon, monospace data. Scoped under .pet.
   ============================================================ */

/* No external font fetches — works in air-gapped / egress-restricted installs.
   Inter and JetBrains Mono use system-font fallback stacks.
   Arcade font is vendored locally. */

@font-face {
  font-family: 'Arcade';
  src: url('fonts/ARCADE_R.TTF') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}

.pet {
  /* ── Structural backgrounds — inherit Hermes theme, fall back for standalone ── */
  --bg-app:    var(--background-base, #16181c);
  --bg-panel:  var(--color-card, #1c1f24);
  --bg-raised: color-mix(in srgb, var(--color-card, #23262d) 88%, var(--color-card-foreground, #fff));
  --bg-input:  color-mix(in srgb, var(--background-base, #121419) 92%, black);
  --bg-hover:  color-mix(in srgb, var(--color-card, #20242b) 90%, var(--color-card-foreground, #fff));
  --bg-active: color-mix(in srgb, var(--color-card, #2b2f37) 82%, var(--color-card-foreground, #fff));

  /* ── Borders ── */
  --border:        var(--color-border, #2a2e35);
  --border-soft:   color-mix(in srgb, var(--color-border, #202329) 60%, transparent);
  --border-strong: color-mix(in srgb, var(--color-border, #363b44) 80%, var(--color-card-foreground, #fff));

  /* ── Text ── */
  --tx-bright: var(--color-card-foreground, #f2f3f5);
  --tx:        color-mix(in srgb, var(--color-card-foreground, #c4cad2) 78%, var(--color-muted-foreground, #99a0a8));
  --tx-mut:    var(--color-muted-foreground, #99a0a8);
  --tx-faint:  color-mix(in srgb, var(--color-muted-foreground, #6b7178) 65%, transparent);
  --tx-ghost:  color-mix(in srgb, var(--color-muted-foreground, #4a5059) 45%, transparent);

  /* ── Accent — follows theme primary ── */
  --acc:        var(--color-primary, #2563eb);
  --acc-bright: color-mix(in srgb, var(--color-primary, #5b9dff) 75%, white);
  --acc-hover:  color-mix(in srgb, var(--color-primary, #1d4fd0) 80%, black);
  --acc-soft:   color-mix(in srgb, var(--color-primary, #2563eb) 15%, transparent);
  --acc-line:   color-mix(in srgb, var(--color-primary, #2563eb) 40%, transparent);

  /* ── Status — follows theme semantic colors ── */
  --ok:      var(--color-success, #3fb950);
  --warn:    var(--color-warning, #e8b13a);
  --err:     var(--color-destructive, #ed4245);
  --ok-soft: color-mix(in srgb, var(--color-success, #3fb950) 14%, transparent);

  /* ── Severity — intentionally fixed (security semantics, not cosmetic) ── */
  --amber:        #e8901c;
  --amber-bright: #f4a836;
  --amber-soft:   rgba(232,144,28,.14);

  --crit: #ed4245;
  --high: #ff7b3d;
  --med:  #e8b13a;
  --low:  #57c97a;
  --info: #5b9dff;
  --crit-soft: rgba(237,66,69,.14);
  --high-soft: rgba(255,123,61,.14);
  --med-soft:  rgba(232,177,58,.14);
  --low-soft:  rgba(87,201,122,.14);
  --info-soft: rgba(91,157,255,.14);

  /* ── Radii & typography — inherit theme ── */
  --r-chip: 5px;
  --r-card: var(--radius, 8px);
  --r-panel: var(--radius, 10px);

  --font-display: 'Arcade', 'Press Start 2P', monospace;
  --font-ui:   var(--theme-font-sans, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  --font-mono: var(--theme-font-mono, 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace);

  position: relative;
  width: 100%;
  height: 100%;
  background: var(--bg-app);
  color: var(--tx);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pet-standalone { height: 100vh; }

.pet, .pet *, .pet *::before, .pet *::after { box-sizing: border-box; }
.pet ::selection { background: var(--acc-soft); }

.pet svg.i { width: 16px; height: 16px; flex: 0 0 auto; }
.pet .badge svg.i { width: 11px; height: 11px; }
.pet .pill svg.i { width: 12px; height: 12px; }
.pet .dir svg.i { width: 12px; height: 12px; }

.pet .mono { font-family: var(--font-mono); font-variant-ligatures: none; }
.pet .num  { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.pet .eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--tx-faint); }
.pet .amber { color: var(--amber); }
.pet .link  { color: var(--amber); text-decoration: none; }

/* ── PANE HEADER ── */
.pet .pane-head {
  flex: 0 0 auto; padding: 14px 20px 0; border-bottom: 1px solid var(--border-soft);
  background: var(--bg-app);
}
.pet .pane-titlerow { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pet .pane-mark {
  width: 38px; height: 32px;
  display: flex; align-items: center; justify-content: center;
}
.pet .pane-mark img {
  width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.55));
}
.pet .pane-name { font-family: var(--font-display); font-size: 15px; font-weight: 400; color: var(--tx-bright); letter-spacing: 1px; }
.pet .pane-sub { font-size: 11px; color: var(--tx-faint); font-family: var(--font-mono); }
.pet .pane-titlerow .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.pet .tabs { display: flex; gap: 4px; }
.pet .tab {
  height: 36px; padding: 0 14px; display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--tx-mut); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.pet .tab svg { width: 15px; height: 15px; }
.pet .tab:hover { color: var(--tx); }
.pet .tab.active { color: var(--tx-bright); border-bottom-color: var(--acc); }

.pet .pane-body { flex: 1; min-height: 0; display: flex; overflow: hidden; }
.pet .content { flex: 1; min-width: 0; padding: 16px 20px; overflow-y: auto; overflow-x: hidden; }

/* ── PANEL ── */
.pet .panel { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--r-panel); display: flex; flex-direction: column; overflow: visible; }
.pet .panel-head { height: 38px; flex: 0 0 38px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--border-soft); overflow: visible; }
.pet .panel-head .ic { color: var(--tx-faint); display: flex; }
.pet .panel-head .ic svg { width: 15px; height: 15px; }
.pet .panel-head .pt { font-size: 12px; font-weight: 700; color: var(--tx-bright); letter-spacing: .2px; }
.pet .panel-head .place { font-size: 10px; color: var(--tx-ghost); font-family: var(--font-mono); }
.pet .panel-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pet .panel-body { flex: 1; min-height: 0; padding: 12px; }
.pet .panel-body.flush { padding: 0; overflow: hidden; border-radius: 0 0 calc(var(--r-panel) - 1px) calc(var(--r-panel) - 1px); }

/* ── PET-114: collapsible config sections (collapse affordance only) ── */
.pet .panel-head.collapsible { cursor: pointer; user-select: none; }
.pet .panel-head .chevron { transition: transform .15s; }
.pet .panel:not(.collapsed) .panel-head .chevron { transform: rotate(90deg); }
.pet .panel.collapsed .panel-body { display: none; }
.pet .panel-head.collapsible:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; border-radius: var(--r-panel) var(--r-panel) 0 0; }

/* ── BADGES / PILLS ── */
.pet .badge { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: var(--r-chip); font-size: 10.5px; font-weight: 700; letter-spacing: .3px; font-family: var(--font-mono); white-space: nowrap; }
.pet .badge .d { width: 6px; height: 6px; border-radius: 50%; }
.pet .sev-crit { background: var(--crit-soft); color: var(--crit); box-shadow: inset 0 0 0 1px rgba(237,66,69,.32); }
.pet .sev-high { background: var(--high-soft); color: var(--high); box-shadow: inset 0 0 0 1px rgba(255,123,61,.32); }
.pet .sev-med  { background: var(--med-soft);  color: var(--med);  box-shadow: inset 0 0 0 1px rgba(232,177,58,.32); }
.pet .sev-low  { background: var(--low-soft);  color: var(--low);  box-shadow: inset 0 0 0 1px rgba(87,201,122,.32); }
.pet .sev-info { background: var(--info-soft); color: var(--info); box-shadow: inset 0 0 0 1px rgba(91,157,255,.32); }

.pet .pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 10px; border-radius: 11px; font-size: 11px; font-weight: 600; font-family: var(--font-mono); background: var(--bg-raised); color: var(--tx-mut); border: 1px solid var(--border); }
.pet .pill.ok   { color: var(--ok);  border-color: rgba(63,185,80,.3);  background: var(--ok-soft); }
.pet .pill.warn { color: var(--warn);border-color: rgba(232,177,58,.3); background: var(--med-soft); }
.pet .pill.err  { color: var(--err); border-color: rgba(237,66,69,.3);  background: var(--crit-soft); }
.pet .pill.blue { color: var(--acc-bright); border-color: var(--acc-line); background: var(--acc-soft); }

.pet .tag { display: inline-flex; align-items: center; height: 18px; padding: 0 8px; border-radius: var(--r-chip); font-size: 9.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.pet .tag-oss  { background: var(--bg-raised); color: var(--tx-mut); }

.pet .live { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--ok); }
.pet .live .blip { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: petpulse 1.8s ease-in-out infinite; }
@keyframes petpulse { 0%,100%{opacity:1} 50%{opacity:.35} }
/* PET-13: connection state. Streaming = green LIVE (pulse); SSE-fallback = amber POLLING (steady). */
.pet .live.polling { color: var(--warn); }
.pet .live.polling .blip { background: var(--warn); box-shadow: none; animation: none; }
/* PET-13: protection-weakening Apply confirm — mirrors the disarm banner's amber confirm register. */
.pet .btn-primary.confirm-weaken { background: var(--med-soft); color: var(--warn); border-color: var(--warn); }

/* ── PET-127: skeleton loading primitive ── */
.pet .skel {
  display: block;
  border-radius: var(--r-card);
  background: linear-gradient(90deg,
    var(--bg-raised) 0%,
    color-mix(in srgb, var(--bg-raised) 82%, var(--tx-mut)) 50%,
    var(--bg-raised) 100%);
  background-size: 200% 100%;
  animation: petshimmer 1.4s ease-in-out infinite;
}
@keyframes petshimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .pet .skel { animation: none; background: var(--bg-raised); }
  .pet .live .blip { animation: none; }  /* PET-13: the LIVE pulse must respect reduced-motion */
}

/* PET-13: visually-hidden live region for screen-reader announcements (new scan verdicts). */
.pet .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── BUTTONS / INPUTS ── */
.pet .btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px; border-radius: var(--r-card); border: 1px solid transparent; cursor: pointer; font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; line-height: 1; transition: background .14s, border-color .14s, color .14s; }
.pet .btn svg { width: 15px; height: 15px; }
.pet .btn-primary { background: var(--acc); color: var(--color-primary-foreground, #fff); }
.pet .btn-primary:hover { background: var(--acc-hover); }
.pet .btn-ghost { background: transparent; color: var(--tx-mut); border-color: var(--border-strong); }
.pet .btn-ghost:hover { background: var(--bg-hover); color: var(--tx-bright); }
.pet .btn-sm { height: 27px; padding: 0 11px; font-size: 11.5px; }

.pet .input { height: 34px; padding: 0 12px; border-radius: var(--r-card); background: var(--bg-input); border: 1px solid var(--border); color: var(--tx-bright); font-family: var(--font-ui); font-size: 13px; width: 100%; }
.pet .input::placeholder { color: var(--tx-ghost); }
.pet .input.mono { font-family: var(--font-mono); }
.pet textarea.input { height: auto; }

.pet .seg { display: inline-flex; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--r-card); padding: 2px; gap: 2px; }
.pet .seg button { height: 26px; padding: 0 14px; border: none; background: transparent; cursor: pointer; font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--tx-mut); border-radius: 5px; transition: background .12s, color .12s; }
.pet .seg button.on { background: var(--acc); color: var(--color-primary-foreground, #fff); }

/* ── PET-124: strength-preset "tuning dial" (Config Editor) ── */
.pet .pet-dial-host { flex: 0 0 auto; }
.pet .pet-dial-wrap { display: flex; flex-direction: column; gap: 6px; padding: 4px 0 12px; margin-bottom: 8px; border-bottom: 1px solid var(--border-soft); }
.pet .pet-dial-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pet .pet-dial-title { flex: 0 0 auto; }
/* The dial reuses .seg; its segments are wider and label-cased, and the Custom
   tail reads as derived (dashed, muted) rather than a peer selectable level. */
.pet .seg.pet-dial { flex-wrap: wrap; }
.pet .pet-dial-seg { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 12px; border: none; background: transparent; cursor: pointer; font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--tx-mut); border-radius: 5px; transition: background .12s, color .12s; }
.pet .pet-dial-seg:hover { color: var(--tx-bright); background: var(--bg-hover); }
.pet .pet-dial-seg.on { background: var(--acc); color: var(--color-primary-foreground, #fff); }
.pet .pet-dial-seg.on:hover { background: var(--acc); }
.pet .pet-dial-seg .help { color: inherit; }
.pet .pet-dial-custom { cursor: default; font-style: italic; color: var(--tx-faint); box-shadow: inset 0 0 0 1px var(--border); }
.pet .pet-dial-custom:hover { background: transparent; color: var(--tx-faint); }
.pet .pet-dial-custom.on { background: var(--bg-active); color: var(--tx-bright); font-style: normal; box-shadow: inset 0 0 0 1px var(--border-strong); }
.pet .pet-dial-rec { font-size: 11px; color: var(--tx-faint); font-family: var(--font-mono); }
.pet .pet-dial-rec b { color: var(--amber); font-weight: 600; }

/* PET-146: Hermes-agent-profile selector — sits above the Strength dial. The
   read-out/note/banner reuse .notice for the alert strips; these style the
   selector chrome, the binding line, the scoped note, and the effective block. */
.pet .pet-hermes-profile-host { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; padding: 4px 0 12px; margin-bottom: 8px; border-bottom: 1px solid var(--border-soft); }
.pet .pet-hermes-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pet .pet-hermes-label { flex: 0 0 auto; font-size: 13px; font-weight: 600; color: var(--tx-bright); }
.pet .pet-hermes-select { height: 32px; min-width: 200px; }
.pet .pet-hermes-binding { font-size: 10px; color: var(--tx-faint); font-family: var(--font-mono); }
.pet .pet-hermes-note { font-size: 11px; color: var(--tx-faint); font-family: var(--font-mono); }
.pet .pet-hermes-effective { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; margin-top: 4px; background: var(--bg-raised); border: 1px solid var(--border-soft); border-radius: var(--r-card); }
.pet .pet-hermes-effective-head { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--tx-faint); }
.pet .pet-hermes-effective-row { font-size: 11px; color: var(--tx-mut); }
.pet .pet-hermes-effective-faint { color: var(--tx-faint); font-style: italic; }

/* flex: none, not a fixed basis — inside the column .pet-ctrl-wrap (petasos.js, PET-81)
   a 38px flex-basis becomes the *height* (column main axis beats the height property),
   rendering the pill as a 38x38 rounded square (PET-89). min/max-height + 999px radius
   keep it a pill even if a host stylesheet drifts the height. */
.pet .switch { width: 38px; height: 22px; min-height: 22px; max-height: 22px; border-radius: 999px; background: var(--bg-active); position: relative; flex: none; transition: background .15s; cursor: pointer; border: none; padding: 0; appearance: none; }
.pet .switch.on { background: var(--acc); }
.pet .switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.pet .switch.on::after { left: 19px; }

/* ── A11y: visible keyboard focus on the primary interactive controls ── */
.pet .btn:focus-visible,
.pet .seg button:focus-visible,
.pet .switch:focus-visible,
.pet .input:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: var(--r-card); }
.pet .tab:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; }

/* ── PET-111: Equipped/Unequipped master banner (Observability tab) ── */
.pet .equip-banner { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--acc); border-radius: 6px; background: var(--bg-active); }
.pet .equip-banner.disarmed { border-color: var(--err); background: var(--crit-soft); }
.pet .equip-banner.confirming { border-color: var(--warn); background: var(--med-soft); }
.pet .equip-banner.confirming .equip-label { color: var(--warn); }
.pet .equip-banner.confirming .equip-sub { color: var(--warn); }
.pet .equip-banner .equip-mark { width: 44px; height: 44px; object-fit: contain; flex: none; }
.pet .equip-banner .equip-text { flex: 1 1 auto; min-width: 0; }
.pet .equip-banner .equip-label { font-family: var(--font-mono); font-size: 14px; letter-spacing: 1px; color: var(--acc); }
.pet .equip-banner.disarmed .equip-label { color: var(--err); }
.pet .equip-banner .equip-sub { font-size: 11px; color: var(--tx-mut); }
.pet .equip-banner.disarmed .equip-sub { color: var(--err); }

/* ── TABLE ── */
.pet table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.pet table.tbl th { text-align: left; font-size: 9.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--tx-ghost); padding: 0 10px 8px; border-bottom: 1px solid var(--border); }
.pet table.tbl td { padding: 7px 10px; border-bottom: 1px solid var(--border-soft); }
.pet table.tbl tr:last-child td { border-bottom: none; }
.pet table.tbl tr:hover td { background: var(--bg-hover); }
.pet .row-blocked td:first-child { box-shadow: inset 3px 0 0 var(--crit); }
.pet .row-safe td:first-child { box-shadow: inset 3px 0 0 var(--low); }
.pet .dir { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 11px; color: var(--tx-mut); }

/* ── SCANNER CARD ── */
.pet .scanner { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-card); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.pet .scanner .sc-top { display: flex; align-items: center; gap: 8px; }
.pet .scanner .sc-name { font-size: 12.5px; font-weight: 600; color: var(--tx-bright); font-family: var(--font-mono); }
.pet .scanner .sc-stat { margin-left: auto; }
.pet .scanner .sc-metrics { display: flex; gap: 18px; }
.pet .scanner .sc-metrics .m .k { font-size: 8.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--tx-ghost); }
.pet .scanner .sc-metrics .m .v { font-size: 15px; font-weight: 700; font-family: var(--font-mono); color: var(--tx-bright); }
.pet .scanner.errstate { border-color: rgba(237,66,69,.45); }

/* ── FINDINGS ── */
.pet .finding { display: flex; gap: 11px; padding: 10px 12px 10px 14px; border-radius: var(--r-card); background: var(--bg-raised); border: 1px solid var(--border); position: relative; overflow: hidden; }
.pet .finding .rail { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.pet .finding .body { flex: 1; min-width: 0; }
.pet .finding .rid { font-family: var(--font-mono); font-size: 11.5px; color: var(--tx-bright); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.pet .finding .msg { font-size: 12px; color: var(--tx-mut); margin-top: 3px; overflow-wrap: anywhere; }
/* PET-99 D4: long unbroken matched_text must wrap inside the overflow:hidden
   finding card rather than overflowing into invisibility. .matched is an inline
   span with no width box, so it also needs display:inline-block + max-width:100%
   to give overflow-wrap a box to wrap within. */
.pet .finding .matched { font-family: var(--font-mono); font-size: 11px; background: var(--bg-input); color: var(--high); padding: 1px 5px; border-radius: 3px; overflow-wrap: anywhere; display: inline-block; max-width: 100%; }
.pet .conf-bar { height: 4px; border-radius: 2px; background: var(--bg-input); overflow: hidden; }
.pet .conf-bar i { display: block; height: 100%; border-radius: 2px; }

/* ── CHARTS ── */
.pet .heat { display: grid; gap: 3px; }
.pet .heat .cell { aspect-ratio: 1; border-radius: 2px; }
.pet .hl { color: var(--tx-faint); font-size: 9px; font-family: var(--font-mono); }

.pet .vlist { display: flex; flex-direction: column; gap: 7px; overflow: hidden; }

.pet .notice { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-card); background: var(--med-soft); border: 1px solid rgba(232,177,58,.3); color: var(--med); font-size: 12px; }
.pet .notice svg { width: 16px; height: 16px; flex: 0 0 16px; }
.pet .notice b { color: var(--tx-bright); font-weight: 600; }

/* ── HELP TOOLTIP ── */
.pet .help { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; color: var(--tx-ghost); cursor: help; flex: 0 0 14px; outline: none; }
.pet .help svg.i { width: 14px; height: 14px; }
.pet .help:hover, .pet .help:focus { color: var(--acc-bright); }
.pet .help:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 2px; }
.pet .tip {
  position: fixed;
  min-width: 220px; max-width: 320px;
  background: var(--color-popover, #0a0b0e); border: 1px solid var(--border-strong); border-radius: var(--r-card);
  padding: 9px 11px; font-family: var(--font-ui); font-size: 11.5px; font-weight: 400;
  line-height: 1.55; letter-spacing: 0; text-transform: none; white-space: normal;
  color: var(--color-popover-foreground, var(--tx)); box-shadow: 0 10px 30px rgba(0,0,0,.55); text-align: left;
  opacity: 0; pointer-events: none; transform: translateY(-4px); transition: opacity .14s, transform .14s; z-index: 9999;
}
.pet .help:hover .tip, .pet .help:focus .tip { opacity: 1; pointer-events: auto; transform: translateY(0); }
.pet .tip b { color: var(--color-popover-foreground, var(--tx-bright)); font-weight: 600; }
.pet .tip code, .pet .tip .m { font-family: var(--font-mono); font-size: 10.5px; color: var(--amber); background: rgba(232,144,28,.1); padding: 0 3px; border-radius: 3px; }

/* ── ABOUT / SUPPORT ── */
.pet .support-coffee {
  display: block; width: 112px; height: 112px; margin: 0 auto 14px;
  border-radius: 12px; object-fit: cover;
  border: 1px solid rgba(232,144,28,.35);
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}

/* ── PET-13 OVERDRIVE: escalation trap stress test ── */
.pet .btn-trap { background: var(--crit-soft); color: var(--crit); border: 1px solid rgba(237,66,69,.4); font-weight: 700; letter-spacing: .3px; }
.pet .btn-trap:hover { background: color-mix(in srgb, var(--crit-soft) 60%, var(--crit)); color: var(--tx-bright); }
.pet .btn-trap:disabled { opacity: .5; cursor: default; }

.pet .trap-viz { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--bg-panel); transition: border-color .2s; }
.pet .trap-viz.sprung { border-color: var(--crit); box-shadow: inset 0 0 0 1px rgba(237,66,69,.35); }
.pet .trap-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }

.pet .trap-bar { height: 6px; border-radius: 3px; background: var(--bg-input); overflow: hidden; }
.pet .trap-bar-fill { height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--low), var(--med), var(--crit)); transition: width .16s ease-out; }

.pet .trap-body { display: flex; gap: 12px; }
.pet .trap-ladder { display: flex; flex-direction: column; gap: 6px; flex: 0 0 168px; }
.pet .trap-rung { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-card); padding: 8px 10px; background: var(--bg-raised); opacity: .5; transition: opacity .18s, border-color .18s; }
.pet .trap-rung-fill { position: absolute; inset: 0; transform: scaleX(0); transform-origin: left; transition: transform .22s ease-out; }
.pet .trap-rung.passed { opacity: 1; border-color: rgba(237,66,69,.35); }
.pet .trap-rung.passed .trap-rung-fill { transform: scaleX(1); background: var(--crit-soft); }
.pet .trap-rung.active { opacity: 1; border-color: var(--warn); }
.pet .trap-rung.active .trap-rung-fill { transform: scaleX(1); background: var(--med-soft); }
.pet .trap-rung-body { position: relative; }
.pet .trap-rung-tier { font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--tx-bright); letter-spacing: .5px; }
.pet .trap-rung-act { font-size: 10px; color: var(--tx-faint); text-transform: uppercase; letter-spacing: 1px; }

.pet .trap-stream { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.pet .trap-shot { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--border-soft); }
.pet .trap-shot-n { font-size: 11px; color: var(--tx-mut); flex: 0 0 32px; }
.pet .trap-shot-tier { margin-left: auto; color: var(--tx-mut); }

.pet .trap-lockdown { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--r-card); background: var(--crit-soft); border: 1px solid var(--crit); }
/* PET-13: the vaporwave bust is the TIER 3 moment - give it real presence, framed + crit glow. */
.pet .trap-lock-mark { width: 104px; height: 104px; flex: none; object-fit: cover; border-radius: var(--r-card); border: 1px solid var(--crit); box-shadow: 0 0 18px rgba(237,66,69,.3); }
.pet .trap-lock-title { font-family: var(--font-mono); font-size: 16px; font-weight: 700; color: var(--crit); letter-spacing: 1px; }
.pet .trap-lock-sub { font-size: 11.5px; color: var(--tx-mut); margin-top: 2px; }
.pet .trap-note { font-size: 11px; color: var(--tx-faint); padding-top: 6px; }

@media (prefers-reduced-motion: reduce) {
  .pet .trap-bar-fill, .pet .trap-rung, .pet .trap-rung-fill, .pet .trap-viz { transition: none; }
}

/* PET-137: scan-history row drill-down. Clickable rows + a typed detail panel that
   answers "what happened" and "is this legit?". Additive; existing rows unchanged
   except for the cursor/focus affordance when clickable. */
.pet .scan-row { border-radius: var(--r-card, 8px); }
.pet .scan-row.clickable { cursor: pointer; padding: 2px 4px; margin: 0 -4px; }
.pet .scan-row.clickable:hover { background: color-mix(in srgb, var(--bg-panel) 70%, var(--tx-faint)); }
.pet .scan-row.clickable:focus-visible { outline: 2px solid var(--accent, var(--tx-bright)); outline-offset: 1px; }
.pet .scan-row.open { background: color-mix(in srgb, var(--bg-panel) 60%, var(--tx-faint)); }

.pet .scan-detail {
  display: flex; flex-direction: column; gap: 8px;
  margin: 2px 0 8px; padding: 12px;
  border-radius: var(--r-card, 8px);
  background: var(--bg-panel); border: 1px solid var(--border);
}
.pet .sd-provenance {
  padding: 8px 10px; border-radius: var(--r-card, 8px);
  background: color-mix(in srgb, var(--bg-panel) 50%, transparent);
  border: 1px solid var(--border-soft);
}
.pet .sd-prov-q { font-size: 11px; font-weight: 700; letter-spacing: .5px; color: var(--tx-bright); text-transform: uppercase; }
.pet .sd-prov-line { font-size: 12px; color: var(--tx-mut); margin-top: 3px; }
.pet .sd-prov-note { font-size: 10.5px; color: var(--tx-faint); margin-top: 4px; }
/* PET-139: spool-integrity attestation badge on the "is this legit?" line. */
.pet .sd-prov-att { font-size: 10.5px; margin-top: 4px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border-soft); display: inline-block; }
.pet .sd-prov-genuine { color: var(--ok); border-color: rgba(63,185,80,.3); background: var(--ok-soft); }
.pet .sd-prov-unverifiable { color: var(--warn); border-color: rgba(232,177,58,.3); background: var(--med-soft); }
.pet .sd-prov-unattested { color: var(--tx-faint); }
.pet .sd-section { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--tx-faint); margin-top: 4px; }
.pet .sd-field { display: flex; gap: 8px; align-items: baseline; font-size: 12px; }
.pet .sd-k { flex: 0 0 84px; color: var(--tx-faint); }
.pet .sd-v { color: var(--tx-mut); overflow-wrap: break-word; min-width: 0; }
.pet .sd-sub { font-size: 11px; color: var(--tx-faint); }
.pet .sd-scanner { font-size: 11px; color: var(--tx-mut); }
.pet .sd-heartbeat { font-size: 12px; color: var(--tx-mut); }
.pet .sd-normalized {
  font-size: 11px; color: var(--tx-mut); white-space: pre-wrap; overflow-wrap: break-word;
  max-height: 140px; overflow-y: auto;
  padding: 6px 8px; border-radius: var(--r-card, 8px);
  background: color-mix(in srgb, var(--bg-panel) 60%, transparent); border: 1px solid var(--border-soft);
}
