/* ============================================================================
   pocket/web-v2/css/dock.css — the Conversation dock's own content (design §4.5, §4.7).
   Owner unit: P06 (prp/2026-09-26-pocket-web-v2/units/P06.md).

   THE OUTER SHELL — position, width per band, bottom-sheet vs. side-panel — is `css/frame.css`'s
   (`.pk-dock`, U03, design §3.5); this file styles only what P06 draws INSIDE `.pk-dock-content`,
   plus the palette overlay (`.pk-pal-*`), which is body-level and never inside the dock at all.
   Rendered through tokens.css / css/kit.css custom properties only — no inline styles (CSP,
   design §11). Everything is scoped under `.pk-dock-content` / `.pk-pal-veil` so this file never
   restyles another page's `.pk-btn`/`.pk-input`. */

.pk-dock-content { display: flex; flex-direction: column; height: 100%; min-height: 0; }

/* ---- head: title + pin + history/collapse controls -------------------------------------------- */
.pk-dock-h {
  display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line); flex: none;
}
.pk-dock-title { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; gap: 1px; }
.pk-dock-t {
  font-family: var(--serif); font-variation-settings: "SOFT" 100; font-weight: 350;
  font-size: 17px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pk-dock-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--you);
  margin-left: 6px; vertical-align: middle;
}
.pk-dock-sub { font-size: 12px; color: var(--ink3); }
.pk-dock-ic {
  flex: none; width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent;
  background: none; color: var(--ink2);
  /* GRID, not flex — measured: a flex row collapses an inline SVG child's WIDTH to 0 (its
     `viewBox` gives it no flex-basis on the main axis even though height sizes fine on the cross
     axis), while `place-items: center` sizes it by its own attributes, exactly like the ask bar's
     already-working `.pk-ask-tb` (css/frame.css) this button otherwise mirrors. */
  display: grid; place-items: center;
}
.pk-dock-ic { cursor: pointer; padding: 0; }
.pk-dock-ic:hover { background: rgba(120, 100, 70, .08); color: var(--ink); }
.pk-dock-h { gap: 2px; }
.pk-dock-title { margin-right: 6px; }
.pk-dock-ic.on { background: var(--sunk); color: var(--ink); }

/* ---- body: messages, working row, proposal ----------------------------------------------------- */
.pk-dock-body { flex: 1 1 auto; overflow-y: auto; min-height: 0; padding: 12px 14px; }
.pk-dock-msgs { display: flex; flex-direction: column; gap: 8px; }
.pk-dock-empty { color: var(--ink3); font-size: 14px; padding: 24px 4px; text-align: center; }
.pk-dock-bub {
  max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 14.5px; line-height: 1.45;
  overflow-wrap: anywhere; white-space: pre-wrap;
}
.pk-dock-bub.me { align-self: flex-end; background: var(--ink); color: var(--bg); border-radius: 14px 14px 3px 14px; }
.pk-dock-bub.me[data-pending] { opacity: .72; }
/* The assistant's turn is TEXT ON THE PAGE, not a card (his 2026-09-27 ask: "remove the background
   of the response"): full width, no fill, the user's own bubble is the only filled shape. */
