/* The done pill (turndone.js): when a Claude chat completes, the Claude logo
   lands at the bottom centre of the canvas, then slides left as the pill opens
   beside it. It opens the viewer — the update panel's white glass, nearly as
   big as the canvas: the page where the edit landed, a bar under it (what was
   asked, what Claude did, Mark as done) between arrows that flip through the
   changes, and the Claude panel out on its right to carry the chat on. See on
   page opens the small floating quick view instead. */
.td-dock {
  position: absolute; left: 50%; bottom: 19px; z-index: 8;
  transform: translateX(-50%);
  display: flex; align-items: center;
  transition: bottom .42s var(--ease-spring);
}
.td-dock[hidden] { display: none; }
.td-dock.under { visibility: hidden; }   /* the viewer is up over it */
/* the update pill (updates.css .upd-live) holds the bottom centre of the
   window, 18px up and 46px tall: while it shows, this sits on top of it */
body:has(.upd-live.open) .td-dock { bottom: 76px; }

.td-pill {
  display: flex; align-items: center; height: 40px; padding: 3px;
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  background: var(--glass-2); color: var(--ink); font: inherit;
  box-shadow: var(--shadow-rest);
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  transition: transform .42s var(--ease-spring), box-shadow .32s var(--ease-out), background .32s var(--ease-out);
}
.td-pill:hover { background: var(--sb-float, #FFFFFF); border-color: rgba(217, 119, 87, .6); transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.td-pill:active { transform: translateY(1px) scale(.97); transition-duration: .06s; }
.td-pill[aria-expanded="true"] { background: var(--sb-float, #FFFFFF); border-color: rgba(217, 119, 87, .6); }

/* the logo — Claude's own mark, in Claude's clay */
.td-logo {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center; background: #D97757; color: #FFFFFF;
}
.td-logo svg { width: 19px; height: 19px; }
.td-dock.is-in .td-logo { animation: td-land .62s var(--ease-spring) both; }
.td-dock.is-in .td-logo svg { animation: td-spin 1.1s var(--ease-out) both; }
@keyframes td-land { 0% { transform: scale(.2); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes td-spin { 0% { transform: rotate(-120deg); } 100% { transform: rotate(0); } }

/* the reveal: zero wide until the logo has landed, then it opens out — the
   pill stays centred, so the growing pill carries the logo off to the left */
.td-reveal {
  display: grid; grid-template-columns: 0fr; opacity: 0;
  transition: grid-template-columns .62s var(--ease-out), opacity .32s var(--ease-out) .12s;
}
.td-dock.is-open .td-reveal { grid-template-columns: 1fr; opacity: 1; }
.td-reveal-in { overflow: hidden; min-width: 0; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.td-done {
  margin-left: 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--muted);
}
.td-title { max-width: 340px; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; font-weight: 600; }
.td-count {
  margin-right: 4px; padding: 2px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-deep);
  font-family: var(--mono); font-size: 11.5px; font-weight: 500;
}
.td-count.all { background: rgba(14, 138, 95, .12); color: var(--ok); }
.td-count[hidden] { display: none; }
.td-reveal-in::after { content: ""; width: 6px; flex-shrink: 0; }

/* the pill and its dismiss, kept together so the circle sits on the pill's corner */
.td-main { position: relative; display: flex; align-items: center; }

/* beside the pill: straight to where the turn changed, and the page load
   check's verdict — small glass pills that come in once the pill has opened */
.td-go, .td-load {
  display: flex; align-items: center; gap: 6px; height: 32px; margin-left: 8px; padding: 0 12px 0 11px;
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  background: var(--glass-2); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  box-shadow: var(--shadow-rest);
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  opacity: 0; transform: translateX(-6px); pointer-events: none;
  transition: opacity .3s var(--ease-out) .35s, transform .42s var(--ease-spring) .35s, background .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.td-go[hidden], .td-load[hidden] { display: none; }
.td-dock.is-open .td-go, .td-dock.is-open .td-load { opacity: 1; transform: none; pointer-events: auto; }
.td-go:hover, .td-load:hover:not(:disabled) { background: var(--sb-float, #FFFFFF); box-shadow: var(--shadow-lift); }
.td-go:active, .td-load:active:not(:disabled) { transform: scale(.97); transition-duration: .06s; }
.td-go-k { font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); }
.td-go-t { max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
.td-go svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--accent-deep); }
.td-load { color: var(--warn); }
.td-load-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.td-load.bad { color: var(--danger-ink, #A32B23); }
.td-load.ok { color: var(--ok); cursor: default; }
.td-load-t { color: var(--ink); }
/* a narrow canvas: the pill's title gives room, the link keeps only where */
@media (max-width: 760px) {
  .td-title { max-width: 150px; }
  .td-go-k { display: none; }
  .td-go-t { max-width: 120px; }
  .td-load-t { display: none; }
  .td-load { padding: 0 11px; }
}

/* dismiss — a small circle that shows beside the pill on hover */
.td-x {
  position: absolute; right: -9px; top: -9px; width: 22px; height: 22px; padding: 0;
  border-radius: 50%; border: 1px solid var(--line); background: var(--glass-2); color: var(--muted);
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-rest);
  opacity: 0; transform: scale(.7); pointer-events: none;
  transition: opacity .2s var(--ease-out), transform .32s var(--ease-spring);
}
.td-x svg { width: 11px; height: 11px; }
.td-dock.is-open:hover .td-x, .td-x:focus-visible { opacity: 1; transform: scale(1); pointer-events: auto; }
.td-x:hover { color: var(--ink); }

/* ---- the pieces the viewer and the quick view share ---- */
.td-ib {
  width: 29px; height: 29px; padding: 0; flex-shrink: 0; border-radius: 50%;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  display: grid; place-items: center;
  transition: background .2s var(--ease-out), color .2s var(--ease-out), transform .32s var(--ease-spring);
}
.td-ib svg { width: 14px; height: 14px; }
.td-ib:hover:not(:disabled) { background: var(--raised); color: var(--accent-deep); }
.td-ib:active:not(:disabled) { transform: scale(.9); transition-duration: .06s; }
.td-ib:disabled { opacity: .35; cursor: default; }
.td-ib[hidden] { display: none; }

.td-label { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.td-kind {
  flex-shrink: 0; padding: 2px 8px; border-radius: 999px;
  background: var(--raised); border: 1px solid var(--line);
  font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap;
}
.td-kind.new { background: rgba(217, 119, 87, .14); border-color: rgba(217, 119, 87, .45); color: #8A3B22; }
.td-spot-page { flex-shrink: 0; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

/* the page in a frame: laid out at the editor's screen width, scaled to fit;
   clipped, never scrollable, so nothing the page does can move the box */
.td-peek { position: relative; overflow: hidden; overflow: clip; background: #FFFFFF; }
.td-peek iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; background: #FFFFFF; }
.td-peek.loading::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(100deg, rgba(255,255,255,0) 30%, rgba(217,119,87,.10) 50%, rgba(255,255,255,0) 70%) #FFFFFF;
  background-size: 220% 100%; animation: td-shimmer 1.1s linear infinite;
}
@keyframes td-shimmer { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
.td-ring {
  position: absolute; pointer-events: none; border: 2px solid #D97757; border-radius: 6px;
  box-shadow: 0 0 0 9999px rgba(20, 20, 20, .16);
  transition: left .3s var(--ease-out), top .3s var(--ease-out), width .3s var(--ease-out), height .3s var(--ease-out);
}
.td-ring[hidden] { display: none; }
.td-ring.pulse { animation: td-ring 1.4s ease-out 2; }
@keyframes td-ring { 0% { outline: 0 solid rgba(217, 119, 87, .6); } 100% { outline: 14px solid rgba(217, 119, 87, 0); } }
.td-peek-note {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 2; padding: 7px 11px; border-radius: 12px;
  background: rgba(20, 20, 20, .82); color: #FFFFFF; font-size: 12.5px; line-height: 1.4;
}
.td-peek-note[hidden] { display: none; }

/* ---- the viewer ----
   The update panel's card (updates.css .upc): 90% white glass, 22px corners,
   its shadow and its spring, the mark on a near-black tile — inset from the
   canvas's edges far enough that the column rails stay clear beside it. In
   the dash it is fenced off with the update panel, so it stays daylight. */
.td-veil {
  position: absolute; inset: 0; z-index: 11;
  background: rgba(20, 20, 20, .2);
  backdrop-filter: blur(3px) saturate(.9); -webkit-backdrop-filter: blur(3px) saturate(.9);
  animation: td-veil-in .22s var(--ease-out) both;
}
.td-veil[hidden] { display: none; }
@keyframes td-veil-in { from { opacity: 0; } }

.td-view {
  position: absolute; z-index: 12; inset: 16px 34px;
  display: flex; flex-direction: column; overflow: hidden; overflow: clip;
  background: rgba(255, 255, 255, .9); color: var(--ink);
  backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 22px 60px rgba(26, 26, 26, .24), 0 4px 30px rgba(123, 30, 46, .16), inset 0 1px 0 rgba(255, 255, 255, .9);
  transform-origin: 50% 100%; container: td-view / inline-size;
  animation: td-view-in .46s var(--ease-spring) both;
  transition: bottom .42s var(--ease-spring);
}
.td-view[hidden] { display: none; }
@keyframes td-view-in { 0% { opacity: 0; transform: translateY(18px) scale(.965); } 50% { opacity: 1; } 100% { opacity: 1; transform: none; } }
body:has(.upd-live.open) .td-view { bottom: 76px; }

.td-view-head { flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px 18px; }
.td-view-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; flex-shrink: 0;
  background: #0B0B0B; color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(20, 20, 20, .28), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.td-view-mark svg { width: 19px; height: 19px; filter: drop-shadow(0 0 4px rgba(255, 255, 255, .6)); }
.td-view-titles { flex: 1; min-width: 0; }
.td-view-titles h2 { margin: 0; font: 800 16.5px/1.25 var(--display); letter-spacing: -.01em; color: #111111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-view-sub { margin: 2px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-view-sub:empty { display: none; }
.td-view-canvas { flex-shrink: 0; padding: 5px 12px; font-size: 12.5px; }
.td-view-canvas[hidden] { display: none; }
.td-view-x { margin-left: -4px; }

.td-view-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.td-view.chat-on .td-view-body { grid-template-columns: minmax(0, 1fr) clamp(300px, 34%, 390px); }
.td-view-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; container: td-main / inline-size; }

/* the page, on its own card like the canvas's */
.td-view-page {
  flex: 1; min-height: 140px; margin: 0 14px;
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(26, 26, 26, .12);
}
.td-view-spot {
  position: absolute; left: 10px; top: 10px; z-index: 2; max-width: calc(100% - 64px);
  display: flex; align-items: center; gap: 7px; padding: 4px 12px 4px 4px;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 14px rgba(26, 26, 26, .12);
  font-size: 12.5px; font-weight: 600; pointer-events: none;
}
.td-view-spot-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the tab on the page's right edge: the Claude panel comes out of this side */
.td-chat-tab {
  position: absolute; right: 0; top: 50%; z-index: 3; transform: translateY(-50%);
  display: flex; align-items: center; gap: 8px; writing-mode: vertical-rl; white-space: nowrap;
  padding: 12px 8px 10px 7px; cursor: pointer;
  border: 1px solid var(--line); border-right: 0; border-radius: 14px 0 0 14px;
  background: rgba(255, 255, 255, .94); color: var(--ink);
  font: 700 10.5px var(--sans); letter-spacing: .1em; text-transform: uppercase;
  box-shadow: -6px 0 22px rgba(26, 26, 26, .14);
  transition: transform .32s var(--ease-spring), box-shadow .32s var(--ease-out), color .16s var(--ease-out), border-color .16s var(--ease-out), background .16s var(--ease-out);
}
.td-chat-tab[hidden] { display: none; }
.td-chat-tab:hover { background: #FFFFFF; color: var(--accent-deep); border-color: rgba(123, 30, 46, .4); transform: translateY(-50%) translateX(-2px); box-shadow: -8px 0 26px rgba(26, 26, 26, .16), 0 2px 30px rgba(123, 30, 46, .14); }
.td-chat-tab:active { transform: translateY(-50%) scale(.96); transition-duration: .06s; box-shadow: -2px 0 8px rgba(26, 26, 26, .12); }
.td-chat-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.td-chat-tab-logo {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: #D97757; color: #FFFFFF;
}
.td-chat-tab-logo svg { width: 13px; height: 13px; }
.td-chat-tab-chev, .td-chat-tab-chev svg { width: 13px; height: 13px; display: block; }
.td-view.chat-on .td-chat-tab { background: var(--accent-soft); border-color: rgba(123, 30, 46, .35); color: var(--accent-deep); }

/* the column the panel comes out into: the cockpit's own Claude panel, moved */
.td-side { display: none; min-width: 0; min-height: 0; padding: 0 14px 14px 0; }
.td-view.chat-on .td-side { display: flex; }
.td-side > .chat {
  flex: 1; min-width: 0; border: 1px solid var(--cl-line, var(--line)); border-radius: 16px;
  box-shadow: 0 1px 2px rgba(20, 20, 19, .05), 0 8px 24px rgba(20, 20, 19, .06);
  animation: td-side-in .3s var(--ease-out) both;
}
@keyframes td-side-in { from { opacity: 0; transform: translateX(18px); } }
.td-side #chat-hide { display: none; }   /* the tab puts it back */
.td-chat-holder { min-width: 0; }

/* ---- the bar: what was asked, what Claude did, Mark as done ---- */
.td-bar { flex-shrink: 0; display: flex; align-items: stretch; gap: 10px; padding: 12px 14px 14px; }
.td-flip {
  align-self: center; width: 38px; height: 38px; padding: 0; flex-shrink: 0; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .85); color: var(--ink);
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 10px rgba(26, 26, 26, .1);
  transition: transform .32s var(--ease-spring), box-shadow .32s var(--ease-out), background .16s var(--ease-out), color .16s var(--ease-out), border-color .16s var(--ease-out);
}
.td-flip svg { width: 16px; height: 16px; }
.td-flip:hover:not(:disabled) { background: #FFFFFF; color: var(--accent-deep); border-color: rgba(123, 30, 46, .45); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(26, 26, 26, .14), 0 2px 30px rgba(123, 30, 46, .12); }
.td-flip:active:not(:disabled) { transform: translateY(1px) scale(.94); box-shadow: 0 1px 4px rgba(26, 26, 26, .18); transition-duration: .06s; }
.td-flip:disabled { opacity: .35; cursor: default; }
.td-flip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.td-flip[hidden] { display: none; }

.td-bar-card {
  flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto;
  border: 1px solid var(--line); border-radius: 16px; background: #FFFFFF;
  box-shadow: 0 6px 20px rgba(26, 26, 26, .08);
}
.td-bar-card.flip > * { animation: td-flip-in .3s var(--ease-out) both; }
@keyframes td-flip-in { from { opacity: 0; transform: translateX(var(--td-from, 0)); } }
.td-bar-col { min-width: 0; padding: 11px 14px 12px; display: flex; flex-direction: column; gap: 5px; }
.td-bar-col + .td-bar-col { border-left: 1px solid var(--line-soft); }
.td-bar-text {
  max-height: min(108px, 15vh); overflow-y: auto; overscroll-behavior: contain;
  font-size: 13.5px; line-height: 1.5; color: var(--ink);
}
.td-bar-text.more {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
}
.td-asked .td-bar-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.td-sec { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 8px; }
.td-sec .td-label, .td-prog { white-space: nowrap; }
.td-prog { font-size: 12px; color: var(--muted); }
.td-prog.all { color: var(--ok); font-weight: 600; }
.td-story { margin: 0 0 4px; white-space: pre-line; overflow-wrap: anywhere; }
.td-none { margin: 0; color: var(--muted); }

.td-tasks { list-style: none; margin: 0 0 0 -6px; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.td-task {
  width: 100%; display: flex; align-items: flex-start; gap: 9px; padding: 4px 6px;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink);
  font: inherit; font-size: 13px; line-height: 1.4; text-align: left; cursor: pointer;
  transition: background .2s var(--ease-out);
}
.td-task:hover { background: var(--raised); }
.td-box {
  width: 16px; height: 16px; margin-top: 1px; flex-shrink: 0; border-radius: 5px;
  border: 1.5px solid var(--muted); background: transparent; color: #FFFFFF;
  display: grid; place-items: center;
  transition: background .2s var(--ease-out), border-color .2s var(--ease-out), transform .32s var(--ease-spring);
}
.td-box svg { width: 11px; height: 11px; opacity: 0; transform: scale(.5); transition: opacity .15s, transform .32s var(--ease-spring); }
.td-task.on .td-box { background: var(--ok); border-color: var(--ok); }
.td-task.on .td-box svg { opacity: 1; transform: scale(1); }
.td-task:active .td-box { transform: scale(.88); transition-duration: .06s; }
.td-task.on .td-task-t { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--muted); }

.td-bar-acts {
  min-width: 176px; padding: 12px 14px; border-left: 1px solid var(--line-soft);
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px;
}
.td-pos { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.td-mark { white-space: nowrap; }
.td-done-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 999px;
  background: rgba(14, 138, 95, .12); color: var(--ok); font-size: 13px; font-weight: 700;
  animation: td-done-pop .42s var(--ease-spring) both;
}
.td-done-chip svg { width: 14px; height: 14px; }
@keyframes td-done-pop { from { transform: scale(.8); opacity: 0; } }
.td-link {
  all: unset; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); border-radius: 4px;
}
.td-link:hover { color: var(--accent-deep); text-decoration: underline; }
.td-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.td-busy { display: inline-flex; align-items: center; gap: 6px; max-width: 170px; font-size: 12px; line-height: 1.35; color: var(--accent-deep); text-align: center; }
.td-busy-dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(123, 30, 46, .5); animation: pulse 1.2s ease-in-out infinite; }

/* a narrower viewer (a small window, or the chat out beside it): Mark as
   done goes to a row under the words; narrower still, what was asked sits
   over what Claude did */
@container td-main (max-width: 780px) {
  .td-bar-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
  .td-bar-acts {
    grid-column: 1 / -1; min-width: 0; flex-direction: row; flex-wrap: wrap; justify-content: space-between;
    gap: 6px 12px; padding: 8px 10px 8px 14px; border-left: 0; border-top: 1px solid var(--line-soft);
  }
  .td-bar-text { max-height: min(76px, 10vh); }
  .td-busy { max-width: none; }
}
@container td-main (max-width: 480px) {
  .td-bar-card { grid-template-columns: minmax(0, 1fr); }
  .td-did { border-left: 0 !important; border-top: 1px solid var(--line-soft); }
  .td-bar-col { padding: 9px 12px 10px; }
  .td-bar-text { max-height: min(58px, 8vh); }
}
@container td-view (max-width: 600px) {
  .td-view-canvas { width: 29px; height: 29px; padding: 0; justify-content: center; }
  .td-view-canvas span { display: none; }
}

/* full screen: the stage is the whole window, with the top bar and the
   panels floating over it — the viewer keeps clear of them */
body.mb-full .td-view { top: 84px; bottom: 18px; }
body.mb-full .cockpit:not(.no-chat) .td-view { left: calc(clamp(250px, 23vw, 330px) + 30px); }
body.mb-full .cockpit:not(.no-insp) .td-view { right: calc(clamp(240px, 22vw, 310px) + 30px); }
body.mb-full:has(.upd-live.open) .td-view { bottom: 76px; }

/* ---- the floating quick view ---- */
.td-float {
  position: fixed; z-index: 60; width: min(400px, calc(100vw - 24px));
  border-radius: 18px; border: 1px solid var(--line); overflow: hidden;
  background: var(--sb-float, rgba(255, 255, 255, .94)); color: var(--ink);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .5);
  backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  animation: td-float-in .38s var(--ease-spring) both;
}
.td-float[hidden] { display: none; }
@keyframes td-float-in { 0% { opacity: 0; transform: translateY(14px) scale(.96); } 100% { opacity: 1; transform: none; } }
.td-float.dragging { box-shadow: 0 30px 80px rgba(0, 0, 0, .6), var(--shadow-lift); user-select: none; }
.td-float.dragging iframe { pointer-events: none; }
.td-float .td-ib { width: 26px; height: 26px; }

.td-float-head {
  display: flex; align-items: center; gap: 8px; padding: 7px 7px 7px 9px;
  border-bottom: 1px solid var(--line-soft); cursor: grab; touch-action: none;
}
.td-float.dragging .td-float-head { cursor: grabbing; }
.td-float-logo {
  width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center; background: #D97757; color: #FFFFFF;
}
.td-float-logo svg { width: 13px; height: 13px; }
.td-float-what { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; }
.td-float-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.td-float-nav { display: flex; align-items: center; }
.td-float-nav[hidden] { display: none; }
.td-float-n { font-family: var(--mono); font-size: 11.5px; color: var(--muted); padding: 0 1px; }
.td-float-body { height: 240px; }

/* the dash squares every corner; the pill, the logo and the small round
   buttons are the shapes this is made of, so they keep theirs (the viewer is
   fenced off with the update panel, and keeps all of its own) */
body.dash .td-dock :is(.td-pill, .td-logo, .td-x, .td-count),
body.dash .td-float :is(.td-float-logo, .td-ib) { border-radius: 999px !important; }
body.dash .td-float .td-ring { border-radius: 4px !important; }
body.dash .td-float .td-kind.new { background: rgba(217, 119, 87, .2); color: #F3B49E; }

/* out of the way of the canvas's other floating bits */
body.ov-on .td-dock { display: none; }

/* phones: above the editor's round buttons, like the change-log toasts; the
   viewer leaves them clear too, and its tab opens the chat's own sheet */
@media (max-width: 768px), (pointer: coarse) and (max-width: 1024px) {
  .td-dock, body:has(.upd-live.open) .td-dock { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); max-width: calc(100vw - 24px); }
  .td-title { max-width: 44vw; }
  .td-x { opacity: 1; transform: none; pointer-events: auto; }
  .td-view, body:has(.upd-live.open) .td-view {   /* under the back chip (14px down, 44px tall), over the round buttons */
    inset: calc(66px + env(safe-area-inset-top, 0px)) 8px calc(84px + env(safe-area-inset-bottom, 0px));
  }
  .td-view-head { padding: 10px 10px 8px 12px; }
  .td-view-canvas { display: none; }
  .td-view-page { margin: 0 8px; }
  .td-bar { padding: 8px; gap: 6px; }
  .td-flip { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .td-dock.is-in .td-logo, .td-dock.is-in .td-logo svg, .td-float, .td-view, .td-veil,
  .td-side > .chat, .td-bar-card.flip > *, .td-done-chip { animation: none; }
  .td-reveal, .td-view { transition: none; }
  .td-chat-tab:hover, .td-chat-tab:active { transform: translateY(-50%); }
  .td-flip:hover:not(:disabled), .td-flip:active:not(:disabled) { transform: none; }
}
