/* Marina — owner corner-DM reference, 2026-10-03.
   One shared local/hosted companion. Load after the current assistant,
   invocation and exact reference-composer sheets. No feed/layout authority.
   Mount as a direct shell child OUTSIDE the reading pane. Do not retain
   .staffmor-context, .as-drawer or .has-staffmor-context on this surface. */
.office-console-shell > .office-corner-dm {
  --office-corner-gap:16px;
  --office-corner-height:min(560px,calc(var(--office-visible-height,100dvh) - 64px));
  position:fixed;inset:auto;
  top:calc(var(--office-visible-top,0px) + var(--office-visible-height,100dvh) - var(--office-corner-height) - var(--office-corner-gap));
  right:max(var(--office-corner-gap),env(safe-area-inset-right));
  z-index:55;display:flex;flex-direction:column;gap:0;box-sizing:border-box;
  width:min(420px,calc(100vw - 32px));height:var(--office-corner-height);
  min-width:0;min-height:0;max-height:var(--office-corner-height);
  overflow:hidden;border:1px solid var(--line);border-radius:16px;
  background:var(--surface);color:var(--ink);
  box-shadow:0 8px 36px color-mix(in srgb,var(--ink) 16%,transparent);
  font:400 1rem/1.5 var(--sans);isolation:isolate;
}
.office-console-shell > .office-corner-dm[hidden] {display:none}
.office-corner-dm .office-corner-dm-head {
  display:flex;align-items:center;gap:10px;flex:none;min-width:0;
  min-height:56px;box-sizing:border-box;padding:6px 8px 6px 12px;
  border-bottom:1px solid var(--line);background:var(--surface);
}
.office-corner-dm .office-corner-dm-avatar {
  display:block;width:28px;height:28px;flex:none;object-fit:contain;
  border-radius:50%;transform-origin:50% 65%;
}
.office-corner-dm .office-corner-dm-title {flex:1;min-width:0}
.office-console-shell .office-corner-dm h2 {
  margin:0;color:var(--ink);font:600 1rem/1.35 var(--sans);letter-spacing:0;
}
.office-corner-dm .office-corner-dm-presence {
  margin:1px 0 0;font:400 .75rem/1.4 var(--sans);color:var(--muted);
  overflow-wrap:anywhere;
}
.office-corner-dm .office-corner-dm-minimize {
  display:grid;place-items:center;flex:none;width:44px;height:44px;
  min-width:44px;min-height:44px;padding:0;border:0;border-radius:8px;
  background:transparent;color:var(--ink);font:400 1.5rem/1 var(--sans);
  box-shadow:none;cursor:pointer;
}
.office-corner-dm .office-corner-dm-minimize:hover {background:var(--surface-2)}
.office-corner-dm .office-assistant-feed {
  display:flex;flex-direction:column;align-items:stretch;gap:12px;
  flex:1 1 0;min-width:0;min-height:0;width:100%;box-sizing:border-box;
  margin:0;padding:14px 12px;overflow:auto;overscroll-behavior:contain;
  overflow-anchor:none;scrollbar-gutter:stable;
}
.office-corner-dm .office-assistant-feed > :is(.remote-message,.msg) {
  display:grid;grid-template-columns:28px minmax(0,1fr);gap:8px;
  flex:none;min-width:0;width:100%;max-width:100%;box-sizing:border-box;
  margin:0;padding:0;border:0;
}
.office-corner-dm :is(.remote-message,.msg) > .message-avatar {
  width:28px;height:28px;object-fit:contain;border-radius:50%;
}
.office-corner-dm .message-main {min-width:0;max-width:100%}
.office-corner-dm .msg-head {display:flex;flex-wrap:wrap;gap:3px 8px;min-width:0;font:.75rem/1.4 var(--sans)}
.office-console-shell .office-corner-dm .office-assistant-feed > :is(.remote-message,.msg) > .message-main > .body {
  min-width:0;max-width:100%;box-sizing:border-box;margin:4px 0 0;
  padding:9px 11px;border:1px solid var(--line);border-radius:5px 14px 14px;
  background:var(--surface-2);color:var(--ink);
  font:400 .9375rem/1.5 var(--sans);white-space:pre-wrap;overflow-wrap:anywhere;
}
.office-corner-dm .office-assistant-feed > .speaker-you {grid-template-columns:minmax(0,1fr)}
.office-corner-dm .speaker-you > .message-avatar {display:none}
.office-corner-dm .speaker-you > .message-main {width:fit-content;max-width:90%;justify-self:end}
.office-corner-dm .speaker-you .msg-head {justify-content:end}
.office-console-shell .office-corner-dm .office-assistant-feed > :is(.remote-message,.msg).speaker-you > .message-main > .body {background:var(--accent-soft,var(--surface-2));border-radius:14px 14px 5px}
.office-corner-dm .office-dm-receipt {
  display:flex;justify-content:end;align-items:center;flex-wrap:wrap;gap:4px 8px;
  margin:3px 0 0;font:400 .75rem/1.4 var(--sans);color:var(--muted);
}
.office-corner-dm .office-assistant-recovery,
.office-corner-dm .office-corner-dm-choice {
  min-width:0;margin:0;padding:10px 11px;border:1px solid var(--line);
  border-radius:12px;background:var(--surface-2);overflow-wrap:anywhere;
  font:400 .875rem/1.5 var(--sans);white-space:normal;
}
.office-corner-dm .office-corner-dm-choice p {margin:0 0 6px}
.office-corner-dm :is(.office-assistant-recovery,.office-corner-dm-choice) .btn {
  min-height:44px;white-space:normal;overflow-wrap:anywhere;
}
.office-corner-dm .office-console-dock {
  position:static;inset:auto;display:block;flex:none;min-width:0;min-height:0;
  width:100%;height:auto;max-height:none;box-sizing:border-box;
  padding:8px;border-top:1px solid var(--line);background:var(--surface);
  box-shadow:none;transform:none;
}
.office-console-shell .office-corner-dm .office-console-dock > form.office-reference-composer {
  --office-input-cap:min(7rem,max(var(--office-input-min),calc(var(--office-visible-height,100dvh) * .2)));
  width:100%;max-width:100%;margin:0;min-width:0;
}
.office-corner-dm .office-composer-context:has(.office-corner-media) {
  height:auto;max-height:min(148px,calc(var(--office-visible-height,100dvh) * .26));
  overflow:auto;overscroll-behavior:contain;
}
.office-corner-dm .office-corner-media-list {display:grid;gap:8px;padding:2px 0 6px;margin:0;min-width:0}
.office-corner-media {
  display:grid;grid-template-columns:64px minmax(0,1fr) auto;align-items:center;
  gap:8px;min-width:0;margin:0;padding:6px;border:1px solid var(--line);
  border-radius:10px;background:var(--surface-2);font:.75rem/1.4 var(--sans);
}
.office-corner-media-preview {display:grid;place-items:center;min-width:0;width:64px;height:56px;overflow:hidden;border-radius:6px;background:var(--surface)}
.office-corner-media-preview :is(img,video) {display:block;width:100%;height:100%;object-fit:contain;max-width:100%}
.office-corner-media figcaption {min-width:0;overflow-wrap:anywhere}
.office-corner-media-name {display:block;font-weight:600;color:var(--ink)}
.office-corner-media-state {display:block;color:var(--muted)}
.office-corner-media[data-state='failed'] .office-corner-media-state {color:var(--bad-ink,var(--ink))}
.office-corner-media progress {display:block;max-width:100%;width:100%;height:5px;margin-top:5px;accent-color:var(--accent)}
.office-corner-media-actions {display:flex;flex-wrap:wrap;gap:2px;justify-content:end;max-width:88px}
.office-corner-media-actions button {min-width:44px;min-height:44px;padding:3px 5px;border:0;border-radius:6px;background:transparent;color:var(--ink);font:500 .75rem/1.3 var(--sans);cursor:pointer}
.office-corner-media-actions button:hover {background:var(--surface)}
.office-corner-dm :is(button,a,summary):focus-visible {outline:2px solid var(--focus,var(--accent));outline-offset:2px}
.office-corner-dm .body :is(img,video) {max-width:100%;height:auto}
.office-corner-dm .body a {color:var(--accent-ink,var(--ink));text-decoration:underline;text-underline-offset:3px;overflow-wrap:anywhere}
.office-console-shell > .office-corner-dm-launcher {
  position:fixed;right:max(16px,env(safe-area-inset-right));z-index:54;
  top:calc(var(--office-visible-top,0px) + var(--office-visible-height,100dvh) - var(--office-console-height,60px) - var(--office-dock-top,6px) - var(--office-dock-bottom,8px) - 56px);
}
@media(max-width:820px) {
  .office-console-shell > .office-corner-dm {
    --office-corner-gap:8px;
    --office-corner-height:calc(var(--office-visible-height,100dvh) - max(56px,env(safe-area-inset-top)) - max(8px,env(safe-area-inset-bottom)) - 8px);
    top:calc(var(--office-visible-top,0px) + max(56px,env(safe-area-inset-top)));
    left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));
    width:auto;border-radius:14px;
  }
  .office-corner-dm .office-assistant-feed {scrollbar-gutter:auto;padding:12px 10px}
  .office-corner-dm .office-console-dock {padding:6px}
  .office-console-shell > .office-corner-dm-launcher {right:max(10px,env(safe-area-inset-right))}
}
@media(prefers-reduced-motion:reduce) {
  .office-corner-dm,.office-corner-dm-launcher {animation:none;transition:none}
}
@media(forced-colors:active) {
  .office-console-shell > .office-corner-dm {border-color:CanvasText;box-shadow:none}
  .office-corner-dm :is(button,a,summary):focus-visible {outline-color:Highlight}
}

/* Mounted local client01: accent-ink is text ON an accent fill, not a link
   on surface-2. Use the existing readable standalone accent; retain ink
   for the person's accent-soft bubble. Same original anchor and callbacks. */
.office-console-shell > .office-corner-dm .office-assistant-feed > :is(.remote-message,.msg) > .message-main > .body a {color:var(--accent,var(--ink))}
.office-console-shell > .office-corner-dm .office-assistant-feed > :is(.remote-message,.msg).speaker-you > .message-main > .body a {color:var(--ink)}