.pk-dock-bub.pm { align-self: stretch; max-width: 100%; background: none; color: var(--ink); padding: 2px 2px; border-radius: 0; }
.pk-dock-msgs { gap: 14px; }
.pk-dock-bub.tool {
  align-self: flex-start; background: none; color: var(--ink3); font-size: 12.5px;
  padding: 2px 4px; max-width: 100%;
}
.pk-dock-working { display: flex; align-items: center; gap: 8px; padding: 2px 2px; }
.pk-dock-dots { width: 7px; height: 7px; border-radius: 50%; background: var(--ink3); animation: pk-dock-pulse 1.2s ease-in-out infinite; }
@keyframes pk-dock-pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pk-dock-dots { animation: none; } }
.pk-dock-clock { font-size: 13px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.pk-dock-stop, .pk-dock-txt {
  background: none; border: 0; padding: 4px 6px; border-radius: 6px; font-size: 12.5px; color: var(--ink3);
  cursor: pointer; height: auto; min-height: 0;
}
.pk-dock-stop:hover, .pk-dock-txt:hover { color: var(--ink); background: rgba(120, 100, 70, .08); }
.pk-dock-prop { margin-top: 10px; padding: 12px 14px; background: var(--you-t); border-radius: 12px; }
.pk-dock-prop-t { font-size: 14px; color: var(--ink); font-weight: 600; }
.pk-dock-prop-w { font-size: 12.5px; color: var(--ink2); margin-top: 4px; }
.pk-dock-prop-x { margin-top: 6px; font-size: 12.5px; color: var(--ink); }
.pk-dock-prop-k { display: block; font-size: 11px; color: var(--ink2); text-transform: uppercase; letter-spacing: .04em; }
.pk-dock-prop-v { display: block; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 40vh; overflow-y: auto; }
.pk-dock-prop .pk-btn { margin-top: 8px; }

/* ---- composer ------------------------------------------------------------------------------------ */
.pk-dock-din { flex: none; border-top: 1px solid var(--line); padding: 10px 14px 12px; }
.pk-dock-din .pk-input {
  width: 100%; height: auto; min-height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); padding: 8px 12px; font-size: 14.5px; line-height: 1.4; color: var(--ink);
  outline: 0; resize: vertical; font-family: var(--sans); box-sizing: border-box;
}
.pk-dock-din .pk-input:focus, .pk-dock-din .pk-input:focus-visible { outline: 0; border-color: var(--ink3); }
.pk-dock-tools { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.pk-dock-sp { flex: 1 1 auto; }
.pk-dock-tools .pk-dock-ic.on { color: var(--you); }
.pk-dock-model {
  flex: none; width: auto; background: none; border: 1px solid var(--line); border-radius: 999px; height: 28px; padding: 0 11px;
  font-size: 12.5px; color: var(--ink2); cursor: pointer; min-height: 0;
}
.pk-dock-tools .pk-dock-model, .pk-dock-tools .pk-dock-ic { flex: none; }
.pk-dock-model:hover { color: var(--ink); border-color: var(--ink3); }
.pk-dock-model.custom { color: var(--ink); }
.pk-dock-send.pk-dock-ic { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--bg); margin-left: 4px; }
.pk-dock-send.pk-dock-ic:hover { background: var(--ink); color: var(--bg); opacity: .88; }
.pk-dock-send.pk-dock-ic:disabled { background: var(--sunk); color: var(--ink3); cursor: default; opacity: 1; }
.pk-dock-note { font-size: 12.5px; color: var(--ink3); line-height: 1.45; margin: 8px 0; }

/* ---- gear popover: model + core mode ------------------------------------------------------------ */
.pk-dock-sh { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--ink3); margin: 16px 0 6px; }
.pk-dock-sh:first-of-type { margin-top: 4px; }
.pk-dock-seg button { text-transform: capitalize; }

/* ---- history: search, rooms, the real shelf ------------------------------------------------------ */
.pk-dock-hist-h { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.pk-dock-search {
  flex: 1 1 auto; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  padding: 0 10px; font-size: 13.5px; color: var(--ink); outline: 0; font-family: var(--sans);
}
.pk-dock-hg { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--ink3); margin: 14px 0 4px; }
.pk-dock-hg:first-of-type { margin-top: 0; }
.pk-dock-row {
  display: block; width: 100%; text-align: left; padding: 9px 6px; border-radius: 8px;
  cursor: pointer; border-bottom: 1px solid var(--line);
}
.pk-dock-row:hover, .pk-dock-row:focus-visible { background: var(--sunk); }
.pk-dock-row-t { font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-dock-row.answered .pk-dock-row-t::after {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--you); margin-left: 8px; vertical-align: middle;
}

/* ================================================================================================
   THE PALETTE (design §4.7) — a body-level overlay, never inside `.pk-dock`. Same veil/panel
   mechanism as js/ask.js's dialog (its own header names the three: aria-modal, inert on #pk-app,
   focus restore).
   ================================================================================================ */
