
/* Drag instructions styling in edit mode */
body.edit-mode .drag-instructions {
  background-color: rgba(34, 139, 34, 0.9) !important;
  border: 1px solid #3cb371 !important;
  color: #fff !important;
}

/* Widget edit controls styling - all green in edit mode */
body.edit-mode .widget-close,
body.edit-mode .widget-maximize,
body.edit-mode .widget-change-type {
  background: linear-gradient(135deg, #228b22, #3cb371) !important;
  color: #fff !important;
  border: 1px solid #3cb371 !important;
  box-shadow: 0 2px 4px rgba(34, 139, 34, 0.3);
  transition: all 0.2s ease;
}

body.edit-mode .widget-close:hover,
body.edit-mode .widget-maximize:hover,
body.edit-mode .widget-change-type:hover {
  background: linear-gradient(135deg, #3cb371, #4cbb81) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(34, 139, 34, 0.4);
}

.control-button#reset-dashboard {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
  border-color: #c0392b;
}

.control-button#reset-dashboard:hover {
  background: linear-gradient(135deg, #c0392b, #a93226);
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(231, 76, 60, 0.4);
}
/* Resize handle in edit mode */
body.edit-mode .widget-resize-handle {
  background: linear-gradient(135deg, #228b22, #3cb371) !important;
  opacity: 0.9;
  border: 2px solid #3cb371 !important;
  border-radius: 0 0 6px 0;
  transition: all 0.2s ease;
}

body.edit-mode .widget-resize-handle:hover {
  opacity: 1;
  background: linear-gradient(135deg, #3cb371, #4cbb81) !important;
  transform: scale(1.1);
}

body.edit-mode .widget-resize-handle::after {
  content: '';
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-bottom: 6px solid var(--wh-ffffff, #fff);
}

/* Widget headers get subtle edit mode indicators */
body.edit-mode .widget-header {
  border: 1px solid rgba(34, 139, 34, 0.3) !important;
  background: linear-gradient(135deg,
    rgba(34, 139, 34, 0.1) 0%,
    rgba(60, 179, 113, 0.05) 100%) !important;
}

body.edit-mode .widget-header:hover {
  border-color: rgba(34, 139, 34, 0.5) !important;
  background: linear-gradient(135deg,
    rgba(34, 139, 34, 0.15) 0%,
    rgba(60, 179, 113, 0.08) 100%) !important;
}

/* Tab area specific edit mode styling */
body.edit-mode .tab-area-widget .widget-header {
  border-color: rgba(34, 139, 34, 0.4) !important;
}

/* Header button container in edit mode */
body.edit-mode .header-button-container {
  background: rgba(34, 139, 34, 0.15) !important;
  border-radius: 4px;
  padding: 2px 4px;
  border: 1px solid rgba(34, 139, 34, 0.2) !important;
}

/* Module selector button in edit mode */
body.edit-mode .module-selector-button {
  border-color: #228b22 !important;
  color: #228b22 !important;
  background: rgba(34, 139, 34, 0.1) !important;
}

body.edit-mode .module-selector-button:hover {
  background: rgba(34, 139, 34, 0.2) !important;
  border-color: #3cb371 !important;
  color: #3cb371 !important;
}

/* Drag preview in edit mode */
body.edit-mode .drag-preview {
  border-color: #228b22 !important;
  background-color: rgba(34, 139, 34, 0.3) !important;
}

/* Drop target highlight in edit mode */
body.edit-mode .drop-target-highlight {
  border: 3px dashed #228b22 !important;
  background-color: rgba(34, 139, 34, 0.1) !important;
}

/* Edit mode indicator badge */
.edit-mode-indicator {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #228b22, #3cb371) !important;
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(34, 139, 34, 0.4);
  animation: editModePulse 3s infinite;
  cursor: pointer;
}

/* Edit mode pulse animation */
@keyframes editModePulse {
  0% { box-shadow: 0 4px 12px rgba(34, 139, 34, 0.4), 0 0 0 0 rgba(34, 139, 34, 0.7); }
  70% { box-shadow: 0 4px 12px rgba(34, 139, 34, 0.4), 0 0 0 10px rgba(34, 139, 34, 0); }
  100% { box-shadow: 0 4px 12px rgba(34, 139, 34, 0.4), 0 0 0 0 rgba(34, 139, 34, 0); }
}

/* Tab styling in edit mode */
body.edit-mode .tab {
  border: 1px solid rgba(34, 139, 34, 0.3) !important;
  background: rgba(34, 139, 34, 0.1) !important;
  color: #228b22 !important;
}

body.edit-mode .tab:hover {
  background: rgba(34, 139, 34, 0.2) !important;
  border-color: rgba(34, 139, 34, 0.5) !important;
}

body.edit-mode .tab.active {
  background: linear-gradient(135deg, #228b22, #3cb371) !important;
  color: #fff !important;
  border-color: #3cb371 !important;
}

body.edit-mode .add-tab {
  background: rgba(34, 139, 34, 0.1) !important;
  border: 1px dashed rgba(34, 139, 34, 0.5) !important;
  color: #228b22 !important;
}

body.edit-mode .add-tab:hover {
  background: rgba(34, 139, 34, 0.2) !important;
  border-color: #228b22 !important;
  color: #3cb371 !important;
}

/* Hide all editing controls in view mode (default state) */
.widget-close,
.widget-maximize,
.widget-change-type,
.widget-resize-handle,
.add-tab,
.tab-close {
  display: none;
}

/* Remove drag cursor from headers in view mode */
.widget-header {
  cursor: default !important;
}

/* Show editing controls only in edit mode */
body.edit-mode .widget-close,
body.edit-mode .widget-maximize,
body.edit-mode .widget-change-type,
body.edit-mode .widget-resize-handle,
body.edit-mode .add-tab,
body.edit-mode .tab-close {
  display: block;
}

/* Restore drag cursor for headers in edit mode */
body.edit-mode .widget-header {
  cursor: move !important;
}

/* Restore resize cursor for resize handles in edit mode */
body.edit-mode .widget-resize-handle {
  cursor: nwse-resize !important;
}

/* ── Chat panel (js/chat.js) ───────────────────────────────────────────────────
   Baked into the dashboard, not a widget: fixed to the header, above the grid. */
/* The panel has to read as a WINDOW floating over the dashboard, not as a hole cut in it. It
   used to be neutral near-black (var(--wh-161a22, #161a22)) with a var(--wh-2a2f3a, #2a2f3a) hairline, while everything behind it
   is navy -- a different colour family and an edge too faint to find.

   CHAT'S COLOUR IS PURPLE (#9879e5), and this is a deliberate choice, not a default.
   Teal (var(--wh-5bc0be, #5bc0be)) was tried first and was wrong: it is THE app accent -- 54 uses, 15 of them in
   the header alone -- and the user avatar two buttons away is literally
   `linear-gradient(135deg, var(--wh-5bc0be, #5bc0be), var(--wh-6fffe9, #6fffe9))`, so a teal pressed state was pixel-identical to
   its left stop and read as decoration rather than as "this button is on".
   #9879e5 is already in the app's palette (the chart and content modules use it ~28 times) but
   appears NOWHERE in the header, so it is in-family for the product and unique in this row.
   Structural purple stays #9879e5; TEXT uses the lighter #d4c7f4 -- mid-tone purple on a dark
   bar is the same hard-to-read trap the teal title fell into (6.63:1 vs 9.02:1 now).
   Three things separate the panel from the page, and #contactBtn.active reuses the same purple
   so the pressed button and the window it opens are visibly one thing:
     1. a purple edge + outer ring
     2. a deep shadow, so it sits ABOVE the page rather than in it
     3. a tinted title bar, which gives the panel a top edge you can actually see */
.wh-chat { position:fixed; top:52px; right:12px; width:340px; max-height:calc(100vh - 76px);
           background:var(--wh-141b2b, #141b2b); border:1px solid rgba(152,121,229,.55); border-radius:8px;
           z-index:9000; display:none; flex-direction:column; color:var(--wh-e8eaed, #e8eaed); font-size:12px;
           box-shadow:0 0 0 1px rgba(152,121,229,.15), 0 18px 50px rgba(0,0,0,.65);
           font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif; }
.wh-chat.open { display:flex; }
/* position:relative anchors the +Chat / +User dropdown to the header, so it hangs off the
   button that opened it instead of floating as a modal in the middle of the panel.

   ROW GEOMETRY. Every control in this row is one height (--wh-hd-ctl) and the row's own
   vertical padding is small, so the bar is compact while the things you click are bigger --
   the opposite of what it was, which padded 8px above and below four controls of four
   different heights (input 24, +Chat 21.4, close 16, clear 13). Height is set explicitly
   rather than left to each control's font and padding, because that is what made them
   disagree in the first place. */
.wh-chat-head { --wh-hd-ctl:26px;
                display:flex; align-items:center; gap:6px; padding:4px 10px; position:relative;
                background:rgba(152,121,229,.14);
                border-bottom:1px solid rgba(152,121,229,.38);
                border-radius:7px 7px 0 0; }
/* Title and row name share a structure: a truncating .txt plus a pencil that is NOT inside
   the truncation, so a long name clips the text and never the control that edits it. */
.wh-chat-title { flex:1; min-width:0; font-weight:600; color:var(--wh-d4c7f4, #d4c7f4);
                 display:flex; align-items:center; gap:4px; }
.wh-chat-title .txt { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wh-chat-head button { background:none; border:none; color:var(--wh-b5bdc7, #b5bdc7); cursor:pointer;
                       font-size:16px; line-height:1; padding:0 4px;
                       height:var(--wh-hd-ctl); box-sizing:border-box; flex:none;
                       display:inline-flex; align-items:center; justify-content:center; }
.wh-chat-head button:hover { color:var(--wh-e8eaed, #e8eaed); }
.wh-chat-body { flex:1; overflow:auto; padding:6px; }
.wh-chat-sec { color:var(--wh-8ab4f8, #8ab4f8); font-size:11px; font-weight:600; margin:8px 4px 4px; }
.wh-chat-row { display:flex; align-items:center; gap:8px; padding:6px 8px; border-radius:5px; }
.wh-chat-row.act { cursor:pointer; }
.wh-chat-row.act:hover { background:var(--wh-1c2740, #1c2740); }
/* Row layout: title takes the leftover width and truncates; age and the delete X keep their
   natural width on the right. min-width:0 is load-bearing -- a flex item's default
   min-width:auto refuses to shrink below its content, so without it the title would push the
   age column out of the row instead of ellipsising. */
.wh-chat-who { flex:1; min-width:0; }
.wh-chat-who .name { display:flex; align-items:center; gap:4px; min-width:0; }
.wh-chat-who .name .txt { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* The rename affordance. Hidden until the NAME is hovered -- not the whole row -- because the
   request was for it to appear on the name, and it keeps the row from sprouting two controls
   at once. visibility, not display, so nothing shifts sideways as the pointer arrives. */
.wh-chat-edit { visibility:hidden; flex:none; background:none; border:none; cursor:pointer;
                color:var(--wh-8f98a6, #8f98a6); font-size:11px; line-height:1; padding:0 2px; border-radius:3px; }
.wh-chat-who .name:hover .wh-chat-edit,
.wh-chat-title.nameable:hover .wh-chat-edit,
.wh-chat-edit:focus { visibility:visible; }
.wh-chat-edit:hover { color:#d4c7f4; background:rgba(152,121,229,.22); }
/* the header pencil only means something once a conversation is open */
.wh-chat-title:not(.nameable) .wh-chat-edit { display:none; }
/* while editing, the input takes the name's place -- same row, same position, no reflow */
.editing .txt, .editing .wh-chat-edit { display:none; }
.wh-rename { flex:1; min-width:0; background:var(--wh-101728, #101728); border:1px solid rgba(152,121,229,.6);
             color:var(--wh-e8eaed, #e8eaed); border-radius:3px; padding:1px 5px; font:inherit; font-size:12px;
             font-weight:400; }
.wh-rename:focus { outline:none; border-color:#9879e5; }
.wh-chat-sub { color:var(--wh-acb2bb, #acb2bb); font-size:10px;
               overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* Time since the last message. flex:none so it is never the thing that gets squeezed, and
   right-aligned so the ages form a readable column down the list. */
.wh-chat-age { flex:none; color:var(--wh-acb2bb, #acb2bb); font-size:10px; white-space:nowrap;
               text-align:right; padding-left:6px; }
/* ── who is in the chat ────────────────────────────────────────────────────────
   The row's second line used to be text ("deal_universe · running"). It is now the roster:
   one circle per participant, Claude last. That is what makes Claude read as a participant
   rather than as a mode of the panel -- it sits in the same strip as the people, the same
   size, differing only in wearing a robot instead of initials.

   The hue comes from the user id via a CSS custom property (--h), so a person is the same
   colour in every chat and after every reload. A random or index-based colour would reshuffle
   as the list reorders and the circles would stop being recognisable. */
.wh-avs { display:inline-flex; align-items:center; gap:3px; vertical-align:middle; }
.wh-av { width:16px; height:16px; border-radius:50%; flex:none; position:relative;
         display:inline-flex; align-items:center; justify-content:center;
         font-size:8px; font-weight:700; letter-spacing:.2px; line-height:1;
         color:hsl(var(--h,220) 70% 88%); background:hsl(var(--h,220) 38% 30%);
         border:1px solid hsl(var(--h,220) 45% 44%); }
.wh-av.more { background:var(--wh-22293a, #22293a); border-color:var(--wh-39435c, #39435c); color:var(--wh-acb2bb, #acb2bb); font-size:8px; }
/* Claude. Purple by default -- the panel's own colour -- so it belongs to the chat rather
   than borrowing a person's hue, and the svg inherits it through currentColor. */
.wh-av.bot { background:rgba(152,121,229,.18); border-color:rgba(152,121,229,.55);
             color:#c3b0f0; }
.wh-av.bot svg { width:12px; height:12px; display:block; }
/* Run state, and ONLY the live one moves. Motion in this list means "an agent is working
   right now" -- if a finished or errored chat also animated, the signal would be worth
   nothing. The spin runs 0-60% and holds, so it turns and then rests rather than whirring
   continuously. The exact status is the element's title, which is where the text that used to
   occupy this line went. */
.wh-av.bot.live { background:rgba(166,227,161,.16); border-color:#6fbf73; color:#a6e3a1; }
.wh-av.bot.live svg { animation:whBotSpin 2.2s ease-in-out infinite; transform-origin:50% 50%; }
.wh-av.bot.warn { background:rgba(255,217,160,.14); border-color:#8a7340; color:#ffd9a0; }
.wh-av.bot.bad  { background:rgba(242,184,181,.13); border-color:#8f4b48; color:#f2b8b5; }
@keyframes whBotSpin { 0% { transform:rotate(0); } 60%,100% { transform:rotate(360deg); } }
/* ── presence ──────────────────────────────────────────────────────────────
   Green online, red offline, yellow busy: the Bloomberg convention, chosen because this desk
   already reads it without a legend.

   Notched into the avatar's lower-right rather than placed beside it. The strip is capped at
   five people inside a 340px panel, so a dot that consumed its own column would have pushed
   colleagues into the "+N" overflow to say something about the ones still visible.

   The 1.5px ring is the panel background, not a colour of its own -- without it a red dot on
   a red-ish avatar has no edge and reads as part of the circle. It is what keeps the dot
   legible over all 360 of the hues .wh-av can generate.

   Colours carry a second cue for the ~8% of men who will not separate this red from this
   green: offline is HOLLOW (its centre is the ring colour) while online and busy are solid.
   The state survives the colour being lost. */
.wh-pres { position:absolute; right:-2px; bottom:-2px; width:6px; height:6px;
           border-radius:50%; box-sizing:content-box; border:1.5px solid var(--wh-141b2b, #141b2b);
           display:block; pointer-events:auto; }
.wh-pres.online  { background:#4ade80; }
.wh-pres.busy    { background:#fbbf24; }
.wh-pres.offline { background:var(--wh-141b2b, #141b2b); box-shadow:inset 0 0 0 1.5px #ef4444; }

/* The header's own-status button. Sized to the header's control height so it lines up with
   close and steps, and the dot is centred in it rather than notched -- there is no avatar
   here for it to hang off, and it is a control rather than a label. */
.wh-chat-head button.wh-chat-me { width:var(--wh-hd-ctl); padding:0; position:relative; }
.wh-chat-head button.wh-chat-me .wh-pres { position:static; width:9px; height:9px;
                                           border-color:transparent; }
.wh-chat-head button.wh-chat-me:hover .wh-pres { border-color:rgba(var(--wh-e8eaed-rgb, 232,234,237),.55); }

/* a chat with nobody else left in it. Muted and lowercase: it is a state, not a name. */
.wh-chat-solo { color:var(--wh-8f98a6, #8f98a6); font-size:9.5px; vertical-align:middle; }
/* the module tag, when a chat came from one -- small, after the avatars, never the headline */
.wh-chat-mod { color:var(--wh-8f98a6, #8f98a6); font-size:9.5px; margin-left:6px; vertical-align:middle; }
/* name label above someone else's bubble; only rendered in chats of 3+ */
.wh-chat-from { font-size:9.5px; color:var(--wh-9aa4b2, #9aa4b2); margin:4px 0 1px 2px; }
/* Delete affordance: hidden until the row is hovered, so a list of conversations does not
   read as a row of delete buttons. visibility (not display) keeps the row's layout identical
   hovered and not, so nothing shifts sideways as the pointer moves down the list. It stays
   visible on :focus-within so it is reachable by keyboard, where there is no hover. */
.wh-chat-row .wh-chat-del { visibility:hidden; background:none; border:none; cursor:pointer;
                            color:var(--wh-acb2bb, #acb2bb); font-size:15px; line-height:1; padding:0 2px;
                            border-radius:3px; flex:none; }
.wh-chat-row:hover .wh-chat-del, .wh-chat-row:focus-within .wh-chat-del { visibility:visible; }
.wh-chat-row .wh-chat-del:hover { background:#7a2d2d; color:#ffd7d7; }
/* unread count. flex:none like the age column -- it must never be the thing that shrinks */
.wh-chat-badge { background:#7a2d2d; color:#ffd7d7; border-radius:9px; padding:0 6px;
                 font-size:10px; flex:none; }
/* A chat with unread messages flashes until it is opened (opening is what marks it read). */
@keyframes wh-chat-unread-flash { 0%,100% { background:transparent; } 50% { background:#3a2a52; } }
.wh-chat-row.unread { animation:wh-chat-unread-flash 1.4s ease-in-out infinite; }
.wh-chat-row.unread .wh-chat-who .name { font-weight:600; color:var(--wh-ffffff, #fff); }
.wh-chat-row.unread:hover { animation:none; background:var(--wh-1c2740, #1c2740); }
@media (prefers-reduced-motion: reduce) {
  .wh-chat-row.unread { animation:none; background:#2a2140; }
}
.wh-chat-mini { background:var(--wh-1f2b45, #1f2b45); border:1px solid var(--wh-2c3f60, #2c3f60); color:var(--wh-e8eaed, #e8eaed); border-radius:4px;
                padding:2px 7px; font-size:11px; cursor:pointer; margin-left:4px; }
.wh-chat-mini.ghost { color:var(--wh-dae0ea, #dae0ea); }
.wh-chat-msg, .wh-chat-err { padding:8px; color:var(--wh-dae0ea, #dae0ea); }
.wh-chat-err { color:#f2b8b5; }
.wh-chat-b { max-width:80%; padding:5px 8px; border-radius:8px; margin:4px 0; line-height:1.4;
             word-wrap:break-word; }
.wh-chat-b.me { background:#1f6feb; margin-left:auto; }
.wh-chat-b.them { background:var(--wh-1f2b45, #1f2b45); }
.wh-chat-when { color:rgba(var(--wh-ffffff-rgb, 255,255,255),.55); font-size:9px; margin-top:2px; }
/* ── Claude transcript: a conversation, not a log ──────────────────────────────
   Your messages and Claude's replies are bubbles. Everything Claude DOES between replies is a
   compact step pill ("Bashing…") that expands on click. */
.wh-chat-bub { max-width:84%; padding:7px 10px; border-radius:11px; font-size:12.5px;
               line-height:1.5; margin-bottom:8px; white-space:pre-wrap;
               overflow-wrap:anywhere; width:fit-content; }
.wh-chat-bub.me { background:#1f6feb; color:#fff; margin-left:auto;
                  border-bottom-right-radius:3px; }
/* another PERSON's message. Bubbled and left, mirroring your own -- unlike Claude's replies
   below, which are not bubbled at all. The asymmetry is between people and Claude, not
   between you and everyone else. */
.wh-chat-bub.them { background:var(--wh-1f2b45, #1f2b45); color:var(--wh-e8eaed, #e8eaed); margin-right:auto;
                    border-bottom-left-radius:3px; }
/* Claude's replies are NOT bubbled: they run the full column width on the panel
   background, because a 274px bubble wrecks code, paths and tables. Only your
   messages get a bubble -- the asymmetry is the point. */
.wh-chat-bub.claude { background:none; color:var(--wh-e3e7ee, #e3e7ee); margin-right:auto;
                      max-width:100%; width:auto; padding:4px 2px;
                      border-radius:0; }
/* Claude's replies are rendered markdown (chat.js md()). pre-wrap would double the spacing the
   block elements already give, so only code keeps it. Tables scroll sideways inside their own
   box and wrap within cells, so a row is never broken across lines. */
.wh-chat-bub.md { white-space:normal; overflow-wrap:break-word; }
.wh-chat-bub.md > :first-child { margin-top:0; }
.wh-chat-bub.md > :last-child { margin-bottom:0; }
.wh-chat-bub.md p { margin:0 0 7px; }
.wh-chat-bub.md h3, .wh-chat-bub.md h4, .wh-chat-bub.md h5, .wh-chat-bub.md h6 {
  margin:10px 0 5px; font-weight:700; color:var(--wh-ffffff, #fff); line-height:1.35; }
.wh-chat-bub.md h3 { font-size:14px; }
.wh-chat-bub.md h4 { font-size:13px; }
.wh-chat-bub.md h5, .wh-chat-bub.md h6 { font-size:12.5px; }
.wh-chat-bub.md ul, .wh-chat-bub.md ol { margin:0 0 7px; padding-left:18px; }
.wh-chat-bub.md li { margin:2px 0; }
.wh-chat-bub.md li > ul, .wh-chat-bub.md li > ol { margin:2px 0 0; }
.wh-chat-bub.md strong { color:var(--wh-ffffff, #fff); font-weight:700; }
.wh-chat-bub.md a { color:var(--wh-6cb6ff, #6cb6ff); }
.wh-chat-bub.md code { font-family:ui-monospace,Menlo,monospace; font-size:11.5px; background:rgba(var(--wh-ffffff-rgb, 255,255,255),.08);
                       border-radius:3px; padding:0 3px; overflow-wrap:anywhere; }
.wh-chat-bub.md pre { margin:0 0 7px; padding:6px 8px; background:var(--wh-0d1520, #0d1520); border:1px solid var(--wh-2a3647, #2a3647);
                      border-radius:5px; overflow-x:auto; white-space:pre; }
.wh-chat-bub.md pre code { background:none; padding:0; overflow-wrap:normal; }
.wh-chat-bub.md blockquote { margin:0 0 7px; padding:2px 0 2px 9px; border-left:3px solid var(--wh-3a4a60, #3a4a60); color:var(--wh-b9c3d1, #b9c3d1); }
.wh-chat-bub.md hr { border:0; border-top:1px solid var(--wh-2f3b4d, #2f3b4d); margin:9px 0; }
.wh-chat-bub.md .md-table { overflow-x:auto; margin:0 0 8px; max-width:100%; }
.wh-chat-bub.md table { border-collapse:collapse; font-size:11.5px; line-height:1.4; }
.wh-chat-bub.md th, .wh-chat-bub.md td { border:1px solid var(--wh-2f3b4d, #2f3b4d); padding:3px 6px; vertical-align:top;
                                         text-align:left; min-width:56px; max-width:220px; }
.wh-chat-bub.md th { background:var(--wh-1b2636, #1b2636); color:var(--wh-ffffff, #fff); font-weight:700; }
.wh-chat-bub.md tbody tr:nth-child(even) td { background:rgba(var(--wh-ffffff-rgb, 255,255,255),.03); }
/* the conclusion: given a surface back so it reads as the answer */
.wh-chat-bub.claude.final { background:#16211a; border:1px solid #2f6f4f;
                            max-width:100%; padding:7px 10px; border-radius:8px; }
/* A long seed prompt is clamped so it cannot fill the panel before Claude has spoken.
   The height limit belongs on the inner .body, NOT on the bubble: with it on the bubble the
   "show more" toggle was inside the overflow:hidden box and got clipped too, leaving the
   prompt truncated with no way to expand it. */
.wh-chat-bub.clamped .body { display:block; max-height:5.6em; overflow:hidden; }
.wh-chat-bub.clamped.open .body { max-height:none; }
.wh-chat-bub .more { display:block; margin-top:4px; font-size:10px; cursor:pointer;
                     opacity:.85; text-decoration:underline; }

.wh-chat-step { margin:0 0 4px 0; max-width:84%; }
.wh-chat-step .hd { display:flex; align-items:baseline; gap:6px; cursor:pointer;
                    background:var(--wh-172136, #172136); border:1px solid var(--wh-2b3b5c, #2b3b5c); border-radius:11px;
                    padding:3px 9px; width:fit-content; max-width:100%; }
.wh-chat-step .hd:hover { background:var(--wh-1e2a44, #1e2a44); border-color:var(--wh-3a506b, #3a506b); }
.wh-chat-step .verb { color:var(--wh-8fa8c8, #8fa8c8); font-size:11px; flex:none; }
.wh-chat-step .hint { color:var(--wh-acb2b9, #acb2b9); font-size:10px; font-family:ui-monospace,Menlo,monospace;
                      overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wh-chat-step .det { display:none; }
.wh-chat-step.open .det { display:block; margin:3px 0 6px 6px; border-left:2px solid var(--wh-2c3f60, #2c3f60);
                          padding-left:7px; }
.wh-chat-step.open .hint { display:none; }
.wh-chat-step .det .in, .wh-chat-step .det .out {
  white-space:pre-wrap; overflow-wrap:anywhere; font-family:ui-monospace,Menlo,monospace;
  font-size:10px; max-height:280px; overflow:auto; }
.wh-chat-step .det .in  { color:var(--wh-9ec5fe, #9ec5fe); margin-bottom:4px; }
.wh-chat-step .det .out { color:var(--wh-acb2bb, #acb2bb); }
/* a step that never returned -- the run was stopped or killed part-way */
.wh-chat-step.cut .verb { color:#f2b8b5; }
.wh-chat-step.cut .verb::after { content:' — interrupted'; font-size:10px; color:var(--wh-ac8a8a, #ac8a8a); }

/* the dots pulse ONLY while the step is still running */
.wh-chat-step .dots::after { content:''; }
.wh-chat-step.busy .dots::after { content:'…'; animation:whDots 1.1s steps(1,end) infinite; }
@keyframes whDots { 0%{content:'.'} 33%{content:'..'} 66%,100%{content:'...'} }

/* Intro card at the top of a transcript: started when/by whom, who is in it. Quiet on
   purpose -- it is orientation, not a message, so no bubble and nothing louder than a note. */
.wh-chat-intro { margin:2px 0 10px; padding:7px 9px; border:1px solid var(--wh-2c3f60, #2c3f60);
                 border-radius:6px; background:rgba(var(--wh-1f2b45-rgb, 31,43,69),.45); font-size:11px;
                 color:var(--wh-dae0ea, #dae0ea); line-height:1.45; }
.wh-ci-line.dim { color:var(--wh-8f98a6, #8f98a6); font-size:10.5px; }
.wh-ci-who { display:flex; flex-wrap:wrap; gap:4px 10px; margin:5px 0 3px; }
.wh-ci-p { display:inline-flex; align-items:center; gap:4px; white-space:nowrap; }
.wh-ci-you { color:var(--wh-8f98a6, #8f98a6); }
.wh-chat-note { font-size:10.5px; color:var(--wh-b5bdc7, #b5bdc7); margin:4px 0; padding:3px 8px;
                border-left:2px solid var(--wh-2c3f60, #2c3f60); }
.wh-chat-note.rate_limited, .wh-chat-note.error, .wh-chat-note.stderr { color:#f2b8b5;
                border-left-color:#7a2d2d; }
.wh-chat-note.rate_limit_warning { color:#ffd9a0; border-left-color:#4a3a1f; }
.wh-chat-note.stopped { color:#ffd9a0; border-left-color:#4a3a1f; }

/* STEPS hides only the tool activity -- never your messages or Claude's replies */
.wh-chat-body.no-steps .wh-chat-step { display:none; }
/* Specificity note: `.wh-chat-head button` (0,1,1) outranks a bare `.wh-chat-steps` (0,1,0),
   so this rule's font-size was losing to the 16px glyph size meant for the < and x controls --
   STEPS rendered at 16px uppercase and ate ~60px of a 340px header. Qualified so it wins. */
.wh-chat-head button.wh-chat-steps { font-size:10px; text-transform:uppercase;
                                     letter-spacing:.4px; flex:none; }
.wh-chat-steps.off { color:var(--wh-8993a6, #8993a6) !important; text-decoration:line-through; }
/* Open on phone. Green while the chat is live on the phone; dimmed while it starts or closes. */
.wh-chat-head button.wh-chat-phone { flex:none; display:flex; align-items:center; }
.wh-chat-head button.wh-chat-phone.on { color:#7fd18b; }
.wh-chat-head button.wh-chat-phone.wait { opacity:.5; cursor:progress; }
.wh-chat-onphone { color:#7fd18b; margin-right:4px; vertical-align:-1px; }
.wh-chat-note.phone, .wh-chat-note.account { color:var(--wh-a8c7fa, #a8c7fa); border-left-color:var(--wh-2c4f80, #2c4f80); }
/* Queued messages (sent while Claude was working): your bubble, dimmed, with plain-text
   actions under it -- not delivered yet, so it must not read as part of the transcript. */
.wh-chat-queue { margin-top:6px; padding-top:4px; border-top:1px solid var(--wh-222a36, #222a36); }
.wh-chat-queue .wh-chat-bub { opacity:.55; }
.wh-chat-qmeta { display:flex; justify-content:flex-end; gap:10px; font-size:10.5px;
                 color:var(--wh-9aa4b2, #9aa4b2); margin:2px 2px 4px; }
.wh-chat-qmeta a { color:var(--wh-a8c7fa, #a8c7fa); cursor:pointer; }
.wh-chat-qmeta a:hover { text-decoration:underline; }
.wh-chat-stop { background:#7a2d2d; border:none; color:#ffd7d7; border-radius:4px;
                padding:5px 12px; cursor:pointer; font-size:12px; }
.wh-chat-stop:hover { background:#8f3636; }
.wh-chat-stop:disabled { opacity:.6; cursor:default; }
/* align-items:flex-end -- the textarea grows with its text; the buttons beside it keep their
   own size and sit at the bottom of the row instead of stretching to the textarea's height. */
.wh-chat-foot { display:flex; align-items:flex-end; gap:6px; padding:8px; border-top:1px solid var(--wh-2c3f60, #2c3f60); }
/* --wh-chat-ctl-h is the textarea's one-line height, measured in growInput() (chat.js). */
.wh-chat-foot > button { height:var(--wh-chat-ctl-h, 30px); box-sizing:border-box; flex:0 0 auto; }
.wh-chat-input { flex:1; background:var(--wh-101728, #101728); border:1px solid var(--wh-2c3f60, #2c3f60); color:var(--wh-e8eaed, #e8eaed);
                 border-radius:4px; padding:6px; font-size:12px; resize:none; max-height:40vh; overflow-y:hidden;
                 font-family:inherit; }
/* "Claude is working…" and "Message…" are PLACEHOLDERS -- with no rule of their own the
   browser picks the colour, and every engine dims it (Chrome ~54% opacity of the text
   colour). That status line is the one thing you read while waiting, so it gets stated
   explicitly rather than left to a UA default. */
.wh-chat-input::placeholder { color:var(--wh-a8b2c0, #a8b2c0); opacity:1; }
.wh-chat-input::-webkit-input-placeholder { color:var(--wh-a8b2c0, #a8b2c0); opacity:1; }
.wh-chat-send { background:#1f6feb; border:none; color:#fff; border-radius:4px; padding:5px 12px;
                cursor:pointer; font-size:12px; }
.wh-chat-send:disabled { opacity:.45; cursor:default; }
/* header button: depressed while the panel is open, badge when something is waiting.
   PURPLE, matching the panel's edge and title -- see the .wh-chat block above for why not
   teal. Nothing else in this header row is purple, so "on" is unambiguous at a glance.
   The inset shadow + 1px nudge do the physical work of looking pressed; hover stays the
   header's own teal wash for the OFF state only, since an active button that lightened on
   hover would flicker between two identities as the pointer crossed it. */
.header-action-btn#contactBtn { position:relative; }
.header-action-btn#contactBtn.active { background:rgba(152,121,229,.24); color:#c9b8f5; }
.header-action-btn#contactBtn.active:hover { background:rgba(152,121,229,.32); color:#d9ccf8; }
/* Confirm overlay. Scoped INSIDE the panel (position:absolute, not fixed) so it dims only the
   chat, not the dashboard behind it -- the question is about one conversation, not the app. */
.wh-chat-ask { position:absolute; inset:0; background:rgba(var(--wh-060a12-rgb, 6,10,18),.72); display:none;
               align-items:center; justify-content:center; border-radius:8px; z-index:5; }
.wh-chat-ask.open { display:flex; }
.wh-chat-ask-box { background:var(--wh-1a2338, #1a2338); border:1px solid var(--wh-3a506b, #3a506b); border-radius:6px;
                   padding:12px; width:270px; max-width:90%; }
.wh-chat-ask-t { font-weight:600; margin-bottom:6px; color:var(--wh-e8eaed, #e8eaed); }
.wh-chat-ask-b { font-size:11px; color:var(--wh-acb2bb, #acb2bb); line-height:1.45; white-space:pre-wrap;
                 margin-bottom:10px; }
.wh-chat-ask-r { display:flex; gap:6px; justify-content:flex-end; }
.wh-chat-mini.danger { background:#7a2d2d; border-color:#8f3636; color:#ffd7d7; }
.wh-chat-mini.danger:hover { background:#8f3636; }
.wh-chat-dot { position:absolute; top:-3px; right:-3px; background:#e5534b; color:#fff;
               border-radius:9px; font-size:9px; line-height:1; padding:2px 4px; min-width:8px;
               text-align:center; }

/* ── + Chat / + User picker ────────────────────────────────────────────────────
   A dropdown off the header button, not a modal: choosing who is in a chat is a small
   decision and should not take the panel over. It is the same component for starting a chat
   and for adding to one -- only the button label and what happens on commit differ. */
/* ── search ────────────────────────────────────────────────────────────────────
   Sits where the title was, on the list view only. flex:1 so it takes the room the title had
   and no more -- +Chat and × keep their natural width and never get pushed off. */
.wh-chat-q { flex:1; min-width:0; background:rgba(var(--wh-0a0f1a-rgb, 10,15,26),.55);
             border:1px solid rgba(152,121,229,.34); border-radius:4px;
             color:var(--wh-e8eaed, #e8eaed); font-family:inherit; font-size:12px; padding:0 8px;
             height:var(--wh-hd-ctl); box-sizing:border-box; }
.wh-chat-q:focus { outline:none; border-color:rgba(152,121,229,.75);
                   background:rgba(var(--wh-0a0f1a-rgb, 10,15,26),.8); }
.wh-chat-q::placeholder { color:var(--wh-a8b2c0, #a8b2c0); opacity:1; }
/* the clear ×, shown only when there is something to clear -- a permanent one would read as a
   second close button next to the real one */
.wh-chat-head button.wh-chat-qx { font-size:13px; flex:none; padding:0 2px; color:var(--wh-acb2bb, #acb2bb); }
.wh-chat-head button.wh-chat-qx:hover { color:var(--wh-e8eaed, #e8eaed); }
/* why this row matched, when the reason is buried in the transcript. One line, clipped: it is
   a hint that you found the right chat, not a preview of its contents. */
.wh-chat-snip { font-size:9.5px; color:var(--wh-9aa4b2, #9aa4b2); margin-top:2px; font-style:italic;
                overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wh-chat-row mark { background:rgba(152,121,229,.34); color:#f0eaff; border-radius:2px;
                    padding:0 1px; font-style:normal; }

/* selector kept more specific than `.wh-chat-head button` (which sets a 16px glyph style for
   the ‹ and × controls) so this reads as a labelled button without needing !important */
.wh-chat-head button.wh-chat-add {
  font-size:11px; font-weight:600; flex:none; line-height:1.4; padding:2px 7px;
  background:rgba(152,121,229,.2); color:#d4c7f4;
  border:1px solid rgba(152,121,229,.5); border-radius:4px; }
.wh-chat-head button.wh-chat-add:hover { background:rgba(152,121,229,.34); color:#f0eaff; }
.wh-chat-pick { display:none; position:absolute; top:calc(100% + 4px); right:8px; width:250px;
                background:var(--wh-1a2338, #1a2338); border:1px solid rgba(152,121,229,.5); border-radius:6px;
                box-shadow:0 14px 34px rgba(0,0,0,.6); z-index:20; padding:6px;
                flex-direction:column; gap:6px; }
.wh-chat-pick.open { display:flex; }
.wh-chat-pick-s { background:var(--wh-101728, #101728); border:1px solid var(--wh-2c3f60, #2c3f60); color:var(--wh-e8eaed, #e8eaed); border-radius:4px;
                  padding:5px 7px; font-size:11px; font-family:inherit; width:100%;
                  box-sizing:border-box; }
.wh-chat-pick-s::placeholder { color:var(--wh-c9d1de, #c9d1de); opacity:1; }
/* capped so a long contact list scrolls inside the dropdown rather than running off-screen */
.wh-chat-pick-l { max-height:210px; overflow:auto; }
.wh-pick-row { display:flex; align-items:center; gap:7px; padding:4px 5px; border-radius:4px;
               cursor:pointer; }
.wh-pick-row:hover { background:var(--wh-243052, #243052); }
/* Claude with no key behind it: shown, but visibly not selectable -- clicking opens the key
   form. Hiding the row instead would leave no clue Claude exists at all.
   The dim lands on the CHECKBOX, never the row: fading the whole row multiplied the subtitle
   down to 3.6:1 against var(--wh-1a2338, #1a2338), and that subtitle is the one line telling the user what to do
   about it. Same treatment .lock gets, and for the same reason. */
.wh-pick-row.off .wh-pick-ck { opacity:.45; }
/* Ticked and not untickable: YOU (removing yourself is not a checkbox decision), or a member
   of a chat you did not start. Shown rather than hidden, because the roster has to be the
   whole roster -- a name you cannot act on is still a name you need to see. */
.wh-pick-row.lock { cursor:default; }
.wh-pick-row.lock:hover { background:none; }
.wh-pick-row.lock .wh-pick-ck { opacity:.45; }
.wh-pick-row.lock .wh-pick-n { color:var(--wh-dde3ed, #dde3ed); }
/* The picker's dot stands on its own (no avatar to hang off), so it sits inline and is sized
   up to be read at a glance. All three states are solid here, offline included, by request --
   the name sits right beside the dot, so the hollow cue is not needed to tell people apart. */
.wh-pick-row .wh-pres { position:static; flex:none; width:11px; height:11px; border-color:transparent; }
.wh-pick-row .wh-pres.offline { background:#ef4444; box-shadow:none; }
/* a member of the chat: the tick means "here now", so unticking is the remove gesture */
.wh-pick-row .wh-pick-ck.on { background:#9879e5; border-color:#b9a3ee; }
.wh-pick-ck { width:12px; height:12px; flex:none; border-radius:3px; border:1px solid var(--wh-4a5a7a, #4a5a7a);
              background:var(--wh-101728, #101728); position:relative; }
.wh-pick-ck.on { background:#9879e5; border-color:#b9a3ee; }
.wh-pick-ck.on::after { content:'✓'; position:absolute; inset:0; font-size:9px; line-height:12px;
                        text-align:center; color:var(--wh-151a26, #151a26); font-weight:700; }
.wh-pick-n { flex:1; min-width:0; font-size:11.5px; color:var(--wh-e8eaed, #e8eaed);
             overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wh-pick-sub { display:block; font-size:10.5px; color:var(--wh-dae0ea, #dae0ea);
               overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wh-pick-empty { padding:8px 5px; font-size:11px; color:var(--wh-dae0ea, #dae0ea); }
.wh-chat-pick-f { display:flex; align-items:center; justify-content:space-between; gap:6px; }
.wh-pick-key { color:var(--wh-dae0ea, #dae0ea); font-size:11px; text-decoration:underline; cursor:pointer; }
.wh-pick-key:hover { color:var(--wh-ffffff, #ffffff); }
.wh-chat-pick-f .wh-chat-pick-go { margin-left:0; }
.wh-chat-pick-go:disabled { opacity:.45; cursor:default; }

/* ── attachments ───────────────────────────────────────────────────────────────
   A chip in the transcript, not a bubble. An attachment is not something anyone SAID -- it is
   a document that entered the conversation at that point -- so it sits full width and reads as
   a record of an event, the way the tool steps do, rather than as a line of dialogue. */
.wh-chat-doc { display:flex; align-items:baseline; gap:6px; margin:4px 0; padding:4px 8px;
               background:var(--wh-18233a, #18233a); border:1px solid var(--wh-2c3f60, #2c3f60); border-left:3px solid var(--wh-5b7fb8, #5b7fb8);
               border-radius:4px; font-size:11px; color:var(--wh-dae0ea, #dae0ea); }
.wh-chat-doc.open { cursor:pointer; }
.wh-chat-doc.open:hover { background:var(--wh-1e2a44, #1e2a44); border-color:var(--wh-3a506b, #3a506b); }
.wh-chat-doc .ic { flex:none; font-size:11px; opacity:.85; }
/* The filename gets the room. It is what the reader is looking for -- the meta is a reminder
   of something they already chose, so it yields first and truncates second. */
.wh-chat-doc .nm { color:var(--wh-e8eaed, #e8eaed); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
                   min-width:0; flex:1 1 auto; }
.wh-chat-doc .mt { color:var(--wh-a8b2c0, #a8b2c0); font-size:10px; flex:0 1 auto; margin-left:auto;
                   max-width:52%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wh-chat-doc .ic svg, .wh-chat-clip svg { display:block; }
.wh-chat-doc .ic { align-self:center; }

/* The clip matches Send's height so the composer stays one row of controls, and is quiet
   until hovered -- it is available on every turn but wanted on very few. */
.wh-chat-clip { background:transparent; border:1px solid var(--wh-2c3f60, #2c3f60); color:var(--wh-c9d1de, #c9d1de);
                border-radius:4px; cursor:pointer; font-size:13px; line-height:1;
                padding:0 7px; }
.wh-chat-clip:hover { background:var(--wh-1f2b45, #1f2b45); color:var(--wh-ffffff, #fff); border-color:var(--wh-3a506b, #3a506b); }

/* Drag and drop. The whole transcript is the target, not a strip at the bottom -- the panel is
   340px wide and a small drop zone in it would be a game of skill. The cue is a border and a
   tint, never a full-panel overlay that hides what you were reading. */
.wh-chat-body.drop { outline:2px dashed var(--wh-5b7fb8, #5b7fb8); outline-offset:-6px; background:var(--wh-16203a, #16203a); }

/* ── Settings dialog ───────────────────────────────────────────────────────────
   A modal, unlike the chat panel: settings are a detour, not a companion to whatever you were
   doing, and one is finished before the dashboard is used again. Left rail rather than tabs
   across the top because the panel list is going to grow past what a row can hold. */
.wh-set { position:fixed; inset:0; z-index:11000; display:none;
          align-items:center; justify-content:center; background:rgba(var(--wh-02050c-rgb, 2,5,12),.55);
          backdrop-filter:blur(3px); -webkit-backdrop-filter:blur(3px); }
.wh-set.on { display:flex; }
/* Fixed width AND height: the box used to size itself to the open panel and, being centred,
   jumped in size and position every time a different section was chosen. The panel scrolls
   inside it instead. */
.wh-set-box { width:680px; max-width:94vw; height:600px; max-height:86vh; display:flex; flex-direction:column;
              /* Lifted well clear of the dashboard's var(--wh-0b132b, #0b132b): under the dimmed backdrop the old
                 var(--wh-141b2b, #141b2b) box and its black shadow disappeared into the page behind it. */
              background:var(--wh-1c2539, #1c2539); border:1px solid var(--wh-5a77a3, #5a77a3); border-radius:8px;
              box-shadow:0 0 0 1px rgba(152,121,229,.18), 0 18px 60px rgba(0,0,0,.7),
                         0 0 40px rgba(var(--wh-5b7fb8-rgb, 91,127,184),.12); overflow:hidden;
              font-family:-apple-system,'Segoe UI',Roboto,sans-serif; }
.wh-set-head { display:flex; align-items:center; gap:8px; padding:11px 14px;
               border-bottom:1px solid var(--wh-3a5070, #3a5070); background:var(--wh-253150, #253150); }
.wh-set-title { font-weight:600; font-size:14px; color:var(--wh-e8eaed, #e8eaed); flex:1; }
.wh-set-close { background:transparent; border:none; color:var(--wh-c9d1de, #c9d1de); font-size:20px;
                line-height:1; cursor:pointer; padding:0 4px; }
.wh-set-close:hover { color:var(--wh-ffffff, #fff); }

.wh-set-body { display:flex; min-height:0; flex:1; }
.wh-set-nav { width:168px; flex:none; border-right:1px solid var(--wh-3a5070, #3a5070); padding:8px 0;
              background:var(--wh-18213a, #18213a); }
.wh-set-tab { display:block; width:100%; text-align:left; background:transparent; border:none;
              color:var(--wh-c9d1de, #c9d1de); font:inherit; font-size:12.5px; padding:7px 14px; cursor:pointer;
              border-left:2px solid transparent; }
.wh-set-tab:hover { background:var(--wh-26334f, #26334f); color:var(--wh-ffffff, #fff); }
.wh-set-tab.on { background:var(--wh-2a3757, #2a3757); color:var(--wh-ffffff, #fff); border-left-color:#9879e5; }

.wh-set-panel { flex:1; min-width:0; overflow-y:auto; scrollbar-gutter:stable; padding:14px 16px 18px; }
.wh-set-sec { font-size:12.5px; font-weight:600; color:var(--wh-e8eaed, #e8eaed); margin:16px 0 4px; }
.wh-set-sec:first-child { margin-top:0; }
.wh-set-note { font-size:11.5px; color:var(--wh-dae0ea, #dae0ea); line-height:1.5; margin:0 0 8px; }
.wh-set-note.blurb { color:var(--wh-a8b2c0, #a8b2c0); }
.wh-set-note.quiet { color:var(--wh-a8b2c0, #a8b2c0); min-height:15px; margin-top:5px; }
.wh-set-note.err { color:var(--wh-f2b8b5, #f2b8b5); }
.wh-set-note.info { color:var(--wh-ffd9a0, #ffd9a0); border-left:2px solid var(--wh-4a3a1f, #4a3a1f); padding-left:8px; }

.wh-set-row { display:flex; gap:7px; align-items:center; }
.wh-set-in { flex:1; min-width:0; background:rgba(var(--wh-0a0f1a-rgb, 10,15,26),.55);
             border:1px solid rgba(152,121,229,.34); border-radius:4px; color:var(--wh-e8eaed, #e8eaed);
             font-family:inherit; font-size:12px; padding:6px 9px; }
.wh-set-in:focus { outline:none; border-color:rgba(152,121,229,.75); }
.wh-set-in::placeholder { color:var(--wh-c9d1de, #c9d1de); opacity:1; }
.wh-set-sel { width:100%; background:rgba(var(--wh-0a0f1a-rgb, 10,15,26),.55); border:1px solid rgba(152,121,229,.34);
              border-radius:4px; color:var(--wh-e8eaed, #e8eaed); font-family:inherit; font-size:12px;
              padding:6px 9px; }
.wh-set-btn { background:var(--wh-1f2b45, #1f2b45); border:1px solid var(--wh-2c3f60, #2c3f60); color:var(--wh-e8eaed, #e8eaed); border-radius:4px;
              padding:6px 11px; font:inherit; font-size:11.5px; cursor:pointer; flex:none; }
.wh-set-btn:hover:not(:disabled) { background:var(--wh-2a3a5c, #2a3a5c); }
.wh-set-btn:disabled { opacity:.45; cursor:default; }
.wh-set-btn.primary { border-color:var(--wh-5b7fb8, #5b7fb8); }

/* Radios, not a select: these are three positions on one axis of trust, and a user deciding a
   compliance question should see all three at once rather than one at a time. */
.wh-set-radios { display:flex; flex-direction:column; gap:5px; }
.wh-set-radio { display:flex; align-items:flex-start; gap:8px; padding:7px 9px; cursor:pointer;
                border:1px solid var(--wh-2c3f60, #2c3f60); border-radius:4px; background:var(--wh-222d48, #222d48);
                font-size:11.5px; color:var(--wh-dae0ea, #dae0ea); line-height:1.45; }
.wh-set-radio:hover { border-color:var(--wh-3a506b, #3a506b); background:var(--wh-2a3757, #2a3757); }
.wh-set-radio.on { border-color:#9879e5; background:#2c2f58; color:#fff; }
.wh-set-radio input { margin:2px 0 0; flex:none; accent-color:#9879e5; }

/* Settings — Account, Chat & notifications, Data access.
   Label/field grid rather than stacked rows: four short profile fields read as a form when the
   labels line up, and as a list of unrelated boxes when they do not. */
.wh-set-grid { display:grid; grid-template-columns:118px 1fr; gap:7px 10px; align-items:center; }
.wh-set-lab { font-size:11.5px; color:var(--wh-a8b2c0, #a8b2c0); }
.wh-set-actions { display:flex; gap:7px; margin-top:9px; }
.wh-set-ro { font-size:12px; color:var(--wh-dae0ea, #dae0ea); padding:5px 0 2px; }

.wh-set-check { display:flex; align-items:flex-start; gap:8px; padding:7px 9px; cursor:pointer;
                border:1px solid var(--wh-2c3f60, #2c3f60); border-radius:4px; background:var(--wh-222d48, #222d48);
                font-size:11.5px; color:var(--wh-dae0ea, #dae0ea); line-height:1.45; }
.wh-set-check:hover { border-color:var(--wh-3a506b, #3a506b); background:var(--wh-2a3757, #2a3757); }
.wh-set-check input { margin:2px 0 0; flex:none; accent-color:#9879e5; }

/* Entitlements. Everything in the catalogue is listed, held or not, so the answer to "why is
   this module empty" is on the page rather than absent from it. */
.wh-set-ents { display:flex; flex-direction:column; gap:4px; }
.wh-set-ent { display:flex; align-items:center; gap:8px; padding:6px 9px; border-radius:4px;
              border:1px solid var(--wh-24344f, #24344f); background:var(--wh-161f33, #161f33); font-size:11.5px; color:var(--wh-8b95a5, #8b95a5); }
.wh-set-ent.held { color:var(--wh-dae0ea, #dae0ea); border-color:var(--wh-33507a, #33507a); background:var(--wh-222d48, #222d48); }
.wh-set-ent-mark { flex:none; width:13px; text-align:center; color:var(--wh-6b7787, #6b7787); }
.wh-set-ent.held .wh-set-ent-mark { color:#7ec69b; }
.wh-set-ent-key { margin-left:auto; padding-left:10px; font-family:ui-monospace,Menlo,monospace;
                  font-size:10.5px; color:var(--wh-6b7787, #6b7787); }

/* Contacts inside Settings. Reuses the entitlement row and the chat panel's own .wh-pres dot,
   which is absolutely positioned there because it hangs off an avatar; here it sits in the row. */
.wh-set-ent .wh-pres { position:static; flex:none; border-color:var(--wh-222d48, #222d48); }
.wh-set-ent-acts { display:flex; gap:6px; margin-left:auto; padding-left:10px; }
.wh-set-ent .wh-set-ent-acts .wh-set-btn { padding:3px 9px; font-size:11px; }
/* Second click of a two-step delete. Red only once it is armed -- a row of permanently red
   buttons reads as a warning about the list rather than about the action. */
.wh-set-btn.danger { border-color:#a33; background:#3a1e22; color:#f2b8b5; }
.wh-set-btn.danger:hover:not(:disabled) { background:#4d262b; }
/* A long dashboard name used to wrap and take the row's meta with it, leaving ragged two-line
   rows. The name is the part that gives, and the meta never breaks. */
.wh-set-ent-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.wh-set-ent-meta { margin-left:auto; padding-left:10px; white-space:nowrap; flex:none;
                   font-size:11px; color:var(--wh-8b95a5, #8b95a5); }
.wh-set-ent.held .wh-set-ent-meta { color:var(--wh-98a3b3, #98a3b3); }

/* Drag-to-reorder tabs (enableTabReorder in original_js.js) */
body.edit-mode .tab {
  cursor: grab;
}

body.edit-mode .tab.tab-dragging {
  opacity: 0.6;
  cursor: grabbing;
}

body.tab-reordering,
body.tab-reordering * {
  cursor: grabbing !important;
  user-select: none !important;
}

/* ===== Frozen modules in edit mode =====
   .wh-frozen-module is set by makeModuleEditable (js/edit_dashboard.js) on real modules only --
   selector slots and tab areas stay interactive. Edit mode is for placing and sizing, so the
   module's own controls are hidden and its body is inert; the press falls through to the module
   element and handleMouseDown (original_js.js) drags it from anywhere. */

.edit-type-label {
  display: none;
}

/* Header: first child (title / bond) stays as a read-only label that shrinks and clips, so the
   edit buttons can never be pushed off the right edge */
body.edit-mode .wh-frozen-module > .widget-header > :first-child:not(.header-button-container) {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
}

body.edit-mode .wh-frozen-module > .widget-header > :not(:first-child):not(.header-button-container),
body.edit-mode .wh-frozen-module > .widget-header > .widget-title > :not(.bond-input-container),
body.edit-mode .wh-frozen-module > .widget-header .color-picker-popup {
  display: none !important;
}

body.edit-mode .wh-frozen-module > .widget-header > .header-button-container {
  flex-shrink: 0;
  margin-left: auto;
}

body.edit-mode .wh-frozen-module > .widget-header > .header-button-container > :not(.edit-type-label):not(.widget-change-type):not(.widget-maximize):not(.widget-close) {
  display: none !important;
}

body.edit-mode .wh-frozen-module .edit-type-label {
  display: inline-block;
  padding: 1px 8px;
  margin-right: 4px;
  border-radius: 10px;
  background: rgba(34, 139, 34, 0.25);
  color: #3cb371;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

/* Body: inert and dimmed, drag from anywhere */
body.edit-mode .wh-frozen-module {
  cursor: move;
}

body.edit-mode .wh-frozen-module > .widget-content,
body.edit-mode .wh-frozen-module > .widget-content * {
  pointer-events: none !important;
  user-select: none !important;
}

body.edit-mode .wh-frozen-module > .widget-content {
  opacity: 0.55;
}

/* Chat Pad windows and pop-outs (chat_window.html, 2026-11-13): one conversation fills the
   window. The pad's own title bar carries close / minimise / maximise / pop out, so the panel's
   back, close and presence buttons are hidden here. */
.wh-chat.embed { position:static; display:flex; width:100%; height:100vh; max-height:none;
                 border:none; border-radius:0; box-shadow:none; }
.wh-chat.embed .wh-chat-back, .wh-chat.embed .wh-chat-close, .wh-chat.embed .wh-chat-me,
.wh-chat.embed .wh-chat-q, .wh-chat.embed .wh-chat-qx { display:none !important; }
.wh-chat.embed .wh-chat-body { flex:1 1 auto; max-height:none; }
/* In the Chat Pad the header doubles as the window's title bar: window buttons, drag, flash. */
.wh-chat.embed.in-pad .wh-chat-head { cursor:move; border-radius:0; }
.wh-chat-head button.wh-chat-wbtn { font-size:13px; padding:0 3px; min-width:20px; color:#c9bff0; }
.wh-chat-head button.wh-chat-wbtn:first-of-type { margin-left:2px; }
.wh-chat-head button.wh-chat-wbtn.wx:hover { color:#fff; background:#c0392b; border-radius:3px; }
@keyframes whPadHeadFlash { 0%,100% { background:rgba(152,121,229,.14); } 50% { background:#8a5a00; } }
.wh-chat.embed.pad-flash .wh-chat-head { animation:whPadHeadFlash 1s ease-in-out infinite; }