.pk-pal-veil {
  position: fixed; inset: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 45%, transparent);
}
.pk-pal {
  position: fixed; top: 14vh; left: 50%; transform: translateX(-50%); z-index: 51;
  width: 92%; max-width: 560px; max-height: 60vh; display: flex; flex-direction: column;
  background: var(--card); border-radius: 16px; box-shadow: var(--shl); overflow: hidden;
}
/* views/palette.js builds the veil/panel ONCE and toggles the `hidden` attribute on later
   opens/closes rather than re-creating them — a same-specificity author `display` rule on the
   SAME element otherwise beats the UA stylesheet's `[hidden]{display:none}` outright, which would
   have left a "closed" palette sitting visible (and still `inert`-covering #pk-app) on the glass. */
.pk-pal-veil[hidden], .pk-pal[hidden] { display: none; }
.pk-pal-in {
  flex: none; height: 48px; border: 0; border-bottom: 1px solid var(--line); background: none;
  padding: 0 16px; font-size: 16px; color: var(--ink); outline: 0; font-family: var(--sans);
}
.pk-pal-list { flex: 1 1 auto; overflow-y: auto; padding: 6px; }
.pk-pal-empty { padding: 18px; color: var(--ink3); font-size: 13.5px; text-align: center; }
.pk-pal-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px;
  border-radius: 10px; background: none; border: 0; cursor: pointer;
}
.pk-pal-row.on, .pk-pal-row:hover, .pk-pal-row:focus-visible { background: var(--sunk); }
.pk-pal-row-k {
  flex: none; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--ink3);
  width: 56px;
}
.pk-pal-row-l { font-size: 14.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================================================================================================
   THE GENIUS ROOM'S OWN MOMENTS (js/genius.js) — the Suggestions/idea/record screens `P.genius.*`
   paints into the dock's `GENIUS_HOST`, through `P.moment` like any other room. `.p-block` (its
   flex column + gap) is entry.css's; these two are the confirm card's own visual weight and the
   idea/fold row's text line — both rendered nowhere until test_v2_css_coverage.mjs caught them.
   ================================================================================================ */
.room-card.p-confirm { padding: 12px 14px; background: var(--sunk); border-radius: 12px; }
.p-confirm-line { font-size: 14px; color: var(--ink); line-height: 1.45; }
.p-confirm-line + .p-confirm-line { margin-top: 6px; color: var(--ink2); font-size: 13px; }
.pk-row-main.pk-row-title {
  flex: 1 1 auto; min-width: 0; font-size: 14px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* assistant markdown (views/dock.js fmtAssistant) — block rhythm inside one bubble */
.pk-dock-bub.pm > :first-child { margin-top: 0; }
.pk-dock-bub.pm > :last-child { margin-bottom: 0; }
.pk-dock-bub.pm p { margin: 0 0 8px; }
.pk-dock-bub.pm h4 { margin: 10px 0 6px; font-size: 14px; font-weight: 600; }
.pk-dock-bub.pm ul, .pk-dock-bub.pm ol { margin: 0 0 8px; padding-left: 18px; }
.pk-dock-bub.pm li { margin: 2px 0; }
.pk-dock-bub.pm li:has(.pk-md-cb), .pk-dock-bub.pm li:has(.pk-md-cb-on) { list-style: none; margin-left: -18px; }
.pk-md-cb { color: var(--ink3); }
.pk-md-cb-on { color: var(--done); }
.pk-dock-bub.pm pre { margin: 0 0 8px; padding: 8px 10px; background: var(--card); border-radius: 8px; overflow-x: auto; font-size: 12.5px; white-space: pre; }
.pk-md-tw { overflow-x: auto; margin: 0 0 8px; }
.pk-dock-bub.pm table { border-collapse: collapse; font-size: 12.5px; }
.pk-dock-bub.pm th, .pk-dock-bub.pm td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pk-dock-bub.pm th { font-weight: 600; color: var(--ink2); }
.pk-dock-bub.pm { white-space: normal; }
.pk-dock-bub.pm th, .pk-dock-bub.pm td { overflow-wrap: normal; word-break: normal; }
